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

Soundness bugs in arrays + reals/ints (no option) #4237

Closed
rainoftime opened this issue Apr 9, 2020 · 2 comments · Fixed by #5073
Closed

Soundness bugs in arrays + reals/ints (no option) #4237

rainoftime opened this issue Apr 9, 2020 · 2 comments · Fixed by #5073
Assignees

Comments

@rainoftime
Copy link

rainoftime commented Apr 9, 2020

Hi,
For this formula:
137.txt

CVC4 throws out a fatal failure:

Fatal failure within void CVC4::theory::arrays::ArrayInfo::addIndex(CVC4::Node, CVC4::TNode) at /home/CVC4/src/theory/arrays/array_info.cpp:137
Check failure

 !i.getType().isArray()

OS: Ubuntu 16.04
Commit: 2f8caab

@nafur
Copy link
Member

nafur commented Aug 19, 2020

A smaller example:

(declare-const a (Array Bool Bool))
(declare-const b (Array (Array Bool Bool) Int))
(assert (= b (store b a 0)))
(check-sat)

Note the comment after the assertion:

Assert(!i.getType().isArray());  // temporary for flat arrays

@rainoftime rainoftime changed the title Fatal failure at src/theory/arrays/array_info.cpp:137 (no option) Soundness bugs in arrays (no option) Sep 14, 2020
@rainoftime
Copy link
Author

(set-logic QF_AUFLIRA)
(declare-fun _substvar_191_ () (Array (Array Bool Bool) (Array Bool Bool)))
(declare-const v2 Bool)
(declare-const arr0 (Array Bool Bool))
(declare-const arr1 (Array (Array Bool Bool) (Array Bool Bool)))
(assert (= arr1 (store arr1 (store arr0 false v2) arr0) _substvar_191_ arr1))
(push 1)
(assert v2)
(assert (= false false false false (= arr1 arr1 (store arr1 (store arr0 false v2) arr0) arr1) false))
(check-sat)

@rainoftime rainoftime changed the title Soundness bugs in arrays (no option) Soundness bugs in arrays + reals (no option) Sep 14, 2020
@rainoftime rainoftime changed the title Soundness bugs in arrays + reals (no option) Soundness bugs in arrays + reals/ints (no option) Sep 14, 2020
ajreynol added a commit that referenced this issue Sep 18, 2020
This throws a logic exception when a term of array type whose index is also an array is registered to the theory of arrays.

It refactors the preRegisterTermInternal method of arrays so that all non-equality terms are added to the equality engine in the same block of code, which also checks for the type.

Fixes #4237.

FYI @barrettcw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants