-
Notifications
You must be signed in to change notification settings - Fork 87
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
feat: creating an SMT verification module #712
Closed
Closed
Changes from 4 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
0561529
Adding cvc5 git module
Sarkoxed 3f91563
Added variable naming functionality + extract the circuit
Sarkoxed 58ddbe3
Added cvc5 api + symbolic circuit construction + tests
Sarkoxed 76c87ba
Merge branch 'master' into as/smt-verification
Sarkoxed cb96334
remove cvc5 git module
Sarkoxed 6f6d92f
remove cvc5 from the src directory
Sarkoxed a6fc7a9
Added modulus of the field to the CircuitSchema
Sarkoxed f12281b
Few corrections
Sarkoxed 77410ab
Added the manual cvc5 instalation phase
Sarkoxed ed2b442
Now you can take the modulus from CircuitSchema
Sarkoxed 80eb513
Documentation
Sarkoxed 6fc22ef
Merge branch 'master' into as/smt-verification
Sarkoxed 9309363
No belief is still a belief
Sarkoxed 713a1eb
q
Sarkoxed 7993aab
Merge branch 'master' into as/smt-verification
Sarkoxed e36a03c
-comment out
Sarkoxed 86690ef
clean up
Sarkoxed File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,6 @@ | |
[submodule "build-system"] | ||
path = build-system | ||
url = [email protected]:AztecProtocol/build-system.git | ||
[submodule "cpp/src/cvc5"] | ||
path = cpp/src/cvc5 | ||
url = [email protected]:Sarkoxed/cvc5.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ | |
#include <unordered_map> | ||
#include <unordered_set> | ||
|
||
#include "barretenberg/serialize/cbind.hpp" | ||
#include "barretenberg/serialize/msgpack.hpp" | ||
|
||
using namespace barretenberg; | ||
|
||
namespace proof_system { | ||
|
@@ -507,6 +510,48 @@ template <typename FF> bool StandardCircuitBuilder_<FF>::check_circuit() | |
} | ||
return true; | ||
} | ||
|
||
/** | ||
* Export the existing circuit into msgpack compatible buffer. | ||
* | ||
* @return msgpack compatible buffer | ||
*/ | ||
template <typename FF> msgpack::sbuffer StandardCircuitBuilder_<FF>::export_circuit() | ||
{ | ||
using base = CircuitBuilderBase<arithmetization::Standard<FF>>; | ||
|
||
CircuitSchema cir; | ||
for (uint32_t i = 0; i < this->get_num_public_inputs(); i++) { | ||
cir.public_inps.push_back(this->real_variable_index[this->public_inputs[i]]); | ||
} | ||
|
||
for (auto& tup : base::variable_names) { | ||
cir.vars_of_interest.insert({ this->real_variable_index[tup.first], tup.second }); | ||
} | ||
|
||
for (auto var : this->variables) { | ||
cir.variables.push_back(var); | ||
} | ||
|
||
for (size_t i = 0; i < this->num_gates; i++) { | ||
std::vector<FF> tmp_sel = { q_m[i], q_1[i], q_2[i], q_3[i], q_c[i] }; | ||
std::vector<uint32_t> tmp_wit = { | ||
this->real_variable_index[w_l[i]], | ||
this->real_variable_index[w_r[i]], | ||
this->real_variable_index[w_o[i]], | ||
}; | ||
cir.selectors.push_back(tmp_sel); | ||
cir.wits.push_back(tmp_wit); | ||
} | ||
|
||
msgpack::sbuffer buffer; | ||
msgpack::pack(buffer, cir); | ||
return buffer; | ||
// info("Buffer size: ", buffer.size()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Commented out code |
||
// out.write(buffer.data(), static_cast<long>(buffer.size())); | ||
} | ||
|
||
template class StandardCircuitBuilder_<barretenberg::fr>; | ||
template class StandardCircuitBuilder_<grumpkin::fr>; | ||
|
||
} // namespace proof_system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
barretenberg_module(smt_verification common ${CMAKE_SOURCE_DIR}/src/cvc5/tmp-lib/lib/libcvc5.so.1) | ||
|
||
barretenberg_module(smt_examples common proof_system stdlib_primitives smt_verification) | ||
#barretenberg_module(smt_polynomials common proof_system stdlib_primitives smt_verification) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Commented out code |
||
#barretenberg_module(smt_bigfield common proof_system stdlib_primitives smt_verification) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo ("Calss")