exercise_min.pl

loading
details
attribute value
description
owner Johannes Waldmann
uploaded 2017-08-17 03:45:08.0
disk size 310 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
%Source: http://colin.barker.pagesperso-orange.fr/sands.htm
%query:min(g,f).
/* min(Is,M) is true if M is the smallest element in the list Is.          */
min([I|Is],M):-min(Is,I,M).

min([],Min,Min).
min([I|Is],Temp,Min):-min_1(I,Temp,Temp1), min(Is,Temp1,Min).

min_1(I,J,I):-J >= I, !.
min_1(I,J,J):-J < I.
popout

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

actions get anonymous link download benchmark