Commit Graph

540 Commits

Author SHA1 Message Date
Fedor Isakov 6f9958e432 Minor optimization in UnificationPredicate. Adapt to DataProvider interface. 2020-06-04 11:44:07 +02:00
Fedor Isakov 04c2dfb385 Implement DataProvider interface in DefaultSupervisor. 2020-06-04 11:44:07 +02:00
Fedor Isakov 68c2d212a5 Fix presumable memleaks in activation trace view.
The leak may have been caused by TabContentLayout's
myLastLayout keeping a live reference to the component.
2020-06-04 11:44:07 +02:00
Fedor Isakov b8f2d63353 Access NavigationManager as service, fix memleak. MPSCR-56 2020-05-25 11:03:39 +02:00
Fedor Isakov 5f6ea9e6c1 Fix NPE in checking rule. 2020-05-25 11:03:39 +02:00
Fedor Isakov d4c2e6f303 Fix property constraint for when splice is present. 2020-05-25 11:03:39 +02:00
Grigorii Kirgizov 400198f965 Adjust principal constraints analysis to not consider node refs wrapped in terms
It makes definition of principal constraint clearer:
principal constraint is a constraint that has at least one arg
of type node<> and passes to it ruleOrigin in at least one rule.

Such constraints are most likely meant to define relations
of nodes to terms, e.g. `typeOf` -- which is what we're interested in.

At the same time semantics of values inside terms is less defined.
TermFeatures are also untyped, and so complete analysis of
ValueFeatures would require full code traversal of coderules program
to find out whether a value feature is used to carry smth of `node` type.

Relevant to MPSCR-62.
2020-05-22 21:40:03 +03:00
Grigorii Kirgizov e2b3c21b2f Change semantics of implicit ListFeature: treat as wildcard, not as empty list
Motivation is that implicit (non-overriden) list features must unify
with list of any length. Consider an example:
`classifier(cls: node-ptr/A/) = classifier(cls: node-ptr/A/ param: [B,C])`
With previous approach it would fail, which seems counter-intuitive to me.
So, if empty list (e.g. of type parameters) is meant, then it must be
specified explicitly.

There's one thing to remember, though: such wildcard list features
won't match with MetaLogicalArrays in rule heads.
(e.g. see dpromote_* rules and consider what happens when
a classifier with unbound `parameter` feature comes in)
2020-05-21 16:38:36 +03:00
Grigorii Kirgizov 9bbcf6ecef Allow terms to inherit features from ancestor terms
Avoides the need to exactly duplicate features of ancestors.
Opens possibility to match on super-terms
with partially provided (overriden) features.

For example, suppose there's `typeParameterized(child: param)`
term which is extended by `classifier` and `methodSignature`.
Then it becomes possible to write a common rule for both terms,
matching on `typeParameterized(param=[Smth])`.
2020-05-21 16:31:36 +03:00
Grigorii Kirgizov 36606e5740 Add a test for AspectClique for the case of asepct with branches 2020-05-11 15:20:37 +03:00
Fedor Isakov da43822154 Manually migrate try statements that were not auto-migrated. 2020-05-09 15:07:06 +02:00
Fedor Isakov 14780b5561 Apply automatic migrations. 2020-05-09 15:04:25 +02:00
Fedor Isakov d1163fc883 Open and rebuild the project with MPS 2020.1. 2020-05-09 15:02:20 +02:00
Fedor Isakov f3b16186e6 Fix build scripts and regenerate. 2020-05-09 10:54:18 +02:00
Fedor Isakov c4fc687f76 Refactor and simplify code in AspectClique. Write tests.
Treat a language and its sidekick (if any) as a single vertex.
Add all extended languages to the pool before building the graph.
Drop dubious invariant check.
Fix the second pass in findAspectCliques ingnoring the fact
that there might be leafs without aspects.
2020-05-09 10:53:40 +02:00
Fedor Isakov 5bac140e61 Drop unnecessary test languages. 2020-05-07 10:23:04 +02:00
Fedor Isakov f2bcaffccc Revert "Upd coderules buildscript, regen build.xml"
This reverts commit 6b826334
2020-05-07 10:18:16 +02:00
Fedor Isakov 65429c800e Test for AspectClique. Use test model instead of real languages. 2020-05-07 10:16:55 +02:00
Fedor Isakov 4744081e36 Refactor AspectLookup and related interfaces for testability.
Simplify interfaces, abstract away the direct dependency
on LanguageRutime, make the code in AspectClique testable.
2020-05-07 10:16:53 +02:00
Grigorii Kirgizov 6b82633450 Upd coderules buildscript, regen build.xml 2020-05-07 02:37:35 +03:00
Grigorii Kirgizov cd3e56c16a Handle case of language cycles in AspectClique, add simple test with lang cycle (MPSCR-60) 2020-05-07 02:21:26 +03:00
Grigorii Kirgizov e7d23f9b6d Redefine how Aspect Cliques are found (fixes MPSCR-60)
Now algorithm for finding aspect cliques includes 3 stages:
1) topological sort (as before)
2) bottom-up pass with initial assignment of clique ids (as before)
3) top-down pass (i.e. in reverse topo sort order) (added stage)

