diff options
author | Morgan Deters <mdeters@gmail.com> | 2010-04-01 05:54:26 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@gmail.com> | 2010-04-01 05:54:26 +0000 |
commit | a2e17e436cae22997c762a424cf2cddcbab317ac (patch) | |
tree | 635a072109f0c2a6b10260cba87fe5e10fab333e /src/expr/node_manager.h | |
parent | 5f92777db6265321759f463e6c703111cdfc9a80 (diff) |
PARSER STUFF:
* Other minor changes to the new parser to match coding guidelines,
add documentation, ....
* Add CFLAGS stuff to configure.ac parser Makefile.ams. This ensures
that profiling, coverage, optimization, debugging, and warning
level options will apply to the new parser as well (which is in C,
not C++). This fixes the deprecated warning we were seeing this
evening.
* Now, if you have ANTLR_HOME set in your environment, you don't need
to specify --with-antlr-dir to ./configure or have libantlr3c
installed in standard places. --with-antlr-dir still overrides
$ANTLR_HOME, and if the installation in $ANTLR_HOME is missing or
doesn't work, the standard places are still tried.
* Extend "silent make" to new parser stuff.
* Added src/parser/bounded_token_buffer.{h,cpp} to the list of
exclusions in contrib/update-copyright.pl and mention them as
excluded from CVC4 copyright in COPYING. They are antlr3-derived
works, covered under a BSD license.
OTHER STUFF:
* expr_manager.h, expr.h, expr_manager.cpp, and expr.cpp are now
auto-generated by a "mkexpr" script. This provides the correct
instantiations of mkConst() for public use, e.g., by the parser.
* Fix doxygen documentation in expr, expr_manager.. closes bug #35
* Node::isAtomic() implemented in a better way, based on theory kinds
files. Fixes bug #40. To support this, a "nonatomic_operator"
command has been added. All other "parameterized" or "operator"
kinds are atomic.
* Added expr_black test
* Remove kind::TRUE and kind::FALSE and make a new CONST_BOOLEAN kind
that takes a "bool" payload; for example, to make "true" you now do
nodeManager->mkConst(true).
* Make new "cvc4_public.h" and "cvc4parser_public.h" headers. Private
headers should include "cvc4_private.h"
(resp. "cvc4parser_private.h"), which existed previously. Public
headers should include the others. **No one** should include the
autoheader #include (which has been renamed "cvc4autoconfig.h")
directly, and public CVC4 headers can't access its #defines. This
is to avoid us having the same distribution problem as libantlr3c.
* Preliminary fixes based on Tim's code review of attributes (bug #61).
This includes splitting hairy template internals into
attribute_internals.h, for which another code review ticket will be
opened. Bug is still outstanding, but pending further
refactoring/documentation.
* Some *HashFcns renamed to *HashStrategy to match refactoring done
elsewhere (done by Chris?) earlier this week.
* Simplified creation of make rules for generated files (expr.cpp,
expr.h, expr_manager.cpp, expr_manager.h, theoryof_table.h, kind.h,
metakind.h).
* CVC4::Configuration interface and implementation split (so private
stuff doesn't leak into public headers).
* Some documentation/code formatting fixes.
* Add required versions of autotools to autogen.sh.
* src/expr/mkmetakind: fix a nonportable thing in invocation of "expr"
that was causing warnings on Red Hat.
* src/context/cdmap.h: add workaround to what appears to be a g++ 4.1
parsing bug.
Diffstat (limited to 'src/expr/node_manager.h')
-rw-r--r-- | src/expr/node_manager.h | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/src/expr/node_manager.h b/src/expr/node_manager.h index f2718a06c..d17ec9497 100644 --- a/src/expr/node_manager.h +++ b/src/expr/node_manager.h @@ -293,24 +293,28 @@ public: /** Make a function type from domain to range. */ inline FunctionType* mkFunctionType(Type* domain, Type* range) const; - /** Make a function type with input types from argTypes. <code>argTypes</code> - * must have at least one element. */ + /** + * Make a function type with input types from + * argTypes. <code>argTypes</code> must have at least one element. + */ inline FunctionType* mkFunctionType(const std::vector<Type*>& argTypes, Type* range) const; - /** Make a function type with input types from <code>sorts[0..sorts.size()-2]</code> - * and result type <code>sorts[sorts.size()-1]</code>. <code>sorts</code> must have at - * least 2 elements. + /** + * Make a function type with input types from + * <code>sorts[0..sorts.size()-2]</code> and result type + * <code>sorts[sorts.size()-1]</code>. <code>sorts</code> must have + * at least 2 elements. */ - inline FunctionType* - mkFunctionType(const std::vector<Type*>& sorts); + inline FunctionType* mkFunctionType(const std::vector<Type*>& sorts) const; - /** Make a predicate type with input types from <code>sorts</code>. The result with - * be a function type with range <code>BOOLEAN</code>. <code>sorts</code> must have at - * least one element. + /** + * Make a predicate type with input types from + * <code>sorts</code>. The result with be a function type with range + * <code>BOOLEAN</code>. <code>sorts</code> must have at least one + * element. */ - inline FunctionType* - mkPredicateType(const std::vector<Type*>& sorts); + inline FunctionType* mkPredicateType(const std::vector<Type*>& sorts) const; /** Make a new sort with the given name. */ inline Type* mkSort(const std::string& name) const; @@ -453,7 +457,7 @@ NodeManager::mkFunctionType(const std::vector<Type*>& argTypes, } inline FunctionType* -NodeManager::mkFunctionType(const std::vector<Type*>& sorts) { +NodeManager::mkFunctionType(const std::vector<Type*>& sorts) const { Assert( sorts.size() >= 2 ); std::vector<Type*> argTypes(sorts); Type* rangeType = argTypes.back(); @@ -462,10 +466,11 @@ NodeManager::mkFunctionType(const std::vector<Type*>& sorts) { } inline FunctionType* -NodeManager::mkPredicateType(const std::vector<Type*>& sorts) { +NodeManager::mkPredicateType(const std::vector<Type*>& sorts) const { Assert( sorts.size() >= 1 ); return mkFunctionType(sorts,booleanType()); } + inline Type* NodeManager::mkSort(const std::string& name) const { return new SortType(name); } @@ -577,23 +582,6 @@ template <class T> Node NodeManager::mkConst(const T& val) { // typedef typename kind::metakind::constantMap<T>::OwningTheory theory_t; - // - // TODO: construct a special NodeValue that points to this T but - // is == an inlined version (like exists in the hash_set). - // - // Something similar for (a, b) and (a, b, c) and (a, b, c, d) - // versions. - // - // ALSO TODO: make poolLookup() use hash_set<>::operator[] to auto-insert, - // and then set = value after to avoid double-hashing. fix in all places - // where poolLookup is called. - // - // THEN ALSO TODO: CDMap<> destruction in attribute.cpp to make valgrind - // happy - // - // THEN: reconsider CVC3 tracing mechanism, experiments.. - // - NVStorage<1> nvStorage; expr::NodeValue& nvStack = reinterpret_cast<expr::NodeValue&>(nvStorage); |