|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectblog.ArgSpec
blog.Formula
blog.ImplicFormula
public class ImplicFormula
An implication formula alpha -> beta. It is true if alpha is false or beta is true.
| Field Summary |
|---|
| Fields inherited from class blog.Formula |
|---|
ALL_OBJECTS, NOT_EXPLICIT |
| Fields inherited from class blog.ArgSpec |
|---|
location |
| Constructor Summary | |
|---|---|
ImplicFormula(Formula antecedent,
Formula consequent)
Creates a new ImplicFormula of the form antecedent -> consequent. |
|
| Method Summary | |
|---|---|
boolean |
checkTypesAndScope(Model model,
java.util.Map scope)
Returns true if, within the given scope, all the variables used in this ArgSpec are in scope and all type constraints are satisfied. |
boolean |
equals(java.lang.Object o)
|
java.lang.Object |
evaluate(EvalContext context)
Returns the value of this argument specification in the given context. |
Formula |
getAntecedent()
Returns the antecedent (lefthand side) of this formula. |
Formula |
getConsequent()
Returns the consequent (righthand side) of this formula. |
protected Formula |
getEquivToNegationInternal()
The formula equivalent to the negation of phi -> psi is phi & !psi. |
java.util.Set |
getNonSatisfiersIfExplicit(EvalContext context,
LogicalVar subject,
GenericObject genericObj)
Returns the set of values for the logical variable subject that are consistent with the generating
function values of genericObj and that make this
formula false in the given context, if this set can be
determined without enumerating possible values for
subject. |
ConjFormula |
getPropCNF()
The CNF form of an implication phi -> psi is the CNF form of the equivalent formula !phi | psi. |
DisjFormula |
getPropDNF()
The DNF form of an implication phi -> psi is the DNF form of the equivalent formula !phi | psi. |
java.util.Set |
getSatisfiersIfExplicit(EvalContext context,
LogicalVar subject,
GenericObject genericObj)
Returns the set of values for the logical variable subject that are consistent with the generating
function values of genericObj and that make this
formula true in the given context, if this set can be
determined without enumerating possible values for
subject. |
Formula |
getStandardForm()
The standard form of an implication formula phi -> psi is the standard form of the equivalent formula !phi | psi. |
java.util.List |
getSubFormulas()
|
ArgSpec |
getSubstResult(Substitution subst,
java.util.Set<LogicalVar> boundVars)
Returns the result of applying the substitution subst to this expression, excluding the logical
variables in boundVars. |
int |
hashCode()
|
java.lang.String |
toString()
|
| Methods inherited from class blog.Formula |
|---|
compile, containsAnyTerm, containsRandomSymbol, containsTerm, getEquivToNegation, getGenFuncsApplied, getSubExprs, getSubformulas, getTopLevelTerms, isElementary, isLiteral, isQuantified, isTrue |
| Methods inherited from class blog.ArgSpec |
|---|
evaluate, evaluate, getFreeVars, getLocation, getSubstResult, getValueIfNonRandom, getVariable, isDetermined, isNumeric, setLocation |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ImplicFormula(Formula antecedent,
Formula consequent)
| Method Detail |
|---|
public Formula getAntecedent()
public Formula getConsequent()
public java.lang.Object evaluate(EvalContext context)
ArgSpec
evaluate in class ArgSpecpublic Formula getStandardForm()
getStandardForm in class Formulaprotected Formula getEquivToNegationInternal()
getEquivToNegationInternal in class Formulapublic java.util.List getSubFormulas()
public ConjFormula getPropCNF()
getPropCNF in class Formulapublic DisjFormula getPropDNF()
getPropDNF in class Formula
public java.util.Set getSatisfiersIfExplicit(EvalContext context,
LogicalVar subject,
GenericObject genericObj)
Formulasubject that are consistent with the generating
function values of genericObj and that make this
formula true in the given context, if this set can be
determined without enumerating possible values for
subject. Returns the special value
Formula.NOT_EXPLICIT if determining the desired set would
requiring enumerating possible values for subject.
Also, returns the special value Formula.ALL_OBJECTS if this
formula is true in the given context for all objects consistent
with genericObj. Finally, returns null if it
tries to access an uninstantiated random variable.
getSatisfiersIfExplicit in class Formulacontext - an evaluation context that does not assign a
value to the logical variable subjectsubject - a logical variablegenericObj - a GenericObject instance, which can stand for
any object of a given type or include values
for certain generating functions
public java.util.Set getNonSatisfiersIfExplicit(EvalContext context,
LogicalVar subject,
GenericObject genericObj)
Formulasubject that are consistent with the generating
function values of genericObj and that make this
formula false in the given context, if this set can be
determined without enumerating possible values for
subject. Returns the special value
Formula.NOT_EXPLICIT if determining the desired set would
requiring enumerating possible values for subject.
Also, returns the special value Formula.ALL_OBJECTS if this
formula is false in the given context for all objects
consistent with genericObj. Finally, returns null
if it tries to access an uninstantiated random variable.
This default implementation calls
getEquivToNegation, then calls
getSatisfiersIfExplicit on the resulting formula.
Warning: subclasses must override either this method or
getEquivToNegationInternal to avoid an
UnsupportedOperationException.
getNonSatisfiersIfExplicit in class Formulacontext - an evaluation context that does not assign a
value to the logical variable subjectsubject - a logical variablegenericObj - a GenericObject instance, which can stand for
any object of a given type or include values
for certain generating functionspublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
public boolean checkTypesAndScope(Model model,
java.util.Map scope)
ArgSpec
checkTypesAndScope in class ArgSpecscope - a Map from variable names (Strings) to LogicalVar objects
public ArgSpec getSubstResult(Substitution subst,
java.util.Set<LogicalVar> boundVars)
ArgSpecsubst to this expression, excluding the logical
variables in boundVars. This method is used for
recursive calls. The set boundVars should contain
those variables that are bound in the syntax tree between this
sub-expression and the top-level expression to which the
substitution is being applied.
getSubstResult in class ArgSpec
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||