Interface FOFormulaDisjunction
- All Superinterfaces:
FOFormula, fr.inria.rules.dlgpemodel.api.formulas.IDisjunction, fr.inria.rules.dlgpemodel.api.formulas.IFormula, fr.inria.rules.dlgpemodel.api.sentences.IPrintable, Substitutable<FOFormula>, TermCompound
- All Known Implementing Classes:
FODisjunctionImpl
public non-sealed interface FOFormulaDisjunction
extends FOFormula, fr.inria.rules.dlgpemodel.api.formulas.IDisjunction
Representation of disjunctions of sub formulas
- Author:
- Florent Tornil, Guillaume Perution-Kihli
-
Field Summary
Fields inherited from interface fr.inria.rules.dlgpemodel.api.sentences.IPrintable
WRITER -
Method Summary
Modifier and TypeMethodDescriptiondefault FOFormulaDisjunctionapplySubstitution(Substitution substitution) Applies a substitution without evaluating nested functions.applySubstitution(Substitution substitution, boolean evaluate) Applies a substitution to this formula.Recursively flattens this disjunction by expanding any nested disjunctions and returning aStreamthat contains only sub‑formulas which are not disjunctions themselves.Collection<? extends FOFormula> default booleanIndicates whether this formula node is a disjunction.Methods inherited from interface FOFormula
asAtomSet, asBooleanQuery, copy, getPredicates, isAtomic, isConjunction, isNegationMethods inherited from interface fr.inria.rules.dlgpemodel.api.formulas.IDisjunction
exportsMethods inherited from interface fr.inria.rules.dlgpemodel.api.sentences.IPrintable
toDLGPEMethods inherited from interface TermCompound
getAllNestedTerms, getConstants, getLiterals, getNestedTerms, getTerms, getVariables
-
Method Details
-
isDisjunction
default boolean isDisjunction()Description copied from interface:FOFormulaIndicates whether this formula node is a disjunction.- Specified by:
isDisjunctionin interfaceFOFormula- Returns:
- true iff this node of the formula is a disjunction
-
getSubElements
Collection<? extends FOFormula> getSubElements()- Specified by:
getSubElementsin interfacefr.inria.rules.dlgpemodel.api.formulas.IDisjunction- Returns:
- the sub formulas
-
applySubstitution
Description copied from interface:FOFormulaApplies a substitution without evaluating nested functions.- Specified by:
applySubstitutionin interfaceFOFormula- Specified by:
applySubstitutionin interfaceSubstitutable<FOFormula>- Parameters:
substitution- the substitution to apply- Returns:
- the substituted formula
-
applySubstitution
Description copied from interface:FOFormulaApplies a substitution to this formula.- Specified by:
applySubstitutionin interfaceFOFormula- Specified by:
applySubstitutionin interfaceSubstitutable<FOFormula>- Parameters:
substitution- the substitution to applyevaluate- whether evaluable functions should be evaluated- Returns:
- the substituted formula
-
flattenedSubFormulas
Recursively flattens this disjunction by expanding any nested disjunctions and returning aStreamthat contains only sub‑formulas which are not disjunctions themselves.Conceptually, the transformation performed is:
(A v (B v C) v D) ⟼ (A v B v C v D)
The method is implemented lazily—no intermediate collections are created and elements are produced on demand.- Returns:
- a sequential stream of the atomic sub‑formulas of this disjunction, with all nested disjunction layers removed Note: The traversal is depth‑first and preserves the left‑to‑right order of the original formula.
-