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

The type language---records in particular #57

Open
stever00 opened this issue Oct 22, 2018 · 3 comments
Open

The type language---records in particular #57

stever00 opened this issue Oct 22, 2018 · 3 comments

Comments

@stever00
Copy link

I am writing something mainly for myself on transliterating Z to PVS. (I know...I'm mad...)

At one point what I WANT to write is (using _ to mimic the priming of Z names...since PVS does not allow primes in identifiers)

Transaction_0_ : TYPE = [# date_ : DATE, description_ : TEXT, amount_ : MONEY #]

(I am modelling the Delta-inclusion idiom from Z here...)

SingleState : TYPE = [# ssaccount : finseq[Transaction_0] #]

SingleState_ : TYPE = [# ssaccount_ : finseq[Transaction_0] #]

Then I write this (to mimic inclusion)

PhiDoSomeBusiness : TYPE = {dsm : Transaction_0_ WITH SingleState WITH SingleState_ | TRUE}

(somewhat simplified, especially using the predicate TRUE).

This give the (bizarre?) error message

Error: No next method for method

If I don’t use the type expression (with the WITHs above) and invent a new identifier instead, as in

Transaction_0_ : TYPE = [# date_ : DATE, description_ : TEXT, amount_ : MONEY #]

SingleState : TYPE = [# ssaccount : finseq[Transaction_0] #]

SingleState_ : TYPE = [# ssaccount_ : finseq[Transaction_0] #]

DSM_Type : TYPE = Transaction_0_ WITH SingleState WITH SingleState_

PhiDoSomeBusiness : TYPE = {dsm : DSM_Type | TRUE}

then it compiles and tcs fine.

So, two things: what does the error mean?; and, this seems to be a general weakness in PVS in that it does not allow type expressions where a type identifier is allowed. But I might be wrong.

Is the fact that WITH can be used to form type expressions in this way documented anywhere? (I found out about it after asking Paolo Masci for help :) )

Thanks!

Steve

@samowre
Copy link
Contributor

samowre commented Oct 23, 2018 via email

@stever00
Copy link
Author

stever00 commented Oct 23, 2018 via email

@samowre
Copy link
Contributor

samowre commented Oct 23, 2018 via email

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