ValuesUnderConstraints
Eval
return the value of value-under-constraints object after evaluating it
Calling Sequence
Parameters
Description
Examples
References
Compatibility
Eval(vc, eqs)
vc
-
ValueUnderConstraints
eqs
equation of the form name = rational or a set or list of such equations
The command Eval(vc,eqs) returns the value of the value-under-constraints object vc after evaluating it at the equation(s) given by eqs.
If the constraints are not satisfied, the command returns NULL. This is useful when dealing with a list of ValueUnderConstraints objects, such as might be returned by, for example, MakeCaseDiscussion: then one can evaluate all objects at a particular point, and obtain only the value that applies at the given point.
Assumptions
Each given equation must be of the form v=r, where v belongs to Symbols(vc) and r is a rational number. Moreover, every variable occurring in vc must be given a value. If this is not the case, an error is signaled.
Remarks
When Eval(vc, eqs) executes, the object vc is copied and the equations given by eqs are added to the constraints of that copy of vc.
If this makes the system of constraints of that copy of vc inconsistent, then NULL is returned, otherwise the command Simplify is applied and the value of the simplified value-under-constraints object is returned. See HasInconsistentConstraints for the rules of the consistency check.
Note that the simplification of the constraints must yield a single solution for the variables of vc. If this is not the case, then an error is raised.
Note also that the original object vc is not modified when executing Eval(vc, eqs).
with⁡ValuesUnderConstraints:
Create a value-under-constraints object with constraints a=2,0≤b,0<c,d≠0.
vc1≔ValueUnderConstraints⁡a+b+c+d,a,b,c,d,a−2,b,c,d,∅
vc1≔value a+b+c+d when a−2=0,d≠0,0<c,0≤b
Print the value and the constraints of vc1
Value⁡vc1;Constraints⁡vc1
a+b+c+d
a−2=0,d≠0,0<c,0≤b
Apply Simplify on vc1
Simplify⁡vc1
value 2+b+c+d when a−2=0,d≠0,0<c,0≤b
Print the value and the constraints of simplified vc1
2+b+c+d
Evaluate the simplified vc1 at a=3,b=6,c=3,d=−2. Note that NULL is returned, because this contradicts the constraint a=2.
Eval⁡vc1,a=3,b=6,c=3,d=−2
Evaluate the simplified vc1 at a=2,b=6,c=3,d=−2.
Eval⁡vc1,a=2,b=6,c=3,d=−2
9
Create another value-under-constraints object.
vc2≔ValueUnderConstraints⁡1,x,y,x2+y2+1,x,y,,x−y,∅
vc2≔value 1 (inconsistent)
Evaluate vc2 at x=0, y=1. This does not satisfy the constraints (indeed, no assignment of rationals to x and y will).
Eval⁡vc2,x=0,y=1
Rui-Juan Jing, Yuzhuo Lei, Christopher F. S. Maligec, Marc Moreno Maza: "Counting the Integer Points of Parametric Polytopes: A Maple Implementation." Proceedings of Computer Algebra in Scientific Computing - 26th International Workshop (CASC) 2024: 140-160, Lecture Notes in Computer Science, vol. 14938, Springer.
The ValuesUnderConstraints[Eval] command was introduced in Maple 2025.
For more information on Maple 2025 changes, see Updates in Maple 2025.
See Also
ValuesUnderConstraints[Constraints]
ValuesUnderConstraints[Equations]
ValuesUnderConstraints[Eval]
ValuesUnderConstraints[HasInconsistentConstraints]
ValuesUnderConstraints[Inequations]
ValuesUnderConstraints[NonNegativeInequalities]
ValuesUnderConstraints[PositiveInequalities]
ValuesUnderConstraints[RefineCaseDiscussion]
ValuesUnderConstraints[Simplifier]
ValuesUnderConstraints[Simplify]
ValuesUnderConstraints[Symbols]
ValuesUnderConstraints[Value]
ValuesUnderConstraints[ValueUnderConstraints]
Download Help Document