Commit Graph

63 Commits

Author SHA1 Message Date
Fedor Isakov 2b146e886b Migrate to latest MPS 2026.1 EAP 2026-04-24 11:22:20 +02:00
Fedor Isakov 53ab46fba7 Apply migrations and rebuild 2025-11-03 12:33:34 +01:00
Fedor Isakov 1a1cb13621 Apply migrations from 251 2025-04-09 11:34:06 +02:00
Fedor Isakov 17dd2a6c01 Appply migrations from MPS 243 branch 2024-12-11 11:57:18 +01:00
Fedor Isakov 0aad66b951 Automatic migrations 2024-07-04 18:17:56 +02:00
Clement de La Bourdonnaye 0776351977 Ran CleanStubForeignMethodIds migration 2024-01-23 16:33:23 +01:00
Fedor Isakov fc8451e63d Run migration 2023-10-13 18:13:09 +02:00
Fedor Isakov f3010743c1 Migration: FixExpandMacroTemplate 2023-10-13 18:13:08 +02:00
Fedor Isakov 3cf666e633 Apply migrations and make project 2023-07-31 12:57:24 +02:00
Fedor Isakov 6a849f82f2 Apply migrations and rebuild project 2023-06-12 12:01:02 +02:00
Fedor Isakov 4fd280f06e Fix closure type inference: infer result type
Proceed with the closure result type as with other inferrable types:
declare as inference var and resolve at the end of processing.
2023-05-03 10:31:55 +02:00
Fedor Isakov d531c6a5ad Run Migration Assistant 2023-02-22 13:52:02 +01:00
Fedor Isakov 25b82ebfb1 Redo fix of closure param type inference, drop typeScheme/2
The solution for inferring the type of a closure parameter using
auxiliary typeScheme/2 constraint and processing all "inference sites"
doesn't work for some situations, such as closure returning a closure with
untyped (var) parameter.

The new solution uses regular typeOf/2 constraint and calculates the
closure type assuming a variable as the return type. This must not be inferred from the context.

Avoid assigning a type to the closure the 2nd time, which
causes a cascade of typeOf/2 activations.
2022-11-23 14:03:19 +01:00
Fedor Isakov ad3ea9d63d Apply all migrations from 2022.2 2022-11-21 11:25:13 +01:00
Fedor Isakov fecabe840d Fix closure's parameter type inference, drop hacks
Replace the ad-hoc solution with typeScheme/2 cint to be used
on par with type/2. Type inference sites to be extended
with rules to process typeScheme.
2022-11-21 10:50:00 +01:00
Fedor Isakov 2a6d60133b Fix closure's parameter type inference; properly lift function type 2022-11-21 10:50:00 +01:00
Fedor Isakov 8c9f3c8afa Fix closure type inference 2022-09-08 14:07:06 +02:00
Fedor Isakov 7fe773dcc2 Switch all type aspects in mpscore sample to typechecking terms
This includes dropping of Recover rule table and relying on
the automatic types recovery.
2022-07-28 10:30:38 +02:00
Fedor Isakov ed58f59794 Ensure all memo usages have unique keys 2022-05-26 09:55:21 +02:00
Fedor Isakov 17e1bc4589 Applied migration 2021-06-29 14:51:10 +02:00
Fedor Isakov 9527a097b8 Migrate to the latest MPS release, apply migrations 2021-06-18 18:41:01 +02:00
Fedor Isakov d5a91b91e5 Fix closures types: convertsTo of function type
Instead of solving convertsTo for function type in functional domain,
try to find the expected classifier type and solve for it instead.
2021-05-13 15:54:43 +02:00
Fedor Isakov fc7d97f015 Fix closures types: observe function type's inherent variance 2021-05-13 15:54:43 +02:00
Fedor Isakov 637da7d966 Apply migration and rebuild project 2021-05-04 18:24:30 +02:00
Fedor Isakov ea6e930954 Apply migration and rebuild project 2021-05-04 18:24:29 +02:00
Fedor Isakov 47e6e07039 Refactor processing of inference variables
Introduce hasTarget and resolveVar constraints for delayed resolving
of inference variables. In invocation context variables are not
inferred eagerly, but wait for the end of all conversions, and then
resolved via resolveVar.
2021-05-03 13:14:11 +02:00
Fedor Isakov ff6b5ec6ae Apply migrations and rebuild project 2021-04-14 13:19:50 +02:00
Fedor Isakov 6ed5c3329d Fix typing errors: specify correct type annotations 2021-04-14 11:59:09 +02:00
Fedor Isakov c0601cb099 Optimizing types for more efficient evaluation
Replace "push" style genDecl constraint with "pull" schemeOf.
Mark rules as "auxiliary" to avoid these being included in
processing as dependencies.
2021-04-12 12:47:44 +02:00
Fedor Isakov 7fe5a5ad7a Auto-updated files after migrating to MPS 2021.1 EAP 2021-02-04 12:26:59 +01:00
Grigorii Kirgizov 4dac9e794a Fix assignment of 'null' ret type in closures with insufficient infer info. Add require. 2021-01-29 13:39:35 +03:00
Fedor Isakov 62e8e7d013 Switch to MPS 2020.3 release. 2021-01-08 11:00:02 +01:00
Fedor Isakov d87afd868e Closure types: use lub to compute the type of closure literal
Multiple "exit points" in closure literal may have different types.
Calculate lub of these types and use it as returned type.
2020-12-27 16:04:06 +01:00
Fedor Isakov b2c026d74a Fix closures types to populate functional classifier's parameters
On looking up the default functional classifier corresponding to a
function type, the classifier's type parameters are to be appropriately
populated from the function type.
2020-12-27 10:36:00 +01:00
Fedor Isakov c5fed5f2e0 BL and closure types: add necessary explicit dependencies. Fix tests.
In order to ensure properly functioning incremental typechecking
some explicit dependencies are to be declared.
2020-12-11 12:03:17 +01:00
Fedor Isakov 415590f2b2 Minor optimization: memoize calculation of functional methods. 2020-12-11 12:03:17 +01:00
Fedor Isakov fe16b80132 Refactor types in all mps foundation langs. Drop node-ptr usage as anchor in terms.
Drop node-ptr in node features, macro calls.
Drop node-ptr types in rule templates and recover closures,
fix BiConsumer params
Drop node-ptr// refs where appropriate.
Drop pointer operations from macro calls and term ctor's; add resolve to FunctionTypeLookup static table.
Drop node pointer operations from constraints, add require statements in SModel types macro table.
2020-11-24 13:41:24 +01:00
Fedor Isakov 75f97618c9 Introduce cancelContravariance in closures types, fix type inference.
When inferencing the type of a closure within a method call context,
it's important to strip occasional contravariant indicator from the
closure's input variable.

