d.pl

loading
details
attribute value
description
owner Johannes Waldmann
uploaded 2017-08-17 03:45:07.0
disk size 372 Bytes
downloadable true
type
attribute value
name no_type
processor id 1
description this is the default benchmark type for rejected benchmarks and benchmarks that are not associated with a type.
owning community none
loading contents
%query: d(i,i,o).

/* a variant of the (in)famous differentiation example */

d(X,X,1).
d(T,_,0) :- isnumber(T).
d(times(U,V),X,times(B,U)+times(A,V)) :- d(U,X,A), d(V,X,B).
d(div(U,V),X,W) :- d(times(U,power(V,p(0))),X,W).
d(power(U,V),X,times(V,times(W,power(U,p(V))))) :- isnumber(V), d(U,X,W).
isnumber(0).
isnumber(s(X)) :- isnumber(X).
isnumber(p(X)) :- isnumber(X).
popout

content may be truncated. 'popout' for larger text window.

actions get anonymous link download benchmark