JSHOP2
Class MyIterator

java.lang.Object
  extended by JSHOP2.MyIterator

public class MyIterator
extends java.lang.Object

This class implements an iterator with data members that can keep track of where the algorithm is in terms of bindings found so far so that when the next binding is needed it can be calculated correctly. This class is needed because an atom can be satisfied either by looking for bindings at the current state of the world, or by using an axiom.

Version:
1.0.3
Author:
Okhtay Ilghami, http://www.cs.umd.edu/~okhtay

Field Summary
(package private)  Axiom ax
          The axiom being used right now.
(package private)  Term[] binding
          When an axiom is being used, this variable holds the binding that unifies the head of the axiom and the atom being proved.
(package private)  boolean found
          Whether or not at least one satisfier has been found for the current branch of the current axiom.
(package private)  int index
          When looking at the current state of the world, this variable represents the index of the corresponding Vector, when using an axiom to prove an atom, this variable represents which branch of that axiom is being used.
(package private)  Precondition pre
          When an axiom is being used, this variable acts as an iterator over all the possible satisfiers of the precondition of the current branch of the current axiom.
(package private)  java.util.Vector<Term> vec
          The Vector in the current state of the world that represents the atoms for which we are trying to find satisfiers.
(package private)  int whichAxiom
          Which of the (possibly several) axioms that can be used to prove a certain atom is being used right now.
 
Constructor Summary
MyIterator(java.util.Vector<Term> vecIn)
          To initialize this iterator.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ax

Axiom ax
The axiom being used right now. If none is used (i.e., we are still looking for the atom in the current state of the world) the value of this variable is null.


binding

Term[] binding
When an axiom is being used, this variable holds the binding that unifies the head of the axiom and the atom being proved.


found

boolean found
Whether or not at least one satisfier has been found for the current branch of the current axiom. As soon as it becomes true, further branches of the axiom will not be considered.


index

int index
When looking at the current state of the world, this variable represents the index of the corresponding Vector, when using an axiom to prove an atom, this variable represents which branch of that axiom is being used.


pre

Precondition pre
When an axiom is being used, this variable acts as an iterator over all the possible satisfiers of the precondition of the current branch of the current axiom.


vec

java.util.Vector<Term> vec
The Vector in the current state of the world that represents the atoms for which we are trying to find satisfiers.


whichAxiom

int whichAxiom
Which of the (possibly several) axioms that can be used to prove a certain atom is being used right now. If none is being used (i.e., we are still looking for the atom in the current state of the world), it is set to -1.

Constructor Detail

MyIterator

public MyIterator(java.util.Vector<Term> vecIn)
To initialize this iterator.

Parameters:
vecIn - The Vector in the current state of the world that represents the atoms for which we are trying to find satisfiers.