Commit Graph

48 Commits

Author SHA1 Message Date
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
Grigorii Kirgizov 1a720dd76e Fix RuleBuilder.uniqueTag computation: consider SNodeReference not only inside DataNode but also raw 2019-10-31 18:07:31 +03:00
Fedor Isakov 6eb1e06013 Add a unique key to identify an aspect clique. 2019-10-19 22:12:34 +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 9f7b14ef8b Refactorings in coderules helper to better handle effects.
Introduce failure as effect value.
Avoid throwing exceptions on normal evaluation completion.
Drop ResumeNextStepException.
2019-09-15 10:14:04 +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
Fedor Isakov 51860132b7 Remove overlooked debug output. 2019-09-10 18:37:12 +02:00
Fedor Isakov 43e34bd14e Redesing the way aspect cliques are processed.
An empty clique singifies that either none of the languages in the clique have the necessary aspects,
or that the "leaf" languages don't.
2019-09-05 18:53:27 +02:00
Fedor Isakov 899d6b5208 Avoid producing NPE on missing template. 2019-08-26 17:14:39 +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 59bdd8a3da Fix the "isRelevant" logic in coderules typechecker. 2019-08-20 23:11:19 +02:00
Fedor Isakov 39c4499585 Refactor aspect lookup, introduce aspect clique to support multiple typesystems.
There might be several unrelated typesystems defined by languages imported into
a single model. A way to handle this is to use aspect cliques that correspond
to a collection of related aspects, which build a single typesystem.
2019-08-12 18:21:38 +02:00
Fedor Isakov 17544576ac Introduce "disable typechecker" properties page. Implement typechecking coerce query. 2019-08-12 16:45:00 +02:00
Fedor Isakov 4c4c610531 Enable macro expansion on concept; null input produces empty builder. 2019-08-10 16:25:36 +02:00
Grigorii Kirgizov b7b5ece832 Adjust notion of principal rule in analysis. Reenable assert in ProcessingStateImpl.
Now any rule matching on or activating principal constraints counts as principal.
2019-07-29 20:25:25 +03: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 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 0ab4e48da1 Fix hash collision in tests. Rename few usages of 'handler' to 'rulesList'. 2019-07-26 17:00:31 +02:00
Grigorii Kirgizov 43a8838c5a Handle the case of pattern logicals for finding principal constraints. Add rules from queries as principals too. 2019-07-26 17:00:30 +02:00
Grigorii Kirgizov 384782e708 Make Rule.uniqueTag() depend on snodes used inside rule template.
When data used in a rule changes, it must get to the RulesDiff.
RulesDiff works using tags, so tags must change when snode data changes.
2019-07-26 17:00:30 +02:00
Grigorii Kirgizov 9a22149a5c Add some debugging info for incremental lang typecheck tests 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 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 9f8539bfd8 Drop unused and long deprecated feature. 2019-02-15 17:46:10 +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 d5ed9d8fa0 Eliminate duplicate language aspect objects from lookup 2019-01-02 18:16:28 +01:00
Fedor Isakov 19ce84f7ef Switch to 2018.3 RC. Apply all migrations. 2018-11-28 16:48:59 +01:00
Fedor Isakov bfcf89e3df Use stack to implement storage of template application session objects 2018-11-20 22:39:30 +01:00
Fedor Isakov 0282f28a5c Bring reporting in line with MPS core reporting facilities. Cleanup the API. 2018-11-04 12:54:32 +01:00
Fedor Isakov 075b34e24d Replacing usages of deprecated concepts. Minor fixes. 2018-09-11 17:01:45 +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 a710832dbf Avoid passing null value to a method not expecting it. 2018-07-22 19:13:14 +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 8b758be83e Ensure node's own language gets included into the rules scope for application. 2018-07-16 13:45:00 +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 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