public class MacroExpansion extends AbstractProofRule implements Proof.LinearRule
Responsible for inlining macro invocations from their definitions. For example, consider this assertion:
define nat(int n) is:
n >= 0
assert:
forall(int x):
if:
x > 0
then:
nat(x)
In proving this assertion, we will at some point come to the macro invocation
nat(x) or its inversion !nat(x). To deal
with this, we simply replace nat(x) by its body where the
parameters are substituted for their arguments. That is, we replace
nat(x) by n >= 0 and substitute n for
the argument x.
NOTE: A pretty obvious concern with this rule is how to deal with recursive macro definitions. This has not been tried and tested at this stage!
simp, types| Constructor and Description |
|---|
MacroExpansion(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 MacroExpansion(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.