A method may declare its argument to be an SMI with the type(s) of
its functional method's arguments as ? super T to facilitate subtyping.
This must not affect the inferred type of the closure's input variable.
2020-11-24 13:41:24 +01:00
Grigorii Kirgizov 9476f4bba5 Revert introduction of 'runtimeType" superterm (fixes MPSCR-74) 2020-10-23 12:26:30 +02:00
Grigorii Kirgizov d9a35005e2 Fix cycle in coersion of functional type to unknown classifier (fixes MPSCR-72)
Use statically built FunctionTypes table in closures for
finding canonical functional type for a given closure.
2020-09-24 11:43:17 +03:00
Fedor Isakov 02182f4f2f Closures lang types: add template for ClosureArgReference concept. 2020-08-12 12:38:51 +02:00
Grigorii Kirgizov 856210a5ba Migrate langs extending 'convertsTo' handling from blExt types (MPSCR-63) 2020-07-31 11:36:02 +03:00
Grigorii Kirgizov 5bea95f1ab Change `convertsToSafe` signature so it isn't considered principal (required for MPSCR-64)
Just wrap used 'node'-typed argument in a term constructor.
It's not principal according to incrementality contract described in MPSCR-66
2020-07-22 13:09:52 +03:00
Fedor Isakov 936190bca9 Apply migrations. 2020-07-11 15:13:08 +02: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 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 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 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
Grigorii Kirgizov 4e43c924c6 Inherit classifier term from `parameterized` and migrate ListFeature role usages 2020-05-21 16:38:44 +03:00
Grigorii Kirgizov e2b3c21b2f Change semantics of implicit ListFeature: treat as wildcard, not as empty list
Motivation is that implicit (non-overriden) list features must unify
with list of any length. Consider an example:
`classifier(cls: node-ptr/A/) = classifier(cls: node-ptr/A/ param: [B,C])`
With previous approach it would fail, which seems counter-intuitive to me.
So, if empty list (e.g. of type parameters) is meant, then it must be
specified explicitly.

There's one thing to remember, though: such wildcard list features
won't match with MetaLogicalArrays in rule heads.
(e.g. see dpromote_* rules and consider what happens when
a classifier with unbound `parameter` feature comes in)
2020-05-21 16:38:36 +03:00