ValuesUnderConstraints/ValueUnderConstraints - 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/ValueUnderConstraints

ValuesUnderConstraints

  

ValueUnderConstraints

  

return a value-under-constraints object  

 

Calling Sequence

Parameters

Description

Examples

References

Compatibility

Calling Sequence

ValueUnderConstraints(V, C)

ValueUnderConstraints(V, C, IS, E)

ValueUnderConstraints(V, S, F, N, P, H)

ValueUnderConstraints(V, S, F, N, P, H, IS, E)

Parameters

V

-

list of Maple objects of any type

S

-

list of name specifying the variables

F

-

list of polynom defining equations

N

-

list of polynom defining nonnegative inequalities

P

-

list of polynom defining positive inequalities

H

-

list of polynom defining inequations

C

-

list of relation

IS

-

(optional) set of name specifying the integer variables

E

-

(optional) procedure for simplifying the values in this object

Description

• 

Each of the commands ValueUnderConstraints(V, C) and ValueUnderConstraints(V, S, F, N, P, H) return a value-under-constraints object. In both cases the value of that object is given by V and the indeterminates, or symbols, used by the object are given by S. In the former case, the constraints are given by C and in the latter case the constraints are given by F, N, P, H which hold the polynomials defining respectively the equations, the non-negative inequalities, the positive inequalities and the inequations of the object.

• 

If IS is passed as an optional argument, then its members must all be members of S.

• 

If E is passed as an optional argument, then it must be a procedure to be used by the command Simplify. This procedure is passed two arguments: an expression v and a list eqs of equations. It should return a version of v simplified under the assumption that the equations eqs hold. The default value is this procedure: proc(v, eqs::list(`=`)) return eval(v, eqs); end proc.

Assumptions

• 

The indeterminates (or symbols) of all the constraints must be members of V.

• 

The coefficients of all the constraints must be rational numbers.

• 

When a value-under-constraints object vc is created, the polynomials defining its constraints are normalized as follows. If p is a rational polynomial defining the constraint p=0, p > 0, p >= 0 or p <> 0, then this constraint is replaced by q=0, q > 0, q >= 0 or q <> 0, respectively, where q is the primitive part (over the integers) of the numerator of p.

• 

If the indeterminates of the defining polynomial q of a constraint of vc all belong to IntegerSymbols(vc), then these indeterminates take integer values only, and consequently q only takes integer values as well.

Remarks

• 

More details about constraints are described in the help page of the command Constraints. In particular, the constraints of a value-under-constraints object are interpreted as a conjunction of predicates, where each predicate is a binary relation applied to polynomial expressions.

• 

Moreover, when a value-under-constraints object vc is created, a number of simplification rules are applied to its constraints. These rules are described in the help page of the command Constraints.

• 

One objective of the application of these rules is to check whether the conjunction of the constraints of vc is satisfiable or not, that is, whether they form a consistent system.

• 

More details about consistency checks are described in the help page of the command HasInconsistentConstraints.

Terminology

• 

Mathematically, a value-under-constraints object vc is an ordered pair (v,c) where v is a finite set, called the value of vc, and c is a set of Boolean functions defined on some set A, and called the constraints of vc.  The set c is regarded as the conjunction of these constraints.

• 

We write the domain of vc for the subset of A on which all constraints of vc are true.

• 

If the domain of vc is not empty, then We say that vc is consistent, otherwise we say that it is inconsistent.

• 

We say that a finite number of value-under-constraints objects is a case discussion whenever their domains form a partition of some set A, that is, whenever their domains are non-empty and pairwise disjoint.

• 

Let wd be a second value-under-constraints object with value w and constraints d. We say that wd refines vc whenever the domain of wd is contained in the domain of vc and the value of wd contains the value of vc.

• 

Let lvc and lwd be two lists of value-under-constraints objects. We say that lwd refines lvc whenever the following conditions hold:

1. 

for every value-under-constraints object wd in lwd there exists at least one value-under-constraints object vc in lvc that wd refines;

2. 

for every value-under-constraints object vc of lvc there exists a number of value-under-constraints objects in lwd refining vc and such that the union of their domains is equal to the domain of vc

3. 

the value of every value-under-constraints object wd in lwd is the union of the values of the value-under-constraints objects in lvc that wd refines

• 

Assume from now on that the value v of the value-under-constraints object vc consists of functions which (1) are defined on A, the set on which constraints of vc are defined, and (2) take value in a set B. Then, the value-under-constraints object vc naturally defines a binary relation from A to B as the set of all pairs (x,y) where x belongs to the domain of vc and y is the image of x by one of the functions of v.

• 

