Commit Graph

158 Commits

Author SHA1 Message Date
Fedor Isakov 8ce96ec41e Introduce an abstraction layer of type aliases for persistent collections. 2019-09-30 16:31:59 +02:00
Fedor Isakov 60c39f2811 Add a test for a peculiar use case. Only triggered in production. 2019-09-30 16:31:59 +02:00
Fedor Isakov 7d308cb0e3 Experimental feature: Rules segmentation.
The rules index is extended to observe the segment path a rule belongs to.
An occurrence is bound to the rule that activated it and thus has an
associated segment path.
Rules to be picked for activation can be selected on the basis
of matched segment path.
2019-09-27 21:59:58 +02:00
Fedor Isakov 487df639e5 Drop unused methods from EvaluationSession.
Having unused methods is confusing.
2019-09-10 13:17:34 +02:00
Fedor Isakov af212ca92e Refactoring EvaluationSession(Ex): drop controller accessor.
The inverse reference to controller from Evaluation session considered harmful.
Drop controller from EvaluationSession, drop ask/tell from EvaluationSession, extend InvocationContext with controller and supervisor accessors.
2019-09-10 13:08:53 +02:00
Fedor Isakov ed79a8b9b9 Fix TermTrie not processing correctly ref to a Nil.
The code in ClassicTermTrie that is responsible for recursion guarding
when processing cyclic terms, used to mismatch valid pattern term
containing ref to a Nil term, which is a constant.
2019-08-10 15:18:04 +02:00
Grigorii Kirgizov cf5d2ae712 Fix incorrect behavior in journal.reset() in some cases, reenable tests for that. 2019-07-26 17:00:31 +02:00
Grigorii Kirgizov 8ed7eb3c02 Change signature of Supervisor to handle RuleMatch instead of Rule 2019-07-26 17:00:31 +02:00
Grigorii Kirgizov be7283190f Propagate FeedbackStatus out of reactivate for incremental execution. 2019-07-26 17:00:30 +02:00
Grigorii Kirgizov 5414fe7e67 Move RulesDiff construction from reactor to coderules runtime. 2019-07-26 17:00:30 +02:00
Grigorii Kirgizov 769e7fd2ba Fix small issue related to mutable justifications in Occurrence. Upd tests with latest changes. 2019-07-26 17:00:30 +02:00
Grigorii Kirgizov b560bbbd30 Separate incremental tests on testlang and baselang into their own models. 2019-07-26 17:00:30 +02:00
Grigorii Kirgizov ed93865359 Refactor MatchJournal.Pos. Make RulesDiff usable in coderules mps code. Extend EvaluationTrace. 2019-07-26 17:00:30 +02:00
Grigorii Kirgizov 49aa913556 Move MatchJournalImpl to its own file. Some docs for it. Hide underlying mutable history behind immutable List. Add string tag() to Rule. 2019-07-26 17:00:30 +02:00
Grigorii Kirgizov 155266d8ca Abstract java interfaces for incrementality-related classes for interop between reactor and coderules 2019-07-26 17:00:30 +02:00
Grigorii Kirgizov 5995b3a2f9 Simplify last test in TestStoreAwareJournal 2019-06-17 19:31:43 +03:00
Grigorii Kirgizov 65f1198a60 Prune the whole related state in RuleMatchers on removal-phase. Add test case. 2019-06-13 20:10:08 +03:00
Grigorii Kirgizov 7acbbc3988 Fix tests 2019-06-13 18:01:35 +03:00
Grigorii Kirgizov 9863569323 Tests for incrementally removing and removing+adding rules 2019-06-12 19:09:06 +03:00
Grigorii Kirgizov d7b7d40f8a Don't expose InitialRule to RuleDiff. Add first test for rm algo stage. 2019-06-12 14:56:57 +03:00
Grigorii Kirgizov ae20c334b4 Discern incremental reactivation from usual one. Fix postponedMatches logic. 2019-06-12 13:28:06 +03:00
Grigorii Kirgizov a5a46d6c67 Add incrementality test for one nontrivial case in RuleMatchFront.expand 2019-06-12 13:28:06 +03:00
Grigorii Kirgizov 2a5f9e28dc Fix handling of postponed matches (match order comparison was slightly wrong) 2019-06-12 13:28:06 +03:00
Grigorii Kirgizov 5a9019e85c Fix bits of logic responsible for launching 'at-start' rules through 'main'. Fix handling of discarded occs 2019-06-12 13:28:06 +03:00
Grigorii Kirgizov 767eb057f5 Add helper method in Tests builder, adjust few tests with it 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 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 8b4d98f6e2 Add few more checks in TestIncrementalProgram tests and one test in TestStoreAwareJournal 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 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 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 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 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
Fedor Isakov c051542440 Replace usages of java.util.HashMap with persistent map to optimize
memory allocation.
2019-05-17 18:01:34 +02:00