edu.ucla.belief.rc2.kb
Class KnowledgeBaseImpl

Object
  extended by KnowledgeBaseImpl
All Implemented Interfaces:
KnowledgeBase

public class KnowledgeBaseImpl
extends Object
implements KnowledgeBase

Implement KnowledgeBase.

Author:
David Allen

Nested Class Summary
 
Nested classes/interfaces inherited from interface KnowledgeBase
KnowledgeBase.KnowledgeBaseListener
 
Field Summary
 int INCREMENTAL_STACK_GROWTH
          Must be a positive value.
 int INITIAL_STACK_SIZE
          Must be a positive value.
 
Fields inherited from interface KnowledgeBase
KB_UNSATISFIABLE
 
Method Summary
 int assertNegative(int var, int state)
          Asserts var!=state as true.
 int assertPositive(int var, int state)
          Asserts var=state as true.
static KnowledgeBaseImpl createKB(MappedList vars, MultiValuedCNF cnf, KnowledgeBase.KnowledgeBaseListener lstn)
          Will return the created KB, or null if it was unsatisfiable.
 int currentState()
          Returns the current state of the KB, if retract is later called with this value, the KB will return to this state.
 int numClauses()
           
 int numLiterals()
           
 int numPossibleStates(FiniteVariable fv)
           
 void retract(int size)
          The parameter state should be the returned value from either an assertPositive call or from a currentState call.
 void write(PrintStream out)
           
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIAL_STACK_SIZE

public int INITIAL_STACK_SIZE
Must be a positive value.


INCREMENTAL_STACK_GROWTH

public int INCREMENTAL_STACK_GROWTH
Must be a positive value.

Method Detail

currentState

public int currentState()
Description copied from interface: KnowledgeBase
Returns the current state of the KB, if retract is later called with this value, the KB will return to this state.

Specified by:
currentState in interface KnowledgeBase

numClauses

public int numClauses()
Specified by:
numClauses in interface KnowledgeBase

numLiterals

public int numLiterals()
Specified by:
numLiterals in interface KnowledgeBase

createKB

public static KnowledgeBaseImpl createKB(MappedList vars,
                                         MultiValuedCNF cnf,
                                         KnowledgeBase.KnowledgeBaseListener lstn)
Will return the created KB, or null if it was unsatisfiable.


numPossibleStates

public int numPossibleStates(FiniteVariable fv)
Specified by:
numPossibleStates in interface KnowledgeBase

assertPositive

public int assertPositive(int var,
                          int state)
Asserts var=state as true. If KB is unsatisfiable it will return KB_UNSATISFIABLE.

Specified by:
assertPositive in interface KnowledgeBase

assertNegative

public int assertNegative(int var,
                          int state)
Asserts var!=state as true. If KB is unsatisfiable it will return KB_UNSATISFIABLE.


retract

public void retract(int size)
Description copied from interface: KnowledgeBase
The parameter state should be the returned value from either an assertPositive call or from a currentState call.

Specified by:
retract in interface KnowledgeBase

write

public void write(PrintStream out)


Copyright 2010 UCLA Automated Reasoning Group