Commit Graph

350 Commits

Author SHA1 Message Date
Fedor Isakov f3b16186e6 Fix build scripts and regenerate. 2020-05-09 10:54:18 +02:00
Fedor Isakov acd6234415 Force save all. 2020-05-09 10:54:18 +02:00
Grigorii Kirgizov e1af32b97c Add tests for closuresExt concerned with yield and sequence, reproduces MPSCR-60 2020-05-07 01:28:14 +03:00
Grigorii Kirgizov e6b1fe12a7 Don't generate main closureLiteral rule when there's error with return vs. yield 2020-05-07 01:28:14 +03:00
Fedor Isakov 76991aabe7 Fix dependencies among rule tables.
Observing the invariant: whenever a constraint is used in
rule's head, the rule table containing it must extend the
one that constraint.

Also drop unused constraint from the head in ConversionFunctionIFace.
2020-05-05 16:23:13 +02:00
Fedor Isakov 2c363f85f4 Tidy up helper methods contract, drop unnecessary method.
BaseHelper.getListContents() accepts a dataform that must be
an instance of ListNode or be resolved to one via DataFormUtil.ground().
2020-05-05 15:58:48 +02:00
Grigorii Kirgizov 54c9af37a3 Add checking of loop statements in blExt 2020-05-05 16:45:27 +03:00
Grigorii Kirgizov c388aa25b6 Reorganise rule table extends dependencies in blExt
Mainly, avoid extending TypeOf by ConversionMain (unnecessary dependency).
It's also more logical structure: tables defining declarations go first, then typeOf-related.
So rule tables which require only decls can depend only on such tables.

Core tables extends relationship now:
TypeBound <- CheckAll <- Generics <- TypeOf
TypeBound <- ConversionMain [<- other langs' conversions]
2020-05-05 16:45:27 +03:00
Fedor Isakov 66d2896fff Ensure type variable bounds are processed in coerce query.
This fixes constraint errors in model check while running
typechecking with coderules.
2020-05-05 13:20:59 +02:00
Fedor Isakov a15a6b3f1d Fix target statement (not allowed within constraint rule). 2020-05-05 10:19:38 +02:00
Fedor Isakov ab9a22a013 Rebuild project. 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 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 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 bd1e0b61e5 minor: rewrite errorType constraint in blExt as call macro 2020-05-02 13:43:03 +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
Fedor Isakov 77d35bfaa2 Manually migrate all queries to new table format. 2020-04-23 10:15:39 +02:00
Fedor Isakov f23ea05b65 Update query templates to not use QueryParameterReference.
QueryParameter is always referring to Query instance passed
to the template.
Drop QueryKind and parameter declarations from query templates.
2020-04-22 11:43:37 +02:00
Fedor Isakov 46fe463118 Update instances of query templates to include reference to Query type. 2020-04-22 11:25:14 +02:00
Fedor Isakov 98f1a0a6d2 Apply one outstanding migration. Force save all models. 2020-04-19 16:30:11 +02:00
Grigorii Kirgizov 22921b9b17 Clean unneded require statements
Relies on facts that children of origin are always processed and
that all nodes mentioned in rule bodies are required implicitly.
2020-04-19 13:43:05 +03:00
Grigorii Kirgizov 0e0438cf3c Provide necessary dependencies for correct incr typechecking of cls hierarchies, fixes MPSCR-55
Now subclassPaths rule depends on a declaration of classifier,
which allows to track justifications dependency and invalidate
rule on incremental typechecking.
Similarly, rule for declaration now depends on all super classifiers.
2020-04-19 13:43:05 +03:00
Grigorii Kirgizov b07fdd6735 Reproduce MPSCR-55 2020-04-19 13:43:01 +03:00
Grigorii Kirgizov 4bb1b9d3d8 Apply some migrations after rebase on master 2020-04-19 13:42:53 +03:00
Fedor Isakov 9f7d60e7c1 Reorder macro template declarations: move abstract concept to the bottom. 2020-04-16 12:25:59 +02:00
Fedor Isakov 7cc19bdece Minor code fix: remove unnecessary wrapping of logical var. 2020-04-15 11:14:38 +02:00
Fedor Isakov eb4862eb48 Force save all models -- update resolve info. 2020-04-14 16:20:05 +02:00
Fedor Isakov fcbdbe7e47 Attempt to fix gradle task deps graph. 2020-04-13 18:00:15 +02:00
Fedor Isakov 35fd816cbc Update all usages of moved concepts. 2020-04-13 18:00:15 +02:00
Fedor Isakov fd2043e047 Update build scripts. 2020-04-13 18:00:15 +02:00
Fedor Isakov 1336e82065 Fix wrongly used logical item expression. 2020-04-13 17:58:34 +02:00
Fedor Isakov 5b1449fa82 Update all usages of moved concepts. 2020-04-13 17:58:34 +02:00