SlowGuess/NeurIPS_2023_OCR huggingface dataset:
(b)
Figure 3: The associated graph of  $\{x_1^3 -4x_2^2 x_3 +$ $12x_{2} + 3,3x_{1}^{2}x_{4} - 4x_{4}^{3} - 1\}$  in Figure 3a. Assume that we select  $x_{4}$  to project, it results  $\{x_{1} - 1,x_{1}+$ $1,x_{1}^{2} - x_{1} + 1,x_{1}^{2} + x_{1} + 1,x_{1}^{3} - 4x_{2}^{2}x_{3} + 12x_{2} + 3\}$  and the associated graph is shown in Figure 3b.
that of other variables will change slightly. Besides, the projected variable should also be removed from the associated graph. Based on the aforementioned inspiring situations, we propose two rules for approximately simulating project.
At time  $t - 1$ , assume  $x_{i}$  is the next projecting variable. We mainly consider the projected variable's influence on its 1-hop neighbor variables.
Update Rule. We update the embedding  $X$  without project for other variables  $x_{j}$  via
$$
X [ x _ {j} ] ^ {t} = \left\{ \begin{array}{l l} \phi (X [ x _ {j} ] ^ {t - 1}, X [ x _ {i} ] ^ {t - 1}), & A [ x _ {i} ] [ x _ {j} ] = 1, \\ X [ x _ {j} ] ^ {t - 1}, & o t h e r w i s e, \end{array} \right.
$$
where  $\phi(a, b) = MLP(CONCAT(a, b))$  is the neural network that simulates the project for embedding transformation.
Delete Rule. It will trivially remove  $x_{i}$  and edges linked to  $x_{i}$  and update  $A, X$  in the state correspondingly.
$$
A \leftarrow \operatorname {R e m o v e R o w C o l u m n} (A, M a p \left(x _ {i}\right)),
$$
$$
X \leftarrow R e m o v e R o w (X, M a p (x _ {i})),
$$
$$
M a p (x _ {j}) \leftarrow M a p (x _ {j}) - 1, i <   j <   n,
$$
where the function  $\operatorname{Map}(x): V \to \mathbb{N}$ , maps the variable  $x$  to the index in matrix  $A$  and  $X$ , the operation RemoveRowColumn(  $A, \operatorname{Map}(x_i)$ ) removes the row and column of variable  $x_i$  from  $A$ , and the operation RemoveRow(  $X, \operatorname{Map}(x_i)$ ) removes the row of variable  $x_i$  from  $X$ .
After such transitions, the state will feed the model defined by Section 3.4 and obtain the next projecting variable. After calling the model  $n - 1$  times, the trajectory corresponds to a variable order suggested by GRL-SVO(NUP).
Implementation and Environments. We utilized PyTorch Geometric [36] for implementations of our approach. The hyper-parameters are listed in Appendix B. We utilized the NVIDIA Tesla V100 GPU for training. After the heuristics output the variable order, all instances with the given variable order are run with MAPLE 2018 on an Intel Xeon Platinum 8153 CPU (2.00GHz). The run-time limit is 900 seconds, and the time to predict a variable order is also counted.
Dataset. We utilize two CAD datasets: random and SMT-LIB. The detailed parameters of random generation and collecting methods for SMT-LIB are presented in Appendix B.
The random dataset contains 7 categories from 3-var to 9-var. We generate 20000 3-var instances and split them into training, testing, and validation sets in a ratio of  $8:1:1$ . We pre-run all  $3! = 6$  variable orders and remove non-conforming instances where some variables are eliminated due to random
(b)
Figure 4: The performance of all heuristics. Figure 4a and 4b correspond to the training phase, and the horizontal lines represent the timeout instances of corresponding heuristics on the training set. Figure 4c is the  $PT$  graph over number of variables.
generation, for example,  $x - x = 0$ ; we remove the instances that are all timeout under 6 orders. The rest sets have 14990, 1871, and 1887 instances, respectively. The other categories contain 1000 instances. They are generated by randpoly of MAPLE. We also collect a SMT-LIB dataset where there are from 3-var to 9-var instances with numbers {5908, 1371, 131, 123, 318, 41, 24}.
Baselines. We compare our approach with two kinds of state-of-the-art heuristics, UP or NUP. For UP, we compare our approaches with  $sotd$  and  $ndrr$  implemented in the ProjectionCAD package [37]. Besides, we also implement  $gmods$  [13] in MAPLE. For NUP, we compare our approaches with brown, and triangular implemented in the RegularChains package [38]. EMLP approach is proposed by England [15] and its implementation only supports 3-var instances. PVO(brown) and PVO(triangular) are PVO approaches combined with EB & NUP heuristics, brown and triangular, respectively. The provided implementations [16] only support 4,5,6-var instances.
Criterion. Assume  $T$  and  $N$  denote the running time and number of cells.  $AVG.T$  and  $AVG.N$  denote the average of  $T$  and  $N$ . If an instance runs timeout, we count the maximum time (900 seconds) and the maximum number of cells of this instance solved by other heuristics into the calculation. We remove the instances that all heuristics lead to CAD timeout, as such instances can not distinguish the ability of heuristics.  $PT$  and  $\# SI$  denote the variable order prediction time used by heuristics and the number of solved instances within the time limit. For UP heuristics,  $PT$  also takes project time into consideration. Except for  $\# SI$ , the criteria are the smaller, the better.
Experiments. We conduct three experiments to evaluate our approaches. First of all, we only train the models on the 3-var random dataset. Then, we generalize the trained models on random datasets with up to 9 variables and the SMT-LIB dataset. Finally, we compare GRL-SVO(UP) and GRL-SVO(NUP) and discuss different application scenarios. We list ablation experiments in Appendix C, investigating the effect of features (of the initial embedding), network size, network structure, reward normalization factor  $M$ , GNN architecture, and coefficient. We also list additional results in Appendix D, including results under other criteria and performance of fine-tuning.
Training GRL-SVO. Figure 4a and Figure 4b show the performance during training with the instances in the training set. GRL-SVO outperforms the other heuristics through training and shows a rapid performance improvement. The UP heuristics are better than the NUP heuristics. The inference can be more accurate because the UP heuristics obtain more information than the NUP heuristics. In the beginning, GRL-SVO(NUP) with the random initial parameters is better than GRL-SVO(UP). After training, GRL-SVO(UP) shows better performance.
Generalization. We only train on the 3-var dataset and generalize the models to the other datasets. After removing all timeout instances, there are 1876, 651, 416, 354, 349, 409, and 383 instances for the random dataset from 3-var to 9-var; for the SMT-LIB dataset, 1777, 387, 17 instances for 3-var, 4-var to 6-var and 7-var to 9-var, respectively. Table 1 shows the performance of all heuristics, and the best scores are bolded. GRL-SVO(UP) is the only LB approach with UP heuristics, achieving the best performance among most UP and NUP heuristics except for the 4-var category. GRL-SVO(NUP) also achieves competitive performance compared to other NUP heuristics. GRL-SVO also shows
Table 1: The performance of all heuristics. The dash “-” indicates that the method does not support the category.
Categories	NUP	UP
EB	LB	EB	LB
brown	triangular	EMLP	PVO(brown)	PVO(triangular)	GRL-SVO(NUP)	sodt	ndrr	gmods	GRL-SVO(UP)
3-var(test)	#SI	1620	1504	1686	-	-	1772	1784	1663	1693	1798
AVG.T	171.41	228.32	140.87	-	-	94.87	91.47	148.92	124.06	78.06
AVG.N	2427.74	2669.67	2390.68	-	-	2166.67	2149.07	2007.98	2195.80	2089.68
4-var	#SI	415	376	-	408	392	443	625	488	513	533
AVG.T	352.87	394.71	-	360.33	376.71	314.57	85.12	292.06	215.48	191.45
AVG.N	5241.95	5585.90	-	5323.83	5582.46	5131.40	3925.28	4248.45	4849.18	4764.50
5-var	#SI	236	202	-	242	218	238	43	27	329	346
AVG.T	434.52	494.37	-	418.34	465.43	420.51	827.47	853.75	238.01	207.79
AVG.N	12310.70	13224.18	-	11795.90	12555.82	12090.49	14538.69	14845.67	10466.79	9744.58
6-var	#SI	175	149	-	180	160	202	5	5	273	306
AVG.T	501.75	552.14	-	490.73	527.86	439.62	889.16	889.97	284.40	214.55
AVG.N	20639.07	20440.23	-	20181.98	19290.37	19302.97	23298.50	23329.10	17561.67	16715.20
7-var	#SI	163	118	-	-	-	153	1	1	270	297
AVG.T	548.15	631.85	-	-	-	552.47	897.75	897.79	313.73	245.57
AVG.N	27790.31	27795.79	-	-	-	27302.28	30452.64	30456.31	24465.89	22432.30
8-var	#SI	173	138	-	-	-	172	0	0	310	345
AVG.T	601.90	654.20	-	-	-	597.09	900.00	900.00	372.34	322.80
AVG.N	39382.26	40679.57	-	-	-	38815.98	43112.02	43112.02	34016.98	33505.21
9-var	#SI	151	125	-	-	-	158	0	0	286	325
AVG.T	649.41	690.29	-	-	-	625.69	900.00	900.00	431.11	374.78
AVG.N	48273.67	49832.78	-	-	-	46946.09	52173.03	52173.03	42594.25	42270.91
SMT-LIB (3-var)	#SI	1770	1763	1675	-	-	1766	1750	1694	1772	1772
AVG.T	20.33	23.68	83.09	-	-	22.38	34.38	65.10	18.32	18.53
AVG.N	4449.79	5070.46	7661.07	-	-	4104.43	3672.21	4140.72	3873.22	3946.84
SMT-LIB (4-var to 6-var)	#SI	374	372	-	372	372	364	356	339	379	379
AVG.T	86.03	89.95	-	88.32	88.98	91.17	105.18	142.32	59.96	67.51
AVG.N	24596.20	24260.88	-	23039.49	22730.34	21040.09	16896.16	21013.25	17388.52	18894.51
SMT-LIB (7-var to 9-var)	#SI	13	12	-	-	-	12	11	11	16	14
AVG.T	308.14	377.32	-	-	-	339.90	541.53	588.33	260.53	329.91
AVG.N	53971.24	58675.94	-	-	-	51570.88	51470.41	62185.82	50381.12	56312.41
competitive performance in the real-world dataset, SMT-LIB dataset. Note that although the heuristics  $sotd$  perform better than GRL-SVO(UP) on the 4-var instances, they run timeout in most instances from 5-var due to the combinatorial explosion of the number of variable orders as shown in Figure 4c. The NUP heuristics take a short prediction time, and the polylines in Figure 4c overlap. For example, an instance with 7 variables leads to  $7! = 5040$  variable orders to project for  $sotd$  and  $ndrr$ .
4.3 Discussion on GRL-SVO(UP/NUP)
As in Table 1, GRL-SVO(UP) performs better in  $\# SI$ ,  $AVG.T$ ,  $AVG.N$  compared to GRL-SVO(NUP). It is understandable because GRL-SVO(UP) receives more real-world information from the projected polynomial set at each step. As in Figure 4c, GRL-SVO(NUP) is faster than GRL-SVO(UP). The inference time of GRL-SVO(NUP) is almost unchanged with the increase of variables, but there is an obvious increase of GRL-SVO(UP). As the number of variables grows, the time of project and interactions between GRL-SVO(UP) and symbolic computation tools will be critical. It is also the bottleneck of UP heuristics like GRL-SVO(UP), gmods, sotd, and ndrr. Therefore, the application scenarios corresponding to the two models will be different.
Internalizing GRL-SVO(UP) into the CAD process is a promising option. As project is an algorithm component of CAD, internalization will help reuse the results of projection and reduce the interaction time. GRL-SVO(NUP) is cheap and can extract information directly from polynomial representations. It might be applied to other tools that do not use the entire CAD process. As a canonical example, the automated reasoning tools like Z3 [5], YICES2 [6], CVC5[39], utilize project partially only for generating lemmas when solving non-linear arithmetic problems. At the beginning of solving, they also require a fixed variable order. For tasks that are time-critical and do not utilize full CAD in the solving process, GRL-SVO(NUP) seems to be a better option.
Our graph representation cannot embed complete information on polynomials. The associated graph is simple and only shows the relationship between variables. Through selection, we conduct the embedding of graph nodes, but they still ignore plenty of minutiae information, for example, the distribution of coefficients. Besides, the lack of sufficiently large datasets is also a matter of urgency. We can generate large amounts of random data but may lack practical instances for training. Another slight limitation is the prediction time. Python and PyTorch are both heavy techniques. The prediction time of GRL-SVO shown in Figure 4c is actually not much different from other heuristics.
In the paper, we have proposed the first RL-based approach to suggest variable order for cylindrical algebraic decomposition. It has two variants: GRL-SVO(UP) for LB & UP and GRL-SVO(NUP) for LB & NUP. GRL-SVO(UP) can suggest branching variables in the CAD process; GRL-SVO(NUP) can suggest total variable order before the CAD process. Our approaches outperform state-of-the-art learning-based heuristics and are competitive with the best expert-based heuristics. Our RL-based approaches also show a strong learning and generalization ability. Future work is to deploy our approach to practical applications, such as constructing an RL-based package for MAPLE and an algorithm component for automated reasoning tools for non-linear arithmetic solving.
This work has been supported by the National Natural Science Foundation of China (NSFC) under grants No.61972384 and No.62132020. Feifei Ma is also supported by the Youth Innovation Promotion Association CAS under grant No.Y202034. The authors would like to thank Bican Xia, Jiawei Liu, and the anonymous reviewers for their comments and suggestions.
[1] Alfred Tarski. A Decision Method for Elementary Algebra and Geometry. In Quantifier elimination and cylindrical algebraic decomposition, pages 24-84. Springer, 1998.
[2] George E Collins. Quantifier elimination for real closed fields by cylindrical algebraic decomposition. In Automata theory and formal languages, pages 134-183. Springer, 1975.
[3] Mark de Berg, Offried Cheong, Marc J. van Kreveld, and Mark H. Overmars. Computational Geometry: Algorithms and Applications, 3rd Edition. Springer, 2008.
[4] Steven M. LaValle. Planning Algorithms. Cambridge University Press, 2006.
[5] Dejan Jovanovic and Leonardo Mendonça de Moura. Solving Non-linear Arithmetic. In IJCAR 2012, volume 7364 of Lecture Notes in Computer Science, pages 339-354. Springer, 2012.
[6] Dejan Jovanovic. Solving Nonlinear Integer Arithmetic with MCSAT. In VMCAI 2017, volume 10145 of Lecture Notes in Computer Science, pages 330-346. Springer, 2017.
[7] Fuqi Jia, Rui Han, Pei Huang, Minghao Liu, Feifei Ma, and Jian Zhang. Improving Bit-Blasting for Nonlinear Integer Constraints. In ISSTA 2023, pages 14-25. ACM, 2023.
[8] Christopher W. Brown and James H. Davenport. The Complexity of Quantifier Elimination and Cylindrical Algebraic Decomposition. In ISSAC 2007, pages 54-60. ACM, 2007.
[9] Christopher W Brown. Companion to the Tutorial: Cylindrical Algebraic Decomposition. United States Naval Academy, 2004.
[10] Andreas Dolzmann, Andreas Seidl, and Thomas Sturm. Efficient Projection Orders for CAD. In ISSAC 2004, pages 111-118. ACM, 2004.
[11] Changbo Chen, James H. Davenport, François Lemaire, Marc Moreno Maza, Bican Xia, Rong Xiao, and Yuzhen Xie. Computing the Real Solutions of Polynomial Systems with the Regular Chains Library in Maple. ACM Commun. Comput. Algebra, 45(3/4):166-168, 2011.
[12] Russell J. Bradford, James H. Davenport, Matthew England, and David J. Wilson. Optimising Problem Formulation for Cylindrical Algebraic Decomposition. In *CICM 2013*, volume 7961 of Lecture Notes in Computer Science, pages 19–34. Springer, 2013.
[13] Tereso del Río and Matthew England. New Heuristic to Choose a Cylindrical Algebraic Decomposition Variable Ordering Motivated by Complexity Analysis. In CASC 2022, volume 13366 of Lecture Notes in Computer Science, pages 300-317. Springer, 2022.
A Cylindrical Algebraic Decomposition
A.1 Detailed Description
A.1.1 Polynomial
$\mathbb{N}$  and  $\mathbb{R}$  denote the set of natural numbers and real numbers, respectively. Let  $\pmb{x} = \{x_{1},\dots ,x_{n}\}$  be the variable set, where  $x_{1} < x_{2} < \dots < x_{n}$  is the order of the variables.
A term  $t_i$  is a finite production of powers of variables, i.e.  $t_i = \prod_{j=1}^n x_j^{d_{i,j}}$ , where  $d_{i,j} \in \mathbb{N}$  as the degree of the variable  $x_j$ . We denote  $\sum_{j=1}^n d_{i,j}$  as the degree of the term.
A polynomial  $P \in \mathbb{R}[\pmb{x}]$  of general form is a finite sum of terms, i.e.,  $P = \sum_{i=1}^{m} c_i t_i$ , where  $c_i \in \mathbb{R}$  is coefficient of term  $t_i$ . In addition, the equivalent nested form of polynomial  $Q \in \mathbb{R}[x_1, \dots, x_{i-1}, x_i]$ ,
$$
Q = a _ {m} x _ {i} ^ {d _ {m}} + a _ {m - 1} x _ {i} ^ {d _ {m - 1}} + \dots + a _ {0},
$$
where  $0 < d_{1} < \dots < d_{m}$ , and the coefficients  $a_{i}$  are polynomials in  $\mathbb{R}[x_1,\dots ,x_{i - 1}]$  with  $a_{m}\neq 0$ . We denote  $x_{i}$  as main variable,  $d_{m}$  as degree,  $a_{m}$  as leading coefficient of the polynomial  $Q$ . For example, given a variable order  $x_{1} < x_{2} < x_{3}$ ,
$$
\begin{array}{l} p \left(x _ {1}, x _ {2}, x _ {3}\right) = x _ {1} x _ {2} x _ {3} ^ {2} + x _ {2} x _ {3} ^ {2} + x _ {3} ^ {2} + x _ {1} x _ {3} + x _ {2} x _ {3} \\ = \left(\left(x _ {1} + 1\right) x _ {2}\right) x _ {3} ^ {2} + \left(x _ {1} + x _ {2}\right) x _ {3}. \\ \end{array}
$$
The degree of  $x_{1}x_{2}x_{3}^{2}, x_{2}x_{3}^{2}, x_{3}^{2}, x_{1}x_{3}, x_{2}x_{3}$  are 4,3,2,2,2, while that of the polynomial  $p(x_{1}, x_{2}, x_{3})$  is 2, and leading coefficient is  $((x_{1} + 1)x_{2})$ .
A.1.2 Cylindrical Algebraic Decomposition
A Cylindrical Algebraic Decomposition (CAD) is a decomposition algorithm of a set of polynomials in ordered  $\mathbb{R}^n$  space resulting in finite sign-invariant regions, named cells. After CAD, it can query a limited set of sample points in corresponding cells. Due to the sign of each polynomial is either always positive, always negative, or always zero on any given cell, one can determine the sign of the polynomials at any point in  $\mathbb{R}^n$  using this set of sample points.
Note that computing the CAD of a set of univariate polynomials (one-dimensional CAD) is quite simple. We only need to calculate all the real roots of the polynomials, and the cells are precisely these real roots themselves along with the intervals they divide. This leads to a motivation for computing the CAD of a set of polynomials with  $n$  variables, which involves recursively reducing the construction of a  $k$ -dimensional CAD to the construction of a  $(k - 1)$ -dimensional CAD, until reaching the recursive boundary of computing a one-dimensional CAD, and then constructing higher-dimensional CAD from lower-dimensional CAD continuously.
Formally, the algorithm consists of three components: projection, root isolation, and lift. A diagram is shown in Figure 5. The project phase eliminates the variables of a polynomial set  $P_{n}$  with  $n$  variables by a strictly defined projection operator  $proj$  in a given order  $x_{1} < x_{2} < \dots < x_{n}$  until only one variable  $x_{1}$  left, resulting in polynomial sets  $P_{1}, \dots, P_{n-1}$ , where  $P_{i} = proj(P_{i+1})$  contains only the variables  $x_{1}, \dots, x_{i}$ . The projection operator is carefully designed to ensure that the CAD of  $P_{i}$  can be constructed from the CAD of  $P_{i-1}$ . Then the root isolate and lift phases are alternated successively. To make the following statement compatible, we replace the notation of  $P_{1}$  with  $P_{1,1}$ . Let  $N(i)$  denote the number of cells generated by  $P_{i}$  (also equals to the number of sample points). We set  $N(0)$  to be 1. The root isolate phase will output all roots of a univariate polynomial set. When  $i = 1$ , the roots of  $P_{1,1}$  split  $\mathbb{R}$  into  $N(1)$  cells. Let  $SP_{i,k}, 1 \leq k \leq N(i-1)$  denote the set of sample points of the cells generated by  $P_{i,k}$  and  $SP_{i}$  denote the union of  $SP_{i,k}$ . Actually,  $SP_{i}$  is precisely the sample points of the cells generated by  $P_{i}$  and  $|SP_{i}| = N(i)$ . The lift phase assigns each sample point  $s_{i,k}$  of  $SP_{i}$  to variables of  $P_{i+1}$ , i.e.,  $(x_{1}, x_{2}, \dots, x_{i}) \gets s_{i,k}, 1 \leq k \leq N(i)$ , to polynomials in  $P_{i+1}$ , resulting in univariate polynomial sets  $P_{i+1,k}, 1 \leq k \leq N(i)$ . Invoking the root isolate phase will obtain each  $SP_{i+1,k}$  and finally their union  $SP_{i+1}$ . After repeating root isolate and lift for  $n-1$  times, we achieve the cells of  $P_{n}$  characterized by the sample points  $SP_{n}$ . The paper provides a concrete example of the CAD process in Example 2.1.
The projection operator  $proj$  plays a key role in the CAD process, which carries enough information to ensure that the CAD of any set of polynomials  $P$  can be constructed from the CAD of  $proj(P)$ .
Figure 5: The process of CAD.
The first projection operator that satisfies the above property is designed by George Collins[2], which is too complicated, however. Here, we introduce another classic simplified projection operator, the McCallum Projection Operator[40]. It is the default projection operator used in the ProjectionCAD package[37] and our architecture of GRL-SVO(UP).
In mathematics, the resultant is used to determine whether two polynomials have common zeros, while the discriminant is used to determine if one polynomial has repeated roots. Both these two tools are crucial in the construction of the projection operator. We first introduce the definitions of the resultant and the discriminant, and then the McCallum Projection Operator is detailed in Definition 5.
Definition 3 (Resultant). Let  $f_1, f_2$  be two polynomials in  $\mathbb{R}[x_1, \ldots, x_n]$ . Assume that
$$
f _ {1} = a _ {m} x _ {n} ^ {d _ {m}} + a _ {m - 1} x _ {n} ^ {d _ {m - 1}} + \dots + a _ {0},
$$
$$
f _ {2} = b _ {n} x _ {n} ^ {d _ {n}} + b _ {n - 1} x _ {n} ^ {d _ {n - 1}} + \dots + b _ {0}.
$$
The resultant of  $f_{1}$  and  $f_{2}$  with respect to  $x_{n}$ ,  $Res(f_{1},f_{2},x_{n})$ , is:
$$
R e s (f _ {1}, f _ {2}, x _ {n}) = \left| \begin{array}{c c c c c c c} a _ {m} & a _ {m - 1} & \dots & a _ {0} & & & \\ & a _ {m} & a _ {m - 1} & \dots & a _ {0} & & \\ & & \ddots & \ddots & \ddots & \ddots & \\ & & & a _ {m} & a _ {m - 1} & \dots & a _ {0} \\ b _ {n} & b _ {n - 1} & \dots & b _ {0} & & & \\ & b _ {n} & b _ {n - 1} & \dots & b _ {0} & & \\ & & \ddots & \ddots & \ddots & \ddots & \\ & & & b _ {n} & b _ {n - 1} & \dots & b _ {0} \end{array} \right|
$$
Definition 4 (Discriminant). Let  $f$  be a polynomial in  $\mathbb{R}[x_1, \ldots, x_n]$ . Assume that
$$
f = a _ {m} x _ {n} ^ {d _ {m}} + a _ {m - 1} x _ {n} ^ {d _ {m - 1}} + \dots + a _ {0}.
$$
The discriminant of  $f$  with respect to  $x_{n}$ ,  $Dis(f, x_{n})$ , is:
$$
D i s (f, x _ {n}) = \frac {(- 1) ^ {\frac {m (m - 1)}{2}}}{a _ {m}} R e s (f, \frac {\partial f}{\partial x _ {n}}, x _ {n}).
$$
Definition 5 (McCallum Projection Operator). Let  $F = \{f_1, \ldots, f_k\}$  be a set of polynomials in  $\mathbb{R}[x_1, \ldots, x_n]$ . The McCallum projection operator,  $\operatorname{proj}_m$ , is a mapping that maps  $F$  to  $\operatorname{proj}_m(F)$  where  $\operatorname{proj}_m(F)$  is the set of polynomials in  $\mathbb{R}[x_1, \ldots, x_{n-1}]$  defined by:
- The coefficients of each polynomial in  $F$ ,
- The discriminant of each polynomial in  $F$  with respect to  $x_{n}$ ,
- The resultant of any two different polynomials  $f_{i}, f_{j}$  in  $F$  with respect to  $x_{n}$ .
Another important component in the CAD algorithm is the real root isolation algorithm, which accepts a set of univariate polynomials and results in all the roots (actually, the arbitrarily small intervals that contain each root) of the univariate polynomials. This can be accomplished by invoking
the subalgorithm RootIsolation multiple times and adjusting the upper and lower bounds of the initial interval for each univariate polynomial.
We provide the specifics of the algorithm RootIsolation in Algorithm 2. Before that, some necessary concepts like the sign variation, the 1-norm, and the Sturm sequence are introduced, which play a role in the algorithm RootIsolation.
Definition 6 (Sign Variation). For a sequence of non-zero real numbers  $\overline{c}$ :  $c_{1}, c_{2}, \dots, c_{k}$ , the sign variation of  $\overline{c}$ ,  $V(\overline{c})$ , is:
$$
V (\bar {c}) = | \{i \mid 1 \leq i <   k \& c _ {i} c _ {i + 1} <   0 \} |.
$$
For a sequence of univariate polynomials  $\overline{S}$ :  $f_{1}, f_{2}, \dots, f_{k}$ , the sign variation of  $\overline{S}$  at real number  $a$ ,  $V_{a}(\overline{S})$  is:
$$
V _ {a} (\bar {S}) = V (\bar {s}),
$$
where  $\overline{s}$  is the real number sequence  $f_{1}(a), f_{2}(a), \dots, f_{k}(a)$ .
Definition 7 (1-norm). Given a univariate polynomial  $f = a_{m}x^{d_{m}} + a_{m - 1}x^{d_{m - 1}} + \dots +a_{0}$ . The 1-norm of  $f$ ,  $\| f\| _1$ , is: