public class RecordEqualityCaseAnalysis extends AbstractProofRule implements Proof.LinearRule
Handle (non-)equality between expressions of record type. There are two main cases to consider:
Record Equality. The equality case is relatively straightforward.
Since we can already rely on congruence closure to handle the general case,
we need only consider the specific case of initialiser equality.
Specifically, the case when e.g.
"{f1:e1, f2:e2, ...} == {f1:e'1, f2:e'2, ...}" which reduces to
n assertions of the form "e1 == e'1",
"e2 == e'2", etc. Of course, if the set of fields is not a match
then the equality fails immediately.
Record Non-Equality. This is the more complex case. For a non-equality
of the form "e1 != e2" over a record type
{T1 f, T2 g, ...} we generate an n-clause disjunct of the form
"(e1.f != e'1.f) || (e1.g != e'1.g) || ...". One of the
difficulties here is how to handle the case of an open record.
simp, types| Constructor and Description |
|---|
RecordEqualityCaseAnalysis(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 RecordEqualityCaseAnalysis(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.