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] Type theorems #180

Closed
konnov opened this issue Jul 20, 2020 · 1 comment
Closed

[FEATURE] Type theorems #180

konnov opened this issue Jul 20, 2020 · 1 comment
Labels
FTC-Snowcat Feature: Fully-functional type checker Snowcat help wanted product-owner-triage This should be triaged by the product owner

Comments

@konnov
Copy link
Collaborator

konnov commented Jul 20, 2020

Following the discussions in #162 and #179, it may be useful to produce THEOREMs after running type inference.

EXTENDS Sequences
CONSTANTS Range
ASSUME(Range <: "set(Int)")

VARIABLES list

Mem(e, es) ==
  \E i \in DOMAIN es:
    e = es[i]

Init ==
  list = <<>>

Next ==
  \E e \in Range:
    list' = Append(list, e)

If type inference computes the types of list and Mem, we can introduce the following theorems:

THEOREM list \in Seq(Int)
THEOREM \A e \in Int, es \in Seq(Int): Mem(e, es) \in BOOLEAN

Although the translation from types to the statements about sets looks straightforward, some attention should be paid to the following TLA+ values: records and sets of records (we can only compute supertypes of records) and operators (we cannot use operators as values).

The above theorems may be useful for writing manual proofs in TLAPS.

@konnov konnov added the new New issue to be triaged. label Jul 20, 2020
@konnov konnov added this to the v1.0-release-ux milestone Jul 20, 2020
@konnov konnov modified the milestones: v1.0-release-ux, backlog2020 Dec 6, 2020
@konnov konnov added the FTC-Snowcat Feature: Fully-functional type checker Snowcat label Dec 11, 2020
@konnov konnov modified the milestones: backlog2020, backlog2021 Dec 11, 2020
@konnov konnov added help wanted and removed new New issue to be triaged. labels Dec 3, 2021
@konnov konnov added the product-owner-triage This should be triaged by the product owner label Jul 13, 2022
@shonfeder shonfeder removed this from the Typechecker Snowcat milestone Jan 18, 2023
@konnov
Copy link
Collaborator Author

konnov commented Sep 6, 2024

I don't think it's relevant anymore

@konnov konnov closed this as completed Sep 6, 2024
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 help wanted product-owner-triage This should be triaged by the product owner
Projects
None yet
Development

No branches or pull requests

2 participants