/** Parity testing simplification **/

/*K: even; odd; Evenp; Oddp; parity; properties  */
/*A: J Gottschalk */
/*S: University of Western Australia */
/*D: March 1985 */

/*QV: XIntp */

/* SMP already realizes that Evenp[x]:1 => Intp[x]:1 */

/* These definitions are used to extend the operation of the 
	system defined functions Evenp. */
Evenp[$$x + $y] :: Sel[Evenp[$$x]&Evenp[$y],1, \
		        Oddp[$$x]& Oddp[$y],1, \
			Oddp[$$x]&Evenp[$y],0, \
		       Evenp[$$x]& Oddp[$y],0, \
		       1,0]
Evenp[$$x $y]   :: Sel[ Intp[$$x]&Evenp[$y],1, \
		       Evenp[$$x]& Intp[$y],1, \
		        Oddp[$$x]& Oddp[$y],0, \
		       1,0]
Evenp[$x^$y]    :: Sel[Evenp[$x]&Intp[$y],1, \
			Oddp[$x]&Intp[$y],0, \
		       1,0]

Oddp[$$x + $y] :: Sel[Evenp[$$x]&Evenp[$y],0, \
		       Oddp[$$x]& Oddp[$y],0, \
		       Oddp[$$x]&Evenp[$y],1, \
		      Evenp[$$x]& Oddp[$y],1, \
		      1,0]
Oddp[$$x $y]   :: Sel[ Intp[$$x]&Evenp[$y],0, \
		      Evenp[$$x]& Intp[$y],0, \
		       Oddp[$$x]& Oddp[$y],1, \
		      1,0]
Oddp[$x^$y]    :: Sel[Evenp[$x]&Intp[$y],0, \
		       Oddp[$x]&Intp[$y],1, \
		      1,0]

_XEvenpOddp[Loaded] : 1

