-
Notifications
You must be signed in to change notification settings - Fork 33
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
Simple ADT test with different behavior with or without push #1008
Comments
Can you clarify what behavior is different and if either behavior is incorrect/unsound? |
Oh you're right I forgot about it: with the push it does not return, while without it returns unsat (as expected). So it's not an unsoundness issue. |
This test fails when wrapped in a push/pop instruction. Issue OCamlPro#1008 discusses this as an independent issue.
Interesting. I actually don't understand how we prove this in the first place… Here is a simpler example that we are able to prove:
Here is an even simpler example that we are not able to prove anymore, because the type gets converted to a record:
So the ADT theory must be doing something weird… Pinging @Halbaroth who has been looking at ADTs. |
This test fails when wrapped in a push/pop instruction. Issue OCamlPro#1008 discusses this as an independent issue.
This test fails when wrapped in a push/pop instruction. Issue OCamlPro#1008 discusses this as an independent issue.
This test fails when wrapped in a push/pop instruction. Issue OCamlPro#1008 discusses this as an independent issue.
I believe there is no soundness bug here. For instance, for the following input file: (set-logic ALL)
(declare-datatype t ((A) (B (i Int))))
(declare-const e t)
(assert ((_ is B) e))
(assert (forall ((n Int)) (distinct e (B n))))
(check-sat)
Now, if we consider the input: (set-logic ALL)
(declare-datatype t ((B (i Int))))
(declare-const e t)
(assert ((_ is B) e))
(assert (forall ((n Int)) (distinct e (B n))))
(check-sat) The type There are several solutions:
The last solution is probably the best one because we avoid to add fresh terms for each field of a record. In the current state of the code, we do not reach a contradiction with the second example, even if we turn on the model generation, because the generated terms by alt-ergo/src/lib/reasoners/satml.ml Lines 918 to 926 in 85308d4
I am not sure it is a good idea to add these terms to the matching environment for two reasons:
|
This commit adds a test suggested by Basile in issue OCamlPro#1008.
This commit adds tests suggested by Basile in issue OCamlPro#1008.
* Add tests from issue 1008 This commit adds tests suggested by Basile in issue #1008.
The following test have a different behavior given if the
push
instruction is here or not:File
test_adt.smt2
Command:
alt-ergo test_adt.smt2 --enable-assertions --output smtlib2 --sat-solver CDCL --no-minimal-bj
Without the push, alt-ergo returns
unsat
(as expected); with the push, it never returns.The culplrit may be the presence of the existential quantifier and
--no-minimal-bj
; remove the option and everything works fine. This test is a translation of goalg_valid_5_1
oftests/adts/simple_1.ae
.The text was updated successfully, but these errors were encountered: