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

ValuesUnderConstraints

  

PairCompare

  

return the differences and common characteristics of two values-under-constraints objects

 

Calling Sequence

Parameters

Description

Examples

References

Compatibility

Calling Sequence

PairCompare(vc1,vc2)

Parameters

vc1

-

ValueUnderConstraints

vc2

-

ValueUnderConstraints

Description

• 

Denote by V1 and C1 the value and constraints of vc1. Similarly, denote by V2 and C2 the value and constraints of vc2.

• 

Denote by D1 the domain of vc1 and by D2 that of vc2

• 

Then, the command PairCompare(vc1,vc2) returns three lists of value-under-constraints objects L1, L12 and L2 so that the following five conditions hold:

1. 

any value-under-constraint object in L1 has value V1 and its domain is contained in the set theoretic difference of D1 and D2;

2. 

any value-under-constraint object in L12 has value V1 union V2 and its domain is contained in the intersection of D1 and D2;

3. 

any value-under-constraint object in L2 has value V2 and its domain is contained in the set theoretic difference of D2 and D2;

4. 

any point satisfying C1 or C2 satisfies the set of constraints of one and only one value-under-constraints objects among L1, L12 and L2;

5. 

the set of constraints of every value-under-constraints object among L1, L12 and L2 is satisfiable.

Remarks

• 

One useful way to understand what PairCompare(vc1,vc2) computes is as follows. Let D1 and D2 be the domains of vc1 and vc2 respectively. View V1 (resp. V2) as the set of all images of a generic point in D1 (resp. D2). Then, vc1 and vc2 represent two binary relations. Moreover, PairCompare(vc1,vc2) computes three binary relations R1, R12 and R2 encoded by L1, L12 and L2 respectively.

• 

The domain of R1 is given by the disjunction of the systems of constraints listed in L1. Similarly, the domain of R12 is given by the disjunction of the systems of constraints listed in L12. And, similarly, the domain of R2 is given by the disjunction of the systems of constraints listed in L2.

• 

Consequently, if every point satisfying C1 satisfies C2, then L1 is empty. Similarly, if every point satisfying C2 satisfies C1, then L2 is empty.

• 

Another useful observation is that [op(L1), op(L12), op(L2)] is a case discussion refining [vc1, vc2].

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:

Create a value-under-constraints object

vc1ValueUnderConstraints1,a,b,c,d,e,f,g,h,,a,b,c,d,,a,b,c,d,e,f,g,h

vc1value 1 when 0a,0b,0c1,0d1

(1)

Create another value-under-constraints object

vc2ValueUnderConstraints2,a,b,c,d,e,f,g,h,,e,f,g,h,,a,b,c,d,e,f,g,h

vc2value 2 when 0e,0f,0g1,0h1

(2)

Apply PairCompare and pretty-print the result with ToPiecewise

L0PairComparevc1,vc2:

ToPiecewisemapop,L0

ToPiecewisevalue 1 when 0a,0b,0c1,0d1,0e1,value 1 when 0a,0b,0e,0c1,0d1,0f1,value 1 when 0a,0b,0e,0f,0g,0c1,0d1,value 1 when 0a,0b,0e,0f,0h,0c1,0d1,0g1,values 1,2 when 0a,0b,0e,0f,0c1,0d1,0g1,0h1,value 2 when 0e,0f,0a1,0g1,0h1,value 2 when 0a,0e,0f,0b1,0g1,0h1,value 2 when 0a,0b,0e,0f,0c,0g1,0h1,value 2 when 0a,0b,0e,0f,0d,0c1,0g1,0h1

(3)

Consider two other value-under-constraints objects with no integer-valued indeterminate

vc14ValueUnderConstraints1,a,b,c,d,e,f,g,h,a,b,c,1b,d,

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

(4)

vc15ValueUnderConstraints2&comma;a&comma;b&comma;c&comma;d&comma;e&comma;f&comma;g&comma;h&comma;e&comma;f&comma;g&comma;1f&comma;h&comma;

vc15value 2 when e=0&comma;h0&comma;0<g&comma;0<1f&comma;0f

(5)

Apply PairCompare and pretty-print the result with ToPiecewise

L1PairComparevc14&comma;vc15&colon;

ToPiecewisemapop&comma;L1

ToPiecewisevalue 1 when a=0&comma;d0&comma;0<c&comma;0<1b&comma;0b&comma;0g&comma;value 1 when a=0&comma;d0&comma;0<c&comma;0<g&comma;0<1b&comma;0b&comma;01+f&comma;value 1 when a=0&comma;d0&comma;0<c&comma;0<g&comma;0<f&comma;0<1b&comma;0b&comma;value 1 when a=0&comma;d0&comma;e0&comma;0<c&comma;0<g&comma;0<1b&comma;0<1f&comma;0b&comma;0f&comma;value 1 when a=0&comma;e=0&comma;h=0&comma;d0&comma;0<c&comma;0<g&comma;0<1b&comma;0<1f&comma;0b&comma;0f&comma;values 1&comma;2 when a=0&comma;e=0&comma;d0&comma;h0&comma;0<c&comma;0<g&comma;0<1b&comma;0<1f&comma;0b&comma;0f&comma;value 2 when e=0&comma;h0&comma;0<g&comma;0<1f&comma;0f&comma;0c&comma;value 2 when e=0&comma;h0&comma;0<c&comma;0<g&comma;0<1f&comma;0f&comma;01+b&comma;value 2 when e=0&comma;h0&comma;0<c&comma;0<g&comma;0<b&comma;0<1f&comma;0f&comma;value 2 when e=0&comma;a0&comma;h0&comma;0<c&comma;0<g&comma;0<1b&comma;0<1f&comma;0b&comma;0f&comma;value 2 when a=0&comma;d=0&comma;e=0&comma;h0&comma;0<c&comma;0<g&comma;0<1b&comma;0<1f&comma;0b&comma;0f

(6)

Modify the previous two value-under-constraints objects by making all indeterminate integer-valued

vc14ValueUnderConstraints1&comma;a&comma;b&comma;c&comma;d&comma;e&comma;f&comma;g&comma;h&comma;a&comma;b&comma;c&comma;1b&comma;d&comma;b&comma;f

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

(7)

vc15ValueUnderConstraints2&comma;a&comma;b&comma;c&comma;d&comma;e&comma;f&comma;g&comma;h&comma;e&comma;f&comma;g&comma;1f&comma;h&comma;b&comma;f

vc15value 2 when e=0&comma;f=0&comma;h0&comma;0<g

(8)

Apply PairCompare and pretty-print the result with ToPiecewise

L2PairComparevc14&comma;vc15&colon;

ToPiecewisemapop&comma;L2

ToPiecewisevalue 1 when a=0&comma;b=0&comma;d0&comma;0<c&comma;0g&comma;value 1 when a=0&comma;b=0&comma;d0&comma;0<c&comma;0<g&comma;0f1&comma;value 1 when a=0&comma;b=0&comma;d0&comma;0<c&comma;0<g&comma;01+f&comma;value 1 when a=0&comma;b=0&comma;f=0&comma;d0&comma;e0&comma;0<c&comma;0<g&comma;value 1 when a=0&comma;e=0&comma;h=0&comma;b=0&comma;f=0&comma;d0&comma;0<c&comma;0<g&comma;values 1&comma;2 when a=0&comma;e=0&comma;b=0&comma;f=0&comma;d0&comma;h0&comma;0<c&comma;0<g&comma;value 2 when e=0&comma;f=0&comma;h0&comma;0<g&comma;0c&comma;value 2 when e=0&comma;f=0&comma;h0&comma;0<c&comma;0<g&comma;0b1&comma;value 2 when e=0&comma;f=0&comma;h0&comma;0<c&comma;0<g&comma;01+b&comma;value 2 when e=0&comma;b=0&comma;f=0&comma;a0&comma;h0&comma;0<c&comma;0<g&comma;value 2 when a=0&comma;d=0&comma;e=0&comma;b=0&comma;f=0&comma;h0&comma;0<c&comma;0<g

(9)

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

• 

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

See Also

ValuesUnderConstraints[Constraints]

ValuesUnderConstraints[MakeCaseDiscussion]

ValuesUnderConstraints[MergeTwoCaseDiscussions]

ValuesUnderConstraints[RefineCaseDiscussion]

ValuesUnderConstraints[Value]

ValuesUnderConstraints[ValueUnderConstraints]