/* coded by LPH prior to MAY 12, 1983 */


matchdeclare([a,b],true,c,negp,d,posp);
matchdeclare([e,f,g,h],freeof("<=",">=","<",">","="));
negp(u):=(mode_declare(u,any,function(negp),boolean),if asksign(u)='neg then true);
posp(u):=(mode_declare(u,any,function(posp),boolean),if asksign(u)='pos then true);
define_variable(?matchreverse,true,boolean);

eval_when(translate,simp:false,transcompile:true);
tellsimpafter((a<b)*c,a*c>b*c);
tellsimpafter((a>b)*c,a*c<b*c);
tellsimpafter((a<=b)*c,a*c>=b*c);
tellsimpafter((a>=b)*c,a*c<=b*c);
tellsimpafter((a<b)*d,a*d<b*d);
tellsimpafter((a>b)*d,a*d>b*d);
tellsimpafter((a<=b)*d,a*d<=b*d);
tellsimpafter((a>=b)*d,a*d>=b*d);

tellsimpafter((a<b)+e,a+e<b+e);
tellsimpafter((a<=b)+e,a+e<=b+e);
tellsimpafter((a>b)+e,a+e>b+e);
tellsimpafter((a>=b)+e,a+e>=b+e);

tellsimpafter((e<f)+(g<h),e+g<f+h);
tellsimpafter((e<f)+(g<=h),e+g<f+h);
tellsimpafter((e<=f)+(g<=h),e+g<=f+h);
tellsimp((g<h)+(e=f),g+e<h+f);
tellsimp((g<=h)+(e=f),g+e<=h+f);
tellsimp((e=f)+(g<h),g+e<h+f);
tellsimp((e=f)+(g<=h),g+e<=h+f);
tellsimp((e=f)+(g>h),g+e>h+f);
tellsimp((e=f)+(g>=h),g+e>=h+f);
tellsimp((g>h)+(e=f),g+e>h+f);
tellsimp((g>=h)+(e=f),g+e>=h+f);
tellsimpafter((e>f)+(g>h),e+g>f+h);
tellsimpafter((e>f)+(g>=h),e+g>f+h);
tellsimpafter((e>=f)+(g>=h),e+g>=f+h);


eval_when(translate,simp:true);
