Commit Graph

424 Commits

Author SHA1 Message Date
Grigorii Kirgizov f71d734853 Reproduce cause of MPSCR-45 in unification solver 2020-03-06 14:05:29 +03:00
Fedor Isakov 485eedea5e Ensure no infinite recursion is possible in toString.
Scheduler in rxjava2-swing seems to cause a peculiar bug
that is difficult to reproduce.
Seems like AtomicReference or one of its subclasses
gets itself as the value, which triggers infinite recursion.
2020-03-05 22:18:13 +01:00
Fedor Isakov 77c44e9066 Ensure RxSwingPlugins is unset and scheduler initialized. 2020-03-05 18:18:20 +01:00
Fedor Isakov 5a16c4d23b Drop ModelPropertiesChecker temporarily from CheckProjectModules test. 2020-03-05 16:48:04 +01:00
Fedor Isakov 8328467a54 Fix java stub locations for RxJava. 2020-03-05 16:23:47 +01:00
Fedor Isakov a894b33983 Update to the latest RxJava2 and Swing adapter. 2020-03-05 15:49:04 +01:00
Fedor Isakov 719956007a Increase timeout to 10 sec, try to fix the test. 2020-03-05 10:11:37 +01:00
Fedor Isakov fec446f006 Drop wrapping substitutions in favour of regular actions.
The editor for evaluating late expression inserts $() construct
first, then allows to enter the expression.
A couple of minor fixes and a workaround.
2020-02-27 14:48:37 +01: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 2e9a1e8dbf Support deleting pattern from logical variable in head. 2020-02-26 16:08:50 +01:00
Fedor Isakov f2bb87e1b0 Apply migration to replace deprecated concept. 2020-02-26 15:03:31 +01:00
Fedor Isakov c064972266 Deprecate obsolete concept, provide migration. Minor editor fixes.
ExpressionLogicalVariable is replaced with ExpressionItem wrapping
the same expression.
Fixes ensure correct application of transformations.
Late expression can't be used as "placeholder" logical item.
2020-02-26 15:01:29 +01:00
Fedor Isakov 2a5b3661b8 Use EvaluationSetting tag for constraint context.
Concepts supposed to contain constraints are
effectively implementing evaluation setting.
2020-02-24 22:57:05 +01:00
Fedor Isakov 7ba7c983cb Apply migration to use logical variable ref expression. 2020-02-24 22:57:05 +01:00
Fedor Isakov 630fd33629 Introduce logical var reference expression.
This expression is to be used in those rare cases
when a logical var is to be passed to an external method.
Not available within EvaluationSetting (new marker interface).
Normally logical variable (as an instance of LogicalItem)
is only to be used within a logical context.
Logical item value expr only to contain a logical variable.
2020-02-24 22:56:54 +01:00
Fedor Isakov 2c43762f93 Replace all instances of .pointer in constraints to node reference.
SNode is supported now directly as an argument to constraint/predicate.
Pointer operation is no longer necessary, as is node-ptr<> type for logical vars.
2020-02-20 11:59:28 +01:00
Fedor Isakov 8ec26b4e94 Support node<> argument in constraints. Prepare to get rid of node-ptr<>. Minor refactoring. 2020-02-20 11:59:28 +01:00
Fedor Isakov ee36d879b3 Make better editor for provide feedback and fail constraints. 2020-02-20 11:59:28 +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
Fedor Isakov 417fc45933 Restore origin ref in RuleEx interface, fix terminology in templates API.
To avoid confusion, a rule defines "target ref", which is supposed
to indicate the source code location for possible errors.
The origin node is to be referred as "origin" as before.
Temporarily rename OriginSpec's alias to "target" to reflect change
in semantics.
2020-02-17 11:57:14 +01: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 0d7316adf4 Introduce LogicalItemValueExpr, deprecate ValueOfExpr, migration.
LogicalItemValueExpression is to play the same role as valueOf(logical)
within an instance of EvaluationSubject.
LogicalItemExpression is to represent the logical variable itself.
2020-02-12 12:18:30 +01:00
Fedor Isakov 25585f9166 Deprecate assert constraint: a simple $() should serve. 2020-02-12 10:53:40 +01:00
Fedor Isakov 115c368a2f Reconcile different syntaxes for ExpressionConstraint and LateExpression. Use $() for both.
This is an important change in coderules syntax: all expressions to be evaluated from
constraints/predicates are to be wrapped in parentheses and preceded by dollar sign.
So, instead of eval/backticks the new syntax is to be used: $(<expression>).
Also the expressions to be passed to "feedback reporting" predicates are to be wrapped similarly.
2020-02-12 10:53:40 +01:00
Grigorii Kirgizov 820edb8e5a Distinguish between origin and reportOrigin in generator to track changes for regenerating rules (fixes MPSCR-36) 2020-02-11 15:52:30 +03:00
Grigorii Kirgizov c87a2741fe Add test for incrementality in BL to reproduce MPSCR-36 2020-02-11 15:52:30 +03:00
Fedor Isakov 1a6b107a76 Apply migration to replace condition block with if statement. 2020-02-07 13:14:46 +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
Fedor Isakov 73219399f4 Deprecate unused flag "principal" in rule template, drop usages. 2020-02-07 12:05:45 +01:00
Fedor Isakov b76ed3d3e0 Add folding to rule list editor, fix constraint rule editor. 2020-02-07 11:58:11 +01:00
Fedor Isakov 3ae40153a2 Un-deprecate local logical var declaration, drop MITM concept. 2020-02-07 11:33:26 +01:00
Fedor Isakov 4a84ebce5f Apply migration to switch to BodyBlock. 2020-02-06 12:55:32 +01:00
Fedor Isakov fa4537dbc3 Introduce BodyBlock to contain multiple body clause lists. Support multi-line body. Migration. 2020-02-06 12:50:26 +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 c353f89ea0 Apply migration to drop ParameterContainer. 2020-02-05 17:02:32 +01:00
Fedor Isakov c15c6694de Ensure all rule parameters of same type are displayed on separate lines. Deprecte ParameterContainer. Migration. 2020-02-05 17:02:31 +01:00
Fedor Isakov 3f51c1e5c1 Apply migration that replaces empty logical type with term type. 2020-02-05 12:34:20 +01:00
Fedor Isakov 58a1cf16fe Introduce TermType (term) to be represented as "DataForm" in runtime. Migration to specify term type where expected. 2020-02-05 12:24:40 +01:00
Grigorii Kirgizov 73ebfbe7d1 Use invalidatedTags info in TypeIndex to invalidate ReportItems 2020-02-05 12:29:33 +03:00
Grigorii Kirgizov 3a15d40625 Update Supervisor and TypesIndex to incorporate changes in feedback reporting (MPSCR-32)
TypesIndex now invalidates report items from previous sessions not by node refs,
but by tags of rules which produced them. Set of invalidated tags is an addiitonal
output from incremental engine.
2020-02-05 12:29:33 +03:00
Grigorii Kirgizov 119daf05d9 Restrict notion of a principal rule to not track unnecessary matches in journal
Now principal rule head must  include only principal constraints or be empty.
Without this restriction journal may include stale chunks which have no information to invalidate them.
2020-02-05 12:29:33 +03:00
Grigorii Kirgizov 1334c7c7a1 Fix missed dependencies when computing rule's uniqueTag (from nodes in macro expand) 2020-02-05 12:29:33 +03:00
Grigorii Kirgizov 046f4969e1 Remove unnecessary calls to EvaluationResult.storeView() to save some time 2020-02-05 12:29:33 +03:00
Fedor Isakov b6e4e80010 Coderules/logic editor: support entering standalone item as logical clause, allow to type = and == naturally. 2020-02-04 17:34:38 +01:00