Commit Graph

163 Commits

Author SHA1 Message Date
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
Grigorii Kirgizov 37be72d9cf Refactor generation of ListFeature & 'spliced' MultiMetaLogical. Fix BL typesystem to accomodate these changes.
ListRole in DataForms is stricter and doesn't allow non-list values.
Spliced MultiMetaLogical is always generated to ListNode without intermediate step of Variable[].
2019-09-11 13:24:01 +03:00
Grigorii Kirgizov e2e531f13c Add few utilities and extend logic of subtypePaths for LUB impl
subtypePaths constraint now has an extended version subtypePathsRaw that returns
extended 'classifierType' dataforms with type parameters (no only classifiers).
2019-09-11 13:24:01 +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
Fedor Isakov adc115b164 Avoid failure on exception thrown from a template.
Produce a program even in case some of applied rules failed.
Allow to recover from failure in apply templates.
2019-09-10 18:37:12 +02:00
Fedor Isakov b842fb6b9d Avoid unnecessarily throwing exception on failure.
EvaluationFailureException is meant to be only thrown from predicate solvers.
It is specially processed in the reactor engine.
2019-09-10 18:37:12 +02:00
Fedor Isakov d3a555c3a4 Ensure correct nodeRef is passed as a feedback template
.
2019-09-05 22:56:11 +02:00
Fedor Isakov fc3b69f06e Make sure the "annotation" lang has a types aspect. 2019-09-05 18:53:52 +02:00
Fedor Isakov 1636f18f73 Support navigating to rule from editor. Drop implementations of Reporting.report. 2019-09-04 16:53:03 +02:00
Fedor Isakov ab8ec75878 Rewrite feedback handling without Reporting interface.
Instead of using the (deprecated) Reporting interface when handling
feedback, use the more straightforward abstract method.
2019-09-02 17:55:46 +02:00
Fedor Isakov 77be3869a4 Introduce target specification to provide feedback constraint.
One should be able to report issues with a target.
The target is normally inferred from the rule's origin, but sometimes it is
necessary to specify the issue's target explicitly.
2019-09-02 17:55:46 +02:00
Fedor Isakov 8b82d7ba4d Introduce origin block for specifying the constraint rule origin. 2019-09-02 17:55:46 +02:00
Fedor Isakov d279cc64ba Deprecate report operation and API. 2019-09-02 17:55:46 +02:00
Fedor Isakov 41c4c7e0a3 Fix provide feedback predicate to use the updated API. 2019-09-02 17:55:46 +02:00
Fedor Isakov 5c239fb4b9 Fix Memoizer race condition. 2019-08-27 11:22:39 +02:00
Fedor Isakov 899d6b5208 Avoid producing NPE on missing template. 2019-08-26 17:14:39 +02:00
Fedor Isakov 17cb4654cf Introduce message handler parameter to rule application session.
In some situations it is unreasonable to fail on missing templates,
it's better to produce a working but perhaps incomplete program
than not to produce anything.
2019-08-26 16:53:04 +02:00
Grigorii Kirgizov cc20e9735b Extend TypesIndexCache & EvaluateRulesStep with storing and retrieving SessionToken 2019-08-22 15:19:58 +02:00
Grigorii Kirgizov af2faeb077 Remove dependencies on samples.baseLanguageExt and samples.lambdacalc from tests, fix build. Rebase onto master. 2019-08-22 15:16:18 +02:00
Grigorii Kirgizov 2b1ec4a4a6 Remove interprocedural version of analysis 2019-08-22 15:16:18 +02:00
Grigorii Kirgizov 944a181685 Switch basic principals analysis to fully gen-time impl 2019-08-22 15:16:18 +02:00
Grigorii Kirgizov 9843669f79 Remove old runtime coderules analyses 2019-08-22 15:16:18 +02:00
Grigorii Kirgizov 37a6a4e1b7 Two more tests on FreeVarEscapeAnalysis for more complex cases. Extend checker logic for them. 2019-08-22 15:16:18 +02:00
Grigorii Kirgizov c6fc2c3f96 Test FreeVarEscapeAnalysis on full languages. Passes for BL, fails for lambdacalc as intended. 2019-08-22 15:16:17 +02:00
Grigorii Kirgizov 1c9060b769 Add simpler analysis to answer a question "Is incrementality allowed for this Coderules aspect?". Add initial tests for it.
It is a rule-local, non-interprocedural analysis and it also uses VarAnalysisUtil.
New analysis checks whether free variables can "escape" principal constraint rules inside principal constraints.
If there is such escaped variable, then it is a signal that this type system is designed with non-local type inference in mind.
Otherwise there's no need to produce principal constraints with free logicals as arguments.
So, no principal constraints with free vars -- no type inference is possible.
2019-08-22 15:16:17 +02:00
Grigorii Kirgizov ae993f6868 Separate VarAnalysisUtil into base and impl part that handles impl of involved relations ("isAffected"). 2019-08-22 15:16:17 +02:00
Grigorii Kirgizov 87fb26b95b Fix NPE in access to hashmap in VarModificationAnalysis 2019-08-22 15:16:17 +02:00
Grigorii Kirgizov e41589cd4a Fix few places in VarModificationAnalysis. Add tests for it (found some problems). 2019-08-22 15:16:17 +02:00
Grigorii Kirgizov f1aa5cb923 Finish interprocedural part of VarModificationAnalysis. Add one more test for Var..Util. 2019-08-22 15:16:17 +02:00
Grigorii Kirgizov 4ab877e822 Refine isAffected relation in VarAnalysisUtil: handle dep-s through composite logicals 2019-08-22 15:16:17 +02:00
Grigorii Kirgizov 62b08720cd Fix finding isAffected relation in var2notvar case by more carefully handling aliasing with "non-local" vars. Few more tests. 2019-08-22 15:16:17 +02:00