summaryrefslogtreecommitdiff
path: root/src/parser
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2010-06-30 11:12:14 +0000
committerMorgan Deters <mdeters@gmail.com>2010-06-30 11:12:14 +0000
commit4375b60d5df794b2c6193f3892185ea181a0748d (patch)
treed346f9dc6bde42c3def6e0aac3b2711418e3d491 /src/parser
parent4206a75e7a1635d04bb69084404a75670e164b62 (diff)
* theory "tree" rewriting implemented and works
* added TheoryArith::preRewrite() to test and demonstrate the use of pre-rewriting. * array types and type checking now supported * array type checking now supported * theoryOf() dispatching properly to arrays now * theories now required to implement a (simple) identify() function that returns a string identifying them for debugging/user output purposes * added "builtin" theory to hold all built-in kinds and their type rules and rewriting (currently only exploding distinct) * fixed production build failure (regarding NodeSetDepth) * removed an errant "using namespace std" in util/bitvector.h (and made associated trivial fixes elsewhere) * fixes to make unexpected exceptions more verbose in debug builds * fixes to make multiple, cascading assertion fails simpler * minor other fixes to comments etc.
Diffstat (limited to 'src/parser')
-rw-r--r--src/parser/antlr_input.h2
-rw-r--r--src/parser/smt/Smt.g9
-rw-r--r--src/parser/smt2/Smt2.g4
3 files changed, 8 insertions, 7 deletions
diff --git a/src/parser/antlr_input.h b/src/parser/antlr_input.h
index d2d885ce0..ca9b2b747 100644
--- a/src/parser/antlr_input.h
+++ b/src/parser/antlr_input.h
@@ -223,7 +223,7 @@ inline std::string AntlrInput::tokenTextSubstr(pANTLR3_COMMON_TOKEN token,
ANTLR3_MARKER end = token->getStopIndex(token);
Assert( start < end );
if( index > (size_t) end - start ) {
- stringstream ss;
+ std::stringstream ss;
ss << "Out-of-bounds substring index: " << index;
throw std::invalid_argument(ss.str());
}
diff --git a/src/parser/smt/Smt.g b/src/parser/smt/Smt.g
index 575f691a5..e0b144513 100644
--- a/src/parser/smt/Smt.g
+++ b/src/parser/smt/Smt.g
@@ -129,7 +129,7 @@ benchAttributes returns [CVC4::CommandSequence* cmd_seq]
;
/**
- * Matches a benchmark attribute, sucha as ':logic', ':formula', and returns
+ * Matches a benchmark attribute, such as ':logic', ':formula', and returns
* a corresponding command
* @return a command corresponding to the attribute
*/
@@ -261,7 +261,7 @@ builtinOp[CVC4::Kind& kind]
| IFF_TOK { $kind = CVC4::kind::IFF; }
| EQUAL_TOK { $kind = CVC4::kind::EQUAL; }
| DISTINCT_TOK { $kind = CVC4::kind::DISTINCT; }
- // Arithmetic
+ // Arithmetic
| GREATER_THAN_TOK
{ $kind = CVC4::kind::GT; }
| GREATER_THAN_TOK EQUAL_TOK
@@ -305,9 +305,10 @@ builtinOp[CVC4::Kind& kind]
| BVSLE_TOK { $kind = CVC4::kind::BITVECTOR_SLE; }
| BVSGT_TOK { $kind = CVC4::kind::BITVECTOR_SGT; }
| BVSGE_TOK { $kind = CVC4::kind::BITVECTOR_SGE; }
- // NOTE: Theory operators go here
+ // arrays
| SELECT_TOK { $kind = CVC4::kind::SELECT; }
| STORE_TOK { $kind = CVC4::kind::STORE; }
+ // NOTE: Theory operators go here
;
/**
@@ -437,7 +438,7 @@ sortSymbol returns [CVC4::Type t]
: sortName[name,CHECK_NONE]
{ $t = PARSER_STATE->getSort(name); }
| BITVECTOR_TOK '[' NUMERAL_TOK ']' {
- $t = EXPR_MANAGER->bitVectorType(AntlrInput::tokenToUnsigned($NUMERAL_TOK));
+ $t = EXPR_MANAGER->mkBitVectorType(AntlrInput::tokenToUnsigned($NUMERAL_TOK));
}
;
diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g
index 0abc4c4c6..69b2eba76 100644
--- a/src/parser/smt2/Smt2.g
+++ b/src/parser/smt2/Smt2.g
@@ -314,7 +314,7 @@ builtinOp[CVC4::Kind& kind]
| MINUS_TOK { $kind = CVC4::kind::MINUS; }
| SELECT_TOK { $kind = CVC4::kind::SELECT; }
| STORE_TOK { $kind = CVC4::kind::STORE; }
- // NOTE: Theory operators go here
+ // NOTE: Theory operators go here
;
/**
@@ -482,7 +482,7 @@ fragment NUMERAL
<< " strict? " << (bool)(PARSER_STATE->strictModeEnabled())
<< " ^0? " << (bool)(*start == '0')
<< " len>1? " << (bool)(start < (char*)(GETCHARINDEX() - 1))
- << endl; }
+ << std::endl; }
{ !PARSER_STATE->strictModeEnabled() ||
*start != '0' ||
start == (char*)(GETCHARINDEX() - 1) }?
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback