Commit Graph

37 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 506b245438 Drop obsolete deprecated code 2024-06-13 12:23:27 +02:00
Fedor Isakov 3b7eb7c210 Ensure failures has non-null message 2022-05-03 10:26:43 +02:00
Fedor Isakov c51a984648 Alternative solution for invalidating feedback
Introduce feedback basis to track dependencies on rules.
Index journal chunks by evidence for quick lookup.

The feedback basis is the collection of principal rules tags
from the justifications of the current match.
2021-04-08 08:51:39 +02:00
Fedor Isakov f6123273d4 Minor refactoring: drop usages of Program.rulesLists() method. 2020-12-01 21:55:17 +01:00
Grigorii Kirgizov f2d1f089ad Use rule match identity as feedback key for TypesIndex instead of rule unique tag
It seems to reflect the exact information needed: there's
one-to-one correspondence between feedback and its match.
While using rule unique tag as feedback key in TypesIndex
relied on several assumptions.
Also there's less use of MatchJournal information with this.
Previously parent principal match was passed to FeedbackConsumer.
2020-07-22 15:27:46 +03:00
Grigorii Kirgizov a4b28509a8 Provide additional information about parent principal chunk to Feedback (MPSCR-32)
Allows to track connection between invalidated matches and reported feedback.
In future this Journal info can help in simplifying error reporting.
2020-02-05 12:29:33 +03:00
Fedor Isakov 8af582f9b2 Refactoring: simplify contract b/w controller and logical state. 2020-01-14 15:34:54 +01:00
Grigorii Kirgizov ecc948c1fc Add, remove and merge observers on Logical always on their roots. Fixes MPSCR-28 2019-12-23 21:13:07 +03:00
Grigorii Kirgizov 1f69ff7d57 Reproduce MPSCR-28 with a test in Reactor 2019-12-23 18:14:41 +03:00
Grigorii Kirgizov 32a1ef77c9 Add test (fails now) for a new bug MPSCR-17 in Rete Matcher concerned with reactivation 2019-11-19 15:43:15 +03: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 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
Grigorii Kirgizov 8ed7eb3c02 Change signature of Supervisor to handle RuleMatch instead of Rule 2019-07-26 17:00:31 +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 658963903d Refactor controller: extract component for managing dispatching front,
drop Store, introduce ProcessingState and StateFrame.

ProcessingState class to represent current state, including the
dispatching front and all the logical observers.
StateFrame is a persistent class that reacts to activated constraint
and launches processing via Controller.
Breaking change: the frames correspond to an activated constraint occurrence,
and not to a triggered rule match as it has been the case before.
2019-05-16 12:35:52 +02:00
Fedor Isakov bfc4b641bb Refactor constraint occurrence to depend on controller directly.
Drop creating of a frame stack from a store view.
2019-05-13 10:48:10 +02:00
Fedor Isakov eb5b38384f Rename Handler class in reactor API to RulesList. 2019-05-09 17:30:14 +02:00
Fedor Isakov cc2774d66d Refactorings in conreactor: better separation of concerns, cleaner interfaces.
Introduce Supervisor, extract evaluation-related stuff from Program, merge with EvaluationFeedbackHandler.
Move implementation of EvaluationFeedback to internal API, reduce number of public interfaces.
Cleaner interface for reporting feedback.
2019-05-05 13:52:26 +02:00
Fedor Isakov 7dcd683ba5 Enable EvaluationSession to have arbitrary parameters available at exec time.
Drop two obsolete interfaces.
2019-04-26 00:22:02 +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 3f930ba530 Introduce solver() method to PredicateSymbol.
Drop requirement to provide evaluation session with list of solvers; remove unnecessary configuration step.
Minor refactorings in tests.
2019-02-17 11:39:56 +01:00
Fedor Isakov c8d7e52b6f Introduce feedback handling API to facilitate processing of messages during program evaluation.
Minor refactorings in conreactor. Drop deprecated stuff. Default implementations for deprecated methods.
2019-02-15 17:15:09 +01: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 1b584d2825 Reactor API changes: EvaluationResult and FailureHandler.
Failures are no longer propagated as exceptions, instead evaluation
returns optional failure.
2018-11-04 12:54:32 +01:00
Fedor Isakov 74402a8a1c New rule matching algorithm 2018-08-03 11:48:23 +02:00
Fedor Isakov bfd6010b7d Fix a bug in rule matching preventing good matches to be reported. Tests. 2017-10-06 12:09:57 +02:00
Fedor Isakov c5c198cf8b Refactoring in the reactor API: move invocation/occurrence factory methods to evaluation session, enable access to logical context from an invocation. 2017-03-27 19:01:07 +02:00
Fedor Isakov cae150819f Introduce StoreView as a parameter to launching evaluation session. Minor code refactoring/extracting. 2017-01-10 20:19:59 +01:00
Fedor Isakov c68d9a0bd7 Refactoring the reactor API. Extract StoreView. Get rid of obsolete calls to SessionSolver, cleanup the interface. Introduce AbstractSolver. Move instantiation arguments to solver/program. Cleaning up the code. 2017-01-05 17:34:53 +01:00
Fedor Isakov ebfe680aae Refactoring the reactor API. Extract StoreView, get rid of obsolete calls to SessionSolver. Cleaning up the code. 2017-01-04 10:47:23 +01:00
Fedor Isakov 0771504044 Refactoring the reactor API, cleaning up the code. 2017-01-03 12:11:31 +01:00
Fedor Isakov 26f12f187d Refactor the evaluation controller to have handlers. RuleIndex to select handlers with matching primary symbol first, then the "accept-all" handlers. Tests. 2016-12-23 16:50:31 +01:00
Fedor Isakov 49a6ee0bd0 New naming convention for test helper classes (prefix Mock-). 2016-12-22 15:56:23 +01:00
Fedor Isakov e6c7ee74f5 Renaming implementation classes to clean up the namespace. 2016-12-22 12:27:34 +01:00