Class StaticLaw
- java.lang.Object
-
- net.sf.tweety.action.description.syntax.CLaw
-
- net.sf.tweety.action.description.syntax.StaticLaw
-
- All Implemented Interfaces:
CausalLaw,net.sf.tweety.commons.Formula
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
-
-
Field Summary
-
Fields inherited from class net.sf.tweety.action.description.syntax.CLaw
headFormula, ifFormula, requirements
-
-
Constructor Summary
Constructors Constructor Description StaticLaw()Creates an empty static law.StaticLaw(net.sf.tweety.logics.fol.syntax.FolFormula headFormula)Creates an empty static law of the form caused headFormula if TrueStaticLaw(net.sf.tweety.logics.fol.syntax.FolFormula headFormula, Set<GroundingRequirement> requirements)Creates an empty static law of the form caused headFormula if True requires requirementsStaticLaw(net.sf.tweety.logics.fol.syntax.FolFormula headFormula, net.sf.tweety.logics.fol.syntax.FolFormula ifFormula)Creates an empty static law of the form caused headFormula if ifFormulaStaticLaw(net.sf.tweety.logics.fol.syntax.FolFormula headFormula, net.sf.tweety.logics.fol.syntax.FolFormula ifFormula, Set<GroundingRequirement> requirements)Creates an empty static law of the form caused headFormula if ifFormula requires requirements
-
Method Summary
Modifier and Type Method Description Set<CLaw>getAllGrounded()Returns the set of all grounded instances of this causal law.Set<net.sf.tweety.logics.fol.syntax.FolAtom>getAtoms()Returns the set of propositions in all formulas in this law.Set<net.sf.tweety.logics.fol.syntax.FolFormula>getFormulas()Returns the set of formulas contained in this causal law, e.g.net.sf.tweety.commons.SignaturegetSignature()booleanisDefinite()Returns true iff this law is definite.Set<CLaw>toDefinite()Returns an equivalent definite causal law.StringtoString()-
Methods inherited from class net.sf.tweety.action.description.syntax.CLaw
addGroundingRequirement, getHeadFormula, getIfFormula, isConjunctiveClause, isGround, isValidDefiniteHead
-
-
-
-
Constructor Detail
-
StaticLaw
public StaticLaw()
Creates an empty static law.
-
StaticLaw
public StaticLaw(net.sf.tweety.logics.fol.syntax.FolFormula headFormula)
Creates an empty static law of the form caused headFormula if True- Parameters:
headFormula- some FOL formula
-
StaticLaw
public StaticLaw(net.sf.tweety.logics.fol.syntax.FolFormula headFormula, 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(net.sf.tweety.logics.fol.syntax.FolFormula headFormula, net.sf.tweety.logics.fol.syntax.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(net.sf.tweety.logics.fol.syntax.FolFormula headFormula, net.sf.tweety.logics.fol.syntax.FolFormula ifFormula, 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:CLawReturns 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:
isDefinitein classCLaw- Returns:
- true, if this law is definite, false otherwise.
-
toDefinite
public Set<CLaw> toDefinite() throws IllegalStateException
Description copied from class:CLawReturns 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:
toDefinitein classCLaw- Returns:
- the equivalent definite causal law if one exists.
- Throws:
IllegalStateException- when there is no equivalent definite causal law.
-
getSignature
public net.sf.tweety.commons.Signature getSignature()
- Specified by:
getSignaturein interfacenet.sf.tweety.commons.Formula- Specified by:
getSignaturein classCLaw
-
getAtoms
public Set<net.sf.tweety.logics.fol.syntax.FolAtom> getAtoms()
Description copied from class:CLawReturns the set of propositions in all formulas in this law.
-
getAllGrounded
public Set<CLaw> getAllGrounded()
Description copied from class:CLawReturns the set of all grounded instances of this causal law.- Specified by:
getAllGroundedin classCLaw- Returns:
- the set of all grounded instances of this causal law.
-
getFormulas
public Set<net.sf.tweety.logics.fol.syntax.FolFormula> getFormulas()
Description copied from class:CLawReturns 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:
getFormulasin classCLaw- Returns:
- the set of formulas contained in this causal law.
-
-