Class CLaw
- java.lang.Object
-
- org.tweetyproject.action.description.syntax.CLaw
-
- Direct Known Subclasses:
DynamicLaw,StaticLaw
public abstract class CLaw extends java.lang.Object implements CausalLaw
The action description language C consists of two distinct expressions: static laws and dynamic laws. Both share some common functionalities which are implemented in this base class.- Author:
- Sebastian Homann
-
-
Constructor Summary
Constructors Constructor Description CLaw()Creates an empty causal law.CLaw(FolFormula headFormula)Creates a causal law of the form "caused headFormula if True"CLaw(FolFormula headFormula, java.util.Set<GroundingRequirement> requirements)Creates a causal law of the form "caused headFormula if True requires requirements"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"
-
Method Summary
Modifier and Type Method Description voidaddGroundingRequirement(GroundingRequirement c)abstract java.util.Set<CLaw>getAllGrounded()abstract java.util.Set<FolAtom>getAtoms()abstract java.util.Set<FolFormula>getFormulas()Returns the set of formulas contained in this causal law, e.g.FolFormulagetHeadFormula()FolFormulagetIfFormula()abstract SignaturegetSignature()Returns the signature of the language of this formula.abstract booleanisDefinite()Returns true iff this law is definite.booleanisGround()abstract java.util.Set<CLaw>toDefinite()Returns an equivalent definite causal law.
-
-
-
Constructor Detail
-
CLaw
public CLaw()
Creates an empty causal law.
-
CLaw
public CLaw(FolFormula headFormula)
Creates a causal law of the form "caused headFormula if True"- Parameters:
headFormula- some FOL formula
-
CLaw
public CLaw(FolFormula headFormula, java.util.Set<GroundingRequirement> requirements)
Creates a causal law of the form "caused headFormula if True requires requirements"- Parameters:
headFormula- some FOL formularequirements- a set of requirements
-
CLaw
public CLaw(FolFormula headFormula, FolFormula ifFormula, java.util.Set<GroundingRequirement> requirements)
Creates a causal law of the form "caused headFormula if ifFormula requires requirements"- Parameters:
headFormula- some FOL formulaifFormula- some FOL formularequirements- a set of requirements
-
CLaw
public CLaw(FolFormula headFormula, FolFormula ifFormula)
Creates a causal law of the form "caused headFormula if ifFormula"- Parameters:
headFormula- some FOL formulaifFormula- some FOL formula
-
-
Method Detail
-
getSignature
public abstract Signature getSignature()
Description copied from interface:FormulaReturns the signature of the language of this formula.- Specified by:
getSignaturein interfaceFormula- Returns:
- the signature of the language of this formula.
-
isDefinite
public abstract boolean isDefinite()
Returns true iff this law is definite. A causal law is definite if it's head is a literal or a contradiction and all formulas are conjunctions of literals.- Returns:
- true, if this law is definite, false otherwise.
-
toDefinite
public abstract java.util.Set<CLaw> toDefinite() throws java.lang.IllegalStateException
Returns an equivalent definite causal law. A causal law is definite if it's head is a literal or a contradiction and all formulas are conjunctions of literals.- Returns:
- the equivalent definite causal law if one exists.
- Throws:
java.lang.IllegalStateException- when there is no equivalent definite causal law.
-
getAtoms
public abstract java.util.Set<FolAtom> getAtoms()
- Returns:
- the set of propositions in all formulas in this law.
-
getFormulas
public abstract java.util.Set<FolFormula> getFormulas()
Returns the set of formulas contained in this causal law, e.g. in a static law, this contains the head formula and the if formula.- Returns:
- the set of formulas contained in this causal law.
-
addGroundingRequirement
public void addGroundingRequirement(GroundingRequirement c)
-
getHeadFormula
public FolFormula getHeadFormula()
- Returns:
- the headFormula of this causal law.
-
getIfFormula
public FolFormula getIfFormula()
- Returns:
- the ifFormula of this causal law.
-
isGround
public boolean isGround()
-
getAllGrounded
public abstract java.util.Set<CLaw> getAllGrounded()
- Returns:
- the set of all grounded instances of this causal law.
-
-