Fedor Isakov
9bbf86cb8d
Optimize coderules templates runtime and generator.
...
Drop obsolete code from runtime.
Consolidate and reconcile different templates for consistency.
Simplify generated code.
2020-04-19 16:30:11 +02:00
Fedor Isakov
cfcbee9d6f
Cleanup the runtime: drop unused/obsolete methods.
2020-04-19 16:30:11 +02:00
Fedor Isakov
a1c98b5bf0
Apply all outstanding migrations.
2020-04-13 17:58:33 +02:00
Fedor Isakov
9a8b3585d7
Fix runtime and generator to support queries and call macros.
...
Expand macro supports dispatching by concept.
Logical variables declared on macro's body are init'ed in apply method.
Enable the hack to ensure dependencies on macro input are tracked.
2020-03-31 18:43:22 +02:00
Fedor Isakov
28d21f5349
Cleanup in macro runtime, expand macro parameter access.
...
Parameters can be specified for call macro only.
Logicals can be specified for expand and call macro.
Expand macro params are treated exactly as "context"
parameters.
2020-03-31 11:27:09 +02:00
Fedor Isakov
6672ab21e8
Runtime support for new expand and call macro constraints.
2020-03-31 11:27:09 +02:00
Grigorii Kirgizov
91e4d2b582
Revive 'principal' rule feature for MPSCR-51. Mark those rules in BL typesystem.
...
Introduce 'auxiliary/essential' notions instead of 'principal/not principal'.
2020-03-23 14:28:14 +03:00
Grigorii Kirgizov
a619b017ec
Fix NPE in UpdatesRecorder on roots move/remove
...
In such cases typechecking was failing on the point of computing changeSetClosure,
because changeSet got null nodes from SNodeChangeEvents
2020-02-26 18:58:05 +03:00
Grigorii Kirgizov
707982fbe9
Include changed nodes from different roots in invalidated set for incremental program update. (MPSCR-46)
...
The core chang in is InvalidateAndApplyTemplatesStep.
Also rename SNodeEventsFilter to RelevantNodesTracker.
2020-02-26 18:58:05 +03:00
Grigorii Kirgizov
025232969d
Track change events from all referred models (MPSCR-46)
...
UnitTypecheckingCacheHolder now holds the data needed for ChangesTrackers.
This data is updated by UpdatesRecorder: different models and nodes from different roots are tracked.
2020-02-26 18:58:05 +03:00
Fedor Isakov
f2bb87e1b0
Apply migration to replace deprecated concept.
2020-02-26 15:03:31 +01:00
Fedor Isakov
7ba7c983cb
Apply migration to use logical variable ref expression.
2020-02-24 22:57:05 +01:00
Grigorii Kirgizov
6a67865554
Fix NPE in new ChangesTracker in UpdatesRecorder on broken references (relates to MPSCR-44)
2020-02-19 01:04:55 +03:00
Grigorii Kirgizov
725a438bca
Use same information for incremental program update and types cache invalidation (fixes MPSCR-44)
...
Previously there were two independent ChangeTracker-s in UpdatesRecorder and UnitTypecheckingCacheHolder.
Now, given more elaborate logic for tracking changes to types (which includes changes in different roots)
this information must be propagated from UpdatesRecorder to cache holder,
so that if there're changes relevant for recomputing types then types cache is also invalidated.
2020-02-18 23:39:26 +03:00
Grigorii Kirgizov
5abbccf511
Collect changes in UpdatesRecorder in referred-to roots (MPSCR-44)
2020-02-18 23:35:23 +03:00
Grigorii Kirgizov
a8f3ed8d9a
Store reversedRequirements in UpdateRecorder by SNodeId, not by SNodes themselves (fixes MPSCR-42)
...
Sometimes UpdatesRecorder can log changes of SNodes which have same SNodeId, but different identity.
Thus reversedRequirements map returned nothing on such nodes and these require-dependencies were not handled.
Such case is described in MPSCR-42 ticket.
2020-02-13 17:12:33 +03:00
Fedor Isakov
796ad9ad2c
Apply migration to drop ValueOfExpression.
2020-02-12 12:26:09 +01:00
Fedor Isakov
a35b5b46ec
Deprecated condition block in rule template, isApplicable method in API. Migration to use if statement instead.
2020-02-07 13:14:24 +01:00
Grigorii Kirgizov
c6889be4e7
Consider possible errors at rule generation stage as non fatal and produce Program with some rules dropped (fixes MPSCR-38)
...
New Result.RECOVERED case-class is added which collects errors but doesn't fail.
Currently errors are collected but not reported.
2020-02-06 01:02:50 +03:00
Grigorii Kirgizov
7b168e40c7
Provide failure cause in ouput Effect to get more informative failures of Coderules on ApplyTemplatesStep (related to MPSCR-38)
2020-02-05 23:29:05 +03:00
Fedor Isakov
3f51c1e5c1
Apply migration that replaces empty logical type with term type.
2020-02-05 12:34:20 +01:00
Fedor Isakov
28355b99f4
Document/refactor/cleanup UpdatesRecorder for better code readability.
2020-01-22 18:00:57 +01:00
Fedor Isakov
858d43831c
Optimize analysis of constraints when building program. Drop ConstraintRegistry.
2020-01-14 15:34:54 +01:00
Fedor Isakov
d50d3cf9f6
Fix incremental program update not triggered in some cases.
...
Track invalidated set of nodes and update program correspondingly.
Use node instances as keys instead of node pointers.
2020-01-02 17:20:13 +01:00
Fedor Isakov
efd19aa45b
Implement incremental generation of coderules program.
...
Introduce SessionData, allow to keep arbitrary data with the session.
Extend RulesListTable with support for invalidation based on rule unique tags.
Introduce UpdatesRecorder to keep track of invalidated nodes.
Extend ApplyTemplatesStep with invalidate logic for typechecking.
Simplify design, drop unnecessary fields, minor refactorings.
2020-01-02 17:20:13 +01:00
Fedor Isakov
e926b86bcd
Minor refactoring in program producing code.
...
Reorganize and cleanup code.
2019-12-10 11:58:26 +01:00
Fedor Isakov
ecd2594fed
Drop deprecated Reporting interface and all its usages.
...
Remove runtime solution that contained only Reporting.
2019-11-11 13:53:41 +01:00
Grigorii Kirgizov
cd25087ef9
Rename 'handlers' in CodeRulesProgram to 'rulesLists'
2019-11-06 19:10:29 +03:00
Grigorii Kirgizov
e4017b0b16
Preserve still valid Rules from previous incremental sessions with a help of RulesDiff
2019-11-06 19:10:29 +03:00
Grigorii Kirgizov
f343ba0d3b
Adjust to changes in SessionToken & RulesDiff interfaces
2019-11-06 19:10:29 +03:00
Grigorii Kirgizov
9b61c6a2d3
Move RulesListIImpl out of RulesListBuilder
...
For later Program modification by RulesDiff and preserved rules from prev Program
2019-11-06 19:10:29 +03:00
Fedor Isakov
76739d20d9
Minor refactoring and renaming in coderules runtime. Documentation.
...
Rename classes and methods to better reflect the intent.
Move test-related stuff to test util model.
2019-11-05 18:46:02 +01:00
Fedor Isakov
48375c4d14
Extend RuleBuilder with template app session: automatically require node ponters passed as args to constraints.
...
Every node pointer (SNodeReference) specified as an arg to a constraint causes the (resolved) target to be included
into template application session (required).
Reduce NodeAnchor to .pointer call.
Deprecate Reporting interface and context repository in rule definitions.
2019-11-04 16:20:57 +01:00
Fedor Isakov
cc8cf72819
Minor code cleanup: get rid of MacroTemplate.ID, simplify templates. Systemize RuleBuilder usages.
2019-11-04 16:20:57 +01:00
Fedor Isakov
a0405839b3
Necessary plumbing for rules segmentation. Off for now.
...
Turns out this feature actuall worsens the performance.
2019-09-30 16:44:36 +02:00
Grigorii Kirgizov
cdfe1f2c0c
Update language version after migrations from mps.logic lang
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
924d07c8ed
Return 'tagDetail' logic in RuleBuilder to handle duplicate tags of rules generated in loops
2019-09-11 13:24:01 +03:00
Grigorii Kirgizov
9843669f79
Remove old runtime coderules analyses
2019-08-22 15:16:18 +02:00
Fedor Isakov
4c4c610531
Enable macro expansion on concept; null input produces empty builder.
2019-08-10 16:25:36 +02:00
Fedor Isakov
ef7e3fa1a6
Drop "tagDetail" hack, use again string as a unique rule's tag.
2019-07-29 17:16:43 +02:00
Fedor Isakov
66c9222a95
Run migrations with MPS 2019.2 EAP3.
2019-07-26 17:27:18 +02:00
Grigorii Kirgizov
0ab4e48da1
Fix hash collision in tests. Rename few usages of 'handler' to 'rulesList'.
2019-07-26 17:00:31 +02:00
Grigorii Kirgizov
b9309e6369
Add several tests of incr typecheck on BL. ProgramEvaluator now depends on ProgramProducer.
2019-07-26 17:00:31 +02:00
Grigorii Kirgizov
6c4667e066
Add basic coderules program analysis for determining principal constraints
2019-07-26 17:00:30 +02:00
Fedor Isakov
79b08c6f83
Revert "Apply migrations from EAP3 and rebuild project."
...
This reverts commit 9c5bf858c3 .
2019-07-26 15:30:30 +02:00
Fedor Isakov
9c5bf858c3
Apply migrations from EAP3 and rebuild project.
2019-07-19 12:28:27 +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
17ed4642ae
Apply all available automatic migrations.
2019-06-05 16:16:00 +02:00
Fedor Isakov
3b638b2d08
Drop usages of Rule.tag(), replace with Rule.uniqueTag().
...
Switch to using long as a rule's unique tag.
Rename all entities using "handler" to "rulesList".
2019-05-17 18:01:34 +02:00
Fedor Isakov
61b60938d0
Fix heuristic for determining the rule with origin that should serve
...
as a failure recovery point.
2019-05-16 12:36:47 +02:00