diff options
author | Christopher L. Conway <christopherleeconway@gmail.com> | 2010-05-12 20:29:17 +0000 |
---|---|---|
committer | Christopher L. Conway <christopherleeconway@gmail.com> | 2010-05-12 20:29:17 +0000 |
commit | 8d691eac8e478576ebceb6406a8e372db5e3f7f1 (patch) | |
tree | cd808cd26804490fd5a2e938bf24fdec85918004 /test | |
parent | 05d29aa0de4c2d4d773a81375fb14584221595ea (diff) |
true and false are only defined if the core theory is loaded in SMT v2 strict mode
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/parser/parser_black.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/unit/parser/parser_black.h b/test/unit/parser/parser_black.h index e7df27083..49ff24863 100644 --- a/test/unit/parser/parser_black.h +++ b/test/unit/parser/parser_black.h @@ -82,11 +82,11 @@ protected: } } - void tryBadInput(const string badInput) { + void tryBadInput(const string badInput, bool strictMode = false) { // cerr << "Testing bad input: '" << badInput << "'\n"; // Debug.on("parser"); Input* input = Input::newStringInput(d_lang, badInput, "test"); - Parser parser(d_exprManager, input); + Parser parser(d_exprManager, input, strictMode); TS_ASSERT_THROWS ( while(parser.nextCommand()); cout << "\nBad input succeeded:\n" << badInput << endl;, @@ -134,10 +134,7 @@ protected: // Debug.on("parser-extra"); // cout << "Testing bad expr: '" << badExpr << "'\n"; Input* input = Input::newStringInput(d_lang, badExpr, "test"); - Parser parser(d_exprManager, input); - if( strictMode ) { - parser.enableStrictMode(); - } + Parser parser(d_exprManager, input, strictMode); setupContext(parser); TS_ASSERT( !parser.done() ); TS_ASSERT_THROWS @@ -278,10 +275,10 @@ public: tryGoodInput(""); // empty string is OK tryGoodInput("(set-logic QF_UF)"); tryGoodInput("(set-info :notes |This is a note, take note!|)"); - tryGoodInput("(set-logic QF_UF)(assert true)"); + tryGoodInput("(set-logic QF_UF) (assert true)"); tryGoodInput("(check-sat)"); tryGoodInput("(exit)"); - tryGoodInput("(assert false) (check-sat)"); + tryGoodInput("(set-logic QF_UF) (assert false) (check-sat)"); tryGoodInput("(set-logic QF_UF) (declare-fun a () Bool) " "(declare-fun b () Bool)"); tryGoodInput("(set-logic QF_UF) (declare-fun a () Bool) " @@ -299,10 +296,13 @@ public: void testBadSmt2Inputs() { tryBadInput("(assert)"); // no args tryBadInput("(set-info :notes |Symbols can't contain the | character|)"); - tryBadInput("(check-sat true)"); // shouldn't have an arg + tryBadInput("(set-logic QF_UF) (check-sat true)"); // shouldn't have an arg tryBadInput("(declare-sort a)"); // no arg tryBadInput("(declare-sort a 0) (declare-sort a 0)"); // double decl - tryBadInput("(declare-fun p Bool)"); // should be "p () Bool" + tryBadInput("(set-logic QF_UF) (declare-fun p Bool)"); // should be "p () Bool" + // strict mode + tryBadInput("(assert true)", true); // no set-logic, core theory symbol "true" undefined + tryBadInput("(declare-fun p Bool)", true); // core theory symbol "Bool" undefined } void testGoodSmt2Exprs() { |