Skip to content

Instantly share code, notes, and snippets.

@msakai
Created December 20, 2011 13:20
Show Gist options
  • Save msakai/1501545 to your computer and use it in GitHub Desktop.
Save msakai/1501545 to your computer and use it in GitHub Desktop.
Can't Z3 handle datatypes that contains sorts introduced by declare-sort/define-sort?
(declare-sort A)
(define-sort B () Int)
(declare-datatypes ((listA (nilA) (consA (hdA A) (tlA listA)))))
(declare-datatypes ((listB (nilB) (consB (hdB B) (tlB listB)))))
(declare-datatypes ((listInt (nilInt) (consInt (hdInt Int) (tlInt listInt)))))
; =>
; success
; success
; (error "line 3 column 64: could not parse data-type declaration")
; (error "ERROR: line 3 column 47: unknown sort 'A'.")
; (error "line 4 column 64: could not parse data-type declaration")
; (error "ERROR: line 4 column 47: unknown sort 'B'.")
; success
(define-type A)
(define-type B int)
(define-type listA (datatype nilA (consA hdA::A tlA::listA)))
(define-type listB (datatype nilB (consB hdB::B tlB::listB)))
(define-type listInt (datatype nilInt (consInt hdInt::int tlInt::listInt)))
(check) ; => sat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment