public class ExistentialElimination extends AbstractProofRule implements Proof.LinearRule
Responsible for eliminating an existential quantifier through
skolemisation. For example, if we encounter
exists(int i).(i >= 0) then we replace this with the ground term
i >= 0, where i is now a skolem (that is, an
unknown constant).
NOTE: This rule current exploits the underlying structure of a syntactic heap for ensuring that a given variable remains a skolem. This is problematic in the case of existentials nested within universal quantifiers and could be improved somewhat.
simp, types| Constructor and Description |
|---|
ExistentialElimination(Simplification simplify,
TypeSystem types) |
| Modifier and Type | Method and Description |
|---|---|
Proof.State |
apply(Proof.State head,
Formula truth) |
protected Formula |
expandTypeInvariants(wybs.util.AbstractCompilationUnit.Tuple<WyalFile.VariableDeclaration> declarations,
TypeSystem types)
For a given sequence of variable declarations expand their type
invariants as appropriate.
|
String |
getName()
Get the name of this rule
|
apply, extractDefinedTerms, findAllInstances, substituteclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplypublic ExistentialElimination(Simplification simplify, TypeSystem types)
public String getName()
Proof.RulegetName in interface Proof.Rulepublic Proof.State apply(Proof.State head, Formula truth) throws wybs.lang.NameResolver.ResolutionError
apply in class AbstractProofRulewybs.lang.NameResolver.ResolutionErrorprotected Formula expandTypeInvariants(wybs.util.AbstractCompilationUnit.Tuple<WyalFile.VariableDeclaration> declarations, TypeSystem types) throws wybs.lang.NameResolver.ResolutionError
type nat is (int x) where x >= 0
assert:
forall(nat x):
x >= 0
The type invariant given for x in the quantifier will be
expanded, to give then body nat(x) ==> x >= 0. The call
nat(x) will later be expanded during theorem proving to
x >= 0. The reason this is done lazily is to properly
support recursive types and their invariants.declarations - types - wybs.lang.NameResolver.ResolutionErrorCopyright © 2017. All rights reserved.