Hilbert II - JAVA-Packages - Principia Mathematica II

com.meyling.principia.logic.basic
Class BasicFormulaPatternVariable

java.lang.Object
  extended bycom.meyling.principia.argument.AbstractArgument
      extended bycom.meyling.principia.argument.PatternVariable
          extended bycom.meyling.principia.logic.basic.BasicPatternVariable
              extended bycom.meyling.principia.logic.basic.BasicFormulaPatternVariable
All Implemented Interfaces:
Argument, Comparable, CounterMarker, Formula

public class BasicFormulaPatternVariable
extends BasicPatternVariable
implements Formula

Pattern variable, for matching purposes.

Version:
$Revision: 1.6 $
Author:
Michael Meyling

Constructor Summary
BasicFormulaPatternVariable(Argument[] arguments)
          Constructs a pattern variable.
 
Method Summary
 Argument create(Argument[] arguments)
          Create a new Argument with given arguments.
 SubjectVariables getBoundSubjectVariables()
          Get all bounded subject variables.
 SubjectVariables getFreeSubjectVariables()
          Get all free subject variables.
 Formula getPartFormula(int i)
          Get the requested part formula
 int getPartFormulaSize()
          Get the number of part formulas that this formula contains.
 PatternVariables getPatternVariables()
          Get all pattern variables that occur in this argument.
 SubjectVariables getSubjectVariables()
          Get all subject variables that occur in this formula.
 boolean isMatching(Argument argument)
          Is the argument matching the pattern variable?
 Formula replaceBoundSubjectVariable(Enumerator counter, int occurance, SubjectVariable search, SubjectVariable replacement)
          Replace the occurrence-th occurence of a bound SubjectVariable by another one.
 Formula replaceBoundSubjectVariables(Enumerator counter)
          Replace every bound SubjectVariable by a BasicSubjectVariablePatternVariable
 String toString()
          Get the argument in String form.
 
Methods inherited from class com.meyling.principia.argument.PatternVariable
compareTo, containsPatternVariables, copy, getArgument, getArgumentSize, getContent, getNumber, setContent
 
Methods inherited from class com.meyling.principia.argument.AbstractArgument
equals, getHighestNumber, getReplacementParents, getSearchParents, hashCode, matches, matches, replace, replace, replace, replaceMatches
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.meyling.principia.argument.Argument
containsPatternVariables, copy, equals, getArgument, getArgumentSize, getReplacementParents, getSearchParents, hashCode, matches, matches, replace, replace, replace, replaceMatches
 
Methods inherited from interface com.meyling.principia.argument.CounterMarker
getNumber
 

Constructor Detail

BasicFormulaPatternVariable

public BasicFormulaPatternVariable(Argument[] arguments)
                            throws ArgumentException
Constructs a pattern variable.

Parameters:
arguments - first argument is number of this pattern variable
Throws:
ArgumentException - if there is not exactly one argument that is an instance of Counter
Method Detail

getPartFormulaSize

public final int getPartFormulaSize()
Description copied from interface: Formula
Get the number of part formulas that this formula contains.

Specified by:
getPartFormulaSize in interface Formula
Returns:
always 0

getPartFormula

public final Formula getPartFormula(int i)
                             throws IllegalArgumentException
Description copied from interface: Formula
Get the requested part formula

Specified by:
getPartFormula in interface Formula
Parameters:
i - number of part formula (starting with 0)
Returns:
i-th part formula
Throws:
IllegalArgumentException - if i is not inbetween 0 and Formula.getPartFormulaSize() - 1

getFreeSubjectVariables

public final SubjectVariables getFreeSubjectVariables()
Description copied from interface: Formula
Get all free subject variables.

Specified by:
getFreeSubjectVariables in interface Formula
Returns:
all free subject variables

getBoundSubjectVariables

public final SubjectVariables getBoundSubjectVariables()
Description copied from interface: Formula
Get all bounded subject variables.

Specified by:
getBoundSubjectVariables in interface Formula
Returns:
all bounded subject variables

getSubjectVariables

public final SubjectVariables getSubjectVariables()
Description copied from interface: Formula
Get all subject variables that occur in this formula.

Specified by:
getSubjectVariables in interface Formula
Returns:
all subject variables

getPatternVariables

public final PatternVariables getPatternVariables()
Description copied from interface: Argument
Get all pattern variables that occur in this argument.

Specified by:
getPatternVariables in interface Argument
Overrides:
getPatternVariables in class AbstractArgument

isMatching

public boolean isMatching(Argument argument)
Is the argument matching the pattern variable? Here always true is returned.

Overrides:
isMatching in class PatternVariable
Parameters:
argument - argument to match pattern variable
Returns:
true

replaceBoundSubjectVariable

public final Formula replaceBoundSubjectVariable(Enumerator counter,
                                                 int occurance,
                                                 SubjectVariable search,
                                                 SubjectVariable replacement)
Description copied from interface: Formula
Replace the occurrence-th occurence of a bound SubjectVariable by another one.

Specified by:
replaceBoundSubjectVariable in interface Formula
Parameters:
counter - number of matches so far
occurance - number of matches to act on
search - subject variable to look for
replacement - replacement subject variable
Returns:
replaced formula

replaceBoundSubjectVariables

public final Formula replaceBoundSubjectVariables(Enumerator counter)
Description copied from interface: Formula
Replace every bound SubjectVariable by a BasicSubjectVariablePatternVariable

Specified by:
replaceBoundSubjectVariables in interface Formula
Parameters:
counter - contains starting number for replacement pattern variable, is increased after one complete replacement

create

public final Argument create(Argument[] arguments)
                      throws ArgumentException
Description copied from interface: Argument
Create a new Argument with given arguments.

Specified by:
create in interface Argument
Overrides:
create in class BasicPatternVariable
Throws:
ArgumentException

toString

public String toString()
Description copied from interface: Argument
Get the argument in String form.

Specified by:
toString in interface Argument
Overrides:
toString in class BasicPatternVariable

Hilbert II - JAVA-Packages - Principia Mathematica II

©left GNU General Public Licence
All Rights Reserved.