public abstract class AbstractDBIfThenFunctionSymbol extends AbstractArgDependentTypedDBFunctionSymbol implements DBIfThenFunctionSymbol
FunctionSymbol.FunctionalTermNullability| Modifier and Type | Field and Description |
|---|---|
protected boolean |
doOrderingMatter |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractDBIfThenFunctionSymbol(String name,
int arity,
DBTermType dbBooleanType,
DBTermType rootDBTermType,
boolean doOrderingMatter) |
| Modifier and Type | Method and Description |
|---|---|
protected ImmutableFunctionalTerm |
buildCase(Stream<Map.Entry<ImmutableExpression,? extends ImmutableTerm>> newWhenPairs,
ImmutableTerm defaultValue,
TermFactory termFactory)
Can be overridden
|
boolean |
canBePostProcessed(com.google.common.collect.ImmutableList<? extends ImmutableTerm> arguments)
Conservative: can only be post-processed when all sub-functional terms (at different levels of depth)
can be post-processed.
|
protected abstract ImmutableTerm |
extractDefaultValue(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms,
TermFactory termFactory) |
Stream<ImmutableTerm> |
extractPossibleValues(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms) |
protected Stream<ImmutableFunctionalTerm> |
extractSubFunctionalTerms(com.google.common.collect.ImmutableList<? extends ImmutableTerm> subTerms)
Recursive
|
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 |
isPreferringToBePostProcessedOverBeingBlocked()
If it is better to be post-processed than being blocked behind an UNION.
|
protected boolean |
mayReturnNullWithoutNullArguments()
Default, can be overridden
|
ImmutableExpression |
pushDownExpression(ImmutableExpression expression,
int indexOfDBIfThenFunctionSymbol,
TermFactory termFactory)
Pushes a unary boolean function symbol down to the "then" arguments
For instance,
f(CASE(c1, t1, c2, t2, t3), t4) -> BOOL_CASE(c1, f(t1,t4), c2, f(t2,t4), f(t3,t4)) |
protected <T extends ImmutableFunctionalTerm> |
pushDownFunctionalTerm(T functionalTerm,
int indexOfDBIfThenFunctionSymbol,
TermFactory termFactory,
BiFunction<FunctionSymbol,com.google.common.collect.ImmutableList<? extends ImmutableTerm>,T> functionalTermCst,
BiFunction<Stream<Map.Entry<ImmutableExpression,T>>,T,T> caseCst) |
ImmutableFunctionalTerm |
pushDownRegularFunctionalTerm(ImmutableFunctionalTerm functionalTerm,
int indexOfDBIfThenFunctionSymbol,
TermFactory termFactory)
Similar to pushDownExpression(...) but for regular functional terms
|
ImmutableTerm |
simplify(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms,
TermFactory termFactory,
VariableNullability variableNullability) |
protected ImmutableTerm |
simplifyValue(ImmutableTerm immutableTerm,
VariableNullability variableNullability,
TermFactory termFactory)
Can be overridden
|
protected boolean |
tolerateNulls()
Returns true if is not guaranteed to return NULL when one argument is NULL.
|
protected com.google.common.collect.ImmutableList<? extends ImmutableTerm> |
transformIntoRegularArguments(com.google.common.collect.ImmutableList<? extends NonFunctionalTerm> arguments,
TermFactory termFactory)
Requires some of its arguments to be expressions
|
inferTypeanalyzeInjectivity, buildTermAfterEvaluation, canBeSafelyDecomposedIntoConjunction, decomposeInjectiveTopFunctionalTerm, enableIfElseNullLifting, evaluateIsNotNull, evaluateNullability, evaluateStrictEq, evaluateStrictEqWithFunctionalTerm, evaluateStrictEqWithNonNullConstant, getExpectedBaseType, getExpectedBaseTypes, isAggregation, isDeterministic, isInjective, isNullable, proposeProvenanceVariables, simplifyAsGuaranteedToBeNonNull, tryToLiftMagicNumbersequals, getArity, getName, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitanalyzeInjectivity, evaluateIsNotNull, evaluateNullability, evaluateStrictEq, getExpectedBaseType, inferType, isAggregation, isDeterministic, isNullable, proposeProvenanceVariables, simplifyAsGuaranteedToBeNonNullgetArity, getNamegetNativeDBStringprotected AbstractDBIfThenFunctionSymbol(@Nonnull String name, int arity, DBTermType dbBooleanType, DBTermType rootDBTermType, boolean doOrderingMatter)
public boolean isAlwaysInjectiveInTheAbsenceOfNonInjectiveFunctionalTerms()
FunctionSymbolImplisAlwaysInjectiveInTheAbsenceOfNonInjectiveFunctionalTerms in class FunctionSymbolImplpublic Stream<ImmutableTerm> extractPossibleValues(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms)
extractPossibleValues in interface DBIfThenFunctionSymbolextractPossibleValues in class AbstractArgDependentTypedDBFunctionSymbolpublic ImmutableTerm simplify(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, TermFactory termFactory, VariableNullability variableNullability)
simplify in interface FunctionSymbolsimplify in class FunctionSymbolImplprotected ImmutableTerm simplifyValue(ImmutableTerm immutableTerm, VariableNullability variableNullability, TermFactory termFactory)
protected ImmutableFunctionalTerm buildCase(Stream<Map.Entry<ImmutableExpression,? extends ImmutableTerm>> newWhenPairs, ImmutableTerm defaultValue, TermFactory termFactory)
public boolean canBePostProcessed(com.google.common.collect.ImmutableList<? extends ImmutableTerm> arguments)
canBePostProcessed in interface FunctionSymbolprotected Stream<ImmutableFunctionalTerm> extractSubFunctionalTerms(com.google.common.collect.ImmutableList<? extends ImmutableTerm> subTerms)
protected abstract ImmutableTerm extractDefaultValue(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, TermFactory termFactory)
protected boolean mayReturnNullWithoutNullArguments()
mayReturnNullWithoutNullArguments in class FunctionSymbolImplprotected boolean tolerateNulls()
FunctionSymbolImpltolerateNulls in class FunctionSymbolImplpublic boolean isPreferringToBePostProcessedOverBeingBlocked()
DBFunctionSymbolisPreferringToBePostProcessedOverBeingBlocked in interface DBFunctionSymbolprotected com.google.common.collect.ImmutableList<? extends ImmutableTerm> transformIntoRegularArguments(com.google.common.collect.ImmutableList<? extends NonFunctionalTerm> arguments, TermFactory termFactory)
transformIntoRegularArguments in class FunctionSymbolImplpublic ImmutableExpression pushDownExpression(ImmutableExpression expression, int indexOfDBIfThenFunctionSymbol, TermFactory termFactory)
DBIfThenFunctionSymbolf(CASE(c1, t1, c2, t2, t3), t4) -> BOOL_CASE(c1, f(t1,t4), c2, f(t2,t4), f(t3,t4))pushDownExpression in interface DBIfThenFunctionSymbolpublic ImmutableFunctionalTerm pushDownRegularFunctionalTerm(ImmutableFunctionalTerm functionalTerm, int indexOfDBIfThenFunctionSymbol, TermFactory termFactory)
DBIfThenFunctionSymbolpushDownRegularFunctionalTerm in interface DBIfThenFunctionSymbolprotected <T extends ImmutableFunctionalTerm> T pushDownFunctionalTerm(T functionalTerm, int indexOfDBIfThenFunctionSymbol, TermFactory termFactory, BiFunction<FunctionSymbol,com.google.common.collect.ImmutableList<? extends ImmutableTerm>,T> functionalTermCst, BiFunction<Stream<Map.Entry<ImmutableExpression,T>>,T,T> caseCst)
Copyright © 2009–2020 Free University of Bozen-Bolzano. All rights reserved.