Skip to content

Syntax for backend types#638

Merged
marcoeilers merged 3 commits into
masterfrom
meilers_smt_types_syntax
Dec 24, 2022
Merged

Syntax for backend types#638
marcoeilers merged 3 commits into
masterfrom
meilers_smt_types_syntax

Conversation

@marcoeilers

@marcoeilers marcoeilers commented Dec 21, 2022

Copy link
Copy Markdown
Contributor

This PR adds syntax for domain types and domain functions that have interpretations given by the backend.
This functionality used to be available in the AST only.

Syntax example (as discussed in a previous Viper meeting):

domain myBV interpretation (SMTLIB: "(_ BitVec 32)", Boogie: "bv32") {

  function toBV32(i: Int): myBV interpretation "(_ int2bv 32)"
}

Consistency checks ensure that the given input program has interpretations for the current backend.

This domain type and function can be used like any other type and function, but will be interpreted to be the respective SMTLIB/Boogie type by Silicon and Carbon, respectively.
Frontends using the existing BackendFunction AST nodes will have to be adapted slightly (in particular, the declarations of those functions now have to be added to the program using domains, which was not the case before), but there are some constructors and deconstructors to keep existing code working where possible.

Accompanying PRs will modify Silicon and Carbon accordingly.

@marcoeilers

marcoeilers commented Dec 21, 2022

Copy link
Copy Markdown
Contributor Author

Silicon PR 675 and Carbon PR 447 have to be merged before this one for tests to pass.

@marcoeilers marcoeilers merged commit fd5c009 into master Dec 24, 2022
@marcoeilers marcoeilers deleted the meilers_smt_types_syntax branch December 24, 2022 12:30
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

Successfully merging this pull request may close these issues.

1 participant