Created
December 26, 2024 15:02
-
-
Save zsrkmyn/b176d3a5031d6261f1b41bae44b209c6 to your computer and use it in GitHub Desktop.
declare-datatypes syntax
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; z3 supports two types of syntax for declare-datatypes -- z3's own one and smt-lib 2.6 one | |
; smt-lib 2.6 syntax | |
(declare-datatypes ( | |
(Pair 2) ; datatype | |
) | |
( | |
(par (T1 T2) ( | |
(nil) ; constructor 1 | |
(mk-pair (first T1) (second T2)) ; constructor 2 | |
)) | |
)) | |
; Z3 syntax | |
;(declare-datatypes (T1 T2) ( | |
; (Pair ; datatype | |
; (nil) ; constructor 1 | |
; (mk-pair (first T1) (second T2)) ; constructor 2 | |
; ) | |
;)) | |
(declare-const p (Pair Int Int)) | |
(declare-const q (Pair Int Bool)) | |
(simplify (mk-pair 1 2)) | |
(simplify (as nil (Pair Int Int)) ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment