Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Support LAMBDA in typecheck #251

Closed
konnov opened this issue Sep 30, 2020 · 1 comment
Closed

[FEATURE] Support LAMBDA in typecheck #251

konnov opened this issue Sep 30, 2020 · 1 comment
Assignees
Labels
FTC-Snowcat Feature: Fully-functional type checker Snowcat new New issue to be triaged.

Comments

@konnov
Copy link
Collaborator

konnov commented Sep 30, 2020

Several specifications in the examples repository are using the LAMBDA-syntax. For instance, SlidingPuzzles defines the operator move(p, d) as follows (the type annotations are introduced by me):

move(p, d) == "(<<Int, Int>>, <<Int, Int>>) => <<Int, Int>>" :>
              LET s == "<<Int, Int>>" :>
                    <<p[1] + d[1], p[2] + d[2]>>
                  pc == ChooseOne(board, LAMBDA pc : s \in pc)
              IN <<pc, {<<q[1] - d[1], q[2] - d[2]>> : q \in pc}>>

The type checker produces the following error:

[SlidingPuzzlesTyped.tla:47:42-47:61]: Undefined name LAMBDA. Introduce a type annotation.

Currently, the type checker just ignores the LAMBDA syntax. It probably can be just substituted with a LET-IN definition. In this case, the type checker would automatically infer the types inside LAMBDA.

@konnov konnov added the new New issue to be triaged. label Sep 30, 2020
@konnov konnov added this to the v0.9.0-tool-typecheck milestone Sep 30, 2020
@konnov konnov self-assigned this Sep 30, 2020
@konnov konnov added the FTC-Snowcat Feature: Fully-functional type checker Snowcat label Dec 6, 2020
@konnov konnov modified the milestones: v0.9.0-tool-typecheck, backlog2021 Dec 11, 2020
@konnov konnov modified the milestones: backlog2021, January iteration Jan 4, 2021
@konnov
Copy link
Collaborator Author

konnov commented Feb 1, 2021

It is working already in unstable. Nothing to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FTC-Snowcat Feature: Fully-functional type checker Snowcat new New issue to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants