com.bigdata.relation.rule
Interface IProgram

All Superinterfaces:
IStep, Serializable
All Known Implementing Classes:
MappedProgram, Program

public interface IProgram
extends IStep

A program consists of a set of rules and/or programs. Some programs are executed sequentially while others are (at least logically) parallel. A program may also specify the transitive closure of its rules.

Version:
$Id: IProgram.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson
TODO:
add an XML (de-)serialization for programs and rules so that the rule sets may be declared. Note that there are a few very specialized rules whose semantics might not be fully declarable for the fast closure method used by the RDF KB., Make it possible for people to easily extend the RDF KB rule sets or run rules over a RDF data set, but note that there are interactions in the rules choosen for evaluation during forward closure and those choosen for evaluation at query time.

Method Summary
 boolean isClosure()
          true iff the fixed point closure of the IProgram should be computed.
 boolean isParallel()
          true iff the steps() MAY be executed in parallel.
 int stepCount()
          The #of steps in the program (non-recursive).
 Iterator<IStep> steps()
          The sequence of sub-program ISteps.
 IStep[] toArray()
          An array containing the steps in the program (non-recursive).
 
Methods inherited from interface com.bigdata.relation.rule.IStep
getName, getQueryOptions, isRule, toString
 

Method Detail

isParallel

boolean isParallel()
true iff the steps() MAY be executed in parallel. When false the steps WILL be executed sequentially and (for mutation) the buffered writes will be flushed after each step.

Note: Sequential execution of a program makes a multi-IRule program MUCH easier to debug as the rules are executed one by one and the buffer is flushed after each rule so you can directly see the #of elements consider by the IRule for each IPredicate in the tail and the #of ISolutions generated by the IRule.


isClosure

boolean isClosure()
true iff the fixed point closure of the IProgram should be computed.

Note: Closure is computed in rounds. The rounds continue until the IMutableRelation(s) on which the steps are writing reach a fixed point (no new solutions are added to the relation(s) within a given round). If a program has a fixed point, then the same closure will be obtained by either sequential or parallel execution of the steps within each round and in general parallel execution of the steps is perferred as it has better performance. However, the steps MAY be executed sequentially to facilitate debugging.


steps

Iterator<IStep> steps()
The sequence of sub-program ISteps.


stepCount

int stepCount()
The #of steps in the program (non-recursive).


toArray

IStep[] toArray()
An array containing the steps in the program (non-recursive).



Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.