Encodes path conditions
Encodes path conditions
Paths are encoded as an (ordered) series of let-bindings and boolean propositions. A path is satisfiable iff all propositions are true in the context of the provided let-bindings.
This encoding enables let-bindings over types for which equality is not defined, whereas an encoding of let-bindings with equalities could introduce non-sensical equations.
Simplifies the provided adt selector.
Simplifies the provided adt selector.
Encoding of simplified fn(realArgs)
(function application).
Encoding of simplified fn(realArgs)
(function application).
Transforms
((x: A, y: B) => g(x, y))(c, d)
into
val x0 = c val y0 = d g(x0, y0)
and further simplifies it.
Generates an instance of type tpe
such that the following holds:
Generates an instance of type tpe
such that the following holds:
constructExpr(i, tpe) == constructExpr(j, tpe)
iff
i == j
.
i == j }}}
constructExpr(i, tpe) == constructExpr(j, tpe) }}}
Override point for simplifier creation
Override point for simplifier creation
Override point for transformer with PC creation
Override point for transformer with PC creation
Makes sure these symbols pass a certain number of well-formedness checks, such as - function definition bodies satisfy the declared return types - adt sorts and constructors point to each other correctly - each adt type has at least one instance - adt type parameter flags match between children and parents - every variable is available in the scope of its usage
Makes sure these symbols pass a certain number of well-formedness checks, such as - function definition bodies satisfy the declared return types - adt sorts and constructors point to each other correctly - each adt type has at least one instance - adt type parameter flags match between children and parents - every variable is available in the scope of its usage
Fully expands all let expressions.
Fully expands all let expressions.
Returns a nested string explaining why this expression is typed the way it is.
Returns a nested string explaining why this expression is typed the way it is.
Encoding of simplified forall(args, body)
(universal quantification).
Hoists all IfExpr at top level.
Hoists all IfExpr at top level.
Guarantees that all IfExpr will be at the top level and as soon as you encounter a non-IfExpr, then no more IfExpr can be found in the sub-expressions
Assumes no match expressions
Encoding of simplified if (c) t else e
(if-expression).
Encoding of expr.isInstanceOf[tpe], simplifies to true
or false
in clear cases.
Encoding of expr.isInstanceOf[tpe], simplifies to true
or false
in clear cases.
Returns 'true' iff the evaluation of expression expr
cannot lead to a crash.
Returns 'true' iff the evaluation of expression expr
cannot lead to a crash.
Returns 'true' iff the evaluation of expression expr
cannot lead to a crash under the provided path.
Returns 'true' iff the evaluation of expression expr
cannot lead to a crash under the provided path.
Returns true if expr is a value.
Returns true if expr is a value. Stronger than isGround
Returns true if expr is a value of type t
Returns true if expr is a value of type t
Encoding of
, and returns val id = e; vd
bd
if the identifier is not bound in bd
AND
the expression e
is pure.
Lifts lets to top level.
Lifts lets to top level.
Does not push any used variable out of scope.
Wrapper around normalizeStructure that is tailored for structural equality of Lambda and Forall instances.
Wrapper around normalizeStructure that is tailored for structural equality of Lambda and Forall instances.
Normalizes identifiers in an expression to enable some notion of structural equality between expressions on which usual equality doesn't make sense (i.e.
Normalizes identifiers in an expression to enable some notion of structural equality between expressions on which usual equality doesn't make sense (i.e. closures).
This function relies on the static map identifiers
to ensure identical
structures.
The "arguments" (free variables) of expr
The expression to be normalized
Determines whether E-matching patterns should be preserved during normalization (useful for normalizing foralls)
Determines whether non-simple expressions (see
isSimple) should be normalized into a
dependency or recursed into (when they don't depend on args
).
This distinction is used to provide general equality checks
between functions even when they have complex closures.
Determines whether normalization is called on a function. If not, then normalization can normalize impure expressions when the path-condition is empty.
Returns simplest value of a given type
Returns simplest value of a given type
Replace each node by its constructor
Replace each node by its constructor
Remap the expression by calling the corresponding constructor for each node of the expression. The constructor will perfom some local simplifications, resulting in a simplified expression.
Pre-processing for solvers that handle universal quantification in order to increase the precision of polarity analysis for quantification instantiations.
Pre-processing for solvers that handle universal quantification in order to increase the precision of polarity analysis for quantification instantiations.
Simplify all the pure and ground sub-expressions of the given expression, by evaluating them using inox.evaluators.Evaluator.
Simplify all the pure and ground sub-expressions of the given expression,
by evaluating them using inox.evaluators.Evaluator.
If force
is omitted, the given expression will only be evaluated if it is
ground, pure, and does not contain choose or quantifiers.
If isTuple
:
tupleSelect(tupleWrap(Seq(Tuple(x,y))), 1) -> x
tupleSelect(tupleExpr,1) -> tupleExpr._1
If not isTuple
(usually used only in the case of a tuple of arity 1)
tupleSelect(tupleWrap(Seq(Tuple(x,y))),1) -> Tuple(x,y)
.
If isTuple
:
tupleSelect(tupleWrap(Seq(Tuple(x,y))), 1) -> x
tupleSelect(tupleExpr,1) -> tupleExpr._1
If not isTuple
(usually used only in the case of a tuple of arity 1)
tupleSelect(tupleWrap(Seq(Tuple(x,y))),1) -> Tuple(x,y)
.
Simplifies the construct TupleSelect(expr, index)
Simplifies the construct TupleSelect(expr, index)
The arity of the tuple. If less or equal to 1, the whole expression is returned.
Ensures the closure res
can only be equal to some other closure if they share the same
integer identifier id
.
Ensures the closure res
can only be equal to some other closure if they share the same
integer identifier id
. This method makes sure this property is preserved after going through
normalizeStructure(e:SymbolOps\.this\.trees\.Expr,onlySimple:Boolean)*.
Provides the class and function definitions of a program and lookups on them