Commit Graph

2807 Commits

Author SHA1 Message Date
Fedor Isakov 0a77dcb33b Coderules types: fix unifiable relation, add missing typing rules 2021-01-06 12:43:55 +01:00
Fedor Isakov a9643c03b8 Logic types: fix indexed variable, make logical a supertype of its parameter 2021-01-06 12:43:55 +01:00
Fedor Isakov aec8c3f9d9 SModel types: type for concept method call 2021-01-06 12:43:55 +01:00
Fedor Isakov 143fb9cf57 Generator lang types: fix a typo 2020-12-30 18:28:46 +01:00
Fedor Isakov 5e147837ec Drop node pointer in QueryTemplate behaviour 2020-12-30 18:28:46 +01:00
Fedor Isakov 6f92d666f7 BL types: a few fixes, stabilize typechecking
Support Type type.
Simplify depdendency of var decl to its type.
Covariant subtyping for UpperBoundType.
Straightforward dependencies on type's parameters.
Specify BaseConcept as general type's concept.
Fix method reference.
2020-12-30 18:28:46 +01:00
Fedor Isakov 4acae7a1b7 SModel types: minor fixes
Support SConceptLiteralType.
Drop rogue .pointer operation.
Build proper term for enumMember type.
2020-12-30 18:28:46 +01:00
Fedor Isakov 51d5687e1a Add missing language modules to mpscore project 2020-12-30 18:28:45 +01:00
Fedor Isakov 862d7f62c2 Replace direct usages of test data with proper references, fix generation 2020-12-27 21:04:51 +01:00
Fedor Isakov 67c208a360 Drop support for a few concepts that have been dropped 2020-12-27 21:04:51 +01:00
Fedor Isakov 0584d05c4f Drop support for a concept that has been apparently dropped upstream 2020-12-27 20:42:07 +01:00
Fedor Isakov 66f04fe92a Replace direct usages of test data with proper references, fix generation 2020-12-27 20:42:07 +01:00
Fedor Isakov 435a8d4ec8 Replace direct usages of test data with proper references, fix generation 2020-12-27 20:20:21 +01:00
Fedor Isakov c67c62d394 Fix generator for terms, switch to local call instead of this expression 2020-12-27 19:47:35 +01:00
Fedor Isakov 07c5d99a79 Rebuild project 2020-12-27 16:39:22 +01:00
Fedor Isakov f5c9ed7c4b Temporarily change the extends clause of Array rule table
This particular extends clause breaks an internal invariant
of rules plan, namely the topological sorting of rule tables.
This results in broken rule index, which needs to be fixed.

Also, disable a suspect rule that relies no typeof()
*not* being present, which is a transient condition.
2020-12-27 16:39:22 +01:00
Fedor Isakov d87afd868e Closure types: use lub to compute the type of closure literal
Multiple "exit points" in closure literal may have different types.
Calculate lub of these types and use it as returned type.
2020-12-27 16:04:06 +01:00
Fedor Isakov 182ea97cc1 BL internal types: support internal class 2020-12-27 16:04:06 +01:00
Fedor Isakov 2ef3176bc2 BL types: extend lub to primitive types via boxing 2020-12-27 16:04:06 +01:00
Fedor Isakov 621cdaa912 Implement lub for sequence type
Using the fact that sequence type is covariant, just forward
to lub for parameters.
2020-12-27 16:04:06 +01:00
Fedor Isakov 7570d050c9 Fix type declaration: replace linkedlist with list
A problem with collections language is that linkedlist type
gets generated into a Deque. There is a workaround for this,
which fails to work because of another problem in collections
language: linkedlist not being a direct subtype of LinkedList.
Probably a legacy code issue.
2020-12-27 16:04:06 +01:00
Fedor Isakov 37486d4484 Avoid NPE during template application, provide appropriate reporting 2020-12-27 16:04:06 +01:00
Fedor Isakov 70d6dfefa1 Fix failing generation by disabling typechecking of cast expression
Cast expression must check the type of the argument expression
and ensure comparabitiy of types.
2020-12-27 16:04:06 +01:00
Fedor Isakov 26b0f4ac87 Fix helper action items not appearing in inspector 2020-12-27 16:04:06 +01:00
Fedor Isakov 1228ff036b BL types: substring expression, string conversion to classifier 2020-12-27 16:04:06 +01:00
Fedor Isakov eb03d7d218 Include languages imported to all imported models of the model that contains node to check
Some language imports necessary for correct typechecking are obscure.

Example may be a closure type, which requires the type of the operand
(receiver) of the method it serves a parameter to. That, in turn, may
require some type defined in another root and perhaps some other model.
2020-12-27 16:04:05 +01:00
Fedor Isakov 64b33d1a88 Refactor RulesPlanHandler to not depend on AspectClique 2020-12-27 10:36:04 +01:00
Fedor Isakov 43ad19494b Refactor rule processing: straightforward dependencies, simplify code
Enable rule index to be updated during rules application.
Make RuleProcessingSession depend on AspectClique.
Enable updating of rule/macro/query indices.
2020-12-27 10:36:00 +01:00
Fedor Isakov 07a6b722c7 Drop unnecessary computations, simplify rules/query template index. 2020-12-27 10:36:00 +01:00
Fedor Isakov 2a5163c0f4 BL types: support concept function and Void classifier 2020-12-27 10:36:00 +01:00
Fedor Isakov 7ecad792e0 Types for generator.generationContext lang 2020-12-27 10:36:00 +01:00
Fedor Isakov 4c0a06f904 Types for generator lang 2020-12-27 10:36:00 +01:00
Fedor Isakov b2c026d74a Fix closures types to populate functional classifier's parameters
On looking up the default functional classifier corresponding to a
function type, the classifier's type parameters are to be appropriately
populated from the function type.
2020-12-27 10:36:00 +01:00
Fedor Isakov cf85151dad Types for constraints lang 2020-12-27 10:36:00 +01:00
Fedor Isakov b2abb1fda2 Types for quotation lang 2020-12-27 10:36:00 +01:00
Fedor Isakov 8ab783657c Types for typesystem lang 2020-12-27 10:35:59 +01:00
Grigorii Kirgizov e73394863e minor: Remove ignored test for not implemented and not needed feature of MatchJournal 2020-12-15 17:59:10 +03:00
Grigorii Kirgizov bd25263eac Fix leak of LogicalState in Occurrence observers: properly terminate occ-s 2020-12-15 17:59:10 +03:00
Grigorii Kirgizov ba8ccfce03 minor: Disable incremental option (that controls Preamble also) for lambdacalc tests
Preamble optimization requires same contracts from programs as full incrementality.
2020-12-15 17:59:10 +03:00
Grigorii Kirgizov 8022fa4203 Add tests for local typeOf query with occurrence cache 2020-12-15 17:59:10 +03:00
Grigorii Kirgizov 27ed01c447 refactoring: Adjust uniqueTag usages for Rule.Tag refactoring
Fix rule basetag generation to coincide with templateName

Needed for PrincipalStore (occurrence cache) which uses
info about occurrence source rule template name.
2020-12-15 17:59:09 +03:00
Grigorii Kirgizov fd43cc560c refactoring: introduce Rule.Tag instead of several fields (basetag/tag/uniqueTag)
Allows to carry logically connected information in one object.
Needed for subsequent changes to ConstraintOccurrence, which
must have better information on source rule: rule template name.
Used by occurrence cache.
2020-12-15 17:59:05 +03:00
Grigorii Kirgizov 3eccaf81a1 Introduce occurrence store as cache for their reuse in Queries strategy
It's important that program that uses occurrences from cache
shouldn't include rules that could produce their duplicates.
So implementation of occurence cache includes 2 parts:
on reactor level & in ProrgramFactory.

When RuleBuilders are produced, cache is queried whether
there're already  occurrences associated with the rule template
in question. If so -- then those RuleBuilders are not included
into the program (as well as all RuleBuilders required by it).
2020-12-15 17:59:05 +03:00
Grigorii Kirgizov 4a342437f0 Introduce processing strategy for reusing occurrences from cache
CachedOccurrencesProcessing simply activates occurrences
passed to it as input before proceeding with 'main'.
Use it instead of PreambleProcessing (that works with journal).

This should help if 'main' doesn't lead to duplicate activations
of these occurrences. So coderules program must be aware of
occurrence cache and should not include rules for cached occ-s.
2020-12-15 17:51:27 +03:00
Grigorii Kirgizov 0dc072413e minor fix in BL typesystem: always check returns, it can influence resultiing type 2020-12-15 17:51:27 +03:00
Grigorii Kirgizov 61dccfd2d9 BL types: simplify array typing & fix minor errors 2020-12-15 17:51:27 +03:00
Grigorii Kirgizov 4292709c3b Fix incremental clearing of Dispatcher state
It wasn't complete. Now `DispatchingFront.forget(occ)`
additionally triggers removal of invalid ReteNodes.
2020-12-15 17:51:27 +03:00
Grigorii Kirgizov 35335e3d15 Avoid storing DispatchingFront in SessionParts -- it can be stale
ConstraintsProcessing can reassign front internally,
so SessionParts can store a stale one.
2020-12-15 17:51:27 +03:00
Grigorii Kirgizov f051e6bf19 Avoid null nodes in UpdatesRecorder. Caused erroneous invalidation of null-origin rules. 2020-12-15 17:51:27 +03:00
Grigorii Kirgizov c455514325 Get more precise info on invalidated nodes (fixes MPSCR-82)
Get information on invalidated nodes from EvaluateStep & incr processing
instead of UpdatesRecorder, which has only partial info and can't handle
all cases.
2020-12-15 17:51:23 +03:00