Class Extension
- java.lang.Object
-
- net.sf.tweety.commons.AbstractInterpretation<DefaultTheory,FolFormula>
-
- net.sf.tweety.logics.rdl.semantics.Extension
-
- All Implemented Interfaces:
java.lang.Iterable<FolFormula>
,java.util.Collection<FolFormula>
,Interpretation<DefaultTheory,FolFormula>
public class Extension extends AbstractInterpretation<DefaultTheory,FolFormula> implements java.util.Collection<FolFormula>
An extension of a default theory, i.e. a set of first-order formulas.- Author:
- Matthias Thimm
-
-
Constructor Summary
Constructors Constructor Description Extension()
Default constructorExtension(java.util.Collection<FolFormula> formulas)
Creates a new extension with the given set of formulas.
-
Method Summary
Modifier and Type Method Description boolean
add(FolFormula e)
boolean
addAll(java.util.Collection<? extends FolFormula> c)
void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
boolean
equals(java.lang.Object obj)
int
hashCode()
boolean
isEmpty()
java.util.Iterator<FolFormula>
iterator()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
boolean
satisfies(FolFormula formula)
Checks whether this interpretation satisfies the given formula.boolean
satisfies(DefaultTheory beliefBase)
Checks whether this interpretation satisfies the given knowledge base.int
size()
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] a)
-
Methods inherited from class net.sf.tweety.commons.AbstractInterpretation
satisfies
-
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
Extension
public Extension()
Default constructor
-
Extension
public Extension(java.util.Collection<FolFormula> formulas)
Creates a new extension with the given set of formulas.- Parameters:
formulas
- some formulas.
-
-
Method Detail
-
satisfies
public boolean satisfies(FolFormula formula) throws java.lang.IllegalArgumentException
Description copied from interface:Interpretation
Checks whether this interpretation satisfies the given formula.- Specified by:
satisfies
in interfaceInterpretation<DefaultTheory,FolFormula>
- Parameters:
formula
- a formula .- Returns:
- "true" if this interpretation satisfies the given formula.
- Throws:
java.lang.IllegalArgumentException
- if the formula does not correspond to the expected language.
-
satisfies
public boolean satisfies(DefaultTheory beliefBase) throws java.lang.IllegalArgumentException
Description copied from interface:Interpretation
Checks whether this interpretation satisfies the given knowledge base.- Specified by:
satisfies
in interfaceInterpretation<DefaultTheory,FolFormula>
- Parameters:
beliefBase
- a knowledge base.- Returns:
- "true" if this interpretation satisfies the given knowledge base.
- Throws:
java.lang.IllegalArgumentException
- IllegalArgumentException if the knowledgebase does not correspond to the expected language.
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<FolFormula>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection<FolFormula>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<FolFormula>
-
iterator
public java.util.Iterator<FolFormula> iterator()
- Specified by:
iterator
in interfacejava.util.Collection<FolFormula>
- Specified by:
iterator
in interfacejava.lang.Iterable<FolFormula>
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArray
in interfacejava.util.Collection<FolFormula>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray
in interfacejava.util.Collection<FolFormula>
-
add
public boolean add(FolFormula e)
- Specified by:
add
in interfacejava.util.Collection<FolFormula>
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interfacejava.util.Collection<FolFormula>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAll
in interfacejava.util.Collection<FolFormula>
-
addAll
public boolean addAll(java.util.Collection<? extends FolFormula> c)
- Specified by:
addAll
in interfacejava.util.Collection<FolFormula>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAll
in interfacejava.util.Collection<FolFormula>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAll
in interfacejava.util.Collection<FolFormula>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<FolFormula>
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Collection<FolFormula>
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfacejava.util.Collection<FolFormula>
- Overrides:
equals
in classjava.lang.Object
-
-