Commit Graph

172 Commits

Author SHA1 Message Date
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
Fedor Isakov 3f51c1e5c1 Apply migration that replaces empty logical type with term type. 2020-02-05 12:34:20 +01: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 046f4969e1 Remove unnecessary calls to EvaluationResult.storeView() to save some time 2020-02-05 12:29:33 +03:00
Fedor Isakov 9403087c11 Drop RepositoryProvider interface (unused). 2020-02-04 11:43:20 +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 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 f343ba0d3b Adjust to changes in SessionToken & RulesDiff interfaces 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 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 cdfe1f2c0c Update language version after migrations from mps.logic lang 2019-09-11 13:24:02 +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
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 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 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 9843669f79 Remove old runtime coderules analyses 2019-08-22 15:16:18 +02:00
Grigorii Kirgizov 906f919e16 Run coderules program analyses at generation stage. Extend Rule with basetag(). Adjust how rule_tag is generated for reuse in generator.
basetag() returns name of ConstraintRule without node id.
Check on whether Rule is principal are now done through basetag(), it's sufficient.
Add part of future analysis: CallerTableBuilder.
2019-08-22 15:16:17 +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 66c9222a95 Run migrations with MPS 2019.2 EAP3. 2019-07-26 17:27:18 +02:00
Grigorii Kirgizov 11712c7069 Restrict the notion of principal rule (as effect, match journal is shorter now). It also positively affected reporting, so switch reporting to the new way. 2019-07-26 17:00:31 +02:00
Grigorii Kirgizov 3d80841639 Switch ReportingSupervisor to handle RuleMatch. Add Supervisor using ProgramSpec instead of PrincipalOriginIndex. 2019-07-26 17:00:31 +02:00
Grigorii Kirgizov 78c0cc1559 Setup code for failing typechecking tests, add one. Extract Supervisor impl from ProgramEvaluator. 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 9a22149a5c Add some debugging info for incremental lang typecheck tests 2019-07-26 17:00:30 +02:00
Grigorii Kirgizov ce9b91c4a5 Add basic tests for simple program analysis, add test helpers. 2019-07-26 17:00:30 +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 aaec11de9b Adapt to the changes in reactor API. 2019-05-05 14:29:08 +02:00
Fedor Isakov 4389b349d7 Adapt to the changes in reactor API. 2019-05-02 14:59:57 +02:00
Fedor Isakov b1f7ba4ecf Drop usages of deprecated symbols in reactor API. 2019-05-02 14:46:57 +02:00
Fedor Isakov 478b43ce16 Drop usages of deprecated interfaces. 2019-04-26 00:22:02 +02:00
Fedor Isakov adcfba5e9a Introduce two built-in predicates to be used instead of eval(false) etc.: fail and report message (debug/info/warning/error/fatal). 2019-02-18 11:49:11 +01:00
Fedor Isakov b102237bb8 Drop static collection of predicate symbols. Adapt to the latest reactor API. Drop DefaultSessionSolver 2019-02-17 11:39:56 +01:00
Fedor Isakov 5f068c1ac0 Extract stuff related to program producing to separate model. 2019-02-15 17:15:17 +01:00
Fedor Isakov 255b7061f7 Reorganize models/packages, restructure code components responsible for program building/evaluation. 2019-02-15 17:15:17 +01:00
Fedor Isakov 2f8ff698b3 Minor refactorings in program producing code. Consolidating everything related to program producing into a single package. 2019-02-15 17:15:16 +01:00
Fedor Isakov a240246daa Ensure failures don't stop program evaluation, recover failure always at top level (when processing "main/0" constraint).
Keep track of principal origins to be used as points of failure.
Minor code cleanup/refactoring.
2019-02-06 12:57:47 +01:00
Fedor Isakov 27681ef80c Switch substitution to work using equals predicate instead of equals() java method. Testing substitution on tricky cases. 2019-01-15 20:09:16 +01:00
Fedor Isakov 6aa965c96c Ignore commented out nodes while applying templates. Use node pointer to report locations of failed tests. 2019-01-13 15:14:14 +01:00
Fedor Isakov 82b409cb86 Fix SubstituteUtil to match pattern using equals() instead of unification. Tests for SubstituteUtil. 2018-12-14 13:35:36 +01:00
Fedor Isakov 19ce84f7ef Switch to 2018.3 RC. Apply all migrations. 2018-11-28 16:48:59 +01:00
Fedor Isakov 6778fab625 Use index to filter nodes on which FailureHandler should report error and clear failed state. 2018-11-20 22:39:30 +01:00
Fedor Isakov 6788bcf7a1 Switch to latest reactor, update the API calls. Support EvaluationFailure and FailureHandler. 2018-11-04 13:10:40 +01:00
Fedor Isakov 075b34e24d Replacing usages of deprecated concepts. Minor fixes. 2018-09-11 17:01:45 +02:00
Fedor Isakov f44de16c3f Introduce a method to access the context repository into Reporting interface. 2018-09-11 12:22:47 +02:00
Fedor Isakov 8cacd9c326 Ensure terms are copied "properly" without breaking Path's contract. Pending optimization. 2018-08-07 11:50:05 +02:00
Fedor Isakov 78764af3dc Ensure all rule builders within a single rule template have unique tags 2018-08-03 11:48:36 +02:00
Fedor Isakov ea9919f38a Bring the hierarchy of DataForm concepts in line with the runtime.
Merge DataForm constructors into logic language.
Repackaging logic runtime.
Drop obsolete code.
2018-07-21 13:29:22 +02:00
Fedor Isakov 24bcd0426c Ensure conflicting queries are reported as error. 2018-07-16 16:17:52 +02:00
Fedor Isakov 79c02d2b00 Cleaning up dependencies in an attempt to produce a workable build.xml that doesn't break gradle. 2018-07-14 17:22:14 +02:00
Fedor Isakov 4dfb676349 Ensure the order of handlers corresponds with the "extends" relation. The handler being extended has lower priority. 2018-07-02 11:27:55 +02:00
Fedor Isakov 0ddd0fcaa1 Introduce "principal" flag for rule templates. A principal template is excluded from processing as "required". 2018-07-02 11:27:55 +02:00
Fedor Isakov b4d0ab73bb Initial boilerplate support for launching controlflow queries. Some refactorings to further uncouple coderules-related stuff. 2018-06-15 14:55:44 +02:00
Fedor Isakov a74f00f688 Introduce controlflow language and corresponding solutions as another example of applying code rules in practice. 2018-06-14 16:19:06 +02:00
Fedor Isakov 20c107e428 Introduce j.m.lang.typechecking lang to provide typechecking aspect-related services. Abstract away aspect generation/discovery logic to make it reusable. 2018-06-14 15:02:22 +02:00
Fedor Isakov a8e6c565b5 Rename the language and runtime solution: typesystem2 -> coderules. Move typechecking-related stuff to typechecking solution. Reorganize modules, delete obsolete stuck files. 2018-06-12 18:00:30 +02:00