ValuesUnderConstraints
HasInconsistentConstraints
check whether the conjunction of the constraints of a value-under-constraints object is inconsistent
Calling Sequence
Parameters
Description
Examples
References
Compatibility
HasInconsistentConstraints(vc)
vc
-
ValueUnderConstraints
The command HasInconsistentConstraints(vc) checks whether the conjunction of the constraints of vc yields a contradiction, that is, whether or not, the system formed by the constraints of vc is inconsistent. See details below.
Detection of inconsistencies
When a value-under-constraints object is created, a number of simplifications are applied in order to detect whether the conjunction of its constraints yields a contradiction, that is, whether or not this conjunction of constraints is satisfiable.
If a such a contradiction is discovered then printing vc displays the word (inconsistent).
If such a contradiction is not discovered, then calling HasInconsistentConstraints(vc) runs additional checks;
if these prove that the conjunction of constraints is not satisfiable. then true is returned;
if these prove that the conjunction of constraints is satisfiable, then false is returned;
if these additional checks fail to decide whether the conjunction of constraints is satisfiable, then FAIL is returned.
Limitations
If IntegerSymbols(vc) is not empty and different from Symbols(vc), or if IntegerSymbols(vc) is not empty and non-linear constraints are present, then consistency detection is only heuristical and HasInconsistentConstraints(vc) may return FAIL.
Details of consistency detection
If IntegerSymbols(vc) is empty and all constraints are linear, then Fourier-Motzkin elimination is used in order to decide whether the conjunction of the constraints is satisfiable over the real numbers.
If IntegerSymbols(vc) is empty and some constraints are not linear then RegularChains:-RealTriangularize, is used in order to decide whether the conjunction of the constraints is satisfiable over the real numbers.
If a is an integer-valued polynomial of degree 1, then the so-called GCD test is applied. That is, for this polynomial to vanish at an integer point, the GCD of the coefficients of its non-constant terms must divide its constant term.
If IntegerSymbols(vc) is not empty and equal to Symbols(vc), and all constraints are linear, then the command PolyhedralSets:-ZPolyhedralSet:-IsEmpty is used in order to decide whether the conjunction of the constraints is satisfiable over the integer numbers.
If IntegerSymbols(vc) is not empty and different from Symbols(vc), then Fourier-Motzkin elimination is applied to the linear constraints in conjunction to the transformations described for the command ValuesUnderConstraints:-Constraints. If the result shows that the conjunction of the constraints is not satisfiable over the real numbers, then the conjunction of the constraints is clearly inconsistent. However, if the result shows that the conjunction of the linear constraints is satisfiable over the rational numbers, then HasInconsistentConstraints(vc) may return FAIL.
with⁡ValuesUnderConstraints:
Create a value-under-constraints object
vc1≔ValueUnderConstraints⁡N2−4,N,,,N−4,5−N,,∅
vc1≔value N2−4 when 0<5−N,0<N−4
check whether vc1 is inconsistent
HasInconsistentConstraints⁡vc1
false
Create another value-under-constraints object which differs from vc1 by the fact that N is declared as integer-valued. Note that vc4 is detected to be inconsistent thanks heuristical methods.
vc2≔ValueUnderConstraints⁡N2−4,N,,,N−4,5−N,,N
vc2≔value N2−4 (inconsistent)
check whether vc2 is inconsistent, although the answer is known
HasInconsistentConstraints⁡vc2
true
Create another value-under-constraints object
vc3≔ValueUnderConstraints⁡1,a,b,c,,a−b,−a−b,b+c,b−c,,∅
vc3≔value 1 (inconsistent)
check whether vc3 is inconsistent
HasInconsistentConstraints⁡vc3
Create another value-under-constraints object. Note that vc4 is detected to be inconsistent thanks heuristical methods.
vc4≔ValueUnderConstraints⁡1,a,b,c,,,a−b+1,−a−b,b+c,b−c,,a,b,c
vc4≔value 1 (inconsistent)
check whether vc4 is inconsistent, although the answer is known
HasInconsistentConstraints⁡vc4
Create another value-under-constraints object.
vc5≔ValueUnderConstraints⁡x,y,x+2⁢y3≤4,−x+y≤78,111⁢x+2411≤y,∅
vc5≔values x,y when 0≤117−40⁢y,0≤16⁢y−37,0≤7+8⁢x−8⁢y,0≤12−3⁢x−2⁢y,0≤11⁢y−x−24
check whether vc5 is inconsistent
HasInconsistentConstraints⁡vc5
Create another value-under-constraints object which differs from vc5 by the fact that x and y are declared integer-valued.
vc6≔ValueUnderConstraints⁡x,y,x+2⁢y3≤4,−x+y≤78,111⁢x+2411≤y,x,y
vc6≔values x,y when 0≤117−40⁢y,0≤16⁢y−37,0≤7+8⁢x−8⁢y,0≤12−3⁢x−2⁢y,0≤11⁢y−x−24
check whether vc6 is inconsistent and note that the heuristical methods are not able to discover that the constraints of vc6 are not satisfiable at the time vc6 is created. Only the command HasInconsistentConstraints(vc6) succeeds to accomplish that task.
HasInconsistentConstraints⁡vc6
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[HasInconsistentConstraints] 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[HasInconsistentConstraints]
ValuesUnderConstraints[Inequations]
ValuesUnderConstraints[IntegerSymbols]
ValuesUnderConstraints[NonNegativeInequalities]
ValuesUnderConstraints[PositiveInequalities]
ValuesUnderConstraints[Symbols]
ValuesUnderConstraints[Value]
ValuesUnderConstraints[ValueUnderConstraints]
Download Help Document