You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pr mostly consists of code refactoring/renames
## Cmake
`cvc5` build is now multi-threaded
## Circuit Builders
`CircuitBuilderBase` - added `circuit_finalized` into msgpack schema
`UltraCircuitBuilder` - zero is now force renamed during circuit export
## smt_subcircuits
switched `0xabbba` to `0` since it produced failures duirng circuit
creations
## Solver
- Added new method `get` and `operator[]`. These two methods extract the
value of the variable from solver. Added a test
- fixed the incorrectly placed `BITVECTOR_UDIV`
- renamed `getValue` to `get_symbolic_value` to avoid confusion
## Terms
- New constructor, based on `bb::fr` value
- Got rid of `isFiniteField` like members. Useless
- Added `normalize` method, for more readability
- Refactored the operators
## SMT_Util
- add `is_signed` flag in `string_to_fr()` to avoid overflows
## Tests
For most part it's either a rename, engine switch or new `operator[]`
refactoring
Also
- fixed an incorrect `extract_bit` test
-
All the current changes are reflected in `README.md`
---------
Co-authored-by: Innokentii Sennovskii <[email protected]>
Copy file name to clipboardExpand all lines: barretenberg/cpp/src/barretenberg/smt_verification/README.md
+31-4Lines changed: 31 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Then just build with `smt-verification` preset.
12
12
13
13
-```set_variable_name(u32 index, str name)``` - assignes a name to a variable. Specifically, binds a name with the first index of an equivalence class.
14
14
15
-
**!Note that you don't have to name a zero or one(in standard). It has the name `zero` by default.**
15
+
**!NOTE that somtimes you may encounter variables that are set to be `assert_equal` to `zero`. Their name will be erased no matter what first variable in class says.**
16
16
17
17
-```update_variable_names(u32 idx)``` - in case you've called ```assert_equal``` and ```update_real_variable_indices``` somewhere and you know that two or more variables from the equivalence class have separate names, call this method. Idx is the index of one of the variables of this class. The name of the first variable in class will remain.
18
18
@@ -179,8 +179,14 @@ To store it on the disk just do the following
179
179
After generating all the constrains you should call `bool res = solver.check()` and depending on your goal it could be `true` or `false`.
180
180
181
181
In case you expected `false` but `true` was returned you can then check what went wrong.
182
-
You should generate an unordered map with `str->term` values and ask the solver to obtain `unoredered_map<str, str> res = solver.model(unordered_map<str, FFTerm> terms)`.
183
-
Or you can provide a vector of terms that you want to check and the return map will contain their symbolic names that are given during initialization. Specifically either it's the name that you set or `var_{i}`.
182
+
You have three choices:
183
+
- You can access each of the terms directly by calling `solver[term]`, or `solver.get(term)`
184
+
- You can generate an unordered map with `str->term` values and ask the solver to obtain `unordered_map<str, str> res = solver.model(unordered_map<str, FFTerm> terms)`.
185
+
- You can generate a vector of terms and pass them to `unordered_map<str, str> res = solver.model(vector<FFTerm> terms)`. In this case the mapping name will be taken directly from solver. Specifically either it's the name that you have set or `var_{i}`.
186
+
187
+
**!Note that the resulting values are strings and you can't use them to generate further constraints.**
188
+
In case you want such a behavior use `sym_val = solver.get_value(term)`
189
+
You can then create `STerm(sym_val, &solver, Type)` and use it in operations as a constant
184
190
185
191
Now you have the values of the specified terms, which resulted into `true` result.
186
192
**!Note that the return values are decimal strings/binary strings**, so if you want to use them later you should use `FFConst` with base 10, etc.
0 commit comments