Commit Graph

2419 Commits

Author SHA1 Message Date
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 27b7917a1a Add conversion of closures to functional classifiers, add tests 2020-05-04 16:38:00 +03: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 c6e20d00c2 Handle case of free vars for ternary operation and primitive subtyping (needed for closures) 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 590f3ed6ed Fix usages of OriginSpec: can't use them inside ConstraintRule bodies. Use convertsToSafe instead 2020-05-04 15:16:47 +03:00
Grigorii Kirgizov aa40ca0e01 Fix function conversion to allow coerceTo queries pass 2020-05-04 15:16:47 +03:00
Grigorii Kirgizov 36a85d5c2c Add bl.collectionsExt dependency on bl.function lang; upd mpscore build script and build.xml 2020-05-04 15:16:47 +03:00
Grigorii Kirgizov f7a9c73199 Refactor out lang dependency on function type analogously to sequence type
As closures typesystem depends on collections due to sequence type,
so collections typesystem depends on closures due to function type.
E.g. consider typechecking of SequenceCreator.
2020-05-04 15:16:47 +03:00
Grigorii Kirgizov 898087f427 Fix term table in closuresExt to extend blExt term table and use imported sequence type 2020-05-04 15:15:35 +03:00
Grigorii Kirgizov 72d48d76e3 Add typechecking for recursive closure invoke expression, add tests & fix older ones 2020-05-04 15:15:28 +03:00
Grigorii Kirgizov 3284d2c331 Add typechecking of ClosureLiteral and invoke expressions 2020-05-02 14:04:34 +03:00
Grigorii Kirgizov 19ab82586f Add function type subtyping 2020-05-02 14:04:34 +03:00
Grigorii Kirgizov b9fe7439bb Add empty closuresExt files for lang and test solution, upd bulid script 2020-05-02 14:04:34 +03:00
Grigorii Kirgizov 3101d22a5b Upd mpscore build script and build.xml 2020-05-02 13:44:19 +03:00
Grigorii Kirgizov 735276d2a2 Add import/export constructs for sequence type in collectionsExt to enable basic tests 2020-05-02 13:43:03 +03:00
Grigorii Kirgizov 8921c44a8e Add first tests for sequence type conversions 2020-05-02 13:43:03 +03:00
Grigorii Kirgizov 451b892b9f Add empty models for collectionsExt lang and tests 2020-05-02 13:43:03 +03:00
Grigorii Kirgizov 625ea8c049 Add j.m.bl.sequenceBase language with basic sequence typing rules
This lang doesn't depend on collections lang and extracts
common dependencies of closures and collections langs:
sequence term and its basic typing rules.
2020-05-02 13:43:03 +03:00
Grigorii Kirgizov 69457dc747 minor fix: extend term tabl from blExt in tuplesExt 2020-05-02 13:43:03 +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 bd1e0b61e5 minor: rewrite errorType constraint in blExt as call macro 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 a2f3a5b824 Avoid leaving logicals unassigned in case of error: assign error type explicitly
Needed to disambiguate free variables that are not yet inferred
from those which has been already processed with error.

Also more properly handle case of trivial return type inference
2020-04-30 15:38:34 +03:00
Grigorii Kirgizov aca2b3b8d9 BL typesystem: forbid conversion to/from void type
There's special constraint 'isCompatbile' to handle void.
Conversions with void can arise from closure types returning nothing.
2020-04-30 15:38:34 +03:00
Grigorii Kirgizov 125d051534 Fix check for return statements given possibility of nested method-like decls
Also fuse two bl rules for return statement and last expr.
Output feedback on return stmt, not returned expr,
because it also handles case of erroneous void return
2020-04-30 15:38:34 +03:00
Grigorii Kirgizov 5dcc71d2a5 Separate typing or return statement from checking its compatibility with method type
For convenience: to always get typeOf(return)
to unconditionally match on it (eg in closures lang)
2020-04-30 15:38:34 +03:00
Grigorii Kirgizov e1ff37b815 Document RuleMatchingProbe (most importantly, its matches() contract). 2020-04-30 15:38:34 +03:00
Grigorii Kirgizov 8447081b26 Return from Probe only matches relevant to last expanded Occurrence. Fixes MPSCR-59 2020-04-30 15:38:34 +03:00
Grigorii Kirgizov 4928daf3fc Add tests related to program execution pattern exhibited by MPSCR-59 2020-04-30 15:38:34 +03:00
Grigorii Kirgizov 49d8507eed Avoid duplicate subscription of Occurrences on LogicalState
Previously it was done twice: at Occurence creation
and in ConstraintsProcessing.processActivated.
Occurrences now constructed in 'dead' state (without observers).
2020-04-30 15:38:34 +03:00
Grigorii Kirgizov 17de7bf9fe Fix tracking of logical observers: avoid duplicates & clear observers correctly
Commit also aligns Observable/Observer interfaces a bit.

Side note: the current role of LogicalState is to only
forward events from Logical to Observers with augmented
information (i.e. providing Controller to handle event).
2020-04-30 15:38:34 +03:00
Grigorii Kirgizov 3f2b7df7b4 Add sanity check that every match has active occurrence in its head (MPSCR-59) 2020-04-30 15:38:33 +03:00
Grigorii Kirgizov 14e4385382 Fix incorrect reset of occurrences that led to invalid occurrences state
Resulted in some in fact dead occurrences being reactivated
2020-04-30 15:38:33 +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
Fedor Isakov 3e65376561 Drop deprecated stuff from coderules lang and runtime. 2020-04-22 12:07:50 +02:00