pl8.3.1.pl

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

% mode: minsort[i,o]
minsort([],[]).
minsort(L,[X|L1]) :- min1(X,L), remove(X,L,L2), minsort(L2,L1).

% mode: min1[o,i]
min1(M,[X|L]) :- min2(X,M,L).

% mode: min2[i,o,i]
min2(X,X,[]).
min2(X,A,[M|L]) :- min(X,M,B),min2(B,A,L).

% mode: min[i,i,o]
min(X,Y,X) :- le(X,Y).
min(X,Y,Y) :- gt(X,Y).

% mode: remove[i,i,o]
remove(N,[],[]).
remove(N,[N|L],L).
remove(N,[M|L],[M|L1]) :- notEq(N,M),remove(N,L,L1).

% mode: gt[i,i]
gt(s(X), s(Y)) :- gt(X, Y).
gt(s(X), 0).

% mode: le[i,i]
le(s(X), s(Y)) :- le(X, Y).
le(0, s(Y)).
le(0, 0).

% mode: notEq[i,i]
notEq(s(X), s(Y)) :- notEq(X, Y).
notEq(s(X), 0).
notEq(0, s(X)).
popout

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

actions get anonymous link download benchmark