-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
I think = should be => in the following three lines.
| (= (and (subtype x y) (subtype y z)) |
| (= (and (subtype x y) (subtype x z)) |
| (= (subtype x y) |
Otherwise, the specification prohibits the existence of non-root types. Specifically, the following program (where the only interesting lines are the last three lines) prints sat unsat.
(declare-sort Type)
(declare-fun subtype (Type Type) Bool)
(declare-fun array-of (Type) Type)
(assert (forall ((x Type)) (subtype x x)))
(assert (forall ((x Type) (y Type) (z Type))
(= (and (subtype x y) (subtype y z))
(subtype x z))))
(assert (forall ((x Type) (y Type))
(= (and (subtype x y) (subtype y x))
(= x y))))
(assert (forall ((x Type) (y Type) (z Type))
(= (and (subtype x y) (subtype x z))
(or (subtype y z) (subtype z y)))))
(assert (forall ((x Type) (y Type))
(= (subtype x y)
(subtype (array-of x) (array-of y)))))
(declare-const root-type Type)
(assert (forall ((x Type)) (subtype x root-type)))
(check-sat)
(declare-const another-type Type)
(assert (not (= root-type another-type)))
(check-sat)
Metadata
Metadata
Assignees
Labels
No labels