Skip to content

Commit

Permalink
do not use reference to Pterm when reallocation of term table can happen
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Blicha committed Jan 22, 2021
1 parent 1220474 commit 8d0a77e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/models/Model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ PTRef Model::evaluate(PTRef term) {
}
else {
// complex term not seen before, compute and store the value
const Pterm & t = logic.getPterm(term);
SymRef symbol = t.symb();
SymRef symbol = logic.getPterm(term).symb();
int size = logic.getPterm(term).size();
vec<PTRef> nargs;
for (int i = 0; i < t.size(); ++i) {
PTRef narg = evaluate(t[i]);
for (int i = 0; i < size; ++i) {
PTRef narg = evaluate(logic.getPterm(term)[i]);
nargs.push(narg);
}
PTRef val = logic.insertTerm(symbol, nargs);
Expand Down

0 comments on commit 8d0a77e

Please sign in to comment.