ua.gradsoft.termware
Class Substitution

java.lang.Object
  extended by ua.gradsoft.termware.Substitution
All Implemented Interfaces:
Cloneable

public class Substitution
extends Object
implements Cloneable

Substitution of propositional variables.


Constructor Summary
Substitution()
          constructor
 
Method Summary
 void clear()
           
 Object clone()
           
 Substitution cloneSubstitution()
           
 Term get(int s)
          return substitution of propositional variable with index i If such variable does not exists - return null
 boolean isEmpty()
          return true if substitution is empty.
 void merge(Substitution x)
          merge current substitution with x
 void print(PrintStream out)
          print substitution to out
 void print(PrintWriter out)
          print substitution to out
 void put(Term frs, Term snd)
          put to substitution frs -> snd .
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Substitution

public Substitution()
constructor

Method Detail

put

public void put(Term frs,
                Term snd)
         throws TermWareException,
                MatchingFailure
put to substitution frs -> snd . One of terms must be propositional variable concretizeOnly means, that snd must be not propositional variable, but concrete term.

Parameters:
frs - - term to substitute
snd - - term, which we substitute instead snd.
Throws:
TermWareException
MatchingFailure

merge

public void merge(Substitution x)
           throws TermWareException
merge current substitution with x

Throws:
TermWareException

get

public Term get(int s)
return substitution of propositional variable with index i If such variable does not exists - return null


isEmpty

public boolean isEmpty()
return true if substitution is empty.


print

public void print(PrintStream out)
print substitution to out


print

public void print(PrintWriter out)
print substitution to out


toString

public String toString()
Overrides:
toString in class Object

clear

public void clear()

clone

public Object clone()
Overrides:
clone in class Object

cloneSubstitution

public Substitution cloneSubstitution()