Comments (7)
Thanks for the benchmark.
The reason for the difference in performance is that we use a very different version of enumeration when the synthesis conjecture involves multiple functions to synthesize.
In particular, for conjectures with multiple functions-to-synthesize, we use "smart" enumeration by default.
The output tag -o sygus-enumerator
will show this, with/without the extra synth-fun:
% cvc5 issue10708.sy -o sygus-enumerator
(sygus-enumerator :synth-fun aType :role MULTI_SOLUTION :type SMART)
(sygus-enumerator :synth-fun bType :role MULTI_SOLUTION :type SMART)
(sygus-enumerator :synth-fun cType :role MULTI_SOLUTION :type SMART)
(sygus-enumerator :synth-fun X :role MULTI_SOLUTION :type SMART)
^Ccvc5 interrupted by user.
% cvc5 issue10708.sy -o sygus-enumerator
(sygus-enumerator :synth-fun X :role POOL :type FAST)
(sygus-enumerator :synth-fun X :role POOL :type FAST)
For the latter, 2 fast enumerators are allocated, which is for decision tree learning (role POOL
). This technique is only available when a single function-to-synthesize is present.
For details on these techniques and when we choose fast vs. smart, see this paper: https://homepage.divms.uiowa.edu/~ajreynol/cav19b.pdf
In principle, we could do an optimization here to recognize when the conjecture does not contain a function-to-synthesize, where the "dummy" synth-fun will essentially be ignored in this example. This is something I can add.
from cvc5.
FYI, I opened a PR to address performance issues for unconstrained functions.
There are some issues to address concerning values for uninterpreted sorts.
from cvc5.
Hi!
Thanks a lot for the quick response and the reading material! I will go through the paper (and the CVC5 one, so I have info from there) and see what my translation may break
I will try the PR to see how it works and if I hit any more performance issues. Can you explain a little more about the issues for uninterpreted sorts? I am open to investing some time (a couple of days) into helping fix some lower-hanging fruits (apologies if it sounds naively optimistic that I can help).
from cvc5.
I tested that PR and got the expected performance. Thanks a lot!
I would also like to mention another case that is weird for me (or possibly because I have a different interpretation of the input).
(synth-fun X ((x Int) (y Int)) Int
((Start Int) (StartBool Bool))
((Start Int (0 1 2 3 4 5 6 x y
(+ Start Start)
(- Start Start)
(ite StartBool Start Start)))
(StartBool Bool ((and StartBool StartBool)
(not StartBool)
(= Start Start)
(<= Start Start))))
)
(synth-fun aType () Int)
; alternative
;(synth-fun aType () Int
; ((Start Int) (StartBool Bool))
; ((Start Int (0 1 2 3 4 5 6
; (+ Start Start)
; (- Start Start)
; (ite StartBool Start Start)))
; (StartBool Bool ((and StartBool StartBool)
; (not StartBool)
; (= Start Start)
; (<= Start Start))))
; )
;(assume (= aType 0)) <- breaks correctness
;(constraint (= aType 0)) <- is okay
(constraint (= (X 2 0) 1))
(constraint (and (= (X 0 1) 5) (= (X 0 0) 6)))
I want to use assume
to assume some universal quantifier constraints and a couple such equalities. The quantifiers were okay (albeit with an expected speed cost which is in the change of the solver). The moment I include this sort of statement and things break and the value for X becomes 0. Is this normal? Thank you in advance!
from cvc5.
assume
is a command that is used to give a precondition on the entire synthesis conjecture, so (assume (= aType 0))
means "My synthesis conjecture is only relevant when aType
is 0
". A trivial way to satisify this is to make aType
anything except 0
.
from cvc5.
The issue with "uninterpreted sort values" is that uninterpreted sorts do not have a fixed interpretation. For example, if one asserts:
(constraint (forall ((x U)) (= x a)))
where a : U
, then the interpretation of U
must contain exactly one element.
Thus, it may be unsound to refer to values of type U
(beyond the first one) since they may not even exist in a model.
This poses issues when using (Constant U)
in sygus grammars. In general, cvc5 will instead use "dummy" free constants when this is specified, which can lead to unintuitive behavior. We may disallow (Constant U)
for this purpose.
from cvc5.
I see. These issues make sense. In a way the SMT setup of this and the Sygus behavior diverge and I kind of see why it has to be like that. Thanks a lot! Then, one (possibly last) question out of curiosity: How can one encode properties of uninterpreted functions as a way to represent axioms for said function in sygus?
from cvc5.
Related Issues (20)
- Create a floating point term from a float/double
- The result of `get-value` is not a ground term HOT 1
- Interpolation does not propagate equalities(?) HOT 2
- (sygus-inst) Fatal failure at theory/arrays/theory_arrays.cpp:1595
- Invalid model issue HOT 2
- Why does the divide by 0 error crash? HOT 9
- cvc5 suffered a segfault when producing proofs in experimental format HOT 4
- Unable to solve sygus or smt bitvector problem with extract and nested ITE HOT 5
- Fatal failure at src/theory/theory_model_builder.cpp:1089
- Error solving for boolean operations HOT 4
- Different model on macOS and linux
- Invalid model in default mode HOT 2
- Performance issues caused by mismatched brackets
- Bad model value for integer variable with unknown result HOT 1
- Inconsistent solutions to equivalent formulas for sqrt HOT 4
- "conditional jump or move depends on uninitialised value" in RealAlgebraicNumber::toRational()
- Finite Field theory Unexplained Polynomial failure HOT 4
- (check-proofs) Fatal failure at src/proof/proof_node_manager.cpp:247
- Invalid model issue with `--finite-model-find`
- Build issues on on M3 Mac HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cvc5.