public class ArrayEqualityCaseAnalysis extends AbstractProofRule implements Proof.LinearRule
Handle (non-)equality between expressions of array type. There are six main cases to consider:
Initialiser-Initialiser (Non-)Equality. For a case of the form
[e1,e2,...] == [e'1,e'2,...] we produce false (if
the number of elements differs) or a conjunction of the form
(e1 == e'1) && (e2 == e'2) && .... Similarly for the
non-equality case, either true (if number of elements differs)
or a disjunction is produced.
Initialiser-Generator (Non-)Equality. For a case of the form
[e1,e2,...] == [e'val; e'len] we produce n == e'len
and a conjunction of the form
(e1 == e'val) && (e2 == e'val) && .... Similarly for the
non-equality case, we produce n != e'len disjuncted against a
disjunction of the form (e1 != e'val) || (e2 != e'val) || ....
Generator-Generator (Non-)Equality. For a case of the form
[e1'val; e1'len] == [e2'val; e2'len] we produce
(e1'len == e2'len) && (e1'val == e2'val). Similarly for the
non-equality case, we produce
(e1'len != e2'len) || (e1'val != e2'val).
Initialiser Non-Equality. For a case of the form
[e1,e2,...] != e we produce
(n != |e|) || (e1 != e[0]) || (e2 != e[1]) || .... This is a
case analysis only because we have a finite number of elements from the
intialiser.
General Non-Equality. For an equalty of the form e1 != e2
of array type we produce
(|e1| != |e2|) || some i.(e1[i] != e2[i]).
simp, types| Constructor and Description |
|---|
ArrayEqualityCaseAnalysis(Simplification simplify,
TypeSystem types) |
| Modifier and Type | Method and Description |
|---|---|
Proof.State |
apply(Proof.State state,
Formula truth) |
String |
getName()
Get the name of this rule
|
apply, extractDefinedTerms, findAllInstances, substituteclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplypublic ArrayEqualityCaseAnalysis(Simplification simplify, TypeSystem types)
public String getName()
Proof.RulegetName in interface Proof.Rulepublic Proof.State apply(Proof.State state, Formula truth) throws wybs.lang.NameResolver.ResolutionError
apply in class AbstractProofRulewybs.lang.NameResolver.ResolutionErrorCopyright © 2017. All rights reserved.