com.meyling.principia.logic.basic
Class AbstractFormula
java.lang.Object
|
+--com.meyling.principia.argument.AbstractArgument
|
+--com.meyling.principia.argument.AbstractArgumentList
|
+--com.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.6 $
- Author:
- Michael Meyling
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 interface com.meyling.principia.argument.Argument |
containsPatternVariables, copy, create, equals, getArgument, getArgumentSize, getPatternVariables, getReplacementParents, getSearchParents, hashCode, matches, matches, replace, replace, replace, replaceMatches, toString |
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
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
- Following copied from interface:
com.meyling.principia.logic.basic.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
- Following copied from interface:
com.meyling.principia.logic.basic.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
- Following copied from interface:
com.meyling.principia.logic.basic.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
- Following copied from interface:
com.meyling.principia.logic.basic.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
- Following copied from interface:
com.meyling.principia.logic.basic.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
- Following copied from interface:
com.meyling.principia.logic.basic.Formula
- Parameters:
counter
- number of matches so faroccurrence
- number of matches to act onsearch
- subject variable to look forreplacement
- 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
- Following copied from interface:
com.meyling.principia.logic.basic.Formula
- Parameters:
counter
- contains starting number for
replacement pattern variable, is increased
after one complete replacement- Throws:
ArgumentException
-