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

ValuesUnderConstraints

  

RefineCaseDiscussion

  

refine a case discussion w.r.t. a value-under-constraints object

 

Calling Sequence

Parameters

Description

Examples

References

Compatibility

Calling Sequence

RefineCaseDiscussion(vc,lwd)

RefineCaseDiscussion(vc,lwd, outopt)

Parameters

vc

-

ValueUnderConstraints

lwd

-

list of ValueUnderConstraints objects

outopt

-

(optional) equation, either output = piecewise or output = lists

Description

• 

Denote by V1 and D1 the value and domain of vc. Denote by D2 the union of the domains of the value-under-constraints objects in lwd.

• 

The command RefineCaseDiscussion(vc,lwd) returns L1, L12, L2 where L1, L12 and L2 are three lists of value-under-constraints so that:

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. 

the domain of any value-under-constraint object in L12 is contained in the intersection of D1 and D2;

3. 

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

4. 

each of L1, L12 and L2 is a case discussion;

5. 

the list [op(L1), op(L12), op(L2)] refines the list [vc, op(lwd)].

• 

By including the option output = piecewise, you instruct the command to return the result as a single piecewise expression instead. You can explicitly select the default output of three lists by passing the option output = lists.

Assumptions

• 

The list lwd is assumed to be a case discussion. If this assumption is not satisfied then the result of RefineCaseDiscussion(vc,lwd) may not be correct.

Remarks

• 

The command RefineCaseDiscussion is provided so that users can build efficient divide-and-conquer algorithms for operating on value-under-constraints objects.

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 four value-under-constraints object using the same variables

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

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

(1)

vc2ValueUnderConstraints2&comma;a0&comma;0b&comma;c<0&comma;d=0

vc2value 2 when d=0&comma;a0&comma;0<c&comma;0b

(2)

vc3ValueUnderConstraints3&comma;b=0&comma;0a&comma;d0&comma;c0

vc3value 3 when b=0&comma;c0&comma;d0&comma;0a

(3)

vc4ValueUnderConstraints4&comma;b0&comma;0a&comma;d0&comma;c=0

vc4value 4 when c=0&comma;b0&comma;d0&comma;0a

(4)

In order to create a case discussion based on the above, we could call MakeCaseDiscussion on the list [vc1, vc2, vc3, vc4], which can potentially lead to call PairCompare on any of the six pairs [vc1, vc2], [vc1, vc3], [vc1, vc4], [vc2, vc3], [vc2, vc4], [vc3, vc4].

lvcMakeCaseDiscussionvc1&comma;vc2&comma;vc3&comma;vc4

lvcvalue 4 when c=0&comma;b0&comma;d0&comma;0a&comma;value 3 when b=0&comma;d0&comma;0<a&comma;0<c&comma;value 2 when d=0&comma;a0&comma;0<c&comma;0b&comma;values 1&comma;3 when a=0&comma;b=0&comma;d0&comma;0<c&comma;value 1 when a=0&comma;d0&comma;0<b&comma;0<c&comma;value 3 when b=0&comma;d0&comma;0<c&comma;0a

(5)

Alternatively, we can observe that [vc1, vc2] and [vc3, vc4] already form two case discussions, hence we can reduce the amount of computations by calling MergeTwoCaseDiscussions, which would call PairCompare on only four pairs of value-under-constraints objects.

MergeTwoCaseDiscussionsvc1&comma;vc2&comma;vc3&comma;vc4

value 4 when c=0&comma;b0&comma;d0&comma;0a&comma;value 3 when b=0&comma;d0&comma;0<a&comma;0<c&comma;value 2 when d=0&comma;a0&comma;0<c&comma;0b,values 1&comma;3 when a=0&comma;b=0&comma;d0&comma;0<c,value 1 when a=0&comma;d0&comma;0<b&comma;0<c&comma;value 3 when b=0&comma;d0&comma;0<c&comma;0a

(6)

On this example, we can reduce further the cost of computations by observing that the domain of vc4 is disjoint from each of the domains of vc1, vc2 and vc3. Hence we can obtain a case discussion for [vc1, vc2, vc3, vc4] by simply calling RefineCaseDiscussion as done below thus making only two calls to PairCompare

A,B,CRefineCaseDiscussionvc3&comma;vc1&comma;vc2

A,B,Cvalue 3 when b=0&comma;d0&comma;0<c&comma;0a&comma;value 3 when b=0&comma;d0&comma;0<a&comma;0<c,values 1&comma;3 when a=0&comma;b=0&comma;d0&comma;0<c,value 1 when a=0&comma;d0&comma;0<b&comma;0<c&comma;value 2 when d=0&comma;a0&comma;0<c&comma;0b

(7)

lvcopA&comma;opB&comma;opC&comma;vc4

lvcvalue 3 when b=0&comma;d0&comma;0<c&comma;0a&comma;value 3 when b=0&comma;d0&comma;0<a&comma;0<c&comma;values 1&comma;3 when a=0&comma;b=0&comma;d0&comma;0<c&comma;value 1 when a=0&comma;d0&comma;0<b&comma;0<c&comma;value 2 when d=0&comma;a0&comma;0<c&comma;0b&comma;value 4 when c=0&comma;b0&comma;d0&comma;0a

(8)

If we want to display the results of refining the case discussion a little more easily, we can use the output = piecewise option.

RefineCaseDiscussionvc3&comma;vc1&comma;vc2&comma;output=piecewise

3b=0d00<c0a3b=0d00<a0<c1&comma;3a=0b=0d00<c1a=0d00<b0<c2d=0a00<c0b

(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[RefineCaseDiscussion] 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[PairCompare]

ValuesUnderConstraints[Value]

ValuesUnderConstraints[ValueUnderConstraints]