在z3中,可以声明一个完全未解释的
const
像这样:
(declare-const x Int)
类似地,可以这样定义一个完全解释的:
(define-fun y () Int 3)
; y == 3
给定代数数据类型,可以有如下完全解释的元组:
(declare-datatypes () ((Item (mk-item (size Int) (weight Int)))))
(define-fun z () Item (mk-item 3 4))
; z == Item(size=3, weight=4)
... 或未解释的,如下所示:
(declare-const i1 (Item Int Int))
现在是否可以有一个部分解释的数据类型,因此,根据前面的示例,
weight
将为每个项目固定,并且
size
可能会有所不同?
; (bad syntax, but I hope you get the idea)
; in this case the size is varying, but weight is fixed to 5
(declare-const i2 (Item Int 5))