mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 00:55:31 +00:00
add example of parsing with external declarations
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
37f7c30e23
commit
5d9820f3e2
2 changed files with 27 additions and 2 deletions
|
@ -1129,6 +1129,17 @@ void consequence_example() {
|
|||
std::cout << consequences << "\n";
|
||||
}
|
||||
|
||||
static void parse_example() {
|
||||
std::cout << "parse example\n";
|
||||
context c;
|
||||
sort_vector sorts(c);
|
||||
func_decl_vector decls(c);
|
||||
sort B = c.bool_sort();
|
||||
decls.push_back(c.function("a", 0, 0, B));
|
||||
expr a = c.parse_string("(assert a)", sorts, decls);
|
||||
std::cout << a << "\n";
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
try {
|
||||
|
@ -1173,6 +1184,7 @@ int main() {
|
|||
param_descrs_example(); std::cout << "\n";
|
||||
sudoku_example(); std::cout << "\n";
|
||||
consequence_example(); std::cout << "\n";
|
||||
parse_example(); std::cout << "\n";
|
||||
std::cout << "done\n";
|
||||
}
|
||||
catch (exception & ex) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue