Skip to content

Function vs operator behaviour in apalache #2178

Answered by shonfeder
agouglidis asked this question in Q&A
Discussion options

You must be logged in to vote

@agouglidis: apparently our current approach is that functions with infinite domains are just not supported. We will be adding a validation pass to throw an error when this is encountered in the future.

For the time being, I think the fix for your case is to provide a bounded range for the domain of your function. E.g., something along these lines:

------------------------------ MODULE Test ------------------------------
EXTENDS Naturals

VARIABLES
	\* @type: Int;
	posVal


UpperBound == 100

Calc[x \in 1..UpperBound] == x*x

Init == posVal \in (1..3)

Next == posVal < UpperBound /\ posVal' = Calc[posVal]

Spec == /\ Init
        /\ [][Next]_posVal

Inv1 == posVal > 0
====================…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by shonfeder
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants