Skip to content

Commit

Permalink
Guards
Browse files Browse the repository at this point in the history
  • Loading branch information
ajreynol committed Jun 19, 2024
1 parent 2052116 commit a5c93b3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/cmd_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,12 +509,20 @@ bool CmdParser::parseNextCommand()
// not builtin symbols, thus we must assume they are defined by the user.
// We assume that a symbol named "=" has been defined.
Expr eq = d_state.getVar("=");
if (eq.isNull())
{
d_lex.parseError("Expected symbol '=' to be defined when parsing define-fun.");
}
Expr rhs = expr;
Expr t = ret;
if (!vars.empty())
{
// We assume that a symbol named "lambda" has been defined as a binder.
Expr lambda = d_state.getVar("lambda");
if (lambda.isNull())
{
d_lex.parseError("Expected symbol 'lambda' to be defined when parsing define-fun.");
}
Expr bvl = d_state.mkBinderList(lambda.getValue(), vars);
rhs = d_state.mkExpr(Kind::APPLY, {lambda, bvl, rhs});
std::vector<Expr> types;
Expand Down

0 comments on commit a5c93b3

Please sign in to comment.