public abstract class CLaw extends java.lang.Object implements CausalLaw
Modifier and Type | Field and Description |
---|---|
protected FolFormula |
headFormula |
protected FolFormula |
ifFormula |
protected java.util.Set<GroundingRequirement> |
requirements |
Constructor and Description |
---|
CLaw()
Creates an empty causal law.
|
CLaw(FolFormula headFormula)
Creates a causal law of the form caused headFormula if True
|
CLaw(FolFormula headFormula,
FolFormula ifFormula)
Creates a causal law of the form caused headFormula if ifFormula
|
CLaw(FolFormula headFormula,
FolFormula ifFormula,
java.util.Set<GroundingRequirement> requirements)
Creates a causal law of the form caused headFormula if ifFormula requires
requirements
|
CLaw(FolFormula headFormula,
java.util.Set<GroundingRequirement> requirements)
Creates a causal law of the form caused headFormula if True requires
requirements
|
Modifier and Type | Method and Description |
---|---|
void |
addGroundingRequirement(GroundingRequirement c) |
abstract java.util.Set<CLaw> |
getAllGrounded()
Returns the set of all grounded instances of this causal law.
|
abstract java.util.Set<FOLAtom> |
getAtoms()
Returns the set of propositions in all formulas in this law.
|
abstract java.util.Set<FolFormula> |
getFormulas()
Returns the set of formulas contained in this causal law, e.g.
|
FolFormula |
getHeadFormula()
Returns the headFormula of this causal law.
|
FolFormula |
getIfFormula()
Returns the ifFormula of this causal law.
|
abstract Signature |
getSignature()
Returns the signature of the language of this formula.
|
protected boolean |
isConjunctiveClause(FolFormula pl)
a conjunctive clause is either a literal or a conjunction of literals.
|
abstract boolean |
isDefinite()
Returns true iff this law is definite.
|
boolean |
isGround() |
protected boolean |
isValidDefiniteHead(RelationalFormula pl)
Checks if a propositional formula is a valid head formula for a definite
causal law, which means either a contradiction, a fluent or the negation
of a fluent.
|
private void |
setGroundingRequirements(java.util.Set<GroundingRequirement> requirements) |
private void |
setHeadFormula(FolFormula headFormula)
Sets the headFormula of this causal law
|
private void |
setIfFormula(FolFormula ifFormula)
Sets the IfFormula of this causal law
|
abstract java.util.Set<CLaw> |
toDefinite()
Returns an equivalent definite causal law.
|
protected FolFormula headFormula
protected FolFormula ifFormula
protected java.util.Set<GroundingRequirement> requirements
public CLaw()
public CLaw(FolFormula headFormula)
headFormula
- public CLaw(FolFormula headFormula, java.util.Set<GroundingRequirement> requirements)
headFormula
- requirements
- public CLaw(FolFormula headFormula, FolFormula ifFormula, java.util.Set<GroundingRequirement> requirements)
headFormula
- public CLaw(FolFormula headFormula, FolFormula ifFormula)
headFormula
- public abstract Signature getSignature()
Formula
getSignature
in interface Formula
public abstract boolean isDefinite()
public abstract java.util.Set<CLaw> toDefinite() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- when there is no equivalent definite causal
law.public abstract java.util.Set<FOLAtom> getAtoms()
public abstract java.util.Set<FolFormula> getFormulas()
private void setGroundingRequirements(java.util.Set<GroundingRequirement> requirements)
private void setHeadFormula(FolFormula headFormula)
headFormula
- The new headFormula of this causal law.private void setIfFormula(FolFormula ifFormula)
IfFormula
- The new IfFormula of this causal law.public void addGroundingRequirement(GroundingRequirement c)
public FolFormula getHeadFormula()
public FolFormula getIfFormula()
public boolean isGround()
public abstract java.util.Set<CLaw> getAllGrounded()
protected boolean isValidDefiniteHead(RelationalFormula pl)
pl
- a propositional formulaprotected boolean isConjunctiveClause(FolFormula pl)
pl
- a propositional formula