This module implements the data type of Quartz expressions together with many functions. Expressions are split into expressions having different Quartz types as well as left-hand side expressions LhsExpr that may have any type, but whose operators are restricted to those that can appear on left-hand sides of assignments. Certain operators like *Var,*Ite,*Case,*ArrAcc, and *TupAcc are defined for all types and these generate variables, if-then-else expressions, case expressions, array element access, and tuple access. The other operators should be rather self-explaining (see Module StaticEvaluation for further explanation of these operations and note that boolean lists are usually bitvector constants, radix-2 numbers or 2-complement numbers).
Type | Description |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type abbreviation for substitutions |
|
|
Function or value | Description |
|
compute atoms of a BoolExpr in some random order
|
|
print a propositional formula in Latex
|
|
compute the cells of a declaration
|
|
|
|
compute the cells of an interface
|
|
Enumerate all assignments for the given list of atoms; an assignment is thereby a map that maps an atom of the given boolean expression to a boolean value.
|
|
returns a default value (e.g. used as initial value in Quartz) for a given type; for Qarr types, the default value of the base type is returned.
|
|
|
|
Evaluate a formula with respect to a given assignment of its atoms. It is expected that the given assignment is complete, i.e., that every atom of the given boolean expression is mapped to either true or false.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GetArr(Earr t)=t and fails for other expressions
|
|
GetBool(Ebool t)=t and fails for other expressions
|
|
GetBtv(Ebtv t)=t and fails for other expressions
|
|
GetInt(Eint t)=t and fails for other expressions
|
|
GetLhs(Elhs t)=t and fails for other expressions
|
|
GetNat(Enat t)=t and fails for other expressions
|
|
GetReal(Ereal t)=t and fails for other expressions
|
|
GetTup(Etup t)=t and fails for other expressions
|
|
|
|
|
|
|
|
generate a BoolExpr that states that lhsExpr1 and lhsExpr2 are equal
|
|
LhsWriteCells lhs computes the writeable cells of a lhsExpr.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MkCaseExpr(CL,expr) generates a case-expression using one of the constructors BoolCase,BtvCase,NatCase,IntCase,RealCase,ArrCase,TupCase depending on expr.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MkIteExpr(b,e1,e2) generates an if-then-else expression using one of the constructors BoolIte,BtvIte,NatIte,IntIte,RealIte,ArrIte,TupIte depending on the "types" of e1 and e2 (that should be the same). The result may however not be an Ite-expression since some simplication rules are used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MkTupAccExpr qty (t,i) generates a tuple selection using one of the constructors BoolTupAcc,BtvTupAcc,NatTupAcc,IntTupAcc,RealTupAcc,ArrTupAcc,TupTupAcc depending on qty.
|
|
|
|
generates a variable with name qn and type qtype as an expression
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Partial evaluation of a formula wrt. a partial variable assignment: Since the given assignment rho may not map every atom of the boolean expression to a boolean value, the result is just another boolean formula where the mapped atoms are replaced by constants and where simplifications were applied to propagate these constants.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Prints a substitution
|
|
|
|
QNameOfVarExpr extracts the qualified name of an expression variable, e.g. QNameOfVarExpr(Ebool(BoolVar qn))=qn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TargetOfLhs extracts the name of the variable that is written by the given LhsExpr expr, e.g. TargetOfLhs(LhsVar(qn,qty))=qn
|
|
|
|
|
|
|
|
|