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 3416.214 msec.}
{preprocessed for plai in 0.0 msec.}
{analyzed by plai using det with local-control off in 4.0 msec.}
{written file /tmp/tmpYO8yWj/flat_det_co.pl}
:- module(_1,[flat/2],[assertions]).
:- entry flat(A,B)
: ground(A).
:- true pred flat(tree(_1,_2,tree(_3,_4,_5)),B)
: ( native_props:mshare([[B]]), ground([_1,_2,_3,_4,_5]), term(B), gnd(_1), gnd(_2), gnd(_3), gnd(_4), gnd(_5) )
+ fails.
:- true pred flat(A,B)
: ( native_props:mshare([[B]]), ground([A]), gnd(A), term(B) )
=> ( ground([A,B]), rt6(A), rt8(B) )
+ ( is_det, mut_exclusive ).
flat(niltree,nil).
flat(tree(X,niltree,T),cons(X,Xs)) :-
flat(T,Xs).
flat(tree(X,tree(Y,T1,T2),T3),Xs) :-
flat(tree(Y,T1,tree(X,T2,T3)),Xs).
:- regtype rt7/1.
rt7(niltree).
rt7(tree(A,niltree,B)) :-
gnd(A),
rt7(B).
:- regtype rt6/1.
rt6(niltree).
rt6(tree(A,niltree,B)) :-
gnd(A),
rt7(B).
:- regtype rt9/1.
rt9(nil).
rt9(cons(A,B)) :-
gnd(A),
rt9(B).
:- regtype rt8/1.
rt8(nil).
rt8(cons(A,B)) :-
gnd(A),
rt9(B).