The 3rd stage handles case when hierarchy of langs with
required aspect include branching point (with no join further down),
as in the case of closuresExt & collectionsExt both extending blExt,
but unrelated to each other (neither extends the other).
2020-05-07 01:28:14 +03:00
Grigorii Kirgizov bb5412230a Fix topo sort in Aspect Clique and add check for graph acyclicity (MPSCR-60) 2020-05-07 01:28:14 +03:00
Fedor Isakov 587711a3e8 Drop deprecated class and its usages. 2020-05-05 15:58:48 +02:00
Fedor Isakov d3a72049e8 Drop deprecated stuff from coderules lang. 2020-05-05 15:58:48 +02:00
Grigorii Kirgizov f13b5b3176 Fix a way to get needed clique in incremental tests 2020-05-05 16:45:27 +03:00
Fedor Isakov 56c341f615 Fix apparent memory leak in coderules messages view.
Use SoftReference wrapping TraceObject to avoid out of memory
error.
2020-05-05 11:42:25 +02:00
Fedor Isakov 2dc2191be3 Editor improvement: auto-substitute name from target concept for rule templates. 2020-05-05 10:19:38 +02:00
Fedor Isakov 2f9c23581f Fix substitution menu for LogicalItemExpression.
Prevent LogicalItemExpression from wrapping ExpressionItem.
2020-05-05 10:19:38 +02:00
Fedor Isakov 4666ca5349 Deprecate an obsolete concept. 2020-05-05 10:19:38 +02:00
Fedor Isakov f43b262e7f Introduce helper behaivour methods to be used from typesystem. 2020-05-05 10:19:38 +02:00
Fedor Isakov ea687efb21 Types for j.m.logic language. 2020-05-05 10:19:32 +02:00
Grigorii Kirgizov f75f87f13f Fix TypecheckingTestHelper to handle case of error types appearing with a reason
Error types can appear in cases similar to those of "no type"
because of addittion of "error()" term to typesystem.
2020-05-04 15:16:47 +03:00
Grigorii Kirgizov f6ebd46cb6 Disallow using OriginSpec inside rule bodies (such use case isn't handled) 2020-05-04 15:16:47 +03:00
Grigorii Kirgizov 5305e5d82f Fix generator of macros for case of applying them in alt body blocks
Previously body parts from macros applied in alt body branches
were merged into original, first body branch.
2020-05-02 13:43:03 +03:00
Grigorii Kirgizov 1ba46cef88 Fix analysis tests
Test model didn't containe needed nodes (RulesList-s) as roots
2020-05-01 18:15:15 +03:00
Grigorii Kirgizov aaa4d46655 Fix principal constraints/rules analysis to handle extended langs
Before it incremental typechecking for extending langs was failing
2020-05-01 13:38:12 +03:00
Grigorii Kirgizov f3ed39c8a6 Refactor a bit program analyses merge code in RuleProcessingSession 2020-05-01 13:38:12 +03:00
Grigorii Kirgizov 0569a96b6a Fix ExpressionStatement causing testa failure 2020-04-30 18:59:42 +03:00
Grigorii Kirgizov 09f4a54943 Fix AspectClique lookup for relevant langs: also add langs extended by sidekicked langs
Consider a case when j.m.bl.closuresExt is added as a sidekick,
then extended by it langs (e.g. j.m.baseLanguageExt) must be added also,
because they can contain crucial parts of extended aspects.
2020-04-30 15:38:33 +03:00
Grigorii Kirgizov 5894510797 Fix infinite loop on error of extended macro table not found 2020-04-30 15:38:33 +03:00
Grigorii Kirgizov 46cc65fd59 Allow passing multi meta logicals to macros as parameters 2020-04-30 15:38:33 +03:00
Fedor Isakov 866cd3fb04 Support extends relation between term tables.
A term table is now allowed to extend another term table.
Term prototypes can be imported through extends relation.
2020-04-28 12:54:35 +02:00
Fedor Isakov 25b08b627b Change root concept aliases for consistency. MPSCR-52.
Use "rule table" and "term table".
2020-04-24 10:43:46 +02:00
Fedor Isakov 39cfafb343 Fix analysis to analyze query tables also. 2020-04-23 10:15:39 +02:00
Fedor Isakov 77d35bfaa2 Manually migrate all queries to new table format. 2020-04-23 10:15:39 +02:00
Fedor Isakov 33739d7303 Support query table in generator templates.
Runtime switched to use newly generated query table definitions.
2020-04-23 10:15:39 +02:00
Fedor Isakov 6e7d4c3ae0 Minor refactoring: prefer interfaces over abstract classes. 2020-04-23 10:15:39 +02:00
Fedor Isakov a36369f002 Consistently use unified name RuleTable across all runtime. 2020-04-22 16:00:41 +02:00
Fedor Isakov 78a753a872 Refactor coderules aspect runtime: consolidate manifests.
Have single manifest for all assets instead of separate ones.
QueryTable is declared but not implemented yet.
2020-04-22 16:00:41 +02:00