Class SubContext
java.lang.Object
edu.udel.cis.vsl.sarl.simplify.simplifier.Context
edu.udel.cis.vsl.sarl.simplify.simplifier.SubContext
- All Implemented Interfaces:
ContextIF
A sub-context represents a boolean expression that holds within the context
of some other assumption. Hence everything in the super-context is assumed to
hold, in addition to everything in the sub-context. This is used to provide
scoping to contexts.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanShould we print debugging information?static final PrintStreamWhere the debugging output goes. -
Constructor Summary
ConstructorsConstructorDescriptionSubContext(Context superContext, Set<SymbolicExpression> simplificationStack) New empty sub-context (equivalent to assumption true).SubContext(Context superContext, Set<SymbolicExpression> simplificationStack, BooleanExpression assumption) Creates new sub-context and initializes it using the given assumption. -
Method Summary
Modifier and TypeMethodDescriptionConstructs an instance ofLinearSolverthat can be used to simplify theContext.subMapof thisContext.getSub(SymbolicExpression key) Looks up an entry in the substitution map of this context.simplify(SymbolicExpression expr) Simplifies a symbolic expression using the current state of thisContext.Methods inherited from class edu.udel.cis.vsl.sarl.simplify.simplifier.Context
addSub, assume, cacheSimplification, clearSimplifications, clone, computeRange, getFullAssumption, getInfo, getRangeMap, getReducedAssumption, getSimplification, getSubEntries, isInconsistent, normalize, print, putSub, removeSubkey, restrictRange, standardizePair, toString
-
Field Details
-
debug
public static boolean debugShould we print debugging information? -
out
Where the debugging output goes.
-
-
Constructor Details
-
SubContext
New empty sub-context (equivalent to assumption true).- Parameters:
superContext- the (non-null) context containing this onesimplificationStack- the symbolic expressions that have already been seen; used to prevent cycles (currently only in debug mode)
-
SubContext
public SubContext(Context superContext, Set<SymbolicExpression> simplificationStack, BooleanExpression assumption) Creates new sub-context and initializes it using the given assumption.- Parameters:
superContext- the (non-null) context containing this onesimplificationStack- the symbolic expressions that have already been seen; used to prevent cycles (currently only in debug mode)assumption- the boolean expression to be represented by this sub-context
-
-
Method Details
-
getSub
Looks up an entry in the substitution map of this context. This method is overridden in the SubContext class.Looks first in this sub-context for an entry in the sub map for the given key. If none is found, then looks in the super-context.
-
getLinearSolver
Constructs an instance ofLinearSolverthat can be used to simplify theContext.subMapof thisContext.For this sub-context, a form of "relative" Gaussian elimination is performed. The linear equalities of this sub-context are simplified using the information from the super-context before ordinary Gaussian elimination is performed.
- Overrides:
getLinearSolverin classContext- Returns:
- a linear solver based on relative Gaussian elimination that can be used to simplify the substitution map of this sub-context assuming all substitutions in the super context
-
simplify
Description copied from class:ContextSimplifies a symbolic expression using the current state of thisContext. -
getGlobalContext
- Overrides:
getGlobalContextin classContext
-