# Singular          #### D.2.4.10 ConsLevels

Procedure from library `grobcov.lib` (see grobcov_lib).

Usage:
ConsLevels(list L);
L=[[P1,Q1],...,[Ps,Qs]] is a list of lists of of pairs of ideals represening the constructible set
S=V(P1) \ V(Q1) u ... u V(Ps) \ V(Qs).
To be called in a ring Q[a][x] or a ring Q[a]. But the ideals can contain only the parameters in Q[a].

Return:
The list of ideals [a1,a2,...,at] representing the
closures of the canonical levels of S and its
complement C wrt to the closure of S. The
canonical levels of S are represented by theirs
Crep. So we have:
Levels of S: [a1,a2],[a3,a4],...
Levels of C: [a2,a3],[a4,a5],...
S=V(a1) \ V(a2) u V(a3) \ V(a4) u ...
C=V(a2 \ V(a3) u V(a4) \ V(a5) u ...
The expression of S can be obtained from the
output of ConsLevels by
the call to Levels.

Note:
The algorithm was described in
J.M. Brunat, A. Montes. "Computing the canonical
representation of constructible sets."
Math. Comput. Sci. (2016) 19: 165-178.

Example:
 ```LIB "grobcov.lib"; if(defined(R)){kill R;} ring R=0,(x,y,z),lp; short=0; ideal P1=x*(x^2+y^2+z^2-1); ideal Q1=z,x^2+y^2-1; ideal P2=y,x^2+z^2-1; ideal Q2=z*(z+1),y,x*(x+1); list Cr1=Crep(P1,Q1); list Cr2=Crep(P2,Q2); list L=list(Cr1,Cr2); L; ==> : ==> : ==> _=x^3+x*y^2+x*z^2-x ==> : ==> _=z ==> _=x^2+y^2-1 ==> : ==> : ==> _=y ==> _=x^2+z^2-1 ==> : ==> _=z^2+z ==> _=y ==> _=x+z+1 ConsLevels(L); ==> : ==> _=x^3+x*y^2+x*z^2-x ==> : ==> _=z ==> _=x^2+y^2-1 ==> : ==> _=z ==> _=y ==> _=x-1 ==> : ==> _=1 ```

### Misc 