Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solving with regular constraints doesn't finish in unsat case #7215

Open
Lozov-Petr opened this issue May 2, 2024 · 0 comments
Open

Solving with regular constraints doesn't finish in unsat case #7215

Lozov-Petr opened this issue May 2, 2024 · 0 comments
Labels

Comments

@Lozov-Petr
Copy link

We are hacking formulas with a theory of regular languages. In two cases below first one reports unsat correctly, but second one hangs. It looks like combination of propositional language and regular constraints has missing optimization: the negation of str.in.re should be simplified to str.in.re (re.complement.... Is it a bug? Is our understanding correct?

CC @Kakadu

(declare-const a String)

(set-info :status unsat)


(assert 
  (str.in.re a 
    (re.inter 
      (re.complement 
        (re.++
          (re.* (re.range "a" "z"))
          (re.union
            (str.to.re "string")
            (str.to.re "builder")
            (str.to.re "buffer")
          ))) 
      (re.++
        (re.* (re.range "a" "z"))
        (str.to.re "string")
        (re.opt
            (re.union
                (str.to.re "builder")
                (str.to.re "buffer")
      ))))))

(check-sat)
\

2nd

(declare-const a String)
(declare-const l1 Bool)
(declare-const l2 Bool)

(set-info :status unsat)

(assert (not (= l1
    (str.in.re a (re.++
        (re.* (re.range "a" "z"))
        (re.union
            (str.to.re "string")
            (str.to.re "builder")
            (str.to.re "buffer")
        ))))))
(assert (= l2
    (str.in.re a (re.++
        (re.* (re.range "a" "z"))
        (str.to.re "string")
        (re.opt
            (re.union
                (str.to.re "builder")
                (str.to.re "buffer")
            ))))))

(assert (and l1 l2))
(check-sat)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants