Commit Graph

26 Commits

Author SHA1 Message Date
Fedor Isakov cdb6c91958 Cleanup and refactor code for better readability 2024-06-14 13:42:46 +02:00
Fedor Isakov dc4f046510 Cleanup and optimize Rule.Tag, drop unused methods 2021-05-18 12:32:03 +02:00
Grigorii Kirgizov fd43cc560c refactoring: introduce Rule.Tag instead of several fields (basetag/tag/uniqueTag)
Allows to carry logically connected information in one object.
Needed for subsequent changes to ConstraintOccurrence, which
must have better information on source rule: rule template name.
Used by occurrence cache.
2020-12-15 17:59:05 +03:00
Fedor Isakov f6123273d4 Minor refactoring: drop usages of Program.rulesLists() method. 2020-12-01 21:55:17 +01:00
Fedor Isakov eec84330fc Make RuleIndex incrementally updatable. Drop segments feature. 2020-08-06 17:45:47 +02:00
Grigorii Kirgizov 4928daf3fc Add tests related to program execution pattern exhibited by MPSCR-59 2020-04-30 15:38:34 +03:00
Grigorii Kirgizov f61c436809 Add tests to verify expected behavior of repeated expansion of the same occurrence (MPSCR-37)
Tests are structured similar to how occurrences are processes with ExecQueue
and its 'postponedFutureMatches' in incremental processing in ConstraintProcessing.
Also don't ignore one old test.
2020-02-05 18:52:18 +03:00
Fedor Isakov 818d1a4dbc Fix linked list implementation. Fixes MPSCR-18
New implementation enables the previously failing tests to pass.
2019-11-26 23:07:42 +01:00
Fedor Isakov 65daa76c6b Remove droppedTrail. Optimize operation with consumed signatures. Restore test.
It appears the feature that tracks the occurrences that have been
dropped
requires too much memory.
2019-11-26 11:26:42 +01:00
Fedor Isakov 9fab2e9d34 Refactor and redesign ReteRuleMatcher for better memory footprint.
Drop layer prototype, make layer mutable.
Keep nodes in a layer in a linked list with fail-safe iterator.
Introduce update queue for update blocks.
Update blocks run incrementally unless reset.
Maintain trail of introduced and dropped occurrences.
Generation iterates over nodes in the last (final) layer incrementally,
unless reset.
Introduce new test.
2019-11-24 13:34:59 +01:00
Fedor Isakov 8ce96ec41e Introduce an abstraction layer of type aliases for persistent collections. 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 c051542440 Replace usages of java.util.HashMap with persistent map to optimize
memory allocation.
2019-05-17 18:01:34 +02:00
Fedor Isakov 0e02bab768 Replace tag() method in rule with uniqueTag() returning Object. This
allows for further memory optimization.
2019-05-17 17:10:52 +02:00
Fedor Isakov eb5b38384f Rename Handler class in reactor API to RulesList. 2019-05-09 17:30:14 +02:00
Fedor Isakov d70bc2509d Rename for better readability: fringe -> front, matchRule -> ruleMatch. 2019-05-09 17:30:14 +02:00
Fedor Isakov 9db8bfcdca Minor code cleanup and documentation.
Switch Dispatcher to use tag as Rule's unique identifier.
De-couple RuleMatcherImpl from the Rule instance.

Rule instances are externally provided, and in case of incremental
Program update these will be all replaced with new ones.
Better to keep loose coupling between those and  the reactor implementation.
2019-05-01 15:36:59 +02:00
Fedor Isakov a9a7f66a3a Refactorings and code cleanup in reactor lib. Documenting the code.
Breaking change: ReactorLifecycle to be used to initialize session
backend.

Remove deprecated stuff, deprecate some more.
Consolidate useless interfaces into bigger ones.
Extract interfaces for core classes, move implementation into "internal"
subpackage.
2019-04-24 21:21:03 +02:00
Fedor Isakov b523467c5f Test a weird case of rule not triggered for a particular combination of constraints. 2019-01-24 16:01:55 +01:00
Fedor Isakov 181ccedd95 Establish the contract of OccurrenceMatcher to fail appropriately on unassigned logicals.
Fix processing of reactivated constraints in RuleMatcher, fix propagation history.
Minor code refactorings. Tests.
2019-01-24 12:03:04 +01:00
Fedor Isakov 087ccf4503 Fix matching single constraint on reactivation after a logical has been assigned. 2018-11-20 22:39:30 +01:00
Fedor Isakov 388999833e Minor code optimization 2018-10-08 15:08:11 +02:00
Fedor Isakov bc69a2e291 Minor code reorganization and refactoring. Extract MatchingProbe interface. 2018-10-05 11:25:29 +02:00
Fedor Isakov 6627c06490 Fix matching of reactivated constraints. Fix REF-ed MetaLogical. Minor code cleanup. 2018-09-13 13:52:33 +02:00
Fedor Isakov d26b7197fd Fix a bug in new matching algorithm that prevented correct matching of ref-ed metalogicals with terms. 2018-08-19 17:32:59 +02:00
Fedor Isakov 74402a8a1c New rule matching algorithm 2018-08-03 11:48:23 +02:00