From eab7fae2c02ce635500dbe7c743a5c0d7f39137d Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Tue, 22 May 2018 18:12:54 -0500 Subject: [PATCH] Parse error for sygus grammar term with multiple let bodies (#1961) --- src/parser/smt2/smt2.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/parser/smt2/smt2.cpp b/src/parser/smt2/smt2.cpp index 133cc12c1..e0769f88a 100644 --- a/src/parser/smt2/smt2.cpp +++ b/src/parser/smt2/smt2.cpp @@ -930,7 +930,16 @@ void Smt2::processSygusLetConstructor( std::vector< CVC4::Expr >& let_vars, cargs[index][dindex].pop_back(); collectSygusLetArgs( let_body, cargs[index][dindex], let_define_args ); - Debug("parser-sygus") << "Make define-fun with " << cargs[index][dindex].size() << " arguments..." << std::endl; + Debug("parser-sygus") << "Make define-fun with " + << cargs[index][dindex].size() + << " operator arguments and " << let_define_args.size() + << " provided arguments..." << std::endl; + if (cargs[index][dindex].size() != let_define_args.size()) + { + std::stringstream ss; + ss << "Wrong number of let body terms." << std::endl; + parseError(ss.str()); + } std::vector fsorts; for( unsigned i=0; i