Commit Graph

594 Commits

Author SHA1 Message Date
Fedor Isakov ca973ddc51 Fix test compilation. 2020-07-07 13:50:43 +02:00
Fedor Isakov 8731ca0fce Fix typechecking baseMethodCall: correctly idenify this type. 2020-07-03 16:23:00 +02:00
Fedor Isakov d2b270b14c Rebuild mpscore buildscript. 2020-07-03 16:23:00 +02:00
Grigorii Kirgizov 7e996c8772 Disable checking local types in 2 tests (in anticipation of MPSCR-63 fix) 2020-07-01 14:36:48 +03:00
Grigorii Kirgizov 2df90d00c5 minor: fix buildscript depndencies 2020-07-01 14:36:48 +03:00
Grigorii Kirgizov cba5ff86ed Remove 'error' type-like term from bl typesystem
It was aimed at precluding cascading typechecking failures.
(There was some case with typechecking 'hasBound' after incorrect bind.)

It seems controversial. Typechecking with it is no more predictable
than with free variables left unbound in case of error.
With current tests almost nothing changes after removing it.
2020-07-01 14:36:48 +03:00
Grigorii Kirgizov 424b473b8d Fix error on checking recursive type var bounds (Recursion root) 2020-07-01 14:36:48 +03:00
Grigorii Kirgizov ebddf94c42 minor: remove unnecessary head dependencies in few rules
These unused in bodies constraints were for tracking certain
cases of incremental dependencies. Now it's handled by minor
algorithm extension introduced in several previous commits.
2020-07-01 14:36:48 +03:00
Grigorii Kirgizov a37bd44de0 disable tests on inremental typechecking of recursive closure 'invoke'
To fix them need either extending incr algo to handle rules which
postpone binding logicals in principal constraints (i.e. typeOf)
(see rules in Closures for 'invoke' expression)
or rewriting these rules to not produce typeOf with free logicals.
2020-07-01 14:36:48 +03:00
Grigorii Kirgizov f9ca9f2766 Handle usedDataHash computation for macros
Fixes IncrClosureInference.changeFunctionalInterfaceParam test.
Temporary rules built as macro applications weren't computing hash
due to origin!=null condition. Also macro inputs weren't processed.

Stable hash for TypeVarSubstitution is defined because it's used in macro args.
In general, any classes used as constraint/predicate/macro args
must adhere to stable hashCode() contract: hash should change
if there're important changes that may influence typechecking result.
Otherwise there may be unnecessary incremental recomputations.
Relevant for MPSCR-62
2020-07-01 14:36:48 +03:00
Grigorii Kirgizov 672b46dc65 minor: fix mistake in IncrClosureInference.changeFunctionalInterfaceParams test 2020-07-01 14:36:48 +03:00
Grigorii Kirgizov 1943157cd0 update samples test models dependencies & regen build.xml 2020-07-01 14:36:48 +03:00
Grigorii Kirgizov a16756bfdb Fix error reporting in bl.closures for conversion to functional interface
Add 'genDecl' constraint in heads of toFunctionalCls* rules
to handle incremental changes to respective classifier.
Also fail instead of just reporting error to break execution and
report on correct node according to calling rule.
2020-07-01 14:36:48 +03:00
Grigorii Kirgizov 8ccfa63111 Add test methods for ensuring incremental logic for rules diff 2020-07-01 14:36:48 +03:00
Grigorii Kirgizov 51b0438888 Add tests for incremental processing of closure type inference 2020-07-01 14:36:45 +03:00
Grigorii Kirgizov 827d2e5c42 Add tests for generic method calls 2020-07-01 14:36:45 +03:00
Grigorii Kirgizov 36e4e01f2e Аdd tests for changes to class hierarchy with generics 2020-07-01 14:36:45 +03:00
Fedor Isakov d4602c50d6 Ensure relevant input concepts are in query scope. 2020-06-28 17:14:35 +02:00
Fedor Isakov 9c1d3aad92 Move Result class to commonly-used runtime solution. 2020-06-25 14:30:30 +02:00
Fedor Isakov 11b9709ab1 Provide lift type macro for UndefinedType.
UndefinedType should leave the logical variable unassigned.
Type is an abstract superconcept, so reaching it means
there should have an override for lift macro.
2020-06-24 14:36:31 +02:00
Fedor Isakov 82b37d8103 Add module dependencies to test modules.
This ensures the tests can be launched on a test module in isolation.
2020-06-24 13:59:58 +02:00
Fedor Isakov ecb2569bad Types for smodel lang. 2020-06-22 13:38:09 +02:00
Fedor Isakov ab99a0245c Introduce runtime support module j.m.coderules.runtime. 2020-06-21 23:17:33 +02:00
Fedor Isakov 8441ebc5e1 Minor refactoring in HierarchyGraph: introduce OriginPath.
Use OriginPath for origin vertices instead of InstPath.
Also separate buildPath into two methods for clarity.
2020-06-19 17:34:18 +02:00
Fedor Isakov 3c46f210ca Rebuild build script. 2020-06-18 13:12:02 +02:00
Fedor Isakov be76070914 Replace unification with match where applicable, minor cleanup.
Replace unification with the intent of capturing term feature
with match constraint.
Drop unused term feature from head pattern.
Provide better context for failed class inheritance test.
2020-06-18 13:05:24 +02:00
Fedor Isakov 19994dab9f Introduce comparable constraint.
Comparable should only check if the two
types are in any relation (one converts
to the other) and report error if check fails.
2020-06-18 13:05:23 +02:00
Grigorii Kirgizov 4876c22282 Refactor single root of incremental tests into several, move IncrTestBuilder 2020-06-16 14:14:46 +03:00
Grigorii Kirgizov a03651dd31 Refactor IncrementalLauncher in tests to use TypeIndex (as on runtime) 2020-06-15 13:03:09 +03:00
Grigorii Kirgizov 62d31743ed Refactor incremental tests 2020-06-15 11:14:47 +03:00
Grigorii Kirgizov f81d8ac44e Fix missing lang import on tests model 2020-06-09 12:00:37 +03:00
Grigorii Kirgizov dcb8e5ac53 Fix "link out of search scope" in collections types 2020-06-09 02:19:42 +03:00
Grigorii Kirgizov 1631f77e74 Implement typechecking for j.m.bl.collections & tests for it 2020-06-08 12:29:37 +03:00
Grigorii Kirgizov 5004dc2340 Abstract into bl typechecking of types having runtime representation (e.g. sequence)
See term 'runtimeType' and corresponding rule in ConversionMain
2020-06-05 21:11:37 +03:00
Grigorii Kirgizov 3b456a9063 minor refactorings in bl typesystem 2020-06-05 21:11:27 +03:00
Fedor Isakov 490eb66a3e Disable Thinlet test, too many timeouts. 2020-06-04 12:40:34 +02:00
Fedor Isakov 161beb6a4d Refactoring in hierarchy graph. Introduce various abstractions.
Hierarchy graph vertex can represent LUB as a simple
collection of inheritance paths.
Abstract intefaces allow to model operations such as finding
the LUB in an abstract way.
Greatly simplify code.
2020-06-01 10:18:04 +02:00
Fedor Isakov f96a014543 Minor refactoring: code simplification and cleanup. 2020-05-25 13:15:29 +02:00
Fedor Isakov 3ff038e4a3 Drop obsolete and unused code. Tests superceded by new tests. 2020-05-25 13:15:25 +02:00
Fedor Isakov 71fd7d7301 Switch typechecking templates to use the refactored facade. 2020-05-25 12:38:05 +02:00
Fedor Isakov fc10afdae0 Fix typo in typechecking rule. 2020-05-25 11:03:39 +02:00
Fedor Isakov 35b09d3e2e Fix build script and regenerate. 2020-05-25 11:03:39 +02:00
Fedor Isakov b4a5b4cec4 Refactor various utilities into facade class.
Introduce HierarchyGraph and its specialization,
ClassHierarchyGraph, as a facade to all tasks related to
finding paths and LUB of types.
2020-05-25 11:03:39 +02:00
Fedor Isakov 1aa5608b34 Move files for wrongly placed coderulesExt lang. 2020-05-23 15:25:59 +02:00
Grigorii Kirgizov 6f9337e5cf minor: consider error() term in containedIn relation
This term marks that somewhere error has been already handled
and serves to avoid further errors.
2020-05-22 22:37:48 +03:00
Grigorii Kirgizov 00dc426f43 Consider case of NestedNewExpression for class creators (MPSCR-29) 2020-05-22 22:36:10 +03:00
Grigorii Kirgizov a4901bb730 Change signature of `typeVarBound` constraint to treat it as principal
Recent commit with change to def of pr. constraint
made typeVarBound non-principal. so fix it.
2020-05-22 21:40:03 +03:00
Grigorii Kirgizov 1aa07397d4 minor: document one type inference rule to avoid confusion 2020-05-22 21:39:15 +03:00
Grigorii Kirgizov 42f0d06063 Refactor duplicate code for checking method call into call macro
Also typecheck method call arguments with macro instead of a rule
2020-05-22 21:39:15 +03:00
Grigorii Kirgizov c3cf1e5111 Complete type inference for closure params wit inst macro, add tests, fix few minor issues
Related to MPSCR-20 & MPSCR-29.
2020-05-22 21:39:14 +03:00