Grigorii Kirgizov
0604a69789
Remove older versions of rules and macros for generics. Introduce additional Typecheck stage of "checkGenerics". (MPSCR-16)
2019-12-18 21:47:06 +03:00
Grigorii Kirgizov
31dd2a3644
Handle raw & unparameterized classifiers in new macros (MPSCR-16)
2019-12-18 21:47:06 +03:00
Grigorii Kirgizov
6f5746a31d
Extract checks from macros to separate rules. Add notion of typeScheme (genDecl dataform). Remove type inference logic from capture. (MPSCR-16)
2019-12-18 21:47:06 +03:00
Grigorii Kirgizov
78358bfc1c
Partly rework 'capture' given new hasBound semantics. Produce hasBound in typeVariable macro for Object bound too. (MPSCR-16)
2019-12-18 21:47:06 +03:00
Grigorii Kirgizov
8a2aa76252
Allow default type var decl expansion to typeVariableType() in classifierType macro (MPSCR-16)
...
e.g. needed for ThisExpression
2019-12-18 21:47:06 +03:00
Grigorii Kirgizov
c3aba49059
Fix PathHelper to pass a test for SubtypePaths which uses raw types in subclass paths
2019-12-18 21:47:06 +03:00
Grigorii Kirgizov
0e4e6fe8df
Redefine typeVariableDeclaration macro. Use TypeVariableSubstitution more consistently (MPSCR-16). Fix SubclassPaths.
...
'typeVariableDeclaration' now returns substituted vars or creates new subst.
Earlier it created created a new susbst which led to infinite recursion in specific cases.
Now macro expects tvdecl to be declared in TypeVariableSubstitution.
Accordingly modify usages of TypeVariableSubstitution.
Also fix (apparently broken?) SubclassPaths rulesList (used in lub relation)
and switch 'dpromote' implementation to use it
2019-12-18 21:47:06 +03:00
Grigorii Kirgizov
0bc053fe63
Fix classifierType macro condition, fix typeVariable macro & add tmp forwarding macros (MPSCR-16)
...
Macros currently don't handle subconcepts expansions.
2019-12-18 21:47:06 +03:00
Grigorii Kirgizov
2a71743895
Handle cases when inference variables must be instantiated into typeVariableType (MPSCR-16)
2019-12-18 21:47:05 +03:00
Grigorii Kirgizov
c8d1b9415b
Clean rules in hasBound rulesList (MPSCR-16)
...
Most of the rules were duplicating rules from convertsTo
2019-12-18 21:47:05 +03:00
Grigorii Kirgizov
9fbda2b26d
Change subset of calls to ClassifierType macro to expansion of Classifier macro (MPSCR-16)
2019-12-18 21:47:05 +03:00
Grigorii Kirgizov
0b3354cf24
Move 'cls==null' case to Classifier macro from ClassifierType macro (MPSCR-16)
2019-12-18 21:47:05 +03:00
Grigorii Kirgizov
9a31800dfa
Refactor classifierType macro in ReferenceTypes macro table (MPSCR-16)
2019-12-18 21:47:05 +03:00
Grigorii Kirgizov
13de18ae90
Change calls to typeVariable macro to macro expansions (of TypeVariableDeclaration) (MPSCR-16)
2019-12-18 21:47:05 +03:00
Grigorii Kirgizov
749ac192aa
Begin work on MPSCR-16: rewrite macros for TypeVariableDeclaration & TypeVariableReference
...
Remove duplicated processing of auxiliary bounds in type var declarations.
TypeVariableDeclaration macro now plays a role of instantiating type variables.
hasBound constraint is produced more consistently, on any expansion of TypeVariableDeclaration.
It will work mainly through reactivation due to changes to its arguments.
2019-12-18 21:47:05 +03:00
Grigorii Kirgizov
fa129f5937
Add test case for capture & containment. One case fails.
2019-12-18 21:47:05 +03:00
Fedor Isakov
dfecccfb86
Fixup ArgumentsCollector: include forgotten model changes, fix the build.
2019-12-11 12:00:51 +01:00
Fedor Isakov
7c781a7f87
Add javadocExt language to the build script.
...
Rename javadocExt language's location.
2019-12-08 21:36:51 +01:00
Fedor Isakov
eb50ce7f86
Typechecking BL: optimize matching list with arguments.
...
Checking for triggering condition in guard is ineffective.
Pattern matching is faster.
2019-12-08 17:51:41 +01:00
Fedor Isakov
b182cf60d7
Revert "Temporarily ignore failing tests."
...
This reverts commit 7776f97fe7 .
2019-11-26 23:09:40 +01:00
Fedor Isakov
85674ef077
Add explicit "test" facets to test solutions.
2019-11-24 17:58:15 +01:00
Fedor Isakov
7776f97fe7
Temporarily ignore failing tests.
...
The tests presumably fail because of a broken contract that is used
in the typesystem implementation, namey that a logical variable
contained by an constraint argument-term (as opposed to being an
argument itself) reactivates the constraint on ground/parent change
event. This assumption is false, thereby the implementation needs
to be adjusted keep compatibility with the contract.
2019-11-24 13:34:59 +01:00
Fedor Isakov
96fbab18b4
Fix dependencies of blExt and javadocExt langs.
...
The dependency on j.m.l.typechecking lang must be kept on the module level.
2019-11-24 13:34:59 +01:00
Fedor Isakov
8fdd80c54e
Restore accidentally remove language import. Fix the tests.
2019-11-11 16:58:00 +01:00
Fedor Isakov
dbc5154491
Reload and re-generate build scripts.
2019-11-11 15:28:23 +01:00
Fedor Isakov
69bc34e8f9
Drop language j.m.l.smodel.types containing SNodeTypeOp that is no longer used.
2019-11-11 14:37:41 +01:00
Fedor Isakov
ecd2594fed
Drop deprecated Reporting interface and all its usages.
...
Remove runtime solution that contained only Reporting.
2019-11-11 13:53:41 +01:00
Fedor Isakov
96f45c6e37
Drop commented out code.
2019-11-11 12:20:12 +01:00
Fedor Isakov
1e068abe13
Repackage typechecking tests to separate module.
...
All test data (code) to be contained in j.m.blExt.test module.
The samples are to be kept separately with generation on to demonstrate fewer false negatives
of the new typechecker.
2019-11-06 21:14:12 +01:00
Fedor Isakov
3f1b65ada2
Fix the structural errors introduced by a badly run migration.
2019-11-06 12:05:18 +01:00
Fedor Isakov
ad90a4cb77
Apply migration that replaces all instances of NodeAnchor with .pointer op.
2019-11-06 11:21:57 +01:00
Fedor Isakov
daa1bdceb6
Update default jvm options for running tests to "-Xmx2048m".
2019-11-05 20:53:01 +01:00
Fedor Isakov
15a7dece1b
Move error annotation to the correct place in test samples.
2019-11-05 18:55:08 +01:00
Fedor Isakov
9f3301f1c2
Typechecking BL: Use origin block to suppress target for dpromote solvers.
2019-11-05 18:54:38 +01:00
Fedor Isakov
8d21b056fa
Typechecking BL: drop calls to node-ptr.resolve where not necessary.
...
Replace expand macro with plain term constructors for String and Object.
2019-11-04 17:16:45 +01:00
Fedor Isakov
0585f88496
Suppress a scope error in a "bad" sample.
2019-11-04 16:20:57 +01:00
Fedor Isakov
4396adc9ff
Fix error being reported on another location.
2019-11-04 16:20:57 +01:00
Grigorii Kirgizov
320a19af93
Add test checking precondition for other tests on incrementality
...
The test is concerned with correct computation of RulesDiff and correct work of ArgumentsCollector
2019-10-31 19:33:17 +03:00
Grigorii Kirgizov
224d998c9a
Temporarily comment out a failing line in Samples_bad3
2019-10-28 20:56:56 +03:00
Grigorii Kirgizov
530dfd8719
Fix incorrect vis scopes due to failing coerceTo queries. Assign 'fallback' type in classifierType macro on error to continue typechecking besides returning error.
...
The problem is concerned from incorrect recover of captureType given recent changes to its handling.
Essentially, recover was losing information about inferred type var bounds.
Also, necessary rule for convertsTo for upperBpundType was missing.
2019-10-28 20:55:24 +03:00
Grigorii Kirgizov
3016ffd904
Remove dependency on lang.text to enable experimental typechecker for Samples:bounds.bad
2019-10-28 18:33:00 +03:00
Grigorii Kirgizov
223b243e7f
MPSCR-2: Fix capture of lowerBoundType on type variables with bounds
2019-10-26 21:44:09 +03:00
Grigorii Kirgizov
820066cf4d
Set "do not generate" flags again on some examples in bl tests
2019-10-26 17:11:47 +03:00
Grigorii Kirgizov
bc46a8e5ce
Upd broken refs to logical vars
2019-10-26 17:01:07 +03:00
Grigorii Kirgizov
c16801a928
Remove unnecessary accidental test root for BL
2019-10-26 16:17:41 +03:00
Grigorii Kirgizov
10a4b9ac70
Extend Lub test a bit with intersection type consumer
2019-10-26 16:17:41 +03:00
Grigorii Kirgizov
1b4a5ce55d
Add check that all aux boudns in type var decl are interfaces. Add test for such error.
2019-10-26 16:17:37 +03:00
Grigorii Kirgizov
122917cc42
Fix: clean up lub() constraint in one case. Caused typechecker errors.
2019-10-26 16:17:37 +03:00
Grigorii Kirgizov
03702da2f0
Add handling of aux bounds in type variable macros
2019-10-26 16:17:37 +03:00
Grigorii Kirgizov
b4d61ecb91
Add two more lub examples in LUB test
2019-10-26 16:17:37 +03:00
Grigorii Kirgizov
dfa53a265f
Add static field access to Sample typechecking test in BL
2019-10-26 16:16:59 +03:00
Grigorii Kirgizov
8e1633b0fb
Fix typing rule for FieldReferenceOperation
2019-10-26 16:16:59 +03:00
Grigorii Kirgizov
9ec95421bf
MPSCR-1: Remove unsound rule from containedIn relation. Add test for that case. Restructure Lub tests.
...
Now another test for suspicious rule for fieldReferenceOperation fails.
2019-10-26 16:16:59 +03:00
Grigorii Kirgizov
223cbeaabe
Add incremental test for BL plus operator overload for String type
2019-10-26 16:14:43 +03:00
Fedor Isakov
742adef5f9
Completing BL typesystem: [ClassifierClass,Mul,Div,LT,GT,NEQ]Expression, UnaryMinus.
2019-10-25 22:45:55 +02:00
Fedor Isakov
3092fa3635
Fix all templates with broken scopes for logical variables.
2019-10-25 22:45:55 +02:00
Fedor Isakov
a117f52ad5
Various improvements in j.m.baseLanguageExt typesystem.
...
Introduce generic way of handing recover/2 for ClassifierType.
Extract handling of expectType/2 constraint into a separate ruleslist.
Add lub/3 handler for char type.
2019-10-24 16:29:22 +02:00
Fedor Isakov
2e2cfd5194
Enable generation of samples known to be valid.
2019-10-24 13:29:55 +02:00
Fedor Isakov
c81b88f636
Fix Lub test: proove that the result of ternary operation is correct. Enable compilation of "bounds" model.
2019-10-22 21:20:20 +02:00
Fedor Isakov
fdd7c7fb19
New language j.m.bl.javadocExt to contain types aspect for javadoc.
2019-10-22 21:20:20 +02:00
Fedor Isakov
94dae1c5a8
Fix buildscript for samples/mpscore (extract dependency).
2019-10-18 17:02:14 +02:00
Grigorii Kirgizov
7fb8ebd7c2
Fix one assert in incremental tests to correctly check nodes with type errors. Fixes last failing test.
2019-10-17 13:17:16 +03:00
Grigorii Kirgizov
ef93acd34a
Revert "Temporarily silence the last failing BL incrementality test"
...
This reverts commit 5aa7585b
2019-10-17 12:58:37 +03:00
Grigorii Kirgizov
d861fd5eb4
Add convertsTo_ground reflexive case.
...
At least convertsTo(stringType(), stringType()) was failing without it.
2019-10-17 12:33:17 +03:00
Grigorii Kirgizov
5aa7585bea
Temporarily silence the last failing BL incrementality test
2019-10-15 21:31:29 +03:00
Grigorii Kirgizov
0fdc2ada2a
Rewrite BL Recover base rules to make dependencies between rules visible (i.e. to actually reeval 'eval' predicates in rules incrementally)
2019-10-15 21:29:07 +03:00
Grigorii Kirgizov
28a82fd443
Revert "Temporarily disable failing tests in BLIncrTypecheck test case."
...
This reverts commit 1c1ddd6e
2019-10-15 18:01:21 +03:00
Fedor Isakov
6372f5a4a4
Experimental: cache the results of convertsTo/coerceTo queries.
...
The cache is repository-local and is invalidated on every command in that repository.
2019-10-12 09:35:09 +02:00
Fedor Isakov
c7ad048a9e
Completing the BL typesystem: rules for Minus- and ParethesizedExpression.
2019-10-12 09:35:09 +02:00
Fedor Isakov
1c1ddd6e5d
Temporarily disable failing tests in BLIncrTypecheck test case.
...
Tests started to fail after an argument was introduced to a constraint that is being
activated from a query -- recoverAll/1 now has a parameter.
2019-10-12 09:35:09 +02:00
Fedor Isakov
f8dcf127db
Extend typechecking query TYPECHECK with a parameter to report types.
...
Reporting of calculated types is to be more explicit.
The not-so-obvious _type_.set() operation is to be phased out.
2019-10-10 17:30:11 +02:00
Fedor Isakov
be81c982f1
Housekeeping in BL typesystem: organize artifacts using virtual folders.
2019-10-09 13:45:20 +02:00
Fedor Isakov
3d7f8688f5
Add new sample for testing typechecking performance.
2019-10-08 13:30:16 +02:00
Fedor Isakov
9914c3ba19
Add all descendants of classifier type as required.
2019-10-03 10:25:25 +02:00
Fedor Isakov
64a4be471f
Optimize typechecking of array literals. The errors are now reported on the literal itself.
...
In general one should avoid using `typeOf/2` constraint with first argument being a logical.
The indexing mechanism ensures efficient search of matching rules when at least one argument
is a constant value. However, when all arguments are free logicals, *all* matches should be
tested, which is highly ineffective.
2019-09-30 16:44:36 +02:00
Fedor Isakov
7210fd2cad
Drop checking for unique varname in BL typesystem.
2019-09-30 16:44:36 +02:00
Fedor Isakov
49518e0704
Switch to reactor version 0.9.14.
2019-09-30 16:44:36 +02:00
Grigorii Kirgizov
b362f55b25
Fix error annotations to be on args in method calls tests. Unsilence incremental tests, same arg fix.
2019-09-16 13:56:23 +03:00
Grigorii Kirgizov
c0e4bb1d1a
Fix reporting on argument nodes in MethodCall rules
2019-09-16 13:56:23 +03:00
Grigorii Kirgizov
51258b5179
Silence two tests on incremental typechecking concerned with method calls
2019-09-16 13:56:23 +03:00
Grigorii Kirgizov
ace483a61d
Add tests on varargs. Adjust two error annotations.
2019-09-16 13:56:23 +03:00
Grigorii Kirgizov
b4f2d88123
Add rules for checking method arguments incl. variable argument
2019-09-16 13:56:23 +03:00
Grigorii Kirgizov
d251f626fa
Remove Scratchpad that accidentally found its way into test suite
2019-09-16 13:56:23 +03:00
Fedor Isakov
2942c244a6
Move model access out of coderules evaluation, avoid "read access violation".
...
It's doubtful this check belongs here, but let's keept it for now.
2019-09-13 13:00:03 +02:00
Fedor Isakov
6938a8108b
Drop superfluous check involving smodel access.
...
Typechecker should be occupied with checking types, not the model validation.
2019-09-13 11:31:18 +02:00
Fedor Isakov
eda493f672
Fix typechecking of VariableArityType.
...
Parameter was defined as list instead of child.
2019-09-13 11:28:34 +02:00
Grigorii Kirgizov
332735e770
Remove unneded handler
2019-09-12 15:29:14 +03:00
Grigorii Kirgizov
cdfe1f2c0c
Update language version after migrations from mps.logic lang
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
a9cf2e5589
Fix inf recursion in recovering intersectionType
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
9a782fc619
Run 'list literal -> cons list constructor' migration on samples
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
39fa007310
Run Splice migration on samples
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
163e339436
Add migration for replacing List usages for ConsList constructor usages
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
1e23572397
minor change of method use in BaseHelper
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
005dfa1e33
Fix reporting for typechecking of arrays in bl
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
6a02be6f6e
Avoid nested empty lists in mapped ListNode.Alias. Fix capture in lcta helper for lub. Add test for lub.
...
The problem with empty lists showed up at least in printing lists.
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
442d15204c
Add capture conversion for type variables produced by LUB
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
a8cb00c8b5
Handle recursive case of LUB: produce wildcard type param
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov
618524bdff
Fix Forall term in lambdacalc with recent changes
2019-09-11 13:24:01 +03:00
Grigorii Kirgizov
37be72d9cf
Refactor generation of ListFeature & 'spliced' MultiMetaLogical. Fix BL typesystem to accomodate these changes.
...
ListRole in DataForms is stricter and doesn't allow non-list values.
Spliced MultiMetaLogical is always generated to ListNode without intermediate step of Variable[].
2019-09-11 13:24:01 +03:00
Grigorii Kirgizov
4938551fcb
Subst ListNode for 'term' type in some places in relation concerned with LUB. Change ListRole to ChildRole in upperBoundType & lowerBoundType.
2019-09-11 13:24:01 +03:00