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

Operators from standard modules do not work #13

Closed
lemmy opened this issue Jun 29, 2022 · 6 comments
Closed

Operators from standard modules do not work #13

lemmy opened this issue Jun 29, 2022 · 6 comments

Comments

@lemmy
Copy link
Contributor

lemmy commented Jun 29, 2022

---- MODULE Issue7 ----
EXTENDS TLC, Naturals, FiniteSets

VARIABLES x

Init == x = {}

Next == x' = Cardinality(x)

====
---- MODULE Issue7 ----
EXTENDS TLC, Naturals, Sequences

VARIABLES x

Init == x = <<>>

Next == x' = Len(x)

====
TypeError: Cannot read properties of undefined (reading 'length')
    at eval.js:900:40
    at lodash.min.js:98:241
    at lodash.min.js:54:66
    at ue (lodash.min.js:35:327)
    at Function.Kc [as mapValues] (lodash.min.js:98:213)
    at evalEq (eval.js:896:30)
    at evalBoundInfix (eval.js:1025:16)
    at evalBoundInfix (eval.js:2079:15)
    at evalExpr (eval.js:1598:16)
    at evalExpr (eval.js:2070:15)
@lemmy
Copy link
Contributor Author

lemmy commented Jun 29, 2022

/cc @fhackett-ms

@lemmy
Copy link
Contributor Author

lemmy commented Jun 29, 2022

---- MODULE Issue7 ----
EXTENDS Sequences

VARIABLES x

Init == x = DOMAIN <<>>

Next == x' = x

====
TypeError: Cannot read properties of undefined (reading 'length')
    at eval.js:900:40
    at lodash.min.js:98:241
    at lodash.min.js:54:66
    at ue (lodash.min.js:35:327)
    at Function.Kc [as mapValues] (lodash.min.js:98:213)
    at evalEq (eval.js:896:30)
    at evalBoundInfix (eval.js:1025:16)
    at evalBoundInfix (eval.js:2079:15)
    at evalExpr (eval.js:1598:16)
    at evalExpr (eval.js:2070:15)

@will62794
Copy link
Owner

Partially addressed in 806197a, 30f4151, 56b2ab8, f498057

Some of the remaining standard modules that are not fully implemented:

  • Bags
  • Sequences
  • FiniteSets

See also #14 for some notes on handling module semantics more generally.

@lemmy
Copy link
Contributor Author

lemmy commented Jun 29, 2022

Some of them will need CHOOSE, which doesn't seem supported:

---- MODULE Issue7 ----
Len(s) == CHOOSE n \in Nat : DOMAIN s = 1..n

VARIABLE x

Init == x = CHOOSE n \in {1,2,3} : TRUE

Next == x' = x
====

Note that the semantics of CHOOSE are difficult to implement.

@will62794
Copy link
Owner

Preliminary CHOOSE support added in 338d5ae.

@will62794
Copy link
Owner

Closing for now in favor of new issues that can be scoped to specific, unimplemented standard module operators as they come up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants