Commit Graph

332 Commits

Author SHA1 Message Date
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
Fedor Isakov 296b3e9271 Re-apply all rerunnable migrations. 2020-04-13 17:58:33 +02:00
Fedor Isakov a1c98b5bf0 Apply all outstanding migrations. 2020-04-13 17:58:33 +02:00
Fedor Isakov 52bca36d32 Rebuild project. 2020-04-13 17:58:33 +02:00
Fedor Isakov 7413e9e387 Force save all models. 2020-04-13 17:58:33 +02:00
Fedor Isakov cac5573cb9 Drop instances of deprecated concepts in baseLangExt
.
2020-04-13 17:58:33 +02:00
Grigorii Kirgizov 145aa79753 Regenerate build.xml for mpscore 2020-04-13 15:10:37 +03:00
Grigorii Kirgizov bd87873160 Move baseLanguage.tuplesExt lang to 'samples' and upd build script 2020-04-13 14:36:37 +03:00
Grigorii Kirgizov 8dfcff1844 Add typechecking for indexed tuples (new language .tuplesExt and tests) 2020-04-08 23:24:55 +03:00
Fedor Isakov 4e12f7bf3b Migrate baseLanguageExt sample to new expand/call macros. 2020-03-31 18:44:07 +02:00
Fedor Isakov 6a431fcb49 Rebuild project. 2020-03-31 18:44:07 +02:00
Grigorii Kirgizov 79952036cd Fix ternary operator typechecking 2020-03-26 18:17:06 +03:00
Grigorii Kirgizov 6a53d15a21 Refactor: move logic related to tracking parent match from ControllerImpl to MatchJournal
Relates to machinery introduced in MPSCR-47.
Previously parent match was maintained in Controller on Java call stack.
Now this stack of parent matches is maintained manually in MatchJournal.

So MatchJournal gains new invariant: parentChunk()
returns correct parent after each logMatch() call.
Several tests fail, also need to maintain this
invariant after logActivation() calls.
2020-03-26 13:40:41 +03:00
Grigorii Kirgizov c51d767926 Add typechecking for all missing operators. Refine missing cases, check compatibility. Properly handle ternary op. Add tests. (MPSCR-3) 2020-03-25 20:11:52 +03:00
Grigorii Kirgizov b6aaec8870 Revert temporary workaround for MPSCR-51 from 16e39a93 2020-03-23 14:39:54 +03:00
Grigorii Kirgizov 91e4d2b582 Revive 'principal' rule feature for MPSCR-51. Mark those rules in BL typesystem.
Introduce 'auxiliary/essential' notions instead of 'principal/not principal'.
2020-03-23 14:28:14 +03:00
Grigorii Kirgizov 8874e8eb2c Complete checking rules for overriding methods (add signature clash check, JLS12 8.4.8). Add tests for that. (MPSCR-3) 2020-03-18 19:50:17 +03:00
Grigorii Kirgizov 7a5a5388b1 minor fix: suppress out of scope error in node test code 2020-03-17 18:36:41 +03:00
Grigorii Kirgizov 16e39a9345 Check applicable scope for certain checking rules in BL (workaround for BL for MPSCR-51). Fix SubclassingUtil.
Modified TYPECHECK query to include "checkingScope" query parameter:
it is a root node for which program is generated (for local typechecking it's local node).
Rules additionally match on a constraint `checkDecls(node<>)` bearing this node,
so while rules will be generated for all scopes, only those in applicable scopes will run.

Also split rule for EnumConstantDeclaration on declration checking and just typing rule.
2020-03-17 17:54:38 +03:00