perm.pl

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

% mode: ap1[o,o,i]
ap1(nil, X, X).
ap1(cons(H, X), Y, cons(H, Z)) :- ap1(X, Y, Z).

% mode: ap2[i,i,o]
ap2(nil, X, X).
ap2(cons(H, X), Y, cons(H, Z)) :- ap2(X, Y, Z).

% mode: perm[i,o]
perm(nil, nil).
perm(Xs, cons(X, Ys)) :- ap1(X1s, cons(X, X2s), Xs),
                         ap2(X1s, X2s, Zs),
		         perm(Zs, Ys).


% example 3 in
% Transformational methodology for proving termination of logic programs
% Rao, M.R.K.K.; Kapur, D.; Shyamasundar, R.K. 
% The Journal Of Logic Programming, Vol: 34, Issue: 1, January 1998 

popout

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

actions get anonymous link download benchmark