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

Revise xposts internal representation #379

Open
n-osborne opened this issue Jan 23, 2024 · 1 comment
Open

Revise xposts internal representation #379

n-osborne opened this issue Jan 23, 2024 · 1 comment

Comments

@n-osborne
Copy link
Contributor

n-osborne commented Jan 23, 2024

In the current version, exceptional post-conditions are represented with the type : (xsymbol * (pattern * term) list) list

This doesn't work well with exception that doesn't have any arguments. For example in:

exception E

val f : int -> int
(*@ y = f x
    raises E -> x = 42

the type checker has to fill for the pattern.
It wil linsert a tuple0 pattern, I believe because the type of E is Exn_tuple [].

@n-osborne
Copy link
Contributor Author

After further investigation, the tuple0 is placed by the parser.
In case we have a pattern but no term (raises E _), the parser will insert a Ttrue.

I believe there are two ways to go:

  1. either flatten the type and go for somethin along the way of (xsymbol * pattern option * term) list
  2. add pattern for exceptions and go for (pattern * term) list which is even simpler

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

1 participant