edu.cs.ai.kreator.logic
Class StrictNegation

java.lang.Object
  extended by edu.cs.ai.kreator.logic.Literal
      extended by edu.cs.ai.kreator.logic.SpiritGrammarConform
          extended by edu.cs.ai.kreator.logic.StrictNegation
All Implemented Interfaces:
Latexable, java.lang.Comparable<Literal>

public class StrictNegation
extends SpiritGrammarConform

Author:
mthimm

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.cs.ai.kreator.logic.Literal
Literal.TruthValue
 
Constructor Summary
StrictNegation(GeneralizedAtom atom)
          Constructs a negation with the given atom.
 
Method Summary
 int compareTo(Literal other)
           
 boolean equals(java.lang.Object obj)
          compares if this literals is equal to the other literal.
 java.util.Map<Variable,Term> extendUnifier(Literal l, java.util.Map<Variable,Term> unifier)
          Extends the given unifier "u" to a unifier "u2" such that "u2" transforms this literal into the one given.
 GeneralizedAtom getAtom()
          Returns the atom of this literal.
 Literal getComplement()
          Returns the complement (negation) of this literal.
 java.util.Set<Constant> getConstants()
          Returns the set of constants, that appear in this literal.
 java.util.Set<Literal> getInstantiations(LanguageFactory language)
          Computes all ground literals of this literal with the language, i.e.
 java.util.List<Term> getParameters()
          Returns the list of parameters of that literal.
 GeneralizedPredicate getPredicate()
          Returns the predicate of this literal.
 java.util.Set<Variable> getVariables()
          Returns the set of variables, that appear in this literal.
 int hashCode()
           
 Literal substitute(java.util.Map<? extends Variable,? extends Term> substitution)
          This method substitutes in this literal each occurence of a variable that is a key in the given substitution map by its value in the same given substitution map.
 java.lang.String toLatex()
          Returns a Latex grammar conform string to generate variables, rules (conditionals) etc.
 java.lang.String toSPIRITgrammar()
          Returns a SPIRIT grammar conform string to generate variables and SPIRIT rules (conditionals).
 java.lang.String toString()
           
 
Methods inherited from class edu.cs.ai.kreator.logic.Literal
extendUnifier, extendUnifiers, getUnifier, getUnifiers, isConsistent, substituteAll
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StrictNegation

public StrictNegation(GeneralizedAtom atom)
Constructs a negation with the given atom.

Parameters:
atom - a bayesian atom.
Method Detail

getConstants

public java.util.Set<Constant> getConstants()
Description copied from class: Literal
Returns the set of constants, that appear in this literal.

Specified by:
getConstants in class Literal
Returns:
the set of constants, that appear in this literal.

getVariables

public java.util.Set<Variable> getVariables()
Description copied from class: Literal
Returns the set of variables, that appear in this literal.

Specified by:
getVariables in class Literal
Returns:
the set of variables, that appear in this literal.

getParameters

public java.util.List<Term> getParameters()
Description copied from class: Literal
Returns the list of parameters of that literal.

Specified by:
getParameters in class Literal
Returns:
the list of parameters of that literal.

substitute

public Literal substitute(java.util.Map<? extends Variable,? extends Term> substitution)
Description copied from class: Literal
This method substitutes in this literal each occurence of a variable that is a key in the given substitution map by its value in the same given substitution map.

Specified by:
substitute in class Literal
Parameters:
substitution - a map from variables to constants.
Returns:
a literal.

getAtom

public GeneralizedAtom getAtom()
Description copied from class: Literal
Returns the atom of this literal.

Specified by:
getAtom in class Literal
Returns:
the atom of this literal.

getPredicate

public GeneralizedPredicate getPredicate()
Description copied from class: Literal
Returns the predicate of this literal.

Specified by:
getPredicate in class Literal
Returns:
a bayesian predicate.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(Literal other)

toLatex

public java.lang.String toLatex()
Description copied from interface: Latexable
Returns a Latex grammar conform string to generate variables, rules (conditionals) etc.

Returns:
a Latex grammar conform string.

getComplement

public Literal getComplement()
Description copied from class: Literal
Returns the complement (negation) of this literal.

Specified by:
getComplement in class Literal
Returns:
the complement (negation) of this literal.

toSPIRITgrammar

public java.lang.String toSPIRITgrammar()
Description copied from class: SpiritGrammarConform
Returns a SPIRIT grammar conform string to generate variables and SPIRIT rules (conditionals).

Specified by:
toSPIRITgrammar in class SpiritGrammarConform
Returns:
a SPIRIT grammar conform string.

extendUnifier

public java.util.Map<Variable,Term> extendUnifier(Literal l,
                                                  java.util.Map<Variable,Term> unifier)
Description copied from class: Literal
Extends the given unifier "u" to a unifier "u2" such that "u2" transforms this literal into the one given.

Specified by:
extendUnifier in class Literal
Parameters:
l - a literal
unifier - a (partial) unifier.
Returns:
a (complete) unifier.

getInstantiations

public java.util.Set<Literal> getInstantiations(LanguageFactory language)
Description copied from class: Literal
Computes all ground literals of this literal with the language, i.e. with all constants appearing in the given language. If the given set of terms is empty and this literal has at least one free variable, the set returned will be empty.

Specified by:
getInstantiations in class Literal
Parameters:
language - a language.
Returns:
a set of ground literals of this literal.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Description copied from class: Literal
compares if this literals is equal to the other literal. Two Literals are equal if they are both positive or negative and have the same predicates incl. the same arguments and sorts.

Specified by:
equals in class Literal