- All Known Subinterfaces:
PreUniverse,SymbolicUniverse
CoreUniverse provides most of the functionality of a
SymbolicUniverse, including the mechanisms to create and manipulate
SymbolicExpressions and other SymbolicObjects. The part that
is missing deals with "reasoning", i.e., the ability to determine the
validity of formulas and to simplify expressions within a "context".-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThe result of analyzing certain "forall" expressions. -
Method Summary
Modifier and TypeMethodDescriptionadd(NumericExpression arg0, NumericExpression arg1) Returns a symbolic expression which is the result of adding the two given symbolic expressions.add(Iterable<? extends NumericExpression> args) Returns a symbolic expression representing the sum of the given argument sequence.and(BooleanExpression arg0, BooleanExpression arg1) Returns a symbolic expression representing the conjunction of the two given arguments.and(Iterable<? extends BooleanExpression> args) Returns a symbolic expression which represents the conjunction of the expressions in the given array args.append(SymbolicExpression concreteArray, SymbolicExpression element) Appends an element to the end of a concrete symbolic array.apply(SymbolicExpression function, Iterable<? extends SymbolicExpression> argumentSequence) The result of applying an uninterpreted function to a sequence of arguments.array(SymbolicType elementType, SymbolicExpression[] elements) Creates a concrete array expression backed by the given Java array.array(SymbolicType elementType, Iterable<? extends SymbolicObject> elements) Returns the concrete array consisting of given sequence of elements.dev.civl.sarl.util.Pair<Integer, SymbolicType> Returns the dimension and base type of an array type.arrayElementReference(ReferenceExpression arrayReference, NumericExpression index) Given a reference to an array and anindex(integer), returns a reference to the element of the array at that index.arrayLambda(SymbolicCompleteArrayType arrayType, SymbolicExpression function) Returns an expression representing an array with element type T defined by a function f from int to T.arrayRead(SymbolicExpression array, NumericExpression index) Returns an expression representing the value of the element of the array at position index.arrayType(SymbolicType elementType) Returns the incomplete array type with the given element type.arrayType(SymbolicType elementType, NumericExpression extent) Returns the complete array type with the given element type and extent (array length).arrayWrite(SymbolicExpression array, NumericExpression index, SymbolicExpression value) Returns an expression representing the result of modifying an array by changing the value at position index.assign(SymbolicExpression value, ReferenceExpression reference, SymbolicExpression subValue) Given a symbolic expression value, a reference to a point within that value, and a subValue, returns the symbolic expression obtained by replacing the referenced part of value with subValue.bitand(NumericExpression left, NumericExpression right) Returns the result of bit-and operation for two given unsigned integers, those two unsigned integers are in the form ofNumericExpression.bitnot(NumericExpression expression) Returns the result of bit-not operation for the given unsigned integer, the given unsigned integer is in the form ofNumericExpression.bitor(NumericExpression left, NumericExpression right) Returns the result of bit-or operation for two given unsigned integers, those two unsigned integers are in the form ofNumericExpression.bitshiftLeft(NumericExpression left, NumericExpression right) Returns the result of bit-left-shift operation for the given unsigned integer, the given unsigned integer is in the form ofNumericExpression.bitshiftRight(NumericExpression left, NumericExpression right) Returns the result of bit-right-shift operation for the given unsigned integer, the given unsigned integer is in the form ofNumericExpression.bitvector2Integer(SymbolicExpression bitvector) Converts a bit vector to an integer.bitVectorType(int length) Returns theSymbolicCompleteArrayTyperepresenting a bitVectorType, which is an array of booleans with concrete length.bitxor(NumericExpression left, NumericExpression right) Returns the result of bit-xor operation for two given unsigned integers, those two unsigned integers are in the form ofNumericExpression.bool(boolean value) Short cut for symbolic(booleanObject(value)).bool(BooleanObject object) The symbolic expression wrapping the given boolean object (true or false).booleanObject(boolean value) Returns theBooleanObjectwrapping the given boolean value.The boolean type.boundedIntegerType(NumericExpression min, NumericExpression max, boolean cyclic) Returns the bounded integer types with specified upper and lower bounds.canonicalRenamer(String root) Returns an operator onSymbolicExpressions that replaces all symbolic constants (including bound ones) with symbolic constants with unique canonical names.canonicalRenamer(String root, Predicate<SymbolicConstant> ignore) Returns an operator onSymbolicExpressions that replaces all symbolic constants (including bound ones) with symbolic constants with unique canonical names.cast(SymbolicType newType, SymbolicExpression expression) Casts expression to new type.ceil(NumericExpression expr) Given an expression x of real type, returns an expression of integer type representing the least integer greater than or equal to x.character(char theChar) Returns a concrete symbolic expression of character type which wraps the given Java char.Returns the character type.Returns a comparator on the set of all symbolic objects.compatible(SymbolicType type0, SymbolicType type1) Returns a boolean expression which holds iff the two types are compatible.Returns a symbolic expression of aSymbolicUninterpretedType.cond(BooleanExpression predicate, SymbolicExpression trueCase, SymbolicExpression falseCase) "If-then-else" expression.constantArray(SymbolicType elementType, NumericExpression length, SymbolicExpression value) Returns an array in which every element has the same value.Returns a substituter for which the base substitutions are specified by an explicit JavaMap.denseArrayWrite(SymbolicExpression array, Iterable<? extends SymbolicExpression> values) Returns an array obtained by performing a sequence of writes, given in a "dense" format, to an array.dereference(SymbolicExpression value, ReferenceExpression reference) Given areferenceand avalue, returns the sub-expression ofvaluespecified by the reference.derivative(SymbolicExpression function, IntObject index, IntObject degree) Returns the function which is thedegree-th derivative offunctionwith respect to theindex-th parameter.differentiable(SymbolicExpression function, IntObject degree, Iterable<? extends NumericExpression> lowerBounds, Iterable<? extends NumericExpression> upperBounds) Returns an expression of boolean type which encodes the claim that a function is differentiable on a closed interval in R^n.divide(NumericExpression arg0, NumericExpression arg1) Returns a symbolic expression which is the result of dividing arg0 by arg1.Does the integer a divide the integer b evenly? I.e, does there exist an integer n such that b=a*n?emptyArray(SymbolicType elementType) Returns array of length 0.emptyMap(SymbolicMapType mapType) Returns the entry set of the map.entryType(SymbolicMapType mapType) Returns a tuple type which has two components: component 0 is the key type of the map type; component 1 is the value type of the map type.equals(SymbolicExpression arg0, SymbolicExpression arg1) Returns expression equivalent to arg0 = arg1 ("equals").equiv(BooleanExpression arg0, BooleanExpression arg1) Returns a symbolic expression representing "p is equivalent to q", i.e., pinvalid input: '<'=>q.exists(SymbolicConstant boundVariable, BooleanExpression predicate) Returns the existentially quantified expression exists(x).e.existsInt(NumericSymbolicConstant index, NumericExpression low, NumericExpression high, BooleanExpression predicate) A special case of "exists" that is very common: exists integer i such that lowinvalid input: '<'=iinvalid input: '<'high and p(i).expand(NumericExpression expr) Attempts to expand an expression as a sum of simpler expressions.extractBoolean(BooleanExpression expression) If the given expression has a concreteBooleanvalue, this returns it, else it returnsnull.extractCharacter(SymbolicExpression expression) If the given expression is a concrete character expression, this returns the character value, else it returnsnull.extractNumber(NumericExpression expression) Returns theNumbervalue if the given symbolic expression has a concrete numerical value, else returnsnull.Returns the boolean literal false.floor(NumericExpression expr) Given an expression x of real type, returns an expression of integer type representing the greatest integer less than or equal to x.forall(SymbolicConstant boundVariable, BooleanExpression predicate) Returns the universally quantified expression forall(x).e.forallInt(NumericSymbolicConstant index, NumericExpression low, NumericExpression high, BooleanExpression predicate) A special case of "forall" that is very common: forall integers i such that lowinvalid input: '<'=iinvalid input: '<'high, p(i).fullySubstitute(Map<SymbolicExpression, SymbolicExpression> substituteMap, SymbolicExpression expression) Substitute the givenSymbolicExpressionexpression by repeatedly applying the methoduntil no more substitution can happen.invalid reference
#apply(SymbolicExpression)functionType(Iterable<? extends SymbolicType> inputTypes, SymbolicType outputType) Returns the specified function type.functionType(Iterable<? extends SymbolicType> inputTypes, SymbolicType outputType, SymbolicFunctionType.SpecialRelationKind relKind) Returns the specified function type.get(SymbolicExpression map, SymbolicExpression key) Summary:Get the name (path) of the prover unexpected error file.getForallStructure(BooleanExpression forallExpr) Attempts to find a boolean expression equivalent toforallExprbut with the structureReturns the set of unbound symbolic constants occurring in an expression.intGet the current upper bound of the integer length.Returns the output stream to which information (such as queries) will be printed.The upper bound on the probability of error when deciding whether a polynomial is 0.booleanGets theshowProverQueriesflag: iftrue, the theorem prover queries processed by the underlying theorem prover(s) will be printed to the output stream.booleanGets theshowQueriesflag: iftrue, SARL theorem prover queries will be printed to the output stream.getSummands(NumericExpression expr) Decomposes an expression as a sum of terms, returning those terms as an array.booleanShall theReasoners generated by this universe use backwards substitution when simplifying, in order to solve for certain numeric expressions in terms of others?Returns the Herbrand integer type.Returns the Herbrand real type.Returns the identity (or "trivial") referenceI.implies(BooleanExpression arg0, BooleanExpression arg1) Returns a symbolic expression representing "p implies q", i.e., p=>q.insertElementAt(SymbolicExpression concreteArray, int index, SymbolicExpression value) Inserts value an position index in array, shifting subsequence elements "up".integer(int value) Returns the integer symbolic expression with the givenintvalue.integer(long value) Returns the numeric symbolic expression with the givenlongvalue.integer(BigInteger value) Returns the numeric symbolic expression with the givenBigIntegervalue.integer2Bitvector(NumericExpression integer, SymbolicCompleteArrayType bitVectorType) Returns the conversion of a bit vector from an integer.The "ideal" integer type, representing the set of mathematical integers.intObject(int value) Returns theIntObjectwrapping the given Javaintvalue.booleanbooleanisSubsetOf(SymbolicExpression set1, SymbolicExpression set2) keySet(SymbolicExpression map) lambda(SymbolicConstant boundVariable, SymbolicExpression expression) Returns the lambda expression lambda(x).e, i.e., the expression representing the function which given x returns e, where e might possibly involve the variable x.length(SymbolicExpression array) Returns the length of any symbolic expression of array type.lessThan(NumericExpression arg0, NumericExpression arg1) Returns expression equivalent to arg0 invalid input: '<' arg1.lessThanEquals(NumericExpression arg0, NumericExpression arg1) Returns expression equivalent to arg0 invalid input: '<'= arg1 ("less than or equal to").make(SymbolicExpression.SymbolicOperator operator, SymbolicType type, SymbolicObject[] arguments) Applies the given operator to the arguments and returns the resulting expression in the form used by this universe.mapSubstituter(UnaryOperator<SymbolicExpression> operator) Returns a substituter for which the base substitutions are specified by an explicit JavaMap.mapType(SymbolicType keyType, SymbolicType valueType) Under construction.minus(NumericExpression arg) Returns a symbolic expression which is the negative of the given numerical expression.modulo(NumericExpression arg0, NumericExpression arg1) Returns a symbolic expression which represents arg0 modulo arg1.multiply(NumericExpression arg0, NumericExpression arg1) Returns a symbolic expression which is the result of multiplying the two given symbolic expressions.multiply(Iterable<? extends NumericExpression> args) Returns symbolic expression representing the product of the given sequence of expressions.nameSubstituter(Map<StringObject, StringObject> nameMap) Returns a substituter specified by a mapping of old names to new names for symbolic constants.neq(SymbolicExpression arg0, SymbolicExpression arg1) Returns expression equivalent to arg0 != arg1 ("not equals").not(BooleanExpression arg) Returns a symbolic expression representing the logical negation of the given expression arg.Returns the "NULL" expression.Returns the "null reference", a symbolic expression of reference type which is not equal to a reference value returned by any of the other methods, and which cannot be dereferenced.Returns the concrete symbolic expression wrapping the given number.number(NumberObject numberObject) Returns the concrete symbolic expression wrapping the given number object.Returns the number factory used by this universe.numberObject(Number value) Returns theNumberObjectwrapping the givenNumbervalue.intReturns the number of canonic symbolic objects controlled by this universe.intReturns the total number of calls made to the validity method in the underlying automated theorem prover.intReturns the total number of calls made to methodsReasoner.valid(BooleanExpression)andReasoner.validOrModel(BooleanExpression).objectWithId(int id) Gets the canonicSymbolicObjectbelonging to this universe with the given ID number.offsetReference(ReferenceExpression reference, NumericExpression offset) oneInt()The symbolic expression representing the integer 1.oneReal()Returns the symbolic expression representing the real number 1.or(BooleanExpression arg0, BooleanExpression arg1) Returns a symbolic expression representing the disjunction of the two given arguments.or(Iterable<? extends BooleanExpression> args) Returns a symbolic expression which represents the disjunction of the expressions in the given array args.permut(SymbolicExpression array_a, SymbolicExpression array_b, NumericExpression low, NumericExpression high) A permutation predicate, which asserts the slice from lower indexlowto higher indexhighin arrayarray_ais a permutation of the slice from lower indexlowto higher indexhighin arrayarray_b.power(NumericExpression base, int exponent) Equivalent topower(base, intObject(exponent)).power(NumericExpression base, NumericExpression exponent) General power operator: eb.power(NumericExpression base, IntegerNumber exponent) Concrete power operator: eb, where b is a concrete non-negativeIntegerNumber.voidprintCompressed(SymbolicExpression expr, PrintStream out) Prints the expression by preceding with a sequence of definitions of sub-expressions which are used more than once.voidprintCompressedTree(String prefix, SymbolicExpression expr, PrintStream out) Use this method to print large symbolic expression hierarchically.voidprintExprTree(SymbolicExpression expr, PrintStream out) print symbolic expression as tree structurepureType(SymbolicType type) Returns the "pure" version of the type, i.e., the compatibleSymbolicTypethat contains noSymbolicExpressions.put(SymbolicExpression map, SymbolicExpression key, SymbolicExpression value) quickEquals(SymbolicExpression arg0, SymbolicExpression arg1) rational(double value) Returns the symbolic expression of real type (SymbolicRealType) representing the givendoublevalue.rational(float value) Returns the symbolic expression of real type (SymbolicRealType) representing the givenfloatvalue.rational(int value) Returns the symbolic expression of real type (SymbolicRealType) representing the givenintvalue.rational(int numerator, int denominator) Returns the rational number obtained by dividing two integers,numeratoranddenominator.rational(long value) Returns the symbolic expression of real type (SymbolicRealType) representing the givenlongvalue.rational(long numerator, long denominator) Returns the rational number obtained by dividing two long integers.rational(BigInteger value) Returns the symbolic expression of real type (SymbolicRealType) representing the givenBigIntegervalue.rational(BigInteger numerator, BigInteger denominator) Returns the rational number obtained by dividing twoBigIntegers.realType()The "ideal" real type, representing the set of mathematical real numbers.reduction(SymbolicExpression[] operands, NumericExpression count, SymbolicExpression op, List<BooleanExpression> compatibleConditionsOutput) a$reductionfunction that takes a list of operands, the number of elements per operand and an operator, returns the element-wise reduction result of the operator over the operands.referencedType(SymbolicType type, ReferenceExpression reference) Returns the type referenced by a reference into an expression of the given type.Returns the type of all reference expressions.removeElementAt(SymbolicExpression concreteArray, int index) Removes an element in a specified position in a concrete symbolic array.Returns arg with all clauses containing quantifers removed.roundToZero(NumericExpression expr) Given an expression x of real type, returns an expression of integer type representing the resulting of rounding x towards 0.setAdd(SymbolicExpression set, SymbolicExpression value) setDifference(SymbolicExpression set1, SymbolicExpression set2) voidsetErrFile(String errFile) Summary:Set name (path) for prover unexpected error file.booleansetIntegerLengthBound(int bound) Set the upper bound of the length of the integer type.setIntersection(SymbolicExpression set1, SymbolicExpression set2) voidSets the output stream, the stream to which information (such as queries) will be printed.voidsetProbabilisticBound(RationalNumber epsilon) Sets the upper bound on the probability of error when deciding whether a polynomial is 0.setRemove(SymbolicExpression set, SymbolicExpression value) voidsetShowProverQueries(boolean value) Sets theshowProverQueriesflag.voidsetShowQueries(boolean value) Sets theshowQueriesflag.setType(SymbolicType elementType) Returns the type for "set of T"; not yet implemented.setUnion(SymbolicExpression set1, SymbolicExpression set2) voidsetUseBackwardSubstitution(boolean value) Sets the value of the "useBackwardSubstitution" flag.sigma(NumericExpression low, NumericExpression high, SymbolicExpression function) A fold sum expression.simpleSubstituter(SymbolicConstant var, SymbolicExpression value) Returns a substituter that replaces a specific symbolic constant with some specific value.stringExpression(String theString) Returns a symbolic expression of type array-of-char which is a literal array consisting of the sequence of characters in the given string.stringObject(String string) Returns theStringObjectwrapping the givenStringvalue.subtract(NumericExpression arg0, NumericExpression arg1) Returns a symbolic expression which is the result of subtracting arg1 from arg0.symbolicConstant(StringObject name, SymbolicType type) Returns theSymbolicConstantwith the given name and type.Returns an uninterpreted type which is an instance ofSymbolicUninterpretedType.Returns the boolean literal true.tuple(SymbolicTupleType type, SymbolicExpression[] components) Returns the concrete tuple with the given members.tuple(SymbolicTupleType type, Iterable<? extends SymbolicObject> components) Returns the concrete tuple expression with the given tuple components.tupleComponentReference(ReferenceExpression tupleReference, IntObject fieldIndex) Given a reference to a tuple, and a field index, returns a reference to that component of the tuple.tupleRead(SymbolicExpression tuple, IntObject index) Returns an expression that represents the result of reading a component in a tuple value.tupleType(StringObject name, Iterable<? extends SymbolicType> fieldTypes) Returns the tuple type defined by the given sequence of component types.tupleWrite(SymbolicExpression tuple, IntObject index, SymbolicExpression value) Returns an expression representing the result of modifying a tuple by changing the value of one component.unionExtract(IntObject memberIndex, SymbolicExpression object) Casts an object whose type is a union type to a representation whose type is the appropriate member type of the union type.unionInject(SymbolicUnionType unionType, IntObject memberIndex, SymbolicExpression object) Casts an object belonging to one of the members of a union type to the union type.unionMemberReference(ReferenceExpression unionReference, IntObject memberIndex) Given a reference to a union (expression of union type) and an index of a member type of that union, returns a reference to the underlying element.unionTest(IntObject memberIndex, SymbolicExpression object) Tests whether an object of a union type is in the image of injection from the member type of the given index.unionType(StringObject name, Iterable<? extends SymbolicType> memberTypes) Returns the type which is the union of the given member types.valueSetAssigns(SymbolicExpression oldValue, SymbolicExpression valueSetTemplate, SymbolicExpression newValue) Copies a subset of a valuevto another valuev'with a given value set template.valueSetContains(SymbolicExpression vst0, SymbolicExpression vst1) Test if a value set templatevst0contains another value set templatevst1.valueSetDiff(SymbolicExpression vst0, SymbolicExpression vst1) Given two value set templates, returns their set difference.dev.civl.sarl.util.Pair<SymbolicExpression, Integer> valueSetHavoc(SymbolicExpression value, SymbolicExpression valueSetTemplate, String prefix, int startCount) valueSetNoIntersect(SymbolicExpression vst0, SymbolicExpression vst1) Test if two value set templates have no intersection, i.e., if applying the two templates to the same object, their referred parts have no overlap.valueSetReferences(SymbolicExpression valueSetTemplate) Returns the set ofValueSetReferences in the given value set template.valueSetTemplate(SymbolicType valueType, ValueSetReference[] vsRefs) Given a symbolic type of a symbolic value and a list ofValueSetReferences, returns symbolic expression representing a value set template.Returns the type of a value set template.valueSetUnion(SymbolicExpression vst0, SymbolicExpression vst1) Given two value set templates, returns the union of the two.valueType(SymbolicExpression valueSetTemplate) Returns theSymbolicTypeof values, to which the given value set template refers.vsArrayElementReference(ValueSetReference parent, NumericExpression index) Given a value set reference to a (set-of) array(s) and an index (integer), returns a reference to the (set-of) elements of the (set-of) array(s) at that indexvsArraySectionReference(ValueSetReference parent, NumericExpression lower, NumericExpression upper) Given a reference to a (set-of) array(s) and an inclusive lower index bound, an exclusive upper index bound and a DEFAULT step, which is one, of the range of the section, returns a reference to the (set-of) section(s) of the array(s) with the given bounds.vsArraySectionReference(ValueSetReference parent, NumericExpression lower, NumericExpression upper, NumericExpression step) Given a reference to a (set-of) array(s) and an inclusive lower index bound, an exclusive upper index bound and a step of the range of the section, returns a reference to the (set-of) section(s) of the array(s) with the given bounds.Returns the identity (or "trivial") value set reference I.vsOffsetReference(ValueSetReference parent, NumericExpression offset) Given a reference to a (set-of) value(s) and a integral offset, returns a reference to a (set-of) value(s), which is obtained by applying the (set-of) offset(s) to the given (set-of) value(s).vsTupleComponentReference(ValueSetReference parent, IntObject fieldIndex) Given a reference to a (set-of) tuple(s), and a field index, returns a reference to that (set-of) component(s) of the tuple(s).vsUnionMemberReference(ValueSetReference parent, IntObject memberIndex) Given a reference to a (set-of) union(s) (expression of union type) and an index of a member type of that union, returns a reference to the (set-of) underlying element(s).zeroInt()The symbolic expression representing the 0 integer value.zeroReal()Returns the symbolic expression representing the real number 0.
-
Method Details
-
getUseBackwardSubstitution
boolean getUseBackwardSubstitution()Shall theReasoners generated by this universe use backwards substitution when simplifying, in order to solve for certain numeric expressions in terms of others?- Returns:
- the value of the "useBackwardSubstitution" flag
-
setUseBackwardSubstitution
void setUseBackwardSubstitution(boolean value) Sets the value of the "useBackwardSubstitution" flag. Iftrue, theReasoners generated by this universe will use backwards substitution when simplifying, in order to solve for certain numeric expressions in terms of others.- Parameters:
value- the new value for the "useBackwardSubstitution" flag
-
getShowQueries
boolean getShowQueries()Gets theshowQueriesflag: iftrue, SARL theorem prover queries will be printed to the output stream.- Returns:
- current value of the
showQueriesflag - See Also:
-
setShowQueries
void setShowQueries(boolean value) Sets theshowQueriesflag. If this is set totrue, SARL theorem prover queries will be printed to the output stream.- Parameters:
value- new value for theshowQueriesflag.- See Also:
-
getShowProverQueries
boolean getShowProverQueries()Gets theshowProverQueriesflag: iftrue, the theorem prover queries processed by the underlying theorem prover(s) will be printed to the output stream.- Returns:
- current value of the
showProverQueriesflag - See Also:
-
setShowProverQueries
void setShowProverQueries(boolean value) Sets theshowProverQueriesflag. If set totrue, the theorem prover queries processed by the underlying theorem prover(s) will be printed to the output stream.- Parameters:
value- new value for theshowProverQueriesflag- See Also:
-
getOutputStream
PrintStream getOutputStream()Returns the output stream to which information (such as queries) will be printed. By default, standard out.- Returns:
- current output stream
- See Also:
-
setOutputStream
Sets the output stream, the stream to which information (such as queries) will be printed. By default, standard out.- Parameters:
out- new value for output stream- See Also:
-
comparator
Comparator<SymbolicObject> comparator()Returns a comparator on the set of all symbolic objects. This defines a total order on all symbolic objects.- Returns:
- a comparator on all symbolic objects
-
numObjects
int numObjects()Returns the number of canonic symbolic objects controlled by this universe.- Returns:
- the number of canonic symbolic objects
-
objectWithId
Gets the canonic
SymbolicObjectbelonging to this universe with the given ID number.Each canonic symbolic object is assigned a unique ID number. The numbers start from 0 and there are no gaps, i.e., they are in the range 0..numExpressions-1.
- Parameters:
id- the ID number of aSymbolicObjectbelonging to this universe- Returns:
- the canonic symbolic object with the given ID number.
-
getProbabilisticBound
RationalNumber getProbabilisticBound()The upper bound on the probability of error when deciding whether a polynomial is 0. Must be a rational number in [0,1). If 0, probabilistic techniques are not used. In general, this should be a very small positive number.- Returns:
- the current upper bound on probability of error
-
setProbabilisticBound
Sets the upper bound on the probability of error when deciding whether a polynomial is 0. Must be a rational number in [0,1). If 0, probabilistic techniques are not used. In general, this should be a very small positive number.- Parameters:
epsilon- the new upper bound on probability of error that should be used from this point forward, a rational number in [0,1)
-
compatible
Returns a boolean expression which holds iff the two types are compatible. Two types are compatible if it is possible for them to have a value in common. For the most part, this is the same as saying they are the same type. The exception is that an incompleteSymbolicArrayTypeand aSymbolicCompleteArrayTypewith compatible element types are compatible.- Parameters:
type0- a non-nullsymbolic typetype1- a non-nullsymbolic type- Returns:
- a boolean expression which holds iff the two types are compatible
- See Also:
-
pureType
Returns the "pure" version of the type, i.e., the compatibleSymbolicTypethat contains noSymbolicExpressions. It is obtained by making every array type incomplete, i.e., by removing the length expressions from complete array types. This is applied recursively down all components of the type tree.- See Also:
-
booleanType
SymbolicType booleanType()The boolean type.- Returns:
- the boolean type
-
integerType
SymbolicIntegerType integerType()The "ideal" integer type, representing the set of mathematical integers.- Returns:
- the integer type
- See Also:
-
herbrandIntegerType
SymbolicIntegerType herbrandIntegerType()Returns the Herbrand integer type. All operations in which at least one argument has Herbrand integer type will be treated as uninterpreted functions: no simplifications or other transformations will be performed.
Note: to create a concrete number of Herbrand integer type, create an ideal concrete integer then cast it to the Herbrand type.
- Returns:
- the Herbrand integer type
- See Also:
-
boundedIntegerType
SymbolicIntegerType boundedIntegerType(NumericExpression min, NumericExpression max, boolean cyclic) Returns the bounded integer types with specified upper and lower bounds. Either of the bounds may be
null, indicating there is no bound (i.e., the bound is + or - infinity). Ifcyclicistrue, then all operations treat the domain cyclically (i.e., max+1 = min).NOTE: THIS IS NOT YET IMPLEMENTED.
- Parameters:
min- smallest integer value in the domain ornullmax- largest integer value in the domain ornullcyclic- should operations treat the domain cyclically?- Returns:
- the bounded integer type as specified
- See Also:
-
realType
SymbolicRealType realType()The "ideal" real type, representing the set of mathematical real numbers.- Returns:
- the real type
- See Also:
-
herbrandRealType
SymbolicRealType herbrandRealType()Returns the Herbrand real type. All operations in which at least one argument has Herbrand real type will be treated as uninterpreted functions: no simplifications or other transformations will be performed. Operations may involve mixed real and Herbrand real types, but the result will always be a Herbrand expression as long as at least one argument is Herbrand.
A Herbrand value and non-Herbrand value are always considered to be not equal, even if they are concrete expressions.
Note: to create a concrete number of herbrand real type, create an ideal concrete real then cast it to the herbrand type.
- Returns:
- the Herbrand real type
- See Also:
-
characterType
SymbolicType characterType()Returns the character type.- Returns:
- the character type
-
arrayType
Returns the complete array type with the given element type and extent (array length). Neither argument can benull.- Parameters:
elementType- the type of the elements of the arrayextent- length of the array- Returns:
- the complete array type as specified
- See Also:
-
arrayType
Returns the incomplete array type with the given element type. The element type cannot benull.- Returns:
- the incomplete array type
- See Also:
-
arrayDimensionAndBaseType
Returns the dimension and base type of an array type.
The dimension and base type of an array type T[] are defined as follows: if T is an array type, the dimension of T[] is one plus the dimension of T, and the base type of T[] is the base type of T . Otherwise, the dimension of T[] is 1 and the base type is T.
- Parameters:
type- a non-nullarray type- Returns:
- A
Pairconsisting of dimension (left) and base type (right).
-
tupleType
Returns the tuple type defined by the given sequence of component types. The tuple type consists of all tuples of values (x0, ..., xn-1), where xi has typefieldsTypesi. A tuple type also has a name, and two tuple types are not equal if they have unequal names.- Parameters:
name- the name of the tuple typefieldTypes- an iterable object specifying the sequence of component types for the tuple type- Returns:
- the tuple type specified by the given name and field types
-
functionType
SymbolicFunctionType functionType(Iterable<? extends SymbolicType> inputTypes, SymbolicType outputType) Returns the specified function type. A function type is specified by a sequence of input types, and an output type.- Parameters:
inputTypes- sequence of input typesoutputType- the output type of the function- Returns:
- the function type
-
functionType
SymbolicFunctionType functionType(Iterable<? extends SymbolicType> inputTypes, SymbolicType outputType, SymbolicFunctionType.SpecialRelationKind relKind) Returns the specified function type. A function type is specified by a sequence of input types, and an output type.- Parameters:
inputTypes- sequence of input typesoutputType- the output type of the functionrelKind- the special relation kind if this function represents such a relation- Returns:
- the function type
-
unionType
Returns the type which is the union of the given member types.
Say the member types are t0,...,tn-1 and call the union type u. For 0 ≤ i < n, there are functions injecti: ti → u, extracti: u → ti, and testi: u → {true,false}. The domain of u consists of all expressions of the form injecti(xi).
We have extracti(injecti(x))=x and extracti is undefined on any element of u that is not in the image of injecti. testi(x) is true iff x=injecti(xi) for some xi in ti.
- Parameters:
name- the name of the union typememberTypes- the sequence of member types- Returns:
- the specified union type
-
setType
Returns the type for "set of T"; not yet implemented.- Parameters:
elementType- type of elements of the set- Returns:
- the type "set of
elementType"
-
mapType
Under construction.- Parameters:
keyType-valueType-- Returns:
-
entryType
Returns a tuple type which has two components: component 0 is the key type of the map type; component 1 is the value type of the map type. This is the type of an "entry" in the map. This type is used by the methodentrySet(SymbolicExpression), which returns the set of entries of a map.- Parameters:
mapType- a map type- Returns:
- the type of an entry in the map
-
symbolicUninterpretedType
Returns an uninterpreted type which is an instance ofSymbolicUninterpretedType.- Parameters:
name- the name of the returning uninterpreted type- Returns:
- an instance of
SymbolicUninterpretedTypewhose name is the given String.
-
mapSubstituter
Returns a substituter for which the base substitutions are specified by an explicit JavaMap. The map specifies a set of key-value pairs. The substituter will replace any key with its corresponding value; all other substitutions are determined from those "base" cases by recursive application of substitution.- Parameters:
map- a map which specifies that a key should be replaced by the corresponding value- Returns:
- a substituter based on the given map
-
mapSubstituter
-
constantSubstituter
Returns a substituter for which the base substitutions are specified by an explicit JavaMap. The map specifies a set of key-value pairs. The substituter will replace any key with its corresponding value; all other substitutions are determined from those "base" cases by recursive application of substitution.- Parameters:
map- a map which specifies that a key should be replaced by the corresponding value- Returns:
- a substituter based on the given map
-
nameSubstituter
Returns a substituter specified by a mapping of old names to new names for symbolic constants. Any symbolic constant appearing as a key in the map will be replaced by a similar one with name the corresponding value. This includes bound symbolic constants.- Parameters:
nameMap- mapping of old to new names for symbolic constants- Returns:
- a substituter which replaces symbolic constants as specified by
nameMap
-
simpleSubstituter
Returns a substituter that replaces a specific symbolic constant with some specific value. The value must have a type that is compatible with that of the symbolic constant.- Parameters:
var- the symbolic constantvalue- the value that will replace the symbolic constant- Returns:
- a substituter that will replace any occurrence of
varwithvalue
-
canonicalRenamer
Returns an operator on
SymbolicExpressions that replaces all symbolic constants (including bound ones) with symbolic constants with unique canonical names. The names are formed by appending the integers 0, 1, ..., toroot. The renamer has state, so it can be used repeatedly (applied to multiple symbolic expressions) and will continue to generate new names for the new symbolic constants it encounters if they have not been encountered before. Every fresh binding of a bound variable is considered to be new, so is given a unique new name.The parameter
ignorealso provides a way to specify that certain symbolic constants should be ignored, i.e., they should not be renamed.- Parameters:
root- the string that forms the root of the names of the new symbolic constantsignore- a predicate providing a method that takes aSymbolicConstantand returnstrueorfalse; if it returnstrue, then that symbolic constant should not be renamed- Returns:
- a unary operator which take a symbolic expression and returns a symbolic expression in which the symbolic constants have been assigned canonical names
-
canonicalRenamer
Returns an operator on
SymbolicExpressions that replaces all symbolic constants (including bound ones) with symbolic constants with unique canonical names. The names are formed by appending the integers 0, 1, ..., toroot. The renamer has state, so it can be used repeatedly (applied to multiple symbolic expressions) and will continue to generate new names for the new symbolic constants it encounters if they have not been encountered before. Every fresh binding of a bound variable is considered to be new, so is given a unique new name.Equivalent to invoking
canonicalRenamer(String, Predicate)withignorethe constant predicatefalse.- Parameters:
root- the string that forms the root of the names of the new symbolic constants- Returns:
- a unary operator which take a symbolic expression and returns a symbolic expression in which the symbolic constants have been assigned canonical names
-
make
SymbolicExpression make(SymbolicExpression.SymbolicOperator operator, SymbolicType type, SymbolicObject[] arguments) Applies the given operator to the arguments and returns the resulting expression in the form used by this universe. The arguments should have the form required by the operator; see the documentation in theSymbolicExpressioninterface, especially for theSymbolicExpression.SymbolicOperators. The result returned should be identical to what would be returned by calling the specific methods (e.g.,add(Iterable)).- Parameters:
operator- a symbolic operatortype- the type which the resulting expression should have (since it may not be unambiguous)arguments- arguments which should be appropriate for the specified operator
-
numValidCalls
int numValidCalls()Returns the total number of calls made to methodsReasoner.valid(BooleanExpression)andReasoner.validOrModel(BooleanExpression).- Returns:
- the total number of validity calls
-
numProverValidCalls
int numProverValidCalls()Returns the total number of calls made to the validity method in the underlying automated theorem prover. This is in general smaller than that returned bynumValidCalls(), as not every valid call requires a call to the prover.- Returns:
- the total number of theorem prover validity calls
-
booleanObject
Returns theBooleanObjectwrapping the given boolean value. ABooleanObjectis aSymbolicObject, so can be used as an argument of aSymbolicExpression.- Parameters:
value-trueorfalse, the boolean value to wrap- Returns:
- the corresponding
BooleanObject
-
intObject
Returns theIntObjectwrapping the given Javaintvalue. AnIntObjectis aSymbolicObjectso can be used as an argument of aSymbolicExpression. It is used in cases where a "small" concrete integer is needed. For concrete integers of arbitrary size, useIntegerNumberinstead and create aNumberObject.- Parameters:
value- any Javaint- Returns:
- an
IntObjectwrappingvalue
-
numberObject
Returns theNumberObjectwrapping the givenNumbervalue. These are SARLNumbers, notNumbers. They are used to represent infinite precision, unbounded integers and rational numbers.- Parameters:
value- a finite concrete SARL Number- Returns:
- the
NumberObjectwrappingvalue
-
stringObject
Returns theStringObjectwrapping the givenStringvalue. AStringObjectis aSymbolicObjectso can be used as an argument to aSymbolicExpression.- Parameters:
string- any JavaString- Returns:
- the
StringObjectwrappingstring
-
nullExpression
SymbolicExpression nullExpression()Returns the "NULL" expression. This is a non-null(in the Java sense of "null")SymbolicExpressionfor which the methodSymbolicExpression.isNull()returnstrue. Its type isnull, and it has 0 arguments.- Returns:
- the NULL expression
-
symbolicConstant
Returns the
SymbolicConstantwith the given name and type. TwoSymbolicConstants are equal iff they have the same name and type. This method may use a Flyweight Pattern to return the same object if called twice with the same arguments. Or it may create a new object each time. These details are unimportant because symbolic constants are immutable.This method will return the right kind of
SymbolicConstantbased on the type. For example, if the type is numeric (SymbolicIntegerTypeorSymbolicRealType), an instance ofNumericSymbolicConstantwill be returned. If the type is boolean, aBooleanSymbolicConstantwill be returned.- Parameters:
name- the name to give to this symbolic constant; it will be used to identify the object and for printingtype- the type of the symbolic constant
-
zeroInt
NumericExpression zeroInt()The symbolic expression representing the 0 integer value.- Returns:
- the integer 0 as a numeric symbolic expression
-
oneInt
NumericExpression oneInt()The symbolic expression representing the integer 1.- Returns:
- the integer 1 as a numeric symbolic expression
-
integer
Returns the integer symbolic expression with the givenintvalue.- Parameters:
value- a Javaint- Returns:
- the symbolic expression of integer type representing that concrete value
-
integer
Returns the numeric symbolic expression with the givenlongvalue.- Parameters:
value- any Javalong- Returns:
- the symbolic expression of integer type with that value
-
integer
Returns the numeric symbolic expression with the givenBigIntegervalue. TheBigIntegerclass is a standard Java class for representing integers of any size.- Parameters:
value- anyBigInteger- Returns:
- the symbolic expression of integer type with that value
-
zeroReal
NumericExpression zeroReal()Returns the symbolic expression representing the real number 0. Note that this is NOT equal to the integer number 0, since they have different types.- Returns:
- the real number 0 as a symbolic expression
-
oneReal
NumericExpression oneReal()Returns the symbolic expression representing the real number 1.- Returns:
- the real number 1 as a symbolic expression
-
rational
Returns the symbolic expression of real type (SymbolicRealType) representing the givenintvalue. This is sometimes referred to as a "rational integer".- Parameters:
value- an Javaint- Returns:
- a concrete rational representation of this integer value; essentially, the rational number (value/1)
-
rational
Returns the symbolic expression of real type (SymbolicRealType) representing the givenlongvalue. This is sometimes referred to as a "rational integer".- Parameters:
value- a Javalong- Returns:
- a concrete rational representation of this
longvalue; essentially the rational number (value/1)
-
rational
Returns the symbolic expression of real type (SymbolicRealType) representing the givenBigIntegervalue. This is sometimes referred to as a "rational integer"- Parameters:
value- a JavaBigInteger- Returns:
- a concrete rational representation of this
BigIntegervalue; essentially, the rational number (value/1)
-
rational
Returns the symbolic expression of real type (SymbolicRealType) representing the givenfloatvalue.- Parameters:
value- a Javafloat- Returns:
- a concrete rational representation of this
floatvalue
-
rational
Returns the symbolic expression of real type (SymbolicRealType) representing the givendoublevalue.- Parameters:
value- a Javadouble- Returns:
- a concrete symbolic expression of real type representing the
value
-
rational
Returns the rational number obtained by dividing two integers,numeratoranddenominator. The result is a symbolic expression ofSymbolicRealType. Note that this universe is free to transform the expression into an equivalent form, for example, by canceling any common factors.- Parameters:
numerator- a Javaintdenominator- a non-0 Javaint- Returns:
- the real number formed by dividing
numeratorbydenominator, as a symbolic expression of real type
-
rational
Returns the rational number obtained by dividing two long integers. The result will haveSymbolicRealType.- Parameters:
numerator- a Javalongdenominator- a non-0 Javalong- Returns:
- the real number formed by dividing
numeratorbydenominator, as aNumericExpression
-
rational
Returns the rational number obtained by dividing twoBigIntegers. The result will haveSymbolicRealType.- Parameters:
numerator- an integer, the numeratordenominator- a non-0 integer, the denominator- Returns:
- the rational number formed by dividing
numeratorbydenominator, as a symbolic expression
-
numberFactory
NumberFactory numberFactory()Returns the number factory used by this universe.- Returns:
- the number factory used by this universe
-
number
Returns the concrete symbolic expression wrapping the given number. The type of the expression will be the "ideal"SymbolicIntegerTypeifnumberis anIntegerNumber, or the "ideal"SymbolicRealTypeifnumberis aRationalNumber.- Parameters:
number- any non-nullfinite SARLNumber- Returns:
- the concrete symbolic expression wrapping that number
- See Also:
-
number
Returns the concrete symbolic expression wrapping the given number object. The type of the expression will be the "ideal"SymbolicIntegerTypeifnumberObject.getNumber()is anIntegerNumber, or the "ideal"SymbolicRealTypeif it is aRationalNumber.- Parameters:
numberObject- any non-nullNumberObject- See Also:
-
extractNumber
Returns theNumbervalue if the given symbolic expression has a concrete numerical value, else returnsnull.- Parameters:
expression- any non-nullnumeric expression- Returns:
- the
Numbervalue ornull
-
character
Returns a concrete symbolic expression of character type which wraps the given Java char.- Parameters:
theChar- the Java char- Returns:
- symbolic expression wrapping
theChar - See Also:
-
extractCharacter
If the given expression is a concrete character expression, this returns the character value, else it returnsnull.- Parameters:
expression- a symbolic expression- Returns:
- the character it wraps or
null - See Also:
-
stringExpression
Returns a symbolic expression of type array-of-char which is a literal array consisting of the sequence of characters in the given string.- Parameters:
theString- a Java string- Returns:
theStringrepresented as a symbolic expression of type array-of-char- See Also:
-
add
Returns a symbolic expression which is the result of adding the two given symbolic expressions. The two given expressions must have the same (numeric) type: either both integers, or both real.- Parameters:
arg0- a symbolic expression of a numeric typearg1- a symbolic expression of the same numeric type- Returns:
- the sum arg0+arg1
- See Also:
-
add
Returns a symbolic expression representing the sum of the given argument sequence.- Parameters:
args- a sequence of symbolic expressions of numeric type. They must all have the same type.- Returns:
- expression representing the sum
- See Also:
-
subtract
Returns a symbolic expression which is the result of subtracting arg1 from arg0. The two given expressions must have the same (numeric) type: either both integers, or both real.- Parameters:
arg0- a symbolic expression of a numeric typearg1- a symbolic expression of the same numeric type- Returns:
- the difference, arg0-arg1
- See Also:
-
sigma
A fold sum expression. Takes three arguments: low, high and a function f: int-to-T. The expression meansf(low) + f(low + 1) + ... + f(high - 1)- Parameters:
low- The lower bound of the integer set (inclusive)high- The higher bound of the integer set (exclusive)function- An expression representing the set of addends of the summation expression. It must have a function type t. t must have an integer input type. The output type is the type of the summation expression.- Returns:
-
reduction
SymbolicExpression reduction(SymbolicExpression[] operands, NumericExpression count, SymbolicExpression op, List<BooleanExpression> compatibleConditionsOutput) a
$reductionfunction that takes a list of operands, the number of elements per operand and an operator, returns the element-wise reduction result of the operator over the operands.- Parameters:
operands- a list of operandscount- the number of elements in each operandop- an integer value representing the reduction operatorcompatibleConditionsOutput- output argument, containing compatible conditions, if any of the given compatible conditions fails, the returned result is invalid- Returns:
- the element-wise reduction result of given operator over the operands, if the output compatibale conditions are all valid.
-
isSigmaCall
-
permut
BooleanExpression permut(SymbolicExpression array_a, SymbolicExpression array_b, NumericExpression low, NumericExpression high) A permutation predicate, which asserts the slice from lower indexlowto higher indexhighin arrayarray_ais a permutation of the slice from lower indexlowto higher indexhighin arrayarray_b.- Parameters:
array_a-array_b-low-high-- Returns:
- an instance of the permutation predicate
-
isPermutCall
-
multiply
Returns a symbolic expression which is the result of multiplying the two given symbolic expressions. The two given expressions must have the same (numeric) type: either both integers, or both real.- Parameters:
arg0- a symbolic expression of a numeric typearg1- a symbolic expression of the same numeric type- Returns:
- arg0 * arg1, the product of arg0 and arg1.
- See Also:
-
multiply
Returns symbolic expression representing the product of the given sequence of expressions.- Parameters:
args- symbolic expression sequence; all elements have the same numeric type- Returns:
- a symbolic expression representing the product
- See Also:
-
divide
Returns a symbolic expression which is the result of dividing arg0 by arg1. The two given expressions must have the same (numeric) type: either both integers, or both real. In the integer case, division is interpreted as "integer division", which rounds towards 0.
For reference, here's what C11 (Sec. 6.5.5) says about integer division:
The result of the / operator is the quotient from the division of the first operand by the second; the result of the % operator is the remainder. In both operations, if the value of the second operand is zero, the behavior is undefined. When integers are divided, the result of the / operator is the algebraic quotient with any fractional part discarded. [This is often called "truncation toward zero".] If the quotient a/b is representable, the expression (a/b)*b + a%b shall equal a; otherwise, the behavior of both a/b and a%b is undefined.
Hence in C, a%b=a-(a/b)*b. Examples:
- a=4, b=3: a/b=1, a%b=4-3=1
- a=4, b=-3: a/b=-1, a%b=4-(-1)(-3)=1
- a=-4, b=3: a/b=-1, a%b=-4-(-1)3=-1
- a=-4, b=-3: a/b=1, a%b=-4-1(-3)=-1
Note that the sign of a/b is the same for integer or real division, i .e., sign(a/b)=sign(a)*sign(b). The sign of a%b is sign(a).
- Parameters:
arg0- a symbolic expression of a numeric typearg1- a symbolic expression of the same numeric type- Returns:
- the quotient, arg0 / arg1
- Throws:
ArithmeticException- If there is a division by zero.- See Also:
-
modulo
Returns a symbolic expression which represents arg0 modulo arg1. The two given expressions must have the integer type.- Parameters:
arg0- a symbolic expression of integer typearg1- a symbolic expression of integer type- Returns:
- the modulus, arg0 % arg1
- Throws:
ArithmeticException- If there is a division by zero.- See Also:
-
minus
Returns a symbolic expression which is the negative of the given numerical expression. The given expression must be non-null and have either integer or real type.- Parameters:
arg- a symbolic expression of integer or real type- Returns:
- negation: −
arg - See Also:
-
power
Concrete power operator: eb, where b is a concrete non-negativeIntegerNumber. This method might actually multiply out the expression, i.e., it does not necessarily return an expression with operatorSymbolicExpression.SymbolicOperator.POWER.- Parameters:
base- the base expression in the power expressionexponent- a finite non-negative concrete integer exponent
-
power
Equivalent topower(base, intObject(exponent)).- Parameters:
base- the base expression in the power expressionexponent- a non-negative concrete integer exponent- Returns:
power(base, intObject(exponent))
-
power
General power operator: eb. Both e and b are numeric expressions.- Parameters:
base- the base expression in the power expressionexponent- the exponent in the power expression
-
extractBoolean
If the given expression has a concreteBooleanvalue, this returns it, else it returnsnull.- Parameters:
expression- anyBooleanExpression- Returns:
- one of the two concrete
Booleanvalues ifexpressionis concrete, elsenull
-
trueExpression
BooleanExpression trueExpression()Returns the boolean literal true.- Returns:
- the symbolic expression true
-
falseExpression
BooleanExpression falseExpression()Returns the boolean literal false.- Returns:
- the symbolic expression false
-
bool
The symbolic expression wrapping the given boolean object (true or false). -
bool
Short cut for symbolic(booleanObject(value)).- Parameters:
value-- Returns:
- symbolic expression wrapping boolean value
-
and
Returns a symbolic expression representing the conjunction of the two given arguments. Each argument must be non-null and have boolean type.- Parameters:
arg0- a symbolic expression of boolean typearg1- a symbolic expression of boolean type- Returns:
- conjunction of arg0 and arg1
-
and
Returns a symbolic expression which represents the conjunction of the expressions in the given array args. Each expression in args must have boolean type. args must be non-null, and may have any length, including 0. If the length of args is 0, the resulting expression is equivalent to "true".- Parameters:
args- a sequence of expressions of boolean type- Returns:
- the conjunction of the expressions in args
-
or
Returns a symbolic expression representing the disjunction of the two given arguments. Each argument must be non-null and have boolean type.- Parameters:
arg0- a symbolic expression of boolean typearg1- a symbolic expression of boolean type- Returns:
- disjunction of arg0 and arg1
-
or
Returns a symbolic expression which represents the disjunction of the expressions in the given array args. Each expression in args must have boolean type. args must be non-null, and may have any length, including 0. If the length of args is 0, the resulting expression is equivalent to "false".- Parameters:
args- a sequence of expressions of boolean type- Returns:
- the disjunction of the expressions in args
-
not
Returns a symbolic expression representing the logical negation of the given expression arg. arg must be non-null and have boolean type.- Parameters:
arg- a symbolic expression of boolean type- Returns:
- negation of arg
-
implies
Returns a symbolic expression representing "p implies q", i.e., p=>q.- Parameters:
arg0- a symbolic expression of boolean type (p)arg1- a symbolic expression of boolean type (q)- Returns:
- p=>q
-
equiv
Returns a symbolic expression representing "p is equivalent to q", i.e., pinvalid input: '<'=>q.- Parameters:
arg0- a symbolic expression of boolean type (p)arg1- a symbolic expression of boolean type (q)- Returns:
- pinvalid input: '<'=>q
-
lessThan
Returns expression equivalent to arg0 invalid input: '<' arg1. The arguments must be numeric of the same type (i.e., both are of integer type or both are of real type).- Parameters:
arg0- symbolic expression of numeric typearg1- symbolic expression of same numeric type- Returns:
- symbolic expression of boolean type arg0 invalid input: '<' arg1
-
lessThanEquals
Returns expression equivalent to arg0 invalid input: '<'= arg1 ("less than or equal to"). The arguments must be numeric of the same type (i.e., both are of integer type or both are of real type).- Parameters:
arg0- symbolic expression of numeric typearg1- symbolic expression of same numeric type- Returns:
- symbolic expression of boolean type arg0 invalid input: '<'= arg1
-
equals
Returns expression equivalent to arg0 = arg1 ("equals"). This is a general equals operator (not just for numeric expressions). To be equal, the arguments must have equal types. The notion of equals then depends on the particular type.- Parameters:
arg0- a symbolic expressionarg1- a symbolic expression- Returns:
- symbolic expression of boolean type arg0 = arg1
-
quickEquals
-
neq
Returns expression equivalent to arg0 != arg1 ("not equals").- Parameters:
arg0- a symbolic expressionarg1- a symbolic expression- Returns:
- symbolic expression of boolean type arg0 != arg1
-
removeQuantifiers
Returns arg with all clauses containing quantifers removed.- Parameters:
arg- a symbolic expression- Returns:
- the conjunction of all quantifer-free clauses of arg.
-
forall
Returns the universally quantified expression forall(x).e.- Parameters:
boundVariable- the bound variable xpredicate- the expression e (of boolean type)- Returns:
- the expression forall(x).e
-
forallInt
BooleanExpression forallInt(NumericSymbolicConstant index, NumericExpression low, NumericExpression high, BooleanExpression predicate) A special case of "forall" that is very common: forall integers i such that lowinvalid input: '<'=iinvalid input: '<'high, p(i).- Parameters:
index- i, a symbolic constant of integer typelow- a symbolic expression of integer type, lower bound of i (inclusive)high- a symbolic expression of integer type, upper bound of i (exclusive)predicate- some boolean symbolic expression, usually involving i- Returns:
- an expression equivalent to "forall int i. lowinvalid input: '<'=iinvalid input: '<'high -> p(i)".
-
exists
Returns the existentially quantified expression exists(x).e.- Parameters:
boundVariable- the bound variable xpredicate- the expression e (of boolean type)- Returns:
- the expression exists(x).e
-
existsInt
BooleanExpression existsInt(NumericSymbolicConstant index, NumericExpression low, NumericExpression high, BooleanExpression predicate) A special case of "exists" that is very common: exists integer i such that lowinvalid input: '<'=iinvalid input: '<'high and p(i).- Parameters:
index- i, a symbolic constant of integer typelow- a symbolic expression of integer type, lower bound of i (inclusive)high- a symbolic expression of integer type, upper bound of i (exclusive)predicate- some boolean symbolic expression, usually involving i- Returns:
- an expression equivalent to "exists int i. lowinvalid input: '<'=iinvalid input: '<'high invalid input: '&'invalid input: '&' p(i)".
-
divides
Does the integer a divide the integer b evenly? I.e, does there exist an integer n such that b=a*n?- Parameters:
a- a symbolic expression of integer typeb- a symbolic expression of integer type- Returns:
- a symbolic expression of boolean type holding iff a divides b
-
lambda
Returns the lambda expression lambda(x).e, i.e., the expression representing the function which given x returns e, where e might possibly involve the variable x. Note that x is a symbolic constant.- Parameters:
boundVariable- the bound variable xexpression- the expression e- Returns:
- lambda(x).e
-
apply
SymbolicExpression apply(SymbolicExpression function, Iterable<? extends SymbolicExpression> argumentSequence) The result of applying an uninterpreted function to a sequence of arguments. The number and types of arguments must match the function's input signature. -
unionInject
SymbolicExpression unionInject(SymbolicUnionType unionType, IntObject memberIndex, SymbolicExpression object) Casts an object belonging to one of the members of a union type to the union type.- Parameters:
unionType- the union typememberIndex- the index of the member type of the object in the list of member types of the union typeobject- an expression whose type is the member type with the given index- Returns:
- an expression whose type is the union type representing the same object as the given object
-
unionTest
Tests whether an object of a union type is in the image of injection from the member type of the given index.- Parameters:
memberIndex- an integer in range [0,n-1], where n is the number of member types of the union typeobject- an expression of the union type- Returns:
- a boolean expression telling whether the object belongs to the specified member type
-
unionExtract
Casts an object whose type is a union type to a representation whose type is the appropriate member type of the union type. The behavior is undefined if the object does not belong to the specified member type.- Parameters:
memberIndex- an integer in range [0,n-1], where n is the number of member types of the union typesobject- an object whose type is the union type and for which unionTest(unionType, memberIndex, object) holds.- Returns:
- a representation of the object with type the member type
-
array
Creates a concrete array expression backed by the given Java array. Any changes to the Java array will also change the returned expression, so the Java array should never be modified after this method is called.
Precondition: every element of
elementsmust have typeelementType. This is not necessarily checked. If this condition is not met, behavior is undefined.- Parameters:
elementType- the type of each element ofelementselements- array of symbolic expressions, each of typeelementType- Returns:
- symbolic expression of type
SymbolicCompleteArrayTypewith element typeelementTypeand lengthelements.lengthwrappingelements
-
array
Returns the concrete array consisting of given sequence of elements. The type of the array will be the complete array type determined by the element type and the number of elements.- Parameters:
elementType- the type of each element of the arrayelements- sequence of symbolic expressions- Returns:
- array consisting of those elements
-
emptyArray
Returns array of length 0.- Parameters:
elementType- the type of the non-existent elements of this array- Returns:
- array of length 0 of given type
-
constantArray
SymbolicExpression constantArray(SymbolicType elementType, NumericExpression length, SymbolicExpression value) Returns an array in which every element has the same value.- Parameters:
elementType- the element type of the arraylength- the length of the arrayvalue- the value of each element- Returns:
- an array of specified length in which every element is value
-
append
Appends an element to the end of a concrete symbolic array. Returns a new array expression which is same as old with new element appended to end. TODO: extend to arbitrary arrays, not just concrete- Parameters:
concreteArray- a concrete arrayelement- a symbolic expression whose type is compatible with element type of the array- Returns:
- an array obtained by appending element to given array
-
removeElementAt
Removes an element in a specified position in a concrete symbolic array. Returns a new array which is same as old except the element has been removed and the remaining elements have been shifted down to remove the gap. The resulting array has length 1 less than the original one. TODO: extend to arbitrary arrays, not just concrete- Parameters:
concreteArray- a concrete arrayindex- an int index- Returns:
- array obtained by removing element at specified index
- Throws:
SARLException- if index is negative or greater than or equal to the length of the given concrete array
-
insertElementAt
SymbolicExpression insertElementAt(SymbolicExpression concreteArray, int index, SymbolicExpression value) Inserts value an position index in array, shifting subsequence elements "up".- Parameters:
concreteArray- a concrete arrayindex- an int index in the range [0,length], where length is the length of the original array. If index=length, this is the same as append.value- expression to insert- Returns:
- array obtained by inserting the element at specified index
-
length
Returns the length of any symbolic expression of array type. This is a symbolic expression of integer type.- Parameters:
array- a symbolic expression of array type- Returns:
- a symbolic expression of integer type representing the length of the array
-
arrayRead
Returns an expression representing the value of the element of the array at position index. Arrays are indexed from 0. The expression returned has type the element type of the array.- Parameters:
array- the given arrayindex- symbolic expression of integer type- Returns:
- expression representing value of index-th element of the array
-
arrayWrite
SymbolicExpression arrayWrite(SymbolicExpression array, NumericExpression index, SymbolicExpression value) Returns an expression representing the result of modifying an array by changing the value at position index. Arrays are indexed from 0. The expression returned has the same (array) type as the original array.- Parameters:
array- the given arrayindex- symbolic expression of integer typevalue- the new value for the element at position index- Returns:
- expression representing the result of changing the index-th element to value
-
denseArrayWrite
SymbolicExpression denseArrayWrite(SymbolicExpression array, Iterable<? extends SymbolicExpression> values) Returns an array obtained by performing a sequence of writes, given in a "dense" format, to an array. The sequence of values are used to write to the indexes 0, 1, .... A null element in the sequence is simply ignored.- Parameters:
array- a symbolic expression of array typevalues- a sequence of symbolic expressions, each of which is either null or a symbolic expression of the appropriate type- Returns:
- the array resulting from writing to the given array in position 0,...,n-1, where n is the length of the sequence.
-
arrayLambda
Returns an expression representing an array with element type T defined by a function f from int to T. -
tuple
Returns the concrete tuple with the given members. This does NOT check that members have types compatible with the fields types of the tuple type. If they don't, the behavior is undefined.- Parameters:
type- the tuple typecomponents- the component expressions- Returns:
- the tuple formed from the components
-
tuple
Returns the concrete tuple expression with the given tuple components.- Parameters:
type- the tuple typecomponents- the component expressions- Returns:
- the tuple formed from the components
-
tupleRead
Returns an expression that represents the result of reading a component in a tuple value. The index should be an integer-valued expression. The components are numbered starting from 0.- Parameters:
tuple- the tuple value being readindex- index of the component to read- Returns:
- a symbolic expression representing the component at that index
-
tupleWrite
Returns an expression representing the result of modifying a tuple by changing the value of one component. The component is specified by its index. The components are indexed starting from 0. In this method, the index is specified by a concrete Java int.- Parameters:
tuple- the original tupleindex- the index of the component to modifyvalue- the new value for the component- Returns:
- an expression representing the new tuple
-
isSubsetOf
-
setAdd
-
setRemove
-
setUnion
-
setIntersection
-
setDifference
-
cardinality
-
emptyMap
-
put
-
get
-
removeEntryWithKey
-
keySet
-
mapSize
-
entrySet
Returns the entry set of the map. This is the set consisting of all ordered pairs (key,value) for each entry in the map. Each entry is a symbolic expression which has a tuple type. The tuple type has two components: component 0 is the key type, component 1 the value type.- Parameters:
map-- Returns:
-
cast
Casts expression to new type.- Parameters:
newType- a symbolic typeexpression- a symbolic expression- Returns:
- symbolic expression cast to new type
-
cond
SymbolicExpression cond(BooleanExpression predicate, SymbolicExpression trueCase, SymbolicExpression falseCase) "If-then-else" expression. Note that trueCase and falseCase must have the same type, which becomes the type of this expression.- Parameters:
predicate- the test condition ptrueCase- the value if condition is truefalseCase- the value if condition is false- Returns:
- symbolic expression whose values is trueCase if predicate holds, falseCase if predicate is false
-
referenceType
SymbolicType referenceType()Returns the type of all reference expressions. A reference expression is a kind of symbolic expression used to represent a reference to a subexpression of other expressions. It may be thought of as a sequence of directions for navigating to a particular node in a tree, starting from the root. For example, a reference expression r might encode "the 3rd element of the 2nd component". Given an expression e of tuple type in which the 2nd component has array type, that r specifies a particular element of a particular component of e.
A reference may also be thought of as a function which takes a symbolic expression (of a compatible type) and returns a sub-expression of that expression.
- Returns:
- the type of all reference expressions
-
nullReference
ReferenceExpression nullReference()Returns the "null reference", a symbolic expression of reference type which is not equal to a reference value returned by any of the other methods, and which cannot be dereferenced.- Returns:
- the null reference
-
dereference
Given areferenceand avalue, returns the sub-expression ofvaluespecified by the reference. Throws exception if the reference is not of the correct form for the type ofvalue.- Parameters:
value- a non-nullsymbolic expressionreference- a non-nullreference into a sub-expression ofvalue- Returns:
- the sub-expression of
valuespecified by the reference
-
referencedType
Returns the type referenced by a reference into an expression of the given type. Example: iftypeis array-of-integer andreferenceis an array element reference, this method returns integer.- Parameters:
type- a non-nullsymbolic typereference- a reference that is compatible withtype, i.e., can reference into an expression of that type- Returns:
- the component of the given type which is referenced by the given reference
-
identityReference
ReferenceExpression identityReference()Returns the identity (or "trivial") referenceI. This is the reference characterized by the property thatdereference(I,v)returnsvfor any symbolic expressionv.- Returns:
- the identity reference
-
arrayElementReference
ArrayElementReference arrayElementReference(ReferenceExpression arrayReference, NumericExpression index) Given a reference to an array and anindex(integer), returns a reference to the element of the array at that index. Think of this as tacking on one more instruction to the sequence of directions specified by a reference. For example, ifarrayReferenceencodes "2nd component of element 3" andindexisX+Y, the result returned specifies "elementX+Yof the 2nd component of element 3".- Parameters:
arrayReference- a non-nullreference for which the referenced sub-expression has array typeindex- a non-nullexpression of integer type- Returns:
- a reference to the
index-th element of the referenced array
-
tupleComponentReference
TupleComponentReference tupleComponentReference(ReferenceExpression tupleReference, IntObject fieldIndex) Given a reference to a tuple, and a field index, returns a reference to that component of the tuple. Think of this as tacking on one more instruction to the sequence of directions specified by a reference. For example, iftupleReferenceencodes "2nd component of element 3" andfieldIndexis 15, the result returned specifies "the 15-th component of the 2nd component of element 3".- Parameters:
tupleReference- a non-nullreference for which the referenced sub-expression has tuple typefieldIndex- a non-nullconcrete integer object specifying the component of the tuple (indexed from 0)- Returns:
- a reference to the
fieldIndex-th element of the referenced tuple
-
unionMemberReference
UnionMemberReference unionMemberReference(ReferenceExpression unionReference, IntObject memberIndex) Given a reference to a union (expression of union type) and an index of a member type of that union, returns a reference to the underlying element. -
offsetReference
-
assign
SymbolicExpression assign(SymbolicExpression value, ReferenceExpression reference, SymbolicExpression subValue) Given a symbolic expression value, a reference to a point within that value, and a subValue, returns the symbolic expression obtained by replacing the referenced part of value with subValue.- Parameters:
value- a non-nullsymbolic expressionreference- a non-nullreference to a subexpression ofvaluesubValue- a non-nullexpression with type compatible with that of the referenced sub-expression ofvalue- Returns:
- the expression that results from taking
valueand replacing the referenced sub-expression withsubValue
-
getFreeSymbolicConstants
Returns the set of unbound symbolic constants occurring in an expression. Each symbolic constant will occur at most once in the collection returned. This includes symbolic constants that occur in types (for example, array lengths).- Parameters:
expr- a non-nullsymbolic expression- Returns:
- set of unbound symbolic constants occurring in
expr
-
bitand
Returns the result of bit-and operation for two given unsigned integers, those two unsigned integers are in the form ofNumericExpression.- Parameters:
left- a non-nullNumericExpressionrepresenting an unsigned integer. The length of the unsigned integer should be defined as a concrete integer.right- a non-nullNumericExpressionrepresenting an unsigned integer. The length of the unsigned integer should be defined as a concrete integer, whose value is same to the left.- Returns:
- a
NumericExpressionrepresenting the result.
-
bitor
Returns the result of bit-or operation for two given unsigned integers, those two unsigned integers are in the form ofNumericExpression.- Parameters:
left- a non-nullNumericExpressionrepresenting an unsigned integer. The length of the unsigned integer should be defined as a concrete integer.right- a non-nullNumericExpressionrepresenting an unsigned integer. The length of the unsigned integer should be defined as a concrete integer, whose value is same to the left.- Returns:
- a
NumericExpressionrepresenting the result.
-
bitxor
Returns the result of bit-xor operation for two given unsigned integers, those two unsigned integers are in the form ofNumericExpression.- Parameters:
left- a non-nullNumericExpressionrepresenting an unsigned integer. The length of the unsigned integer should be defined as a concrete integer.right- a non-nullNumericExpressionrepresenting an unsigned integer. The length of the unsigned integer should be defined as a concrete integer, whose value is same to the left.- Returns:
- a
NumericExpressionrepresenting the result.
-
bitnot
Returns the result of bit-not operation for the given unsigned integer, the given unsigned integer is in the form ofNumericExpression. TODO: Not independent with Length, and for shifts- Parameters:
expression- a non-nullNumericExpressionrepresenting an unsigned integer. The length of the unsigned integer should be defined as a concrete integer.- Returns:
- a
NumericExpressionrepresenting the result.
-
bitshiftLeft
Returns the result of bit-left-shift operation for the given unsigned integer, the given unsigned integer is in the form ofNumericExpression.
Note that: all blank bits caused by shifting are filled with 0.- Parameters:
left- The integer will be applied with bit-shiftright- The integer represents the number of shifited bits.- Returns:
-
bitshiftRight
Returns the result of bit-right-shift operation for the given unsigned integer, the given unsigned integer is in the form ofNumericExpression.
Note that: all blank bits caused by shifting are filled with 0.- Parameters:
left- The integer will be applied with bit-shiftright- The integer represents the number of shifited bits.- Returns:
-
bitVectorType
Returns theSymbolicCompleteArrayTyperepresenting a bitVectorType, which is an array of booleans with concrete length.- Parameters:
length- an integer representing the length of the bits of the integer type.- Returns:
- a
SymbolicCompleteArrayTypewith the base-type of boolean and the given length.
-
integer2Bitvector
SymbolicExpression integer2Bitvector(NumericExpression integer, SymbolicCompleteArrayType bitVectorType) Returns the conversion of a bit vector from an integer.- Parameters:
integer- a non-nullSymbolicExpressionrepresenting an integer.bitVectorType- a non-nullSymbolicCompleteArrayTyperepresenting the type of bit vector with a type of boolean and a concrete length.- Returns:
- a non-
nullSymbolicExpressionrepresenting a bit vector.
-
bitvector2Integer
Converts a bit vector to an integer. Pre-conditions: The type ofbitvectorshould be aSymbolicCompleteArrayTypewhose element type is Boolean with a concrete length.- Parameters:
bitvector- a non-nullSymbolicExpressionrepresenting a bit vector.- Returns:
- a non-
nullSymbolicExpressionrepresenting an integer.
-
setErrFile
Summary:Set name (path) for prover unexpected error file.
Details: A prover unexpected error file saves all unexpected error messages coming from external provers (e.g. z3, cvc3 etc). Unexpected errors are caused by bugs either in the provers or in SARL . By setting filename including path to the file through such an interface, other components (like CIVL) can direct the file the any favorite places.
- Parameters:
errFile- The desired prover error file name.
-
getErrFile
String getErrFile()Summary:Get the name (path) of the prover unexpected error file. For details of the error file see
setErrFile(String)- Returns:
- The String type filename (including path)
-
printCompressed
Prints the expression by preceding with a sequence of definitions of sub-expressions which are used more than once. Good for printing large expressions with many repeated sub-expressions.- Parameters:
expr- the symbolic expression to printout- the stream to which the output will be sent
-
printCompressedTree
Use this method to print large symbolic expression hierarchically.
- Parameters:
prefix- any string the callers of this method want to put at the beginning of each line.expr- the input symbolic expressionout- the output stream
-
printExprTree
print symbolic expression as tree structure
- Parameters:
expr- the input symbolic expressionout- the output stream
-
fullySubstitute
SymbolicExpression fullySubstitute(Map<SymbolicExpression, SymbolicExpression> substituteMap, SymbolicExpression expression) Substitute the givenSymbolicExpressionexpression by repeatedly applying the methoduntil no more substitution can happen.invalid reference
#apply(SymbolicExpression)- Parameters:
substituteMap-expression-- Returns:
- The new predicate which is done the fully substitution.
-
getIntegerLengthBound
int getIntegerLengthBound()Get the current upper bound of the integer length.- Returns:
- the maximum bit-length of the integer type
-
setIntegerLengthBound
boolean setIntegerLengthBound(int bound) Set the upper bound of the length of the integer type.- Parameters:
bound-- Returns:
true
-
derivative
Returns the function which is thedegree-th derivative offunctionwith respect to theindex-th parameter.- Parameters:
function- a function of n real variables, for some n at least 1index- the parameter index, an integer greater than or equal to 0 and less than ndegree- a non-negative integer, the number of times to differentiate- Returns:
- the function which is the derivative; it has the same signature as
the given
function
-
differentiable
BooleanExpression differentiable(SymbolicExpression function, IntObject degree, Iterable<? extends NumericExpression> lowerBounds, Iterable<? extends NumericExpression> upperBounds) Returns an expression of boolean type which encodes the claim that a function is differentiable on a closed interval in R^n.- Parameters:
function- the function from R^n to R, for some n at least 1degree- the maximal degree of the derivatives which exist and are continuous, a nonnegative integerlowerBounds- lower bounds of the domain intervals; a sequence of real-valued expressions of length nupperBounds- upper bounds of the domain intervals; a sequence of real-valued expressions of length n- Returns:
- a boolean expression encoding the differentiability claim
- See Also:
-
concreteValueOfUninterpretedType
Returns a symbolic expression of aSymbolicUninterpretedType.- Parameters:
type- an instance ofSymbolicUninterpretedTypekey- an concrete integral key of the returning symbolic expression.- Returns:
- a symbolic expression of a
SymbolicUninterpretedType.
-
getForallStructure
Attempts to find a boolean expression equivalent toforallExprbut with the structureforall int i . a≤i≤b -> e
where a and b are integer expressions that do not involve i, and e is some boolean expression. If the attempt succeeds, the result is returned as a structure with the bound variable i, the lower bound a, the upper bound b, and the body e. Note that the formula above is equivalent toforall int i . !(a≤i) || !(i≤b) || e
i.e.,forall int i . i≤a-1 || b+1≤i || e
- Parameters:
forallExpr- an expression with operatorSymbolicExpression.SymbolicOperator.FORALL- Returns:
- a structure specifying the components above if the forall expression
has the special form, else
null
-
getSummands
Decomposes an expression as a sum of terms, returning those terms as an array.- Parameters:
expr- a numeric symbolic expression- Returns:
- an array of numeric expressions such that the sum of the elements of that array equals the given expression
-
expand
Attempts to expand an expression as a sum of simpler expressions.- Parameters:
expr- a numeric expression, non-null- Returns:
- an array of expressions whose sum is equivalent to
expr
-
floor
Given an expression x of real type, returns an expression of integer type representing the greatest integer less than or equal to x.- Parameters:
expr- an expression of real type- Returns:
- the floor of
expr, the greatest integer less than or equal toexpr
-
ceil
Given an expression x of real type, returns an expression of integer type representing the least integer greater than or equal to x.- Parameters:
expr- an expression of real type- Returns:
- the ceil of
expr, the least integer greater than or equal toexpr
-
roundToZero
Given an expression x of real type, returns an expression of integer type representing the resulting of rounding x towards 0. This is equivalent to x >= 0 ? floor(x) : ceil(x).- Parameters:
expr- an expression of real type- Returns:
- the result of rounding
exprtowards 0
-
valueSetTemplate
Given a symbolic type of a symbolic value and a list of
ValueSetReferences, returns symbolic expression representing a value set template.A value set template consists of a type
tof some value and a set of ValueSetReferences. Applying a value set template to a symbolic valuevof the typetresults in a subset of the valuev.- Parameters:
vsRefs- references to subsets of some valuevtype- symbolic type of some valuev- Returns:
- a symbolic expression which is a value set template
-
valueSetReferences
Returns the set ofValueSetReferences in the given value set template.- Parameters:
valueSetTemplate- a symbolic expression ofvalueSetTemplateType()- Returns:
- an
Iterablecollection ofValueSetReferences in the given value set template
-
valueType
Returns theSymbolicTypeof values, to which the given value set template refers.- Parameters:
valueSetTemplate- a symbolic expression ofvalueSetTemplateType()- Returns:
- the type of the values, to which the given value set template refers
-
valueSetTemplateType
SymbolicType valueSetTemplateType()Returns the type of a value set template. A value set template is a symbolic expression that can be applied to a value, which is a instance ofSymbolicExpression, in order to obtain a subset of the value.- Returns:
- The symbolic type of a value set template.
-
valueSetContains
Test if a value set template
vst0contains another value set templatevst1.A value set template
vst0contains another value set templatevst1iff 1) both of them are associated with the same symbolic type; 2) all the value set references invst1are contained by value set references invst0.- Parameters:
vst0- a value set templatevst1- a value set template- Returns:
- a boolean expression representing the result of the test
-
valueSetNoIntersect
Test if two value set templates have no intersection, i.e., if applying the two templates to the same object, their referred parts have no overlap.
- Parameters:
vst0- a value set templatevst1- a value set template- Returns:
- the condition that is true iff the two value set templates have no intersection
-
valueSetDiff
Given two value set templates, returns their set difference.
-
valueSetUnion
Given two value set templates, returns the union of the two.
The given two value set templates must be associated with the same symbolic type. The returned value set template contains value set references that are the precise union of the value set references in the given two templates.
- Parameters:
vst0- a value set templatevst1- a value set template- Returns:
- the union of two value set templates
-
valueSetHavoc
dev.civl.sarl.util.Pair<SymbolicExpression,Integer> valueSetHavoc(SymbolicExpression value, SymbolicExpression valueSetTemplate, String prefix, int startCount) -
valueSetAssigns
SymbolicExpression valueSetAssigns(SymbolicExpression oldValue, SymbolicExpression valueSetTemplate, SymbolicExpression newValue) Copies a subset of a value
vto another valuev'with a given value set template. Returns the value after the copy operation.- Parameters:
oldValue- a symbolic expression whose type is same as the one that is associated with the given value set templatevalueSetTemplate- a value set templatenewValue- a symbolic expression whose type is same as the one that is associated with the given value set template- Returns:
- a symbolic expression where the subset referred by the given value set template are come from the "newValue" and the other subset are still same as the ones in "oldValue"
-
valueSetReferenceType
SymbolicType valueSetReferenceType()- Returns:
- the symbolic type of
ValueSetReference
-
vsIdentityReference
VSIdentityReference vsIdentityReference()Returns the identity (or "trivial") value set reference I. This is the reference characterized by the property that dereference(I,v) returns v for any symbolic expression v. -
vsArrayElementReference
Given a value set reference to a (set-of) array(s) and an index (integer), returns a reference to the (set-of) elements of the (set-of) array(s) at that index -
vsArraySectionReference
VSArraySectionReference vsArraySectionReference(ValueSetReference parent, NumericExpression lower, NumericExpression upper) Given a reference to a (set-of) array(s) and an inclusive lower index bound, an exclusive upper index bound and a DEFAULT step, which is one, of the range of the section, returns a reference to the (set-of) section(s) of the array(s) with the given bounds. -
vsArraySectionReference
VSArraySectionReference vsArraySectionReference(ValueSetReference parent, NumericExpression lower, NumericExpression upper, NumericExpression step) Given a reference to a (set-of) array(s) and an inclusive lower index bound, an exclusive upper index bound and a step of the range of the section, returns a reference to the (set-of) section(s) of the array(s) with the given bounds. -
vsTupleComponentReference
Given a reference to a (set-of) tuple(s), and a field index, returns a reference to that (set-of) component(s) of the tuple(s). -
vsUnionMemberReference
Given a reference to a (set-of) union(s) (expression of union type) and an index of a member type of that union, returns a reference to the (set-of) underlying element(s). -
vsOffsetReference
Given a reference to a (set-of) value(s) and a integral offset, returns a reference to a (set-of) value(s), which is obtained by applying the (set-of) offset(s) to the given (set-of) value(s).
-