I have an issue with my SMT code. I'm using SMT-LIB 2.7 syntax, and executing it with a 2.6 solver (CVC4). Here is my code:
(set-option :print-success false)
(set-logic ALL)
(define-sort |Z| () Int)
(declare-sort P 1)
(define-sort |POW Z| () (P |Z|))
(declare-const vmax |Z|)
(declare-const vset |POW Z|)
(declare-const |set.empty Z| |POW Z|)
(assert (!
(forall ((e |Z|))
(not (|set.in |Z|| e |set.empty |Z||)))
:named |ax.set.in.empty Z|))
(declare-fun |set.in Z| (|Z| |POW Z|) Bool)
(declare-fun max (|POW Z|) |Z|)
(assert (!
(forall ((s |POW Z|))
(=> (not (= s |set.empty |Z||))
(|set.in |Z|| (max s) s)))
:named |ax.max.is.member|))
(assert (!
(forall ((s |POW Z|) (e |Z|))
(=> (|set.in |Z|| e s)
(<= e (max s))))
:named |ax.max.is.ge|))
(assert (!
(not (= vmax (max vset)))
:named |Goal|))
(check-sat)
(exit)
When I run this with CVC4, I get the following error:
(error "Parse Error: output.smt:11.36: Symbol Z is not declared.
(forall ((e |Z|)) (not (|set.in |Z|| e |set.empty |Z||)))
^")
I don’t understand why it says "Z is not declared", while I clearly declared it with:
(define-sort |Z| () Int)
I am new to SMT and there are not many resources available online, so I would appreciate your help.
Also, could this be caused by a version mismatch? I'm writing in SMT-LIB 2.7 but running it with a 2.6 solver. Unfortunately, I couldn’t find a download link for a 2.7-compliant solver.
Thanks in advance, and have a great day!