Class StaticLaw
- java.lang.Object
-
- net.sf.tweety.action.description.syntax.CLaw
-
- net.sf.tweety.action.description.syntax.StaticLaw
-
public class StaticLaw extends CLaw
This class represents a static rule in C, which has the following form: caused H if G where H is a propositional formula over the set of fluents and G is a propositional formula over the set of fluents and the set of actions- Author:
- Sebastian Homann
-
-
Constructor Summary
Constructors Constructor Description StaticLaw()
Creates an empty static law.StaticLaw(FolFormula headFormula)
Creates an empty static law of the form caused headFormula if TrueStaticLaw(FolFormula headFormula, java.util.Set<GroundingRequirement> requirements)
Creates an empty static law of the form caused headFormula if True requires requirementsStaticLaw(FolFormula headFormula, FolFormula ifFormula)
Creates an empty static law of the form caused headFormula if ifFormulaStaticLaw(FolFormula headFormula, FolFormula ifFormula, java.util.Set<GroundingRequirement> requirements)
Creates an empty static law of the form caused headFormula if ifFormula requires requirements
-
Method Summary
Modifier and Type Method Description java.util.Set<CLaw>
getAllGrounded()
Returns the set of all grounded instances of this causal law.java.util.Set<FolAtom>
getAtoms()
Returns the set of propositions in all formulas in this law.java.util.Set<FolFormula>
getFormulas()
Returns the set of formulas contained in this causal law, e.g.Signature
getSignature()
Returns the signature of the language of this formula.boolean
isDefinite()
Returns true iff this law is definite.java.util.Set<CLaw>
toDefinite()
Returns an equivalent definite causal law.java.lang.String
toString()
-
Methods inherited from class net.sf.tweety.action.description.syntax.CLaw
addGroundingRequirement, getHeadFormula, getIfFormula, isGround
-
-
-
-
Constructor Detail
-
StaticLaw
public StaticLaw()
Creates an empty static law.
-
StaticLaw
public StaticLaw(FolFormula headFormula)
Creates an empty static law of the form caused headFormula if True- Parameters:
headFormula
- some FOL formula
-
StaticLaw
public StaticLaw(FolFormula headFormula, java.util.Set<GroundingRequirement> requirements)
Creates an empty static law of the form caused headFormula if True requires requirements- Parameters:
headFormula
- some FOL formularequirements
- a set of requirements
-
StaticLaw
public StaticLaw(FolFormula headFormula, FolFormula ifFormula)
Creates an empty static law of the form caused headFormula if ifFormula- Parameters:
headFormula
- some FOL formulaifFormula
- some FOL formula
-
StaticLaw
public StaticLaw(FolFormula headFormula, FolFormula ifFormula, java.util.Set<GroundingRequirement> requirements)
Creates an empty static law of the form caused headFormula if ifFormula requires requirements- Parameters:
headFormula
- some FOL formulaifFormula
- some FOL formularequirements
- a set of requirements
-
-
Method Detail
-
isDefinite
public boolean isDefinite()
Description copied from class:CLaw
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.- Specified by:
isDefinite
in classCLaw
- Returns:
- true, if this law is definite, false otherwise.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toDefinite
public java.util.Set<CLaw> toDefinite() throws java.lang.IllegalStateException
Description copied from class:CLaw
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.- Specified by:
toDefinite
in classCLaw
- Returns:
- the equivalent definite causal law if one exists.
- Throws:
java.lang.IllegalStateException
- when there is no equivalent definite causal law.
-
getSignature
public Signature getSignature()
Description copied from interface:Formula
Returns the signature of the language of this formula.- Specified by:
getSignature
in interfaceFormula
- Specified by:
getSignature
in classCLaw
- Returns:
- the signature of the language of this formula.
-
getAtoms
public java.util.Set<FolAtom> getAtoms()
Description copied from class:CLaw
Returns the set of propositions in all formulas in this law.
-
getAllGrounded
public java.util.Set<CLaw> getAllGrounded()
Description copied from class:CLaw
Returns the set of all grounded instances of this causal law.- Specified by:
getAllGrounded
in classCLaw
- Returns:
- the set of all grounded instances of this causal law.
-
getFormulas
public java.util.Set<FolFormula> getFormulas()
Description copied from class:CLaw
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.- Specified by:
getFormulas
in classCLaw
- Returns:
- the set of formulas contained in this causal law.
-
-