alice.tuprolog
Class Theory

java.lang.Object
  extended byalice.tuprolog.Theory
All Implemented Interfaces:
java.io.Serializable

public class Theory
extends java.lang.Object
implements java.io.Serializable

This class represents prolog theory which can be provided to a prolog engine. Actually theory incapsulates only textual representation of prolog theories, without doing any check about validity

See Also:
Prolog, Serialized Form

Constructor Summary
Theory(java.io.InputStream is)
          Creates a theory getting its source text from an input stream
Theory(java.lang.String theory)
          Creates a theory from its source text
Theory(Struct clauseList)
          Creates a theory from a clause list
 
Method Summary
 void append(Theory th)
          Adds (appends) a theory to this.
 java.util.Iterator iterator(Prolog engine)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Theory

public Theory(java.io.InputStream is)
       throws java.io.IOException
Creates a theory getting its source text from an input stream

Parameters:
is - the input stream acting as source

Theory

public Theory(java.lang.String theory)
       throws InvalidTheoryException
Creates a theory from its source text

Parameters:
theory - the source text
Throws:
s - InvalidTheoryException if theory is null
InvalidTheoryException

Theory

public Theory(Struct clauseList)
       throws InvalidTheoryException
Creates a theory from a clause list

Parameters:
clauseList - the source text
Throws:
s - InvalidTheoryException if clauseList is null or is not a prolog list
InvalidTheoryException
Method Detail

iterator

public java.util.Iterator iterator(Prolog engine)

append

public void append(Theory th)
            throws InvalidTheoryException
Adds (appends) a theory to this.

Parameters:
th - is the theory to be appended
Throws:
s - InvalidTheoryException if the theory object are not compatibles (they are compatibles when both have been built from texts or both from clause lists)
InvalidTheoryException

toString

public java.lang.String toString()