Skip to content

Commit

Permalink
Remove old fromString approach
Browse files Browse the repository at this point in the history
  • Loading branch information
jawline committed Nov 20, 2018
1 parent 50a7f62 commit 1a4a7d9
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/Solver.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,10 @@ class Solver {
}

/**
* Process an SMT2Lib string and return the last assertion to the solver as a Z3_AST
* Process an SMT2Lib string and assert it on slv
*/
fromString(str) {
Z3.Z3_solver_from_string(this.context.ctx, this.slv, str);

//Grab the list of assertions
const assertions = Z3.Z3_solver_get_assertions(this.context.ctx, this.slv);

//Manual memory management for the assertions vector
Z3.Z3_ast_vector_inc_ref(this.context.ctx, assertions);

const vector_size = Z3.Z3_ast_vector_size(this.context.ctx, assertions);

const last_element = new Expr(this.context,
Z3.Z3_ast_vector_get(this.context.ctx, assertions, vector_size - 1)
);

Z3.Z3_ast_vector_dec_ref(this.context.ctx, assertions);

return last_element;
}

getModel() {
Expand Down

0 comments on commit 1a4a7d9

Please sign in to comment.