1 /********************* */
2 /*! \file type_checker_template.cpp
4 ** Original author: Morgan Deters
5 ** Major contributors: none
6 ** Minor contributors (to current version): lianah
7 ** This file is part of the CVC4 project.
8 ** Copyright (c) 2009-2013 New York University and The University of Iowa
9 ** See the file COPYING in the top-level source directory for licensing
10 ** information.\endverbatim
12 ** \brief TypeChecker implementation
14 ** TypeChecker implementation.
17 #line 18 "${template}"
19 #include "expr/type_checker.h"
20 #include "expr/node_manager.h"
21 #include "expr/node_manager_attributes.h"
23 $
{typechecker_includes
}
25 #line 26 "${template}"
30 TypeNode
TypeChecker::computeType(NodeManager
* nodeManager
, TNode n
, bool check
)
31 throw (TypeCheckingExceptionPrivate
, AssertionException
) {
38 typeNode
= nodeManager
->getAttribute(n
, TypeAttr());
41 typeNode
= nodeManager
->builtinOperatorType();
46 #line 47 "${template}"
49 Debug("getType") << "FAILURE" << std::endl
;
50 Unhandled(n
.getKind());
53 nodeManager
->setAttribute(n
, TypeAttr(), typeNode
);
54 nodeManager
->setAttribute(n
, TypeCheckedAttr(),
55 check
|| nodeManager
->getAttribute(n
, TypeCheckedAttr()));
59 }/* TypeChecker::computeType */
61 bool TypeChecker::computeIsConst(NodeManager
* nodeManager
, TNode n
)
62 throw (AssertionException
) {
64 Assert(n
.getMetaKind() == kind::metakind::OPERATOR
|| n
.getMetaKind() == kind::metakind::PARAMETERIZED
);
69 #line 70 "${template}"
76 }/* TypeChecker::computeIsConst */
78 bool TypeChecker::neverIsConst(NodeManager
* nodeManager
, TNode n
)
79 throw (AssertionException
) {
81 Assert(n
.getMetaKind() == kind::metakind::OPERATOR
|| n
.getMetaKind() == kind::metakind::PARAMETERIZED
);
86 #line 90 "${template}"
93 }/* TypeChecker::neverIsConst */
95 }/* CVC4::expr namespace */