execution. It is easy to calculate that $D_{(1)}=\{(0,0),(-1,1)\}$, $D_{(2)}=\{(0,0),(1,-1)\}$, and so $D_1=\{(0,0),(1,-1),(-1,1)\}$.

3.  Similarly, the solution set $D_{(ij)}$ of equation $$\left\{
       \begin{aligned}
       &G(x,y)=0\\
       &G({\pmb{A}}_i(x,y))=0\\
       &G({\pmb{A}}_j({\pmb{A}}_i(x,y)))=0
       \end{aligned}\right.$$ is the set of inputs for which the third iteration is achievable by successively choosing ${\pmb{A}}_i$ and ${\pmb{A}}_j$ in the first and the second iterations. $D_2\triangleq D_{(11)}\cup D_{(12)}\cup D_{(21)}\cup D_{(22)}$ is the set of inputs which allow at least three iterations. By simple calculation, we obtain that $D_{(11)}=\{(0,0)\}$, $D_{(12)}=\{(0,0),(-1,1)\}$, $D_{(21)}=\{(0,0),(1,-1)\}$, $D_{(22)}=\{(1,-1)\}$, and $D_2=\{(0,0),(1,-1),(-1,1)\}$.

4.  Now we note that $D_1=D_2$. Our results reported in this paper guarantee that $D=D_1=\{(0,0),(1,-1),(-1,1)\}$, namely, $D_1$ is actually the set of inputs which make the program possibly nonterminating.

5.  Observe that $V\cap D=\{(1,-1)\}\neq\emptyset$. So the program is nonterminating on input $(x_0,y_0)=(1,-1)$.

Preliminaries {#sec:pre}
=============

In this section, we recall some basic concepts and results on computational algebraic geometry, which serve as the theoretical foundation of our discussion. For a detailed exposition to this subject, please refer to [@DJD07][@FSM27].

Polynomial rings and ideals
---------------------------

Consider a number field ${\mathbb{K}}$, which could be the field of rational numbers $\mathbb{Q}$, real numbers $\mathbb{R}$ or complex numbers $\mathbb{C}$ throughout this paper. Let ${\pmb{x}}=(x_1,x_2,\cdots,x_d)$ be a vector of variables. A monomial of ${{\pmb{x}}}$ is of 