Commit Graph

2717 Commits

Author SHA1 Message Date
Fedor Isakov 4d79fbf263 Fix various issues arizing during generation time.
Avoid dereferencing DynamicReference from OriginIndex as it involves typechecking computation.
Aviod enqueing type nodes with TypesModelHandler during generation,
a workaround for "mature" references unable to be resolved
if target is in a transient (unpublished) model. (MPS-32709)
Ensure "local" typeof computation is used when queries a created with null root.
2020-11-24 13:41:25 +01:00
Fedor Isakov a6fe5327ff Rebuild project. 2020-11-24 13:41:24 +01:00
Fedor Isakov 8691da9ad7 Update build script. 2020-11-24 13:41:24 +01:00
Fedor Isakov f313c1af9a Smodel types: support (unchecked) conversion classifier to node/nodeptr. 2020-11-24 13:41:24 +01:00
Fedor Isakov 80d2152df1 BL types: support as and instanceof 2020-11-24 13:41:24 +01:00
Fedor Isakov 17ad3b0ff7 Tuples types: conversions to unknown tuple and to classifier. 2020-11-24 13:41:24 +01:00
Fedor Isakov f627773585 Collections types: support coercion to sequence type, fix multi foreach.
Coerce to sequence type w/o element type is needed to find out
the element type of a collection.
2020-11-24 13:41:24 +01:00
Fedor Isakov 29f5992ff9 Fix logical type's conversion to classifier; fix generation.
Specifically treat convertsTo of LogicalType to ClassifierType, support
convertsTo classifier type w/o specified classifier.
Fix typeOf LogicalItemValueExpression by to rely on logical's type.
Accept LogicalItem in LogicalItemValueExpression's logical slot to enable
replacement of it with an expression at generation time.
2020-11-24 13:41:24 +01:00
Fedor Isakov 1c04ec1a1d Avoid NPE in highlighting step if previous step(s) failed. 2020-11-24 13:41:24 +01:00
Fedor Isakov fe16b80132 Refactor types in all mps foundation langs. Drop node-ptr usage as anchor in terms.
Drop node-ptr in node features, macro calls.
Drop node-ptr types in rule templates and recover closures,
fix BiConsumer params
Drop node-ptr// refs where appropriate.
Drop pointer operations from macro calls and term ctor's; add resolve to FunctionTypeLookup static table.
Drop node pointer operations from constraints, add require statements in SModel types macro table.
2020-11-24 13:41:24 +01:00
Fedor Isakov 2c8f1a9294 Disable baseline time when running typechecking query. 2020-11-24 13:41:24 +01:00
Fedor Isakov ba39d7d047 Fix NPE during processing of classifier type with null classifier. 2020-11-24 13:41:24 +01:00
Fedor Isakov 9c616971e1 Ensure all relevant languages are searched for aspects.
It might be necessary to look a little further into the input node's
referenced nodes to gather all relevant models for recovering
types aspects. Example: a type in BL may extend another BL type
parameterized by a non-BL type, such as node<>.
2020-11-24 13:41:24 +01:00
Fedor Isakov fcd3e15b83 Fix coderules generator, avoid referrences to transient models in types.
Coerce to be invoked on types inferred from the original input
nodes to avoid references to transient models in the result.
2020-11-24 13:41:24 +01:00
Fedor Isakov bb5bddcc36 Add missing rules in coderules types. 2020-11-24 13:41:24 +01:00
Fedor Isakov 75f97618c9 Introduce cancelContravariance in closures types, fix type inference.
When inferencing the type of a closure within a method call context,
it's important to strip occasional contravariant indicator from the
closure's input variable.

A method may declare its argument to be an SMI with the type(s) of
its functional method's arguments as ? super T to facilitate subtyping.
This must not affect the inferred type of the closure's input variable.
2020-11-24 13:41:24 +01:00
Fedor Isakov 1180f33ef4 Add missing rule in BL internal types. 2020-11-24 13:41:24 +01:00
Fedor Isakov 24ed929715 Fix default class creator typechecking in baseLang.
Ensure valid list of context type var decls is passed to
instantiateScheme macro.

The code in MethodCall needs to be fixed in order to respect
context type variables in case of instantiation of a non-static inner class.
2020-11-24 13:41:24 +01:00
Fedor Isakov b51d8257ba Ensure runtime exceptions are caught when evaluating predicates.
An exception raised by a predicate solver must not break evaluation.
2020-11-24 13:41:24 +01:00
Fedor Isakov 59f653aeee Enable incremental option in test.
Now that "main" constraint is a principal one the test passes.
2020-11-24 13:41:24 +01:00
Fedor Isakov 35811d7322 Ensure "main" constraint is added as "principal".
Absence of "principal" flag on "main" contstaint causes invalid
processing of added rules that are triggered by this constraint.

Introduce protective copying of arguments in IncrProgramSpecBuilder.
The builder implementation must not reuse the collection passed in as argument.
2020-11-24 13:41:24 +01:00
Grigorii Kirgizov 85527c363b minor: consider 'main' as a principal constraint
Required for incremental (or preamble) processing
of rules with no input
2020-11-23 14:07:07 +03:00
Grigorii Kirgizov f9239e4e40 minor: upd build.xml 2020-11-20 12:19:57 +03:00
Grigorii Kirgizov c44e3a7fd8 Upd buildscripts 2020-11-18 11:36:28 +03:00
Grigorii Kirgizov 271c93abfa Implement hashCode() in Hierarchy.Vertex classes to adhere to contract of constraint args
Contract stems from the fact that constraint args influence Rules hashes (unique tags)
and so must be stable under irrelevant changes for incremental logic
2020-11-18 11:36:28 +03:00
Grigorii Kirgizov 42bc7a88fd Modify incremental tests to allow testing other queries, add test 2020-11-18 11:36:28 +03:00
Grigorii Kirgizov 8ac38578ef minor: add docs to incremental stages 2020-11-18 11:36:28 +03:00
Grigorii Kirgizov 1254ebd632 Handle case of query rules in PreambleInfo
Also process expand macro input for rule hash,
so that changed query rules (like one in testlang) get into
RulesDiff and could be updated with Preamble processing.
2020-11-18 11:36:28 +03:00
Grigorii Kirgizov 15cfd8a51b Refactor bl queries: separate "independent" query parts for Preamble 2020-11-18 11:36:28 +03:00
Grigorii Kirgizov 15d6fe8eae Introduce ProcessingSession for creating session from token & ending it
Introduced to discern incremental strategies: Full,Preamble,Default.
because how SessionToken is used and stored depends on it.
EvaluationSessionImpl now simply dispatches to it.
Also rename 'IncrementalProcessing' to 'ProcessingStrategy'.
2020-11-18 11:36:28 +03:00
Grigorii Kirgizov 9d3b7e1fba Add program Preamble as SessionToken, use it in Queries strategy
Program Preamble consists of 2 parts: rules & Journal.
Preamble rules are no-input rules with rules for their required nodes.
Preamble journal is journal part with results of executing these rules.
Preamble is defined per-Query, because Journal differs for Queries.

Repository CacheHolder is used for storing them b/w sessions.
Rules are stored and  retrievied with Memoizer.
Journal is stored as SessionToken in PreambleSet (map Query->SessionToken).

Add option to IncrementalSpec -- incrementality level (Preamble or Full).
2020-11-10 10:40:06 +03:00
Fedor Isakov bf7bad4b4a Drop mockito lib, replace with ad-hoc solution, fix the tests. 2020-10-25 00:17:25 +02:00
Fedor Isakov 51606b56c7 Rebuild project. 2020-10-23 12:26:31 +02:00
Fedor Isakov 930100a47b Several fixes that guarantee stable order of rules in the program.
Ensure the order of rules in the resulting plan follows the priorities
set forward by extends relationship b/w languages. So that even if
rule template tables are unrelated, they are still ordered according to
language extension graph.
Ensure the order of rule lists in the resulting plan is stable b/w invocations of
RulesPlanHandler.allPlans().
Ensure the order of aspects in AspectClique is stable b/w invocations
of buildClique().

Associate RuleTemplatesTable with Manifest, and Manifest with CoderulesAspect.
Tentatively rename RulesList (the runtime object) to RulesPlan,
RulesListTable to RulesPlanHandler.
2020-10-23 12:26:30 +02:00
Grigorii Kirgizov 8bd1ba6590 Fix require statements given restriction of their semantics
Also explicitly require classifiers in Hierarchy rule table
2020-10-23 12:26:30 +02:00
Grigorii Kirgizov 9476f4bba5 Revert introduction of 'runtimeType" superterm (fixes MPSCR-74) 2020-10-23 12:26:30 +02:00
Grigorii Kirgizov 544e630ecb minor fixes in bl typesystem rules
Remove spurious input oriigin in dpromote_induction rule.
Remove unneeded CheckAll extends TypeBound.
Drop several unused rules.
2020-10-23 12:26:30 +02:00
Grigorii Kirgizov cc9c4c54b3 Specify notion of required nodes: separately for tmpl application & for UpdatesRecorder
Too many nodes get into tmpl application process, which is unnecessary.
Many of those nodes are required actually only for correctly tracking
changes to nodes with WatchingTypecheckingStrategy.

Now implicitly required only nodes which are mentioned inside
constraint arguments. In other cases user must require them explicitly.
2020-10-23 12:26:30 +02:00
Fedor Isakov a403b1a252 Update Idea project in reactor. 2020-10-23 12:26:30 +02:00
dependabot[bot] 7971353f31
Bump junit from 4.12 to 4.13.1 in /reactor/Test
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-13 07:03:23 +00:00
Grigorii Kirgizov 99c823d4f7 Integrate tmpl trace in ApplyTemplatesStep with TypecheckingOptions
Introduce TraceReport object for passing program results
(traces+report items) instead of using tuples.
2020-10-08 17:34:43 +03:00
Grigorii Kirgizov 1de365de9c Introduce trace tool for rule template application 2020-10-08 17:34:42 +03:00
Grigorii Kirgizov d9a35005e2 Fix cycle in coersion of functional type to unknown classifier (fixes MPSCR-72)
Use statically built FunctionTypes table in closures for
finding canonical functional type for a given closure.
2020-09-24 11:43:17 +03:00
Grigorii Kirgizov b693156229 minor refactoring: few changes in OriginIndex interface for better readability 2020-09-24 11:43:17 +03:00
Fedor Isakov 25e8e5fd78 Clear shared caches on releasing queries for generator. 2020-09-15 13:32:43 +02:00
Fedor Isakov 613b981977 Refactor UpdatesRecorder for better handling of nodes invalidation.
Alter the way invalidated nodes are handled by UpdatesRecorder.
A set of "source" nodes is now maintained, which helps to
detect the appropriate input for a changed node.
Templates are applied only to "new" or "invalidated" nodes.
2020-09-13 13:31:03 +02:00
Fedor Isakov 9886f0ec25 Re-saved models -- update resolve info. 2020-09-10 09:59:42 +02:00
Fedor Isakov 534c4832ce Re-saved models -- update resolve info. 2020-09-10 09:59:42 +02:00
Fedor Isakov 2d9e3547b6 Refactoring: simplify RelevantNodes[Tracker -> Monitor], drop interface and stub impl.
Rename TypeDependenciesNodeTracker to RelevantNodesMonitor and
have it the only implementation.
The "stub" implementation was never really used.
Simplify creation of and access to the monitor.
2020-09-10 09:57:53 +02:00
Fedor Isakov 9c7307286b Minor refactoring of UpdatesRecorder: straighten up API, better encapsulation. 2020-09-10 09:53:01 +02:00