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 interfacestatic interfacestatic interfaceAbstractTermInterpreter.Serializer<A extends AbstractValue<A,C>, C> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAggregator(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 voidaddDomain(DataExprType type, AnyAbstractDomain domain) protected <R,T> void addNegation(DataExprType type, DataExprType result, Function<Term<R>, Term<T>> termFactory) protected voidaddOverload(PrimitiveName name, Signature signature, Function<List<AnyTerm>, AnyTerm> termFactory) protected voidaddOverloadInternal(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) booleanisCastSupported(DataExprType fromType, DataExprType toType) booleanisComparable(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:
getNegationTypein interfaceTermInterpreter
-
getDomain
- Specified by:
getDomainin interfaceTermInterpreter
-
createNegation
- Specified by:
createNegationin interfaceTermInterpreter
-
getUnaryOperationType
- Specified by:
getUnaryOperationTypein interfaceTermInterpreter
-
createUnaryOperator
- Specified by:
createUnaryOperatorin interfaceTermInterpreter
-
isComparable
- Specified by:
isComparablein interfaceTermInterpreter
-
createComparison
public Optional<Term<TruthValue>> createComparison(ComparisonOp op, DataExprType type, AnyTerm left, AnyTerm right) - Specified by:
createComparisonin interfaceTermInterpreter
-
createLatticeOperator
public Optional<AnyTerm> createLatticeOperator(LatticeBinaryOp op, DataExprType type, AnyTerm left, AnyTerm right) - Specified by:
createLatticeOperatorin 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:
createBinaryOperatorin interfaceTermInterpreter
-
createRange
- Specified by:
createRangein interfaceTermInterpreter
-
getBinaryOperatorType
public Optional<DataExprType> getBinaryOperatorType(BinaryOp op, DataExprType leftType, DataExprType rightType) - Specified by:
getBinaryOperatorTypein interfaceTermInterpreter
-
getAggregationType
- Specified by:
getAggregationTypein interfaceTermInterpreter
-
getAggregator
- Specified by:
getAggregatorin interfaceTermInterpreter
-
isCastSupported
- Specified by:
isCastSupportedin interfaceTermInterpreter
-
createCast
- Specified by:
createCastin interfaceTermInterpreter
-
getOverloadedSignature
public Optional<Signature> getOverloadedSignature(PrimitiveName primitive, List<@Nullable DataExprType> argumentTypes) - Specified by:
getOverloadedSignaturein interfaceTermInterpreter
-
createOverloadedFunctionCall
public Optional<AnyTerm> createOverloadedFunctionCall(PrimitiveName primitive, List<DataExprType> argumentTypes, List<AnyTerm> arguments) - Specified by:
createOverloadedFunctionCallin interfaceTermInterpreter
-
createUnknown
- Specified by:
createUnknownin interfaceTermInterpreter
-
createError
- Specified by:
createErrorin interfaceTermInterpreter
-
createNegativeInfinity
- Specified by:
createNegativeInfinityin interfaceTermInterpreter
-
createPositiveInfinity
- Specified by:
createPositiveInfinityin interfaceTermInterpreter
-
serialize
- Specified by:
serializein interfaceTermInterpreter
-