|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.qedeq.kernel.bo.logic.common.FormulaUtility
public final class FormulaUtility
Some useful static methods for formulas and terms.
Field Summary |
---|
Fields inherited from interface org.qedeq.kernel.bo.logic.common.Operators |
---|
CLASS_OP, CONJUNCTION_OPERATOR, DISJUNCTION_OPERATOR, EQUIVALENCE_OPERATOR, EXISTENTIAL_QUANTIFIER_OPERATOR, FUNCTION_CONSTANT, FUNCTION_VARIABLE, IMPLICATION_OPERATOR, META_VARIABLE, NEGATION_OPERATOR, PREDICATE_CONSTANT, PREDICATE_VARIABLE, SUBJECT_VARIABLE, UNIQUE_EXISTENTIAL_QUANTIFIER_OPERATOR, UNIVERSAL_QUANTIFIER_OPERATOR |
Method Summary | |
---|---|
static boolean |
containsOperatorVariable(Element formula,
Element operatorVariable)
Checks if a given term or formula contains a given function or predicate variable with same size. |
static Element |
createMeta(Element subjectVariable)
Create meta variable for subject variable. |
static Element |
createPredicateVariable(java.lang.String predicateVariableName)
Create predicate variable out of variable name with no further arguments. |
static Element |
createSubjectVariable(java.lang.String subjectVariableName)
Create subject variable out of variable name. |
static ElementSet |
getBoundSubjectVariables(Element element)
Return all bound subject variables of an element. |
static java.lang.String |
getDifferenceLocation(Element first,
Element second)
Get relative context of the first difference between the given elements. |
static ElementSet |
getFreeSubjectVariables(Element element)
Return all free subject variables of an element. |
static ElementSet |
getPartFormulas(Element element)
Return all part formulas of an element. |
static ElementSet |
getPredicateVariables(Element element)
Return all predicate variables of an element. |
static ElementSet |
getPropositionVariables(Element element)
Return all proposition variables of an element. |
static ElementSet |
getSubjectVariables(Element element)
Return all subject variables of an element. |
static boolean |
isBindingOperator(ElementList list)
Has the given list an operator that binds a subject variable? |
static boolean |
isFunctionConstant(Element element)
Is Element a function constant? |
static boolean |
isFunctionVariable(Element element)
Is Element a function variable? |
static boolean |
isImplication(Element formula)
Is the given formula a simple implication like A => B. |
static boolean |
isOperator(java.lang.String operator,
Element element)
Is the given element an list with given operator and has as first element an non empty string atom? |
static boolean |
isPredicateConstant(Element element)
Is Element a predicate constant? |
static boolean |
isPredicateVariable(Element element)
Is Element a predicate variable? |
static boolean |
isPropositionVariable(Element element)
Is Element a proposition variable? |
static boolean |
isSubjectVariable(Element element)
Is Element a subject variable? |
static Element |
replaceOperatorVariable(Element formula,
Element operatorVariable,
Element replacement)
Replace function or predicate variable by given term or formula. |
static Element |
replaceSubjectVariableQuantifier(Element originalSubjectVariable,
Element replacementSubjectVariable,
Element formulaElement,
int occurrenceGoal,
Enumerator occurreneCurrent)
Replace bound subject variables at given occurrence by another one. |
static boolean |
testOperatorVariable(Element formula,
Element operatorVariable,
ElementSet bound)
Test if operator occurrence in formula matches always to a formula that contains no subject variable that is in the given ElementSet of bound subject variables.. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static final boolean isSubjectVariable(Element element)
Element
a subject variable?
element
- Element to look onto.
public static final boolean isPredicateVariable(Element element)
Element
a predicate variable?
element
- Element to look onto.
public static final boolean isPropositionVariable(Element element)
Element
a proposition variable?
element
- Element to look onto.
public static final boolean isFunctionVariable(Element element)
Element
a function variable?
element
- Element to look onto.
public static final boolean isPredicateConstant(Element element)
Element
a predicate constant?
element
- Element to look onto.
public static final boolean isFunctionConstant(Element element)
Element
a function constant?
element
- Element to look onto.
public static boolean isOperator(java.lang.String operator, Element element)
operator
- Operator.element
- Check this element.
public static final ElementSet getFreeSubjectVariables(Element element)
element
- Work on this element.
public static final ElementSet getBoundSubjectVariables(Element element)
element
- Work on this element.
public static final ElementSet getSubjectVariables(Element element)
element
- Work on this element.
public static final ElementSet getPredicateVariables(Element element)
element
- Work on this element.
public static final ElementSet getPropositionVariables(Element element)
element
- Work on this element.
public static final ElementSet getPartFormulas(Element element)
element
- Work on this element.
public static boolean isBindingOperator(ElementList list)
list
- Check for this operator.
public static java.lang.String getDifferenceLocation(Element first, Element second)
first
- First element.second
- Second element.
public static Element replaceSubjectVariableQuantifier(Element originalSubjectVariable, Element replacementSubjectVariable, Element formulaElement, int occurrenceGoal, Enumerator occurreneCurrent)
originalSubjectVariable
- Replace this subject variable.replacementSubjectVariable
- By this subject variable.formulaElement
- This is the formula we work on.occurrenceGoal
- This is the binding occurrence number.occurreneCurrent
- Counter how much occurrences we already had.
public static Element replaceOperatorVariable(Element formula, Element operatorVariable, Element replacement)
formula
- Formula we want the replacement take place.operatorVariable
- Predicate variable or function variable with only subject
variables as arguments.replacement
- Replacement formula or term with matching subject variables.
operatorVariable
might have some subject variables
that are not in replacement
and vice versa.
public static boolean containsOperatorVariable(Element formula, Element operatorVariable)
formula
- Formula we want the replacement take place.operatorVariable
- Predicate variable or function variable with only subject
variables as arguments.
public static boolean testOperatorVariable(Element formula, Element operatorVariable, ElementSet bound)
formula
- Formula we want to test the condition.operatorVariable
- Predicate variable or function variable with only subject
variables as arguments.bound
- Set of subject variables that are tabu.
public static boolean isImplication(Element formula)
formula
- Check this formula.
public static Element createMeta(Element subjectVariable)
subjectVariable
- Subject variable, we want to have a meta variable for.
public static Element createSubjectVariable(java.lang.String subjectVariableName)
subjectVariableName
- Subject variable name.
public static Element createPredicateVariable(java.lang.String predicateVariableName)
predicateVariableName
- Predicate variable name.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |