76 lines (66 sloc) 2.49 KB
fricas
)clear all
All user variables and function definitions have been cleared.
p:=operator 'p
fricas
f:=operator 'f
fricas
g:=operator 'g
fricas
h:=operator 'h
fricas
m:=operator 'm
fricas
N:=29 -- number of tests
fricas
-----------------------------------------
--
Type: List Equation Expression Integer
fricas
-----------------------------------------
P1:=[f(g(x),x) = f(y,a)]
Type: List(Equation(Expression(Integer)))
fricas
P2:=[f(x,h(x),y) = f(g(z), u, z)]
Type: List(Equation(Expression(Integer)))
fricas
P3:=[p(a,x,f(y)) = p(u,v,w),p(a,x,f(y))= p(a, s,f(c)),p(u,v,w) = p(a,s,f(c))]
Type: List(Equation(Expression(Integer)))
fricas
P4:=[f(x, b, g(z)) = f(f(y), y, g(u))]
Type: List(Equation(Expression(Integer)))
fricas
P5:=[p(a,x,h(g(z))) = p(z,h(y),h(y))]
Type: List(Equation(Expression(Integer)))
fricas
P6:=[p(f(a),g(x)) = p(y,y)]
Type: List(Equation(Expression(Integer)))
fricas
P7:=[p(x,x) = p(y,f(y))]
Type: List(Equation(Expression(Integer)))
fricas
P8:=[sin(x+y) = sin(u^2+v^2)]
Type: List(Equation(Expression(Integer)))
fricas
P9:=[p(c,b)=p(a,c),p(a,b)=p(b,c)]
Type: List(Equation(Expression(Integer)))
fricas
P10:=[p(c,b)=p(a,c),p(a,b)=p(b,c),m(a,b)=m(c,d)]
Type: List(Equation(Expression(Integer)))
fricas
P11:=[g(x,f(x,b))=g(f(a,b),f(y,z))]
Type: List(Equation(Expression(Integer)))
fricas
P12:=[p(a,x,h(g(z)))=p(z,h(y),h(y))]
Type: List(Equation(Expression(Integer)))
fricas
P13:=[p(f(a),g(x))=p(y,y)]
Type: List(Equation(Expression(Integer)))
fricas
P14:=[f(x1)=f(g(x0,x0))]
Type: List(Equation(Expression(Integer)))
fricas
P15:=[f(x1,x2)=f(g(x0,x0),g(x1,x1))]
Type: List(Equation(Expression(Integer)))
fricas
P16:=[f(x1,x2,x3)=f(g(x0,x0),g(x1,x1),g(x2,x2))]
Type: List(Equation(Expression(Integer)))
fricas
-- Result list
res:List(Boolean):=[false for i in 1..N]
Type: List(Boolean)
fricas
--------
-- unify
--------
res.1:=test (unify(P1,[])=[y= g(a),x= a])
Type: Boolean
fricas
res.2:=test (unify(P2,[])=[x= g(z),u= h(g(z)),y= z])
Type: Boolean
fricas
res.3:=test (unify(P3,[])=[a= u,x= s,w= f(c),v= s,y= c])
Type: Boolean
fricas
res.4:=test (unify(P4,[])=[x= f(y),b= y,z= u])
Type: Boolean
fricas
res.5:=test (unify(P5,[])=[a= z,x= h(g(z)),y= g(z)])
Type: Boolean
fricas
res.6:=test (unify(P6,[]) case "failed")
Type: Boolean
fricas
res.7:=test (unify(P7,[]) case "failed")
Type: Boolean
fricas
res.8:=test (unify(P8,[])=[y + x = v^2 + u^2 ])
Type: Boolean
fricas
res.9:=test (unify(P9,[])= [c = a,b = a])
Type: Boolean
fricas
res.10:=test (unify(P10,[])= [c = d,b = d,a = d])
Type: Boolean
fricas
res.11:=test (unify(P11,[])=[x= f(a,z),y= f(a,z),b= z])
Type: Boolean
fricas
res.12:=test (unify(P12,[])=[a = z,x = h(g(z)),y = g(z)])
Type: Boolean
fricas
res.13:=test (unify(P13,[]) case "failed")
Type: Boolean
fricas
res.14:=test (unify(P14,[])= [x1 = g(x0,x0)])
Type: Boolean
fricas
res.15:=test (unify(P15,[])=[x1 = g(x0,x0),x2 = g(g(x0,x0),g(x0,x0))])
Type: Boolean
fricas
res.16:=test (unify(P16,[])= [x1 = g(x0,x0), x2 = g(g(x0,x0),g(x0,x0)), _
x3 = g(g(g(x0,x0),g(x0,x0)),g(g(x0,x0),g(x0,x0)))])
Type: Boolean
fricas
res.17:=true
Type: Boolean
fricas
-------------
-- reduceWith
-------------
res.18:=test (reduceWith(P1,unify(P1,[])).1)
Type: Boolean
fricas
res.19:=test (reduceWith(P2,unify(P2,[])).1)
Type: Boolean
fricas
res.20:=test (reduceWith(P3,unify(P3,[])).1)
Type: Boolean
fricas
res.21:=test (reduceWith(P4,unify(P4,[])).1)
Type: Boolean
fricas
res.22:=test (reduceWith(P5,unify(P5,[])).1)
Type: Boolean
fricas
res.23:=test (reduceWith(P9,unify(P9,[])).1)
Type: Boolean
fricas
res.24:=test (reduceWith(P10,unify(P10,[])).1)
Type: Boolean
fricas
res.25:=test (reduceWith(P11,unify(P11,[])).1)
Type: Boolean
fricas
res.26:=test (reduceWith(P12,unify(P12,[])).1)
Type: Boolean
fricas
res.27:=test (reduceWith(P14,unify(P14,[])).1)
Type: Boolean
fricas
res.28:=test (reduceWith(P15,unify(P15,[])).1)
Type: Boolean
fricas
res.29:=test (reduceWith(P16,unify(P16,[])).1)
Type: Boolean
fricas
-- ***** Final result *****
reduce(_and,res)
Type: Boolean