ValuesUnderConstraints/Eval - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : ValuesUnderConstraints/Eval

ValuesUnderConstraints

  

Eval

  

return the value of value-under-constraints object after evaluating it

 

Calling Sequence

Parameters

Description

Examples

References

Compatibility

Calling Sequence

Eval(vc, eqs)

Parameters

vc

-

ValueUnderConstraints

eqs

-

equation of the form name = rational or a set or list of such equations

Description

• 

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).

Examples

withValuesUnderConstraints:

Create a value-under-constraints object with constraints a=2,0b,0<c,d0.

vc1ValueUnderConstraintsa+b+c+d&comma;a&comma;b&comma;c&comma;d&comma;a2&comma;b&comma;c&comma;d&comma;

vc1value a+b+c+d when a2=0&comma;d0&comma;0<c&comma;0b

(1)

Print the value and the constraints of vc1

Valuevc1&semi;Constraintsvc1

a+b+c+d

a2=0&comma;d0&comma;0<c&comma;0b

(2)

Apply Simplify on vc1

Simplifyvc1

value 2+b+c+d when a2=0&comma;d0&comma;0<c&comma;0b

(3)

Print the value and the constraints of simplified vc1

Valuevc1&semi;Constraintsvc1

2+b+c+d

a2=0&comma;d0&comma;0<c&comma;0b

(4)

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.

Evalvc1&comma;a=3&comma;b=6&comma;c=3&comma;d=2

Evaluate the simplified vc1 at a=2,b=6,c=3,d=−2.

Evalvc1&comma;a=2&comma;b=6&comma;c=3&comma;d=2

9

(5)

Create another value-under-constraints object.

vc2ValueUnderConstraints1&comma;x&comma;y&comma;x2+y2+1&comma;x&comma;y&comma;&comma;xy&comma;

vc2value 1 (inconsistent)

(6)

Evaluate vc2 at x=0, y=1. This does not satisfy the constraints (indeed, no assignment of rationals to x and y will).

Evalvc2&comma;x=0&comma;y=1

References

  

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.

Compatibility

• 

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]