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.

{loaded in 3372.211 msec.}
{preprocessed for plai in 0.0 msec.}
{analyzed by plai using det with local-control off in 16.001 msec.}
{written file /tmp/tmp4xPYfb/preorder_det_co.pl}
:- module(_1,[preorder/2],[assertions]).

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

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

preorder(X,Y) :-
        pdl(X,Y-[]).

:- true pred pdl(T,_1-[])
         : ( native_props:mshare([[_1]]), ground([T]), gnd(T), term(_1) )
        => ( native_props:mshare([[_1]]), ground([T]), rt29(T), term(_1) )
         + ( is_det, mut_exclusive ).

:- true pred pdl(T,_1-_2)
         : ( native_props:mshare([[_1]]), ground([T,_2]), rt21(T), term(_1), term(_2) )
        => ( native_props:mshare([[_1]]), ground([T,_2]), rt25(T), term(_1), term(_2) )
         + ( is_det, mut_exclusive ).

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

pdl(nil,Y) :-
        !,
        eq(Y,X-X).
pdl(T,[X|Xs]-Zs) :-
        value(T,X),
        left(T,L),
        right(T,R),
        pdl(L,Xs-Ys),
        pdl(R,Ys-Zs).

:- true pred left(_1,L)
         : ( native_props:mshare([[L]]), var(L), ground([_1]), rt6(_1), term(L) )
        => ( ground([_1,L]), rt10(_1), gnd(L) )
         + ( is_det, mut_exclusive ).

left(nil,nil).
left(tree(L,_1,_2),L).

:- true pred right(_1,R)
         : ( native_props:mshare([[R]]), var(R), ground([_1]), rt10(_1), term(R) )
        => ( ground([_1,R]), rt14(_1), gnd(R) )
         + ( is_det, mut_exclusive ).

right(nil,nil).
right(tree(_1,_2,R),R).

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

value(nil,_1).
value(tree(_1,X,_2),X).

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

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

eq(X,X).


:- regtype rt31/1.

rt31(A) :-
        gnd(A).
rt31(nil).
rt31(tree(A,B,C)) :-
        rt31(A),
        gnd(B),
        rt30(C).


:- regtype rt30/1.

rt30(A) :-
        gnd(A).
rt30(nil).
rt30(tree(A,B,C)) :-
        rt31(A),
        gnd(B),
        rt30(C).


:- regtype rt29/1.

rt29(nil).
rt29(tree(A,B,C)) :-
        rt31(A),
        gnd(B),
        rt30(C).


:- regtype rt21/1.

rt21(A) :-
        gnd(A).


:- regtype rt27/1.

rt27(A) :-
        gnd(A).
rt27(nil).
rt27(tree(A,B,C)) :-
        rt27(A),
        gnd(B),
        rt26(C).


:- regtype rt26/1.

rt26(A) :-
        gnd(A).
rt26(nil).
rt26(tree(A,B,C)) :-
        rt27(A),
        gnd(B),
        rt26(C).


:- regtype rt25/1.

rt25(nil).
rt25(tree(A,B,C)) :-
        rt27(A),
        gnd(B),
        rt26(C).


:- regtype rt20/1.

rt20(A) :-
        gnd(A).
rt20(nil).
rt20(tree(A,B,C)) :-
        rt20(A),
        gnd(B),
        rt19(C).


:- regtype rt19/1.

rt19(A) :-
        gnd(A).
rt19(nil).
rt19(tree(A,B,C)) :-
        rt20(A),
        gnd(B),
        rt19(C).


:- regtype rt18/1.

rt18(nil).
rt18(tree(A,B,C)) :-
        rt20(A),
        gnd(B),
        rt19(C).


:- regtype rt10/1.

rt10(nil).
rt10(tree(A,B,C)) :-
        gnd(A),
        gnd(B),
        gnd(C).


:- regtype rt14/1.

rt14(nil).
rt14(tree(A,B,C)) :-
        gnd(A),
        gnd(B),
        gnd(C).


:- regtype rt6/1.

rt6(nil).
rt6(tree(A,B,C)) :-
        gnd(A),
        gnd(B),
        gnd(C).


:- regtype rt15/1.

rt15(A-B) :-
        term(A),
        term(B).


:- regtype rt0/1.

rt0(A-[]) :-
        term(A).


:- regtype rt1/1.

rt1([]).