Package net.sf.tweety.logics.rdl.syntax
Class DefaultTheory
- java.lang.Object
-
- net.sf.tweety.logics.rdl.syntax.DefaultTheory
-
- All Implemented Interfaces:
BeliefBase
public class DefaultTheory extends java.lang.Object implements BeliefBase
Models a default theory in Reiter's default logic, see [R. Reiter. A logic for default reasoning. Artificial Intelligence, 13:81–132, 1980].- Author:
- Matthias Thimm, Nils Geilen
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Collection<DefaultRule>
defaults
The set of default rulesprivate FolBeliefSet
facts
The set of facts (first-order formulas).
-
Constructor Summary
Constructors Constructor Description DefaultTheory()
constructs empty default theoryDefaultTheory(FolBeliefSet facts, java.util.Collection<DefaultRule> defaults)
constructs a default theory from a knowledge base and a set of defaults
-
Method Summary
Modifier and Type Method Description (package private) void
addDefault(DefaultRule d)
adds default rule(package private) void
addFact(FolFormula fact)
add facts to knowledge basejava.util.Collection<DefaultRule>
getDefaults()
FolBeliefSet
getFacts()
Signature
getMinimalSignature()
Returns the signature of the language of this knowledge base.DefaultTheory
ground()
Removes Variables by expanding formulas(package private) void
removeDefault(DefaultRule d)
removes default rule(package private) void
removeFact(FolFormula fact)
removes fact from knowledge basejava.lang.String
toString()
-
-
-
Field Detail
-
facts
private FolBeliefSet facts
The set of facts (first-order formulas).
-
defaults
private java.util.Collection<DefaultRule> defaults
The set of default rules
-
-
Constructor Detail
-
DefaultTheory
public DefaultTheory()
constructs empty default theory
-
DefaultTheory
public DefaultTheory(FolBeliefSet facts, java.util.Collection<DefaultRule> defaults)
constructs a default theory from a knowledge base and a set of defaults- Parameters:
facts
- the knowledge basedefaults
- the defaults
-
-
Method Detail
-
addFact
void addFact(FolFormula fact)
add facts to knowledge base- Parameters:
fact
- some fol formula
-
removeFact
void removeFact(FolFormula fact)
removes fact from knowledge base- Parameters:
fact
- some fol formula
-
addDefault
void addDefault(DefaultRule d)
adds default rule- Parameters:
d
- a default rule
-
removeDefault
void removeDefault(DefaultRule d)
removes default rule- Parameters:
d
- a default rule
-
getDefaults
public java.util.Collection<DefaultRule> getDefaults()
- Returns:
- all the default rules
-
ground
public DefaultTheory ground()
Removes Variables by expanding formulas- Returns:
- grounded version of the default theory
-
getMinimalSignature
public Signature getMinimalSignature()
Description copied from interface:BeliefBase
Returns the signature of the language of this knowledge base.- Specified by:
getMinimalSignature
in interfaceBeliefBase
- Returns:
- the signature of the language of this knowledge base.
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfaceBeliefBase
- Overrides:
toString
in classjava.lang.Object
-
getFacts
public FolBeliefSet getFacts()
- Returns:
- FoL formulas in default theories
-
-