summaryrefslogtreecommitdiff
path: root/src/theory/arrays
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2011-04-20 07:57:28 +0000
committerMorgan Deters <mdeters@gmail.com>2011-04-20 07:57:28 +0000
commitce04216289985021ce53588e3040e2ac9d6a2a0d (patch)
treea2106cad04287c5b739df99e209e3a600ebf50c5 /src/theory/arrays
parent12c1e41862e4b12c3953272416a1edc103d299ee (diff)
Minor mixed-bag commit. Expected performance impact negligible.
* Fixed hole in arrays typechecking. * Fixed "make dist". * Better ouroborous test, and some printer fixes. * Continued cleanup in CVC parser, removed some warnings. * Better output.
Diffstat (limited to 'src/theory/arrays')
-rw-r--r--src/theory/arrays/theory_arrays_type_rules.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/theory/arrays/theory_arrays_type_rules.h b/src/theory/arrays/theory_arrays_type_rules.h
index 9f24e9873..11e8a8443 100644
--- a/src/theory/arrays/theory_arrays_type_rules.h
+++ b/src/theory/arrays/theory_arrays_type_rules.h
@@ -5,7 +5,7 @@
** Major contributors: cconway
** Minor contributors (to current version): none
** This file is part of the CVC4 prototype.
- ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys)
+ ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys)
** Courant Institute of Mathematical Sciences
** New York University
** See the file COPYING in the top-level source directory for licensing
@@ -31,6 +31,9 @@ struct ArraySelectTypeRule {
Assert(n.getKind() == kind::SELECT);
TypeNode arrayType = n[0].getType(check);
if( check ) {
+ if(!arrayType.isArray()) {
+ throw TypeCheckingExceptionPrivate(n, "array select operating on non-array");
+ }
TypeNode indexType = n[1].getType(check);
if(arrayType.getArrayIndexType() != indexType) {
throw TypeCheckingExceptionPrivate(n, "array select not indexed with correct type for array");
@@ -46,6 +49,9 @@ struct ArrayStoreTypeRule {
Assert(n.getKind() == kind::STORE);
TypeNode arrayType = n[0].getType(check);
if( check ) {
+ if(!arrayType.isArray()) {
+ throw TypeCheckingExceptionPrivate(n, "array store operating on non-array");
+ }
TypeNode indexType = n[1].getType(check);
TypeNode valueType = n[2].getType(check);
if(arrayType.getArrayIndexType() != indexType) {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback