de.unidu.is.pdatalog.ds
Class Fact

java.lang.Object
  extended byde.unidu.is.pdatalog.ds.Rule
      extended byde.unidu.is.pdatalog.ds.Fact
Direct Known Subclasses:
HySpiritFact

public class Fact
extends Rule

The representation of a datalog probabilistic fact. A fact is a rule with an emtpy (always true) body.

Since:
2003-10-27
Version:
$Revision: 1.8 $, $Date: 2005/03/14 17:33:14 $
Author:
Henrik Nottelmann

Field Summary
 
Fields inherited from class de.unidu.is.pdatalog.ds.Rule
body, head
 
Constructor Summary
Fact(double prob, Literal head)
          Creates a new fact from the specified literal with the given probability.
Fact(Fact fact)
          Creates a new fact as a copy of the specified fact.
Fact(Literal head)
          Creates a new deterministic fact from the specified literal.
Fact(Literal head, Expression mapping)
          Creates a new probabilistic fact.
 
Method Summary
 int getArity()
          Returns the arity of this fact's predicate.
 Expression getConst(int num)
          Returns the constant of this fact at the specified index.
 java.lang.String getConsts()
          Returns a string description of the constants of this fact, separated by colons.
 double getProb()
          Returns the probabilistic weight of this fact.
 
Methods inherited from class de.unidu.is.pdatalog.ds.Rule
addLiteral, contains, containsExactly, containsExactlyInBody, getAllArguments, getAllArgumentsAsArray, getBody, getConstants, getHead, getMapping, getMapping, getMapping, getName, getPredicateName, getVariables, isOptimizable, literalAt, literalCount, putAllArguments, putConstants, putVariables, removeLiteral, removeLiteral, setHead, setLiteral, setMapping, setOptimizable, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Fact

public Fact(Literal head,
            Expression mapping)
Creates a new probabilistic fact.

Parameters:
head - "head" of the fact
mapping - mapping function

Fact

public Fact(Literal head)
Creates a new deterministic fact from the specified literal. This literal is the head of the new fact.

Parameters:
head - literal describing this deterministic fact

Fact

public Fact(double prob,
            Literal head)
Creates a new fact from the specified literal with the given probability. This literal is the head of the new fact.

Parameters:
prob - probability of this fact
head - literal describing this fact

Fact

public Fact(Fact fact)
Creates a new fact as a copy of the specified fact.

Parameters:
fact - fact to be copied
Method Detail

getConsts

public java.lang.String getConsts()
Returns a string description of the constants of this fact, separated by colons.

Returns:
the string description of the constants of this fact

getArity

public int getArity()
Returns the arity of this fact's predicate.

Returns:
arity of this fact's predicate

getConst

public Expression getConst(int num)
Returns the constant of this fact at the specified index.

Returns:
constant of this fact at the specified index

getProb

public double getProb()
Returns the probabilistic weight of this fact.

Returns:
probabilistic weight of this fact