Hilbert II - JAVA-Packages - Principia Mathematica II

com.meyling.principia.logic.basic
Class AbstractFormula

java.lang.Object
  extended bycom.meyling.principia.argument.AbstractArgument
      extended bycom.meyling.principia.argument.AbstractArgumentList
          extended bycom.meyling.principia.logic.basic.AbstractFormula
All Implemented Interfaces:
Argument, Formula
Direct Known Subclasses:
LogicalOperatorWithTwoFormulas, Negation, PredicateVariable, PropositionVariable, Quantifier

public abstract class AbstractFormula
extends AbstractArgumentList
implements Formula

From this abstract implementation of Formula each non abstract Formula must inherit from.

Version:
$Revision: 1.9 $
Author:
Michael Meyling

Constructor Summary
AbstractFormula(Argument[] arguments)
          Constructs an formula.
 
Method Summary
static Formula createPattern(Formula formula)
          Replace the every occurence of a SubjectVariable by a BasicSubjectVariablePatternVariable, every PropositionVariable by a BasicFormulaPatternVariable and TODO not yet: every PredicateVariable by a BasicPredicateVariablePatternVariable.
abstract  SubjectVariables getBoundSubjectVariables()
          Get all bounded subject variables.
abstract  SubjectVariables getFreeSubjectVariables()
          Get all free subject variables.
abstract  Formula getPartFormula(int i)
          Get the requested part formula
abstract  int getPartFormulaSize()
          Get the number of part formulas that this formula contains.
abstract  SubjectVariables getSubjectVariables()
          Get all subject variables that occur in this formula.
 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
 
Methods inherited from class com.meyling.principia.argument.AbstractArgumentList
copy, create, getArgument, getArgumentSize, toString
 
Methods inherited from class com.meyling.principia.argument.AbstractArgument
containsPatternVariables, equals, getHighestNumber, getPatternVariables, 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, create, equals, getArgument, getArgumentSize, getPatternVariables, getReplacementParents, getSearchParents, hashCode, matches, matches, replace, replace, replace, replaceMatches, toString
 

Constructor Detail

AbstractFormula

public AbstractFormula(Argument[] arguments)
Constructs an formula.

Parameters:
arguments - the arguments to make a list of
Throws:
IllegalArgumentException - if the argument was a nullpointer
Method Detail

createPattern

public static final Formula createPattern(Formula formula)
                                   throws IllegalArgumentException
Replace the every occurence of a SubjectVariable by a BasicSubjectVariablePatternVariable, every PropositionVariable by a BasicFormulaPatternVariable and TODO not yet: every PredicateVariable by a BasicPredicateVariablePatternVariable.

Parameters:
formula - replace in this formula
Returns:
replaced formula
Throws:
IllegalArgumentException - if creating replacement failed

getPartFormulaSize

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

Specified by:
getPartFormulaSize in interface Formula
Returns:
number of part formulas that this formula is build of

getPartFormula

public abstract 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 abstract 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 abstract 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 abstract 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

replaceBoundSubjectVariable

public final Formula replaceBoundSubjectVariable(Enumerator counter,
                                                 int occurance,
                                                 SubjectVariable search,
                                                 SubjectVariable replacement)
                                          throws ArgumentException
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
Throws:
ArgumentException - if creating replacement failed

replaceBoundSubjectVariables

public final Formula replaceBoundSubjectVariables(Enumerator counter)
                                           throws ArgumentException
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
Throws:
ArgumentException

Hilbert II - JAVA-Packages - Principia Mathematica II

©left GNU General Public Licence
All Rights Reserved.