Ciao Preprocessor (integrated Alpha version)
 | This is an alpha distribution, meant only for testing. Please do let us 
 | know at ciaopp-bugclip.dia.fi.upm.es any problems you may have.

{Reading /tmp/tmp5ZDWQx/rev.pl
}
{loaded in 3372.211 msec.}
{preprocessed for plai in 4.0 msec.}
{analyzed by plai using det with local-control off in 12.001 msec.}
{written file /tmp/tmp5ZDWQx/rev_det_co.pl}
:- module(_1,[rev/2],[assertions]).

:- entry rev(A,B)
         : ground(A).

:- true pred rev(A,B)
         : ( native_props:mshare([[B]]), ground([A]), gnd(A), term(B) )
        => ( native_props:mshare([[B]]), ground([A]), rt33(A), rt35(B) )
         + ( is_det, mut_exclusive ).

rev(L,R) :-
        rev(L,[],R).

:- true pred rev(L,[],Z)
         : ( native_props:mshare([[Z]]), ground([L]), gnd(L), term(Z) )
        => ( native_props:mshare([[Z]]), ground([L]), rt33(L), rt35(Z) )
         + ( is_det, mut_exclusive ).

:- true pred rev(L,[_1|_2],Z)
         : ( native_props:mshare([[Z],[_1]]), ground([L,_2]), gnd(L), term(Z), term(_1), rt2(_2) )
        => ( native_props:mshare([[Z],[Z,_1]]), ground([L,_2]), rt30(L), rt27(Z), term(_1), rt26(_2) )
         + ( is_det, mut_exclusive ).

:- true pred rev(L,[_1|_2],Z)
         : ( native_props:mshare([[Z],[_1],[_2]]), ground([L]), rt16(L), term(Z), term(_1), rt14(_2) )
        => ( native_props:mshare([[Z],[Z,_1],[Z,_1,_2],[Z,_2]]), ground([L]), rt24(L), rt17(Z), term(_1), rt23(_2) )
         + ( is_det, mut_exclusive ).

rev([],Y,Z) :-
        !,
        eq(Y,Z).
rev(L,S,R) :-
        head(L,X),
        tail(L,T),
        rev(T,[X|S],R).

:- true pred head(_2,_1)
         : ( native_props:mshare([[_1]]), var(_1), ground([_2]), gnd(_2), term(_1) )
        => ( native_props:mshare([[_1]]), ground([_2]), rt5(_2), term(_1) )
         + ( is_det, mut_exclusive ).

head([],_1).
head([X|_1],X).

:- true pred tail(_1,Xs)
         : ( native_props:mshare([[Xs]]), var(Xs), ground([_1]), rt5(_1), term(Xs) )
        => ( ground([_1,Xs]), rt9(_1), gnd(Xs) )
         + ( is_det, mut_exclusive ).

tail([],[]).
tail([_1|Xs],Xs).

:- true pred eq(X,_1)
         : ( native_props:mshare([[X],[_1]]), rt17(X), term(_1) )
        => ( native_props:mshare([[X,_1]]), rt17(X), rt17(_1) )
         + ( is_det, mut_exclusive ).

:- true pred eq(X,_1)
         : ( native_props:mshare([[X],[_1]]), rt10(X), term(_1) )
        => ( native_props:mshare([[X,_1]]), rt10(X), rt10(_1) )
         + ( is_det, mut_exclusive ).

:- true pred eq(X,_1)
         : ( native_props:mshare([[_1]]), ground([X]), rt0(X), term(_1) )
        => ( ground([X,_1]), rt0(X), rt0(_1) )
         + ( is_det, mut_exclusive ).

eq(X,X).


:- regtype rt34/1.

rt34([]).
rt34(A) :-
        gnd(A).
rt34([A|B]) :-
        gnd(A),
        rt34(B).


:- regtype rt33/1.

rt33([]).
rt33([A|B]) :-
        gnd(A),
        rt34(B).


:- regtype rt37/1.

rt37([]).
rt37([A|B]) :-
        term(A),
        rt37(B).


:- regtype rt36/1.

rt36([]).
rt36([A|B]) :-
        term(A),
        rt37(B).


:- regtype rt35/1.

rt35([]).
rt35([A|B]) :-
        term(A),
        rt36(B).


:- regtype rt2/1.

rt2([]).


:- regtype rt31/1.

rt31([]).
rt31(A) :-
        gnd(A).
rt31([A|B]) :-
        gnd(A),
        rt31(B).


:- regtype rt30/1.

rt30([]).
rt30([A|B]) :-
        gnd(A),
        rt31(B).


:- regtype rt29/1.

rt29([]).
rt29([A|B]) :-
        term(A),
        rt29(B).


:- regtype rt28/1.

rt28([]).
rt28([A|B]) :-
        term(A),
        rt29(B).


:- regtype rt27/1.

rt27([A|B]) :-
        term(A),
        rt28(B).


:- regtype rt26/1.

rt26([]).
rt26([A|B]) :-
        term(A),
        rt26(B).


:- regtype rt16/1.

rt16(A) :-
        gnd(A).


:- regtype rt15/1.

rt15([]).
rt15([A|B]) :-
        term(A),
        rt15(B).


:- regtype rt14/1.

rt14([]).
rt14([A|B]) :-
        term(A),
        rt15(B).


:- regtype rt25/1.

rt25([]).
rt25(A) :-
        gnd(A).
rt25([A|B]) :-
        gnd(A),
        rt25(B).


:- regtype rt24/1.

rt24([]).
rt24([A|B]) :-
        gnd(A),
        rt25(B).


:- regtype rt17/1.

rt17([A|B]) :-
        term(A),
        rt14(B).


:- regtype rt23/1.

rt23([]).
rt23([A|B]) :-
        term(A),
        rt23(B).


:- regtype rt5/1.

rt5([]).
rt5([A|B]) :-
        gnd(A),
        gnd(B).


:- regtype rt9/1.

rt9([]).
rt9([A|B]) :-
        gnd(A),
        gnd(B).


:- regtype rt10/1.

rt10([A|B]) :-
        term(A),
        rt2(B).


:- regtype rt0/1.

rt0([]).