edu.udo.cs.ie.cowbots.bdi.brf.operators
Class SURI

Package class diagram package SURI
java.lang.Object
  extended by edu.udo.cs.ie.cowbots.bdi.brf.operators.SURI
All Implemented Interfaces:
IInferenceOperator

public class SURI
extends java.lang.Object
implements IInferenceOperator

a believe operator based on the ideas behind causal rejection, with constraint handling based upon revision programming.


Field Summary
(package private)  java.util.Map<java.lang.String,java.util.List<ELPLiteral>> rejSet
           
(package private)  java.util.Set<java.lang.String> savePreds
           
 
Constructor Summary
SURI()
           
 
Method Summary
protected  void add2RejSet(ELPLiteral l)
          inserts a literal into the reject set
protected  void cleanAnswerSet(java.util.Set<ELPLiteral> as)
          removes extended predicates from an answer set, also builds internal reject tables
protected  void clearRejSet()
          resets the reject set
 ELP createBeliefState(java.util.List<InformationObject> ioList)
          this method builds a belief state from a list of information objects.
 java.util.Map<java.lang.String,java.util.List<ELPLiteral>> getRejectSet()
          returns the literals being rejected in the answer set analyzed by selectAnswerSet.
protected  ELPLiteral higher(ELPLiteral l, java.lang.String index)
          auxiliary function, creates a "higher_" literal from a literal.
protected  ELPLiteral indexLiteral(ELPLiteral l, java.lang.String counter)
          auxiliary function that creates an indexed (or priorized) version of a literal.
protected  ELPLiteral inverse(ELPLiteral l)
          returns the inverse of a literal
protected  ELPLiteral max(ELPLiteral l, java.lang.String index)
          auxiliary function, creates a max literal from a literal.
protected  ELPLiteral rejLiteral(ELPLiteral l)
          auxiliary function that creates a reject literal for a literal
protected  ELPLiteral rejLiteralIndex(ELPLiteral l, java.lang.String p, java.lang.String pPrime)
          auxiliary function that create a priority comparison reject literal
 AnswerSet selectAnswerSet(java.util.List<AnswerSet> asl, DLV dlv)
          this method evaluates a collection of answer sets and returns the "best" answer set. it is used in situations where multiple answer sets arise from an asp solver. additionally, any literals introduced during belief state construction, which are part of the inference's extended alphabet has to be removed here!
 void setSavePredicates(java.util.Set<java.lang.String> savePreds)
          assigns a set of "save" functor names to the inference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rejSet

java.util.Map<java.lang.String,java.util.List<ELPLiteral>> rejSet

savePreds

java.util.Set<java.lang.String> savePreds
Constructor Detail

SURI

public SURI()
Method Detail

createBeliefState

public ELP createBeliefState(java.util.List<InformationObject> ioList)
Description copied from interface: IInferenceOperator
this method builds a belief state from a list of information objects.

Specified by:
createBeliefState in interface IInferenceOperator
Parameters:
ioList - list of information objects
Returns:
belief state (encoded as an elp)

indexLiteral

protected ELPLiteral indexLiteral(ELPLiteral l,
                                  java.lang.String counter)
auxiliary function that creates an indexed (or priorized) version of a literal.

Parameters:
l - atom with sign S and any predicate N, terms T
p - priority 1
pPrime - priority 2
Returns:
rejindex_S_N(T, p, pPrime)

rejLiteral

protected ELPLiteral rejLiteral(ELPLiteral l)
auxiliary function that creates a reject literal for a literal

Parameters:
l - atom with sign S and any predicate N, terms T
Returns:
rej_S_N(T)

rejLiteralIndex

protected ELPLiteral rejLiteralIndex(ELPLiteral l,
                                     java.lang.String p,
                                     java.lang.String pPrime)
auxiliary function that create a priority comparison reject literal

Parameters:
l - atom with sign S and any predicate N, terms T
p - priority 1
pPrime - priority 2
Returns:
rejindex_S_N(T, p, pPrime)

inverse

protected ELPLiteral inverse(ELPLiteral l)
returns the inverse of a literal

Parameters:
l - = (Not) ~L
Returns:
(Not) L if l = (Not) ~L (and vice versa)

higher

protected ELPLiteral higher(ELPLiteral l,
                            java.lang.String index)
auxiliary function, creates a "higher_" literal from a literal.

Parameters:
l - literal l with sign S (p=+, n=~), functor N, terms T
index - priority index
Returns:
higher_S_N(T, index)

max

protected ELPLiteral max(ELPLiteral l,
                         java.lang.String index)
auxiliary function, creates a max literal from a literal.

Parameters:
l - literal l with sign S (p=+, n=~), functor N, terms T
index - priority index
Returns:
max_S_N(T, index)

selectAnswerSet

public AnswerSet selectAnswerSet(java.util.List<AnswerSet> asl,
                                 DLV dlv)
Description copied from interface: IInferenceOperator
this method evaluates a collection of answer sets and returns the "best" answer set. it is used in situations where multiple answer sets arise from an asp solver. additionally, any literals introduced during belief state construction, which are part of the inference's extended alphabet has to be removed here!

Specified by:
selectAnswerSet in interface IInferenceOperator
Parameters:
asl - a list of answer sets
dlv - instance to dlv
Returns:
answer set to be transformed into a belief set

cleanAnswerSet

protected void cleanAnswerSet(java.util.Set<ELPLiteral> as)
removes extended predicates from an answer set, also builds internal reject tables

Parameters:
as -

getRejectSet

public java.util.Map<java.lang.String,java.util.List<ELPLiteral>> getRejectSet()
Description copied from interface: IInferenceOperator
returns the literals being rejected in the answer set analyzed by selectAnswerSet.

Specified by:
getRejectSet in interface IInferenceOperator
Returns:
functor-hashed lists of rejected literals

clearRejSet

protected void clearRejSet()
resets the reject set


add2RejSet

protected void add2RejSet(ELPLiteral l)
inserts a literal into the reject set

Parameters:
l - literal to be inserted

setSavePredicates

public void setSavePredicates(java.util.Set<java.lang.String> savePreds)
Description copied from interface: IInferenceOperator
assigns a set of "save" functor names to the inference. a save predicate is assumed to cause no conflicts and can be written directly into the edb (and answer set).

Specified by:
setSavePredicates in interface IInferenceOperator
Parameters:
savePreds - set of predicates which should not be transformed