org.deri.iris.facts
Class FiniteUniverseFacts

java.lang.Object
  extended by org.deri.iris.facts.FiniteUniverseFacts
All Implemented Interfaces:
IFacts

public class FiniteUniverseFacts
extends Object
implements IFacts

Definition: Unsafe negation A rule has a variable in a negated sub-goal that also occurs in the head, but nowhere else. Definition: Unsafe A rule has a variable that does not occur in a positive ordinary literal. Create a $UNIVERSE$(?X) relation. To handle unsafe negation (Gelder, Well-founded semantics, p.24): 1. For every rule, extract every occurrence of a non-ground-term, e.g. ?X or f(?Y) 2. Substitute a distinct ground term (not found anywhere else) for the variable(s), e.g. '$X', f('$Y') 3. Add this term to $UNIVERSE$ To handle all unsafe rules (with free variables in head or built-ins): 5. Add all concrete terms that occur anywhere in the program (facts and rules) to $UNIVERSE$ For both: 6. Add $UNIVERSE$(?variable) sub-goals for each free variable in each rule


Field Summary
static IPredicate UNIVERSE
          The universe predicate.
 
Constructor Summary
FiniteUniverseFacts(IFacts facts, Collection<IRule> rules)
          Constructor.
 
Method Summary
 IRelation get(IPredicate predicate)
          Get the relation associated with the given predicate and create one if one does not already exist.
 Set<IPredicate> getPredicates()
          Get the set of predicate identifying all relations known to this facts object.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNIVERSE

public static final IPredicate UNIVERSE
The universe predicate.

Constructor Detail

FiniteUniverseFacts

public FiniteUniverseFacts(IFacts facts,
                           Collection<IRule> rules)
Constructor. Extract all ground terms from starting facts and rules.

Parameters:
facts - The starting facts of the knowledge-base.
rules - The rules of the knowledge-base.
Method Detail

get

public IRelation get(IPredicate predicate)
Description copied from interface: IFacts
Get the relation associated with the given predicate and create one if one does not already exist.

Specified by:
get in interface IFacts
Parameters:
predicate - The predicate identifying the relation.
Returns:
The relation associated with the given predicate.

getPredicates

public Set<IPredicate> getPredicates()
Description copied from interface: IFacts
Get the set of predicate identifying all relations known to this facts object.

Specified by:
getPredicates in interface IFacts
Returns:

toString

public String toString()
Overrides:
toString in class Object