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

Shadowing builtin types in Alt-Ergo native language #1104

Open
Halbaroth opened this issue May 2, 2024 · 3 comments
Open

Shadowing builtin types in Alt-Ergo native language #1104

Halbaroth opened this issue May 2, 2024 · 3 comments

Comments

@Halbaroth
Copy link
Collaborator

Dolmen accepts to shadow some builtin types. For instance, the input file:

logic x : (int, int) farray
type ('a, 'b) farray
logic y : (int, int) farray

goal g : x = y

produces the error:

goal g : x = y
             ^^^^^
Error The term: `y` has type `farray(int, int)`
      but was expected to be of type `array(int, int)`

The legacy frontend of Alt-Ergo accepts this input file because it uses the names of types as identifiers.

Notice this file is refused by both legacy and Dolmen frontend:

type int 

goal g : true 

because int is a reserved token, which isn't the case of farray.

It seems shadowing is used in the SMT-LIB as noticed in the issue #712.

@Gbury
Copy link
Collaborator

Gbury commented May 2, 2024

Note: it is easy for Dolmen to change that behavior and for instance treat as errors a problem that would try to redefine/shadow a builtin type (that is already being done for the smtlib). It all depends on the rules for the native ae language, which the alt-ergo team can choose.

@Halbaroth
Copy link
Collaborator Author

I think we should forbid such redefinitions but we can do it after the next release.

@hra687261
Copy link
Contributor

IIRC it was used on function and value names, not on theory symbols, AFAIK the shadowing of theory symbols is not allowed in the SMT-LIB standard.

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

No branches or pull requests

4 participants