summaryrefslogtreecommitdiff
path: root/src/theory
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@cs.nyu.edu>2014-06-20 22:25:21 -0400
committerMorgan Deters <mdeters@cs.nyu.edu>2014-06-20 22:25:21 -0400
commitf37411e40673b07e8fe7d20ed9b6c5be98f3b8ae (patch)
treea5c623b21066a1f7289e85fc4ef02637afd09688 /src/theory
parent33324a13308886291d802d69a23993226d557d1a (diff)
Implement RecordProperties::mkGroundTerm(). Resolves bug #546.
Diffstat (limited to 'src/theory')
-rw-r--r--src/theory/datatypes/theory_datatypes_type_rules.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/theory/datatypes/theory_datatypes_type_rules.h b/src/theory/datatypes/theory_datatypes_type_rules.h
index 09d43b3bc..4d0acccc8 100644
--- a/src/theory/datatypes/theory_datatypes_type_rules.h
+++ b/src/theory/datatypes/theory_datatypes_type_rules.h
@@ -477,7 +477,18 @@ struct RecordUpdateTypeRule {
struct RecordProperties {
inline static Node mkGroundTerm(TypeNode type) {
- Unimplemented();
+ Assert(type.getKind() == kind::RECORD_TYPE);
+
+ const Record& rec = type.getRecord();
+ std::vector<Node> children;
+ for(Record::iterator i = rec.begin(),
+ i_end = rec.end();
+ i != i_end;
+ ++i) {
+ children.push_back((*i).second.mkGroundTerm());
+ }
+
+ return NodeManager::currentNM()->mkNode(NodeManager::currentNM()->mkConst(rec), children);
}
inline static bool computeIsConst(NodeManager* nodeManager, TNode n) {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback