Commit Graph

1674 Commits

Author SHA1 Message Date
Grigorii Kirgizov dffab2016c upd gitignore 2019-06-12 13:28:06 +03:00
Grigorii Kirgizov fa380c9f36 Fix failing build of coderules because of changed interfaces 2019-06-12 13:28:06 +03:00
Grigorii Kirgizov 3e50f47f73 Add MatchJournal.Index for additional queries and operations involving ordering of occurrences 2019-06-12 13:28:06 +03:00
Grigorii Kirgizov eec343f902 Add stub code for handling case of adding headless ('at-start') rules 2019-06-12 13:28:06 +03:00
Grigorii Kirgizov c0cb26d598 Add two more tests for addition phase. Handle one additional case and make one test pass. 2019-06-12 13:28:06 +03:00
Grigorii Kirgizov ddb67690f4 Add partial sketch of removal phase of incremental algorithm.
For that: Extend DispatchingFront and RuleMatcherImpl interface with
'forget' methods which completely drops related matches from matchers' state;
Extend MatchJournal & Chunk interfaces with helper methods.
2019-06-12 13:28:06 +03:00
Grigorii Kirgizov 8b4d98f6e2 Add few more checks in TestIncrementalProgram tests and one test in TestStoreAwareJournal 2019-06-12 13:28:06 +03:00
Grigorii Kirgizov 5b500340e5 Make StoreAwareJournal a pure interface, move delegated inheritance to StoreAwareJournalImpl (hide journal) 2019-06-12 13:28:06 +03:00
Grigorii Kirgizov 71eac08775 Move replayOccurrences back to MatchJournal again, fix tests 2019-06-12 13:28:06 +03:00
Grigorii Kirgizov 8d615852c6 Remove Controller from Occurrence and instead pass a new one each time through OccurrenceObserver
It caused a situation when on the very next incremental evaluation session
occurrences carried a stale Controller along with all the state from previous session.
As a result, incorrect logic of program evaluation.
2019-06-12 13:28:06 +03:00
Grigorii Kirgizov 4e60ef9909 Add tests for incremental additions (one fails for now). Don't log reactivations in journal. 2019-06-12 13:28:06 +03:00
Grigorii Kirgizov 95b5f97869 Add equals() to MatchJournal.Pos. Handle corner case in 'replay', when it happens to the same pos. Same for 'reset'. 2019-06-12 13:28:06 +03:00
Grigorii Kirgizov e33df7aac2 Hide mutable collection of occurrences in Chunk and add 'principleConstraint' fun to its interface 2019-06-12 13:28:06 +03:00
Grigorii Kirgizov c9b486c170 Fix StoreAwareJournal test given updated journal's iterator starting pos 2019-06-12 13:28:05 +03:00
Grigorii Kirgizov 97d36d8d1f Fix corner case in algo stage. Add test for it. 2019-06-12 13:28:05 +03:00
Grigorii Kirgizov 6a3aad364c Add SessionToken to preserve eval state between sessions. Add IncrementalProgramSpec. Add impl of one algo stage, in ProcessingStateImpl.
SessionToken includes MatchJournal.View and a state of all RuleMatchers.
IncrementalProgramSpec specifies information needed for incremental evaluation.
In essence, it answers on queries of type 'isPrincipal' for Rules and Constraints.
It decouples specific incremental info from entities, allows to inject it easily in tests.
Its presence also enables incremental version of evaluation, in EvaluationSessionImpl.
2019-06-12 13:28:05 +03:00
Grigorii Kirgizov 6932e99774 Enable tracking justification in Controller for principal constraints' occ-s 2019-06-12 13:28:05 +03:00
Grigorii Kirgizov 76194a62ae Refactor tests to make them more readable. Remove unsafe cast from journal's reset. 2019-06-12 13:28:05 +03:00
Grigorii Kirgizov 11bec29410 Use journal for aborting execution of alternative branches, fix 'reset' method
All tests for Controller pass, but one test from StoreAwareJournal fails, mute for now
2019-06-12 13:28:05 +03:00
Grigorii Kirgizov 0fb54fc5ba Add invariant to Journal that it always has at least initial chunk, with EmptyRuleMatch
Also slightly fix tests and add tracking (i.e. using journal) to ProcessingStateImpl
2019-06-12 13:28:05 +03:00
Grigorii Kirgizov 225bd9861e Separate concerns b/w ProcessingStateImpl and StateAwareJournal, construct in a new way
ProcessingStateImpl has only processing logic and inherits frame stack logic from StateAwareJournal
2019-06-12 13:28:05 +03:00
Grigorii Kirgizov 77bc7538a4 Prepare before merging StoreAwareJournal & ProcessingStateImpl: extract FrameStack from ProcState, inherit StoreAwareJ from MatchJ by delegation 2019-06-12 13:28:05 +03:00
Grigorii Kirgizov 799b57c74e minor: remove usages of rule.tag() in tests 2019-06-12 13:28:05 +03:00
Grigorii Kirgizov 0cbc32d4a0 Get rid off nullability of Justs 2019-06-12 13:28:05 +03:00
Grigorii Kirgizov 52fd54afce Hide use of TIntSet from trove behind typealias; one usage in ConstraintOccurrence.java is left 2019-06-12 13:28:05 +03:00
Grigorii Kirgizov f8b7ac1d50 Few renames in MatchJournal; throw exceptions at invalid iteration states 2019-06-12 13:28:05 +03:00
Grigorii Kirgizov d3883effaf Extract frame-independent logic from MatchHistory to its base class MatchJournal
Small changes: rename MatchHistory -> StateAwareJournal; use referential
eq when iterating through chunks; provide only Pos, not Chunk from
current()/currentPos(); fix tests according to all this.
2019-06-12 13:28:05 +03:00
Grigorii Kirgizov e5942d2c77 Fix MatchHistory tests: fix impl of storeView, taking into account current pos in history (not all of it) 2019-06-12 13:28:05 +03:00
Grigorii Kirgizov c4309084c5 Refactor: remove match-logic from StateFrame (now it's only about Observers), mvoe it to ProcessingState 2019-06-12 13:28:05 +03:00
Grigorii Kirgizov b2f65e1510 Implement storeView() method to MatchHistory, remove it from ProcessingImpl (but not its single usage yet) and stored occurrences from StateFrame 2019-06-12 13:28:05 +03:00
Grigorii Kirgizov cbddd108bb Subst FrameStack in MatchHistory for ProcessingImpl 2019-06-12 13:28:05 +03:00
Grigorii Kirgizov cd5ad91caf minor: fix type in 'logOccurence' method 2019-06-12 13:28:05 +03:00
Grigorii Kirgizov c322cf5c70 Add test with more complex and representative manipulation of MatchHistory 2019-06-12 13:28:05 +03:00
Grigorii Kirgizov a360abc59e Add MatchHistory.View class (snapshot of history), refine one test, fix mistake in history.reset() 2019-06-12 13:28:05 +03:00
Grigorii Kirgizov 612f0a212c Refine MatchHistory impl, extract interface for tests, add several tests. 2019-06-12 13:28:05 +03:00
Grigorii Kirgizov 9a7838fdc7 Add initial sketch of MatchHistory; add justifications to ConstraintOccurence interface 2019-06-12 13:28:05 +03:00
Fedor Isakov 9bd793c8ec Move the logic of updating TypesIndex to TypecheckingStep. 2019-06-07 09:16:21 +02:00
Fedor Isakov a0b5acaa62 Rebuild project. 2019-06-07 09:16:21 +02:00
Fedor Isakov 86821af258 Fix incorrect model name saved inside the model itself. 2019-06-07 09:16:21 +02:00
Fedor Isakov 1a7c383ebe Switch to MPS 2019.2 EAP 2019-06-07 09:16:21 +02:00
Fedor Isakov 947f9523bd Fix language imports. 2019-06-07 09:16:21 +02:00
Fedor Isakov b827c509e7 Drop requirement to invoke TypesIndexCache.dispose() in a read action. 2019-06-07 09:16:21 +02:00
Fedor Isakov cd37daaa07 Apply migrations after switching to the latest EAP build of MPS. 2019-06-07 09:16:21 +02:00
Fedor Isakov e19a66f512 Fix implementation of typechecking provider interfaces. 2019-06-07 09:16:20 +02:00
Fedor Isakov 7061fff775 Update TypesIndex as a reactive step. 2019-06-05 16:16:00 +02:00
Fedor Isakov 17ed4642ae Apply all available automatic migrations. 2019-06-05 16:16:00 +02:00
Fedor Isakov 57de11c3fe Rename all modules/models having prefix j.m.typechecking to j.m.coderules.typechecking. The former is reserved. 2019-06-05 16:15:59 +02:00
Fedor Isakov fe505792c6 A bunch of refactorings and renames in typechecking plugin.
Remove unused interfaces, merge classes with similar functionality, reduce the number of used classes.
2019-06-05 16:14:27 +02:00
Fedor Isakov d0ffcb66ef Regenerated project. 2019-06-05 16:14:27 +02:00
Fedor Isakov 9cd438bbdf New sample in staging model for typechecking test. 2019-06-05 16:09:20 +02:00