Commit Graph

67 Commits

Author SHA1 Message Date
Fedor Isakov da43822154 Manually migrate try statements that were not auto-migrated. 2020-05-09 15:07:06 +02:00
Fedor Isakov 14780b5561 Apply automatic migrations. 2020-05-09 15:04:25 +02:00
Fedor Isakov d1163fc883 Open and rebuild the project with MPS 2020.1. 2020-05-09 15:02:20 +02:00
Fedor Isakov a36369f002 Consistently use unified name RuleTable across all runtime. 2020-04-22 16:00:41 +02:00
Fedor Isakov 78a753a872 Refactor coderules aspect runtime: consolidate manifests.
Have single manifest for all assets instead of separate ones.
QueryTable is declared but not implemented yet.
2020-04-22 16:00:41 +02:00
Fedor Isakov 767a41ad24 Switch runtime and generator templates to use Query interface.
Previously used contract with QueryKind/Object[] parameters is
replaced with Query object.
2020-04-22 11:43:37 +02:00
Fedor Isakov 1bb158d50b Consolidate models in template runtime solution. 2020-04-19 16:30:11 +02:00
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