diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2018-04-08 15:23:20 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-08 15:23:20 -0500 |
commit | df4fce8f41319c80ca13e20aefdad1dd32cb42bd (patch) | |
tree | ec469663b43132b0fab144b5678a7120d4e98e83 /src/parser | |
parent | e8f753f8ace5611c7204f390b7590a125e2bfa2a (diff) |
Check free variables in assertions (#1737)
Diffstat (limited to 'src/parser')
-rw-r--r-- | src/parser/smt2/Smt2.g | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g index 2c26c824f..ae9d304f1 100644 --- a/src/parser/smt2/Smt2.g +++ b/src/parser/smt2/Smt2.g @@ -429,6 +429,17 @@ command [std::unique_ptr<CVC4::Command>* cmd] csen->setMuted(true); PARSER_STATE->preemptCommand(csen); } + // if sygus, check whether it has a free variable + // this is because, due to the sygus format, one can write assertions + // that have free function variables in them + if (PARSER_STATE->sygus()) + { + if (expr.hasFreeVariable()) + { + PARSER_STATE->parseError("Assertion has free variable. Perhaps you " + "meant constraint instead of assert?"); + } + } } | /* check-sat */ CHECK_SAT_TOK { PARSER_STATE->checkThatLogicIsSet(); } |