Class AbstractTermInterpreter
java.lang.Object
tools.refinery.language.expressions.AbstractTermInterpreter
- All Implemented Interfaces:
TermInterpreter
- Direct Known Subclasses:
BuiltinTermInterpreter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static interface
static interface
AbstractTermInterpreter.Serializer<A extends AbstractValue<A,
C>, C> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAggregator
(AggregatorName aggregator, DataExprType type, DataExprType result, AnyPartialAggregator partialAggregator) protected <R,
T1, T2>
voidaddBinaryOperator
(BinaryOp op, DataExprType leftType, DataExprType rightType, DataExprType result, BiFunction<Term<T1>, Term<T2>, Term<R>> termFactory) protected <R,
T> void addCast
(DataExprType fromType, DataExprType toType, AbstractTermInterpreter.Cast<R, T> cast) protected <A extends AbstractValue<A,
C>, C>
voidaddDomain
(DataExprType type, AbstractDomain<A, C> domain, AbstractTermInterpreter.Serializer<A, C> serializer) protected void
addDomain
(DataExprType type, AnyAbstractDomain domain) protected <R,
T> void addNegation
(DataExprType type, DataExprType result, Function<Term<R>, Term<T>> termFactory) protected void
addOverload
(PrimitiveName name, Signature signature, Function<List<AnyTerm>, AnyTerm> termFactory) protected void
addOverloadInternal
(PrimitiveName name, Signature signature, Function<List<AnyTerm>, AnyTerm> termFactory) protected <R,
T> void addUnaryOperator
(UnaryOp op, DataExprType type, DataExprType result, Function<Term<T>, Term<R>> termFactory) createBinaryOperator
(BinaryOp op, DataExprType leftType, DataExprType rightType, AnyTerm left, AnyTerm right) createCast
(DataExprType fromType, DataExprType toType, AnyTerm body) createComparison
(ComparisonOp op, DataExprType type, AnyTerm left, AnyTerm right) createError
(DataExprType type) createLatticeOperator
(LatticeBinaryOp op, DataExprType type, AnyTerm left, AnyTerm right) <A extends AbstractValue<A,
C>, C>
AnyTermcreateLatticeOperatorTerm
(LatticeBinaryOp op, AbstractDomain<A, C> abstractDomain, AnyTerm left, AnyTerm right) createNegation
(DataExprType type, AnyTerm body) createOverloadedFunctionCall
(PrimitiveName primitive, List<DataExprType> argumentTypes, List<AnyTerm> arguments) createRange
(DataExprType type, AnyTerm left, AnyTerm right) createUnaryOperator
(UnaryOp op, DataExprType type, AnyTerm body) createUnknown
(DataExprType type) getAggregationType
(AggregatorName aggregator, DataExprType type) getAggregator
(AggregatorName aggregator, DataExprType type) getBinaryOperatorType
(BinaryOp op, DataExprType leftType, DataExprType rightType) getDomain
(DataExprType type) getNegationType
(DataExprType type) getOverloadedSignature
(PrimitiveName primitive, List<@Nullable DataExprType> argumentTypes) getUnaryOperationType
(UnaryOp op, DataExprType type) boolean
isCastSupported
(DataExprType fromType, DataExprType toType) boolean
isComparable
(DataExprType type) serialize
(DataExprType type, Object value)
-
Constructor Details
-
AbstractTermInterpreter
protected AbstractTermInterpreter()
-
-
Method Details
-
addDomain
-
addDomain
protected <A extends AbstractValue<A,C>, void addDomainC> (DataExprType type, AbstractDomain<A, C> domain, AbstractTermInterpreter.Serializer<A, C> serializer) -
addNegation
protected <R,T> void addNegation(DataExprType type, DataExprType result, Function<Term<R>, Term<T>> termFactory) -
addUnaryOperator
protected <R,T> void addUnaryOperator(UnaryOp op, DataExprType type, DataExprType result, Function<Term<T>, Term<R>> termFactory) -
addBinaryOperator
protected <R,T1, void addBinaryOperatorT2> (BinaryOp op, DataExprType leftType, DataExprType rightType, DataExprType result, BiFunction<Term<T1>, Term<T2>, Term<R>> termFactory) -
addCast
protected <R,T> void addCast(DataExprType fromType, DataExprType toType, AbstractTermInterpreter.Cast<R, T> cast) -
addAggregator
protected void addAggregator(AggregatorName aggregator, DataExprType type, DataExprType result, AnyPartialAggregator partialAggregator) -
addOverload
-
addOverloadInternal
-
getNegationType
- Specified by:
getNegationType
in interfaceTermInterpreter
-
getDomain
- Specified by:
getDomain
in interfaceTermInterpreter
-
createNegation
- Specified by:
createNegation
in interfaceTermInterpreter
-
getUnaryOperationType
- Specified by:
getUnaryOperationType
in interfaceTermInterpreter
-
createUnaryOperator
- Specified by:
createUnaryOperator
in interfaceTermInterpreter
-
isComparable
- Specified by:
isComparable
in interfaceTermInterpreter
-
createComparison
public Optional<Term<TruthValue>> createComparison(ComparisonOp op, DataExprType type, AnyTerm left, AnyTerm right) - Specified by:
createComparison
in interfaceTermInterpreter
-
createLatticeOperator
public Optional<AnyTerm> createLatticeOperator(LatticeBinaryOp op, DataExprType type, AnyTerm left, AnyTerm right) - Specified by:
createLatticeOperator
in interfaceTermInterpreter
-
createLatticeOperatorTerm
public <A extends AbstractValue<A,C>, AnyTerm createLatticeOperatorTermC> (LatticeBinaryOp op, AbstractDomain<A, C> abstractDomain, AnyTerm left, AnyTerm right) -
createBinaryOperator
public Optional<AnyTerm> createBinaryOperator(BinaryOp op, DataExprType leftType, DataExprType rightType, AnyTerm left, AnyTerm right) - Specified by:
createBinaryOperator
in interfaceTermInterpreter
-
createRange
- Specified by:
createRange
in interfaceTermInterpreter
-
getBinaryOperatorType
public Optional<DataExprType> getBinaryOperatorType(BinaryOp op, DataExprType leftType, DataExprType rightType) - Specified by:
getBinaryOperatorType
in interfaceTermInterpreter
-
getAggregationType
- Specified by:
getAggregationType
in interfaceTermInterpreter
-
getAggregator
- Specified by:
getAggregator
in interfaceTermInterpreter
-
isCastSupported
- Specified by:
isCastSupported
in interfaceTermInterpreter
-
createCast
- Specified by:
createCast
in interfaceTermInterpreter
-
getOverloadedSignature
public Optional<Signature> getOverloadedSignature(PrimitiveName primitive, List<@Nullable DataExprType> argumentTypes) - Specified by:
getOverloadedSignature
in interfaceTermInterpreter
-
createOverloadedFunctionCall
public Optional<AnyTerm> createOverloadedFunctionCall(PrimitiveName primitive, List<DataExprType> argumentTypes, List<AnyTerm> arguments) - Specified by:
createOverloadedFunctionCall
in interfaceTermInterpreter
-
createUnknown
- Specified by:
createUnknown
in interfaceTermInterpreter
-
createError
- Specified by:
createError
in interfaceTermInterpreter
-
createNegativeInfinity
- Specified by:
createNegativeInfinity
in interfaceTermInterpreter
-
createPositiveInfinity
- Specified by:
createPositiveInfinity
in interfaceTermInterpreter
-
serialize
- Specified by:
serialize
in interfaceTermInterpreter
-