Skip to content

Wrong solution for subset and Bool Set #7544

@leuschel

Description

@leuschel

I would have expected that the following constraint is unsat (there is no strict superset of Bool).
However, I do get a solution

; when replacing Bool by Int the formula becomes unsat (cns3)
; z3 says (wrongly?!) that this constraint below is sat; i.e., there exists a strict superset of Bool
; tested with 4.13.3 and 4.13.4
(set-info :status unknown)
(declare-fun id5 () (Set Bool))
(declare-fun id4 () (Set Bool))
(assert (= id4 ((as const (Set Bool)) true )))
(assert (subset id4 id5))
(assert (not (= id4 id5)))
(check-sat)
(get-model)

I do get this result:

$ z3 subset_ticket-cns5.smt2 
sat
(
  (define-fun id5 () (Set Bool)
    (lambda ((x!1 Bool)) x!1))
  (define-fun id4 () (Set Bool)
    ((as const (Set Bool)) true))
)

Am I using subset/Set incorrectly or is this a bug?
I get the same result when using Arrays rather than Sets:

(set-info :status unknown)
(declare-fun id5 () (Array (Array Bool Bool) Bool))
(assert
 (let ((?x7 (lambda ((id4 (Array Bool Bool)) )true)
))
(let (($x10 (subset ?x7 id5)))
(let (($x8 (= ?x7 id5)))
(let (($x9 (not $x8)))
(and $x9 $x10))))))
(check-sat)
(get-model)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions