div.pl

loading
details
attribute value
description
owner Johannes Waldmann
uploaded 2017-08-17 03:45:07.0
disk size 381 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: div(i,i,o).

/*
div(0, s(Y), 0).
div(s(X), s(Y), 0) :- lss(X, Y).
div(s(X), s(Y), s(Z)) :-
    sub(X, Y, R),
    div(R, s(Y), Z).
*/
div(X, s(Y), Z) :- div_s(X,Y,Z).

div_s(0, Y, 0).
div_s(s(X), Y, 0) :- lss(X, Y).
div_s(s(X), Y, s(Z)) :-
    sub(X, Y, R),
    div_s(R, Y, Z).

lss(s(X), s(Y)) :- lss(X, Y).
lss(0, s(Y)).

sub(s(X), s(Y), Z) :- sub(X, Y, Z).
sub(X, 0, X).
popout

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

actions get anonymous link download benchmark