This interpretation in terms of binary relation helps understanding the concept of a value-under-constraints object. In particular, it helps understanding why the value of such an object is a set.

Examples

withValuesUnderConstraints&colon;

Create a value-under-constraints objects with no integer-valued symbol

vc1ValueUnderConstraints1&comma;a&comma;b&comma;c&comma;d&comma;a&comma;b&comma;c&comma;d&comma;

vc1value 1 when a=0&comma;d0&comma;0<c&comma;0b

(1)

Print its value, its constraints, its symbols and its integer-valued symbols

Valuevc1&semi;Constraintsvc1&semi;Symbolsvc1&semi;IntegerSymbolsvc1

1

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

a&comma;b&comma;c&comma;d

(2)

Print its equations, inequations, non-negative inequalities and positive inequalities

Equationsvc1&semi;Inequationsvc1&semi;PositiveInequalitiesvc1&semi;NonNegativeInequalitiesvc1

a=0

d0

0<c

0b

(3)

Create another value-under-constraints objects where all symbols are integer-valued

vc2ValueUnderConstraints2&comma;a&comma;b&comma;c&comma;d&comma;a&comma;b&comma;c&comma;d&comma;a&comma;b&comma;c&comma;d

vc2value 2 when a=0&comma;d0&comma;0b&comma;0c1

(4)

Print its value, its constraints, its symbols and its integer-valued symbols

Valuevc2&semi;Constraintsvc2&semi;Symbolsvc2&semi;IntegerSymbolsvc2

2

a=0&comma;d0&comma;0b&comma;0c1

a&comma;b&comma;c&comma;d

a&comma;b&comma;c&comma;d

(5)

Print its equations, inequations, non-negative inequalities and positive inequalities

Equationsvc2&semi;Inequationsvc2&semi;PositiveInequalitiesvc2&semi;NonNegativeInequalitiesvc2

a=0

d0

0b&comma;0c1

(6)

Define a simplifier

mysimplifier := proc(v, eqs::list(`=`)) return :-Eval(v, eqs) mod 2; end proc;

mysimplifierprocv&comma;eqs::list`=`return:-Evalv&comma;eqsmod2end proc

(7)

Create a value-under-constraints object using the above simplifier

vcValueUnderConstraintsa+b&comma;a+b=100&comma;ab=2&comma;&comma;mysimplifier

vcvalue a+b when a51=0&comma;b49=0

(8)

Apply Simplify

Simplifyvc

value 0 when a51=0&comma;b49=0

(9)

Get the simplifier

pSimplifiervc&semi;evalp

pprocv&comma;eqs::list`=`return:-Evalv&comma;eqsmod2end proc

procv&comma;eqs::list`=`return:-Evalv&comma;eqsmod2end proc

(10)

Create another value-under-constraints object using the default simplifier

vcValueUnderConstraintsa+b&comma;a+b=100&comma;ab=2

vcvalue a+b when a51=0&comma;b49=0

(11)

Apply Simplify

Simplifyvc

value 100 when a51=0&comma;b49=0

(12)

Get the simplifier

pSimplifiervc&semi;evalp

pprocv&comma;eqs::list`=`returnevalsubsindetsv&comma;PolyhedralSets:-QuasiPolynomials:-QuasiPolynomial&comma;qp&rarr;function:-Evalqp&comma;eqs&comma;eqsend proc

procv&comma;eqs::list`=`returnevalsubsindetsv&comma;PolyhedralSets:-QuasiPolynomials:-QuasiPolynomial&comma;qp&rarr;function:-Evalqp&comma;eqs&comma;eqsend proc

(13)

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[ValueUnderConstraints] command was introduced in Maple 2025.

• 

For more information on Maple 2025 changes, see Updates in Maple 2025.

See Also

ValuesUnderConstraints[AreEqual]

ValuesUnderConstraints[Constraints]

ValuesUnderConstraints[Equations]

ValuesUnderConstraints[HasInconsistentConstraints]

ValuesUnderConstraints[Inequations]

ValuesUnderConstraints[IntegerSymbols]

ValuesUnderConstraints[MakeCaseDiscussion]

ValuesUnderConstraints[MergeTwoCaseDiscussions]

ValuesUnderConstraints[NonNegativeInequalities]

ValuesUnderConstraints[PairCompare]

ValuesUnderConstraints[PositiveInequalities]

ValuesUnderConstraints[RefineCaseDiscussion]

ValuesUnderConstraints[Simplifier]

ValuesUnderConstraints[Simplify]

ValuesUnderConstraints[Symbols]

ValuesUnderConstraints[ToPiecewise]

ValuesUnderConstraints[Value]

ValuesUnderConstraints[ValueUnderConstraints]