public abstract class FunctionSymbolImpl extends PredicateImpl implements FunctionSymbol
FunctionSymbol.FunctionalTermNullability| Modifier | Constructor and Description |
|---|---|
protected |
FunctionSymbolImpl(String name,
it.unibz.inf.ontop.com.google.common.collect.ImmutableList<TermType> expectedBaseTypes) |
| Modifier and Type | Method and Description |
|---|---|
Optional<ImmutableFunctionalTerm.FunctionalTermDecomposition> |
analyzeInjectivity(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> arguments,
it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<Variable> nonFreeVariables,
VariableNullability variableNullability,
VariableGenerator variableGenerator,
TermFactory termFactory)
To be overridden when is sometimes but not always injective in the absence of non-injective functional terms
|
protected ImmutableTerm |
buildTermAfterEvaluation(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<ImmutableTerm> newTerms,
TermFactory termFactory,
VariableNullability variableNullability)
By default, just build a new functional term.
|
protected boolean |
canBeSafelyDecomposedIntoConjunction(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms,
VariableNullability variableNullability,
it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> otherTerms)
ONLY for injective function symbols
Makes sure that the conjunction would never evaluate as FALSE instead of NULL
(first produced equality evaluated as false, while the second evaluates as NULL)
|
protected ImmutableFunctionalTerm.FunctionalTermDecomposition |
decomposeInjectiveTopFunctionalTerm(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> arguments,
it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<Variable> nonFreeVariables,
VariableNullability variableNullability,
VariableGenerator variableGenerator,
TermFactory termFactory)
Only when injectivity of the top function symbol is proved!
|
protected boolean |
enableIfElseNullLifting()
Returns false if IfElseNullLifting must be disabled althrough it may have been technically possible.
|
IncrementalEvaluation |
evaluateIsNotNull(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms,
TermFactory termFactory,
VariableNullability variableNullability)
Default implementation, can be overridden
|
FunctionSymbol.FunctionalTermNullability |
evaluateNullability(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends NonFunctionalTerm> arguments,
VariableNullability childNullability,
TermFactory termFactory) |
IncrementalEvaluation |
evaluateStrictEq(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms,
ImmutableTerm otherTerm,
TermFactory termFactory,
VariableNullability variableNullability)
Default implementation, to be overridden to convert more cases
Incoming terms are not simplified as they are presumed to be already simplified
(so please simplify them before)
|
protected IncrementalEvaluation |
evaluateStrictEqWithFunctionalTerm(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms,
ImmutableFunctionalTerm otherTerm,
TermFactory termFactory,
VariableNullability variableNullability)
Default implementation, can be overridden
|
protected IncrementalEvaluation |
evaluateStrictEqWithNonNullConstant(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms,
NonNullConstant otherTerm,
TermFactory termFactory,
VariableNullability variableNullability)
Default implementation, does nothing, can be overridden
|
TermType |
getExpectedBaseType(int index) |
protected it.unibz.inf.ontop.com.google.common.collect.ImmutableList<TermType> |
getExpectedBaseTypes() |
boolean |
isAggregation()
By default, assume it is not an aggregation function symbol
To be overridden when needed
|
protected abstract boolean |
isAlwaysInjectiveInTheAbsenceOfNonInjectiveFunctionalTerms()
When the function symbol is, in the absence of non-injective functional sub-terms, sometimes but not always injective,
please override isInjective(...)
|
boolean |
isDeterministic() |
protected boolean |
isInjective(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> arguments,
VariableNullability variableNullability,
TermFactory termFactory) |
boolean |
isNullable(it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<Integer> nullableIndexes)
By default, to be overridden by function symbols that supports tolerate NULL values
|
protected abstract boolean |
mayReturnNullWithoutNullArguments()
Returns false when a functional term with this symbol:
1.
|
Stream<Variable> |
proposeProvenanceVariables(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms)
Conservative by default
Can be overridden
|
ImmutableTerm |
simplify(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms,
TermFactory termFactory,
VariableNullability variableNullability) |
FunctionalTermSimplification |
simplifyAsGuaranteedToBeNonNull(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms,
TermFactory termFactory)
By default, only handles the case of function symbols that do not tolerate nulls
and never return nulls in the absence of nulls as input.
|
protected abstract boolean |
tolerateNulls()
Returns true if is not guaranteed to return NULL when one argument is NULL.
|
protected it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> |
transformIntoRegularArguments(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends NonFunctionalTerm> arguments,
TermFactory termFactory)
By default, reuses the same arguments
Needed to be overridden by function symbols that require EXPRESSIONS for some of their arguments
|
protected Optional<ImmutableTerm> |
tryToLiftMagicNumbers(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<ImmutableTerm> newTerms,
TermFactory termFactory,
VariableNullability variableNullability,
boolean isBoolean) |
equals, getArity, getName, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcanBePostProcessed, inferTypeprotected abstract boolean isAlwaysInjectiveInTheAbsenceOfNonInjectiveFunctionalTerms()
public FunctionSymbol.FunctionalTermNullability evaluateNullability(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends NonFunctionalTerm> arguments, VariableNullability childNullability, TermFactory termFactory)
evaluateNullability in interface FunctionSymbolprotected it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> transformIntoRegularArguments(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends NonFunctionalTerm> arguments, TermFactory termFactory)
public ImmutableTerm simplify(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, TermFactory termFactory, VariableNullability variableNullability)
simplify in interface FunctionSymbolpublic IncrementalEvaluation evaluateStrictEq(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, ImmutableTerm otherTerm, TermFactory termFactory, VariableNullability variableNullability)
evaluateStrictEq in interface FunctionSymbolpublic IncrementalEvaluation evaluateIsNotNull(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, TermFactory termFactory, VariableNullability variableNullability)
evaluateIsNotNull in interface FunctionSymbolpublic boolean isDeterministic()
isDeterministic in interface FunctionSymbolpublic boolean isNullable(it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<Integer> nullableIndexes)
isNullable in interface FunctionSymbolpublic boolean isAggregation()
isAggregation in interface FunctionSymbolpublic Stream<Variable> proposeProvenanceVariables(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms)
proposeProvenanceVariables in interface FunctionSymbolpublic FunctionalTermSimplification simplifyAsGuaranteedToBeNonNull(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, TermFactory termFactory)
simplifyAsGuaranteedToBeNonNull in interface FunctionSymbolprotected IncrementalEvaluation evaluateStrictEqWithFunctionalTerm(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, ImmutableFunctionalTerm otherTerm, TermFactory termFactory, VariableNullability variableNullability)
protected boolean canBeSafelyDecomposedIntoConjunction(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, VariableNullability variableNullability, it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> otherTerms)
protected IncrementalEvaluation evaluateStrictEqWithNonNullConstant(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, NonNullConstant otherTerm, TermFactory termFactory, VariableNullability variableNullability)
protected abstract boolean tolerateNulls()
protected abstract boolean mayReturnNullWithoutNullArguments()
protected boolean enableIfElseNullLifting()
public Optional<ImmutableFunctionalTerm.FunctionalTermDecomposition> analyzeInjectivity(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> arguments, it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<Variable> nonFreeVariables, VariableNullability variableNullability, VariableGenerator variableGenerator, TermFactory termFactory)
analyzeInjectivity in interface FunctionSymbolprotected ImmutableFunctionalTerm.FunctionalTermDecomposition decomposeInjectiveTopFunctionalTerm(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> arguments, it.unibz.inf.ontop.com.google.common.collect.ImmutableSet<Variable> nonFreeVariables, VariableNullability variableNullability, VariableGenerator variableGenerator, TermFactory termFactory)
protected final boolean isInjective(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> arguments, VariableNullability variableNullability, TermFactory termFactory)
protected ImmutableTerm buildTermAfterEvaluation(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<ImmutableTerm> newTerms, TermFactory termFactory, VariableNullability variableNullability)
protected it.unibz.inf.ontop.com.google.common.collect.ImmutableList<TermType> getExpectedBaseTypes()
public TermType getExpectedBaseType(int index)
getExpectedBaseType in interface FunctionSymbolprotected Optional<ImmutableTerm> tryToLiftMagicNumbers(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<ImmutableTerm> newTerms, TermFactory termFactory, VariableNullability variableNullability, boolean isBoolean)
Copyright © 2009–2021 Free University of Bozen-Bolzano. All rights reserved.