Commit Graph

193 Commits

Author SHA1 Message Date
Fedor Isakov 28355b99f4 Document/refactor/cleanup UpdatesRecorder for better code readability. 2020-01-22 18:00:57 +01:00
Fedor Isakov c66e746e77 Introduce open terms, support ad-hoc polymorphism.
A term may indicate that it "extends" another open term.
An extended term has essentially the same form as the one
being extended, so that they can be unified.
2020-01-20 10:52:39 +01:00
Fedor Isakov 858d43831c Optimize analysis of constraints when building program. Drop ConstraintRegistry. 2020-01-14 15:34:54 +01:00
Fedor Isakov fa7532f34f Include origin features's hash to requiredHash when building rules.
This enables to adequately reflect changes in the model when it is updated
by editor actions, such as "side transform".

Three tests was broken as the result of this fix and are disabled
http://127.0.0.1:63320/node?ref=r%3A8d22f6d9-72f0-49ec-92ee-027a87fbedd4%28jetbrains.mps.baseLanguageExt.test.incremental%40tests%29%2F3095008005741803340
2020-01-02 17:42:38 +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 1e9e41601a Add method to RuleEx that had been removed from the superclass. 2020-01-02 17:20:13 +01:00
Grigorii Kirgizov 894c727e70 Fix minor bug concerned with CopyUtil
CopyUtil didn't correctly map logicals nested inside DataForms which are bound to Logicals.
That's because CopyUtil relies on DataForm:variablesCount() and
LogicalDataForm:variablesCount didn't consider the case when bound value is itself DataForm.
2019-12-18 21:47:06 +03:00
Fedor Isakov e926b86bcd Minor refactoring in program producing code.
Reorganize and cleanup code.
2019-12-10 11:58:26 +01:00
Fedor Isakov 69bc34e8f9 Drop language j.m.l.smodel.types containing SNodeTypeOp that is no longer used. 2019-11-11 14:37:41 +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
Fedor Isakov f92148094a Drop long deprecated concepts with zero instances. 2019-11-11 13:53:41 +01:00
Grigorii Kirgizov 53ddcb8492 Small cleanup of TraceTool for incremental processing 2019-11-07 17:15:56 +03:00
Grigorii Kirgizov ea309d05e7 MPSCR-14: Remove unnecessary & failing call to tracer.restored() for incrementally preserved occurrences 2019-11-07 15:43:02 +03: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 3f1b65ada2 Fix the structural errors introduced by a badly run migration. 2019-11-06 12:05:18 +01:00
Fedor Isakov ad90a4cb77 Apply migration that replaces all instances of NodeAnchor with .pointer op. 2019-11-06 11:21:57 +01:00
Fedor Isakov bb8fffc7ea Enable to use origin{} block to specify no origin.
Rules that are used only as auxiliary resolvers don't have an associated
origin node, even though they are produced from a specific location.
To enable tracking of correct origin to report errors to one can use
origin(no origin){} to override the default behaviour.
2019-11-05 18:46:02 +01: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 e32ff36d1b Allow node-ptr<> to be specified in require statement. 2019-11-04 17:10:34 +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 84162b9097 Deprecate NodeAnchor, provide migration to .pointer operation.
A usage of .pointer op as an argument to a constraint invokes require() on template application session.
2019-11-04 16:20:38 +01:00
Fedor Isakov a0b2af95c9 Revert "MPSCR-4: Upd refs to new RuleIndex on Dispatcher construction in incremental case."
This reverts commit 0dd7f8c70f.
2019-11-04 15:58:54 +01:00
Grigorii Kirgizov 0dd7f8c70f MPSCR-4: Upd refs to new RuleIndex on Dispatcher construction in incremental case.
Slightly extend RuleMatcher interface.
Store RuleMatcher instances instead of RuleMatcherProbe in SessionToken.
2019-10-31 22:20:19 +03:00
Grigorii Kirgizov 0e33bffa96 Handle additional case of constructing ListNodeCons 2019-10-26 16:17:37 +03:00
Fedor Isakov 3092fa3635 Fix all templates with broken scopes for logical variables. 2019-10-25 22:45:55 +02:00
Fedor Isakov c797b5d2ad Breaking change: logical vars must be declared by constraint rule that uses them.
Stronger rules for logical variables scope: constraint rule can't reference logical variable defined in another constraint rule. Logical variable definitions are localized to ConstraintRule template.
Simplify/cleanup the logic of searching for available logical variables.
2019-10-25 22:45:55 +02:00
Grigorii Kirgizov bc06bf39cc Handle one more case of finding principal constraints in Query rules with an additional heuristic. 2019-10-15 21:15:38 +03:00
Fedor Isakov 06076860ed Deprecate SNodeSetType operation in typechecking lang. This lang exists now only for the sake of "types" aspect. 2019-10-12 09:35:09 +02:00
Fedor Isakov 5258a9343f Switch to collecting types during typechecking using the explicit type collector.
Use the parameter to typechecking query TYPECHECK to collect types.
Stop highlighting every expression with its type.
2019-10-10 17:30:11 +02:00
Fedor Isakov f8dcf127db Extend typechecking query TYPECHECK with a parameter to report types.
Reporting of calculated types is to be more explicit.
The not-so-obvious _type_.set() operation is to be phased out.
2019-10-10 17:30:11 +02: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
Fedor Isakov 1cbd5defff Drop PrintDelegate stack, avoid memory leaks. 2019-09-13 13:44:23 +02:00
Fedor Isakov 068ce227c3 Avoid propagating runtime exception from program evaluation. 2019-09-12 17:08:02 +02:00
Fedor Isakov 8b73b66e34 Introduce RepositoryProvider interface to provide access to context repository.
TemplateApplicationSession to provide repository to templates.
Supervisor subclasses to provide repository to predicates.
2019-09-12 17:08:02 +02:00
Grigorii Kirgizov 332735e770 Remove unneded handler 2019-09-12 15:29:14 +03:00
Grigorii Kirgizov cdfe1f2c0c Update language version after migrations from mps.logic lang 2019-09-11 13:24:02 +03:00
Grigorii Kirgizov 85b074d189 Make ListNodeCons migration a bit more restrictive 2019-09-11 13:24:02 +03:00
Grigorii Kirgizov 135724a481 Fix use case of list matching with any list 2019-09-11 13:24:02 +03:00
Grigorii Kirgizov 7242e832b1 Upd mps.logic lang version 2019-09-11 13:24:02 +03:00
Grigorii Kirgizov fc1caf1238 Fix Remove_Splice_from_ListNode migration 2019-09-11 13:24:02 +03:00
Grigorii Kirgizov 163e339436 Add migration for replacing List usages for ConsList constructor usages 2019-09-11 13:24:02 +03:00
Grigorii Kirgizov 3ff9ccb0c6 Add wrapping substitute menu for LogicalDataForm concept 2019-09-11 13:24:02 +03:00
Grigorii Kirgizov cfe0b1b648 Add ListNodeCons DataForm: another constructor for ListNode similar to Haskell's `head:tail` constructor 2019-09-11 13:24:02 +03:00
Grigorii Kirgizov edbd77c748 Prepare for migration from spliced Logicals in ListNode to LogicalDataForm 2019-09-11 13:24:02 +03:00
Grigorii Kirgizov 6a02be6f6e Avoid nested empty lists in mapped ListNode.Alias. Fix capture in lcta helper for lub. Add test for lub.
The problem with empty lists showed up at least in printing lists.
2019-09-11 13:24:02 +03:00