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 3424.214 msec.}
{preprocessed for plai in 0.0 msec.}
{analyzed by plai using det with local-control off in 8.001 msec.}
{written file /tmp/tmpThRJSo/bappend_det_co.pl}
:- module(_1,[goal/1],[assertions]).

:- entry goal(A)
         : ground(A).

:- true pred goal(A)
         : ( ground([A]), gnd(A) )
        => ( ground([A]), rt8(A) )
         + ( is_det, mut_exclusive ).

goal(X) :-
        s2l(X,Xs),
        append(Xs,_1,_2).

:- true pred append(X,Y,Z)
         : ( native_props:mshare([[X],[Y],[Z]]), var(Y), var(Z), rt10(X), term(Y), term(Z) )
        => ( native_props:mshare([[X],[X,Z],[Y,Z],[Z]]), var(Y), rt21(X), term(Y), term(Z) )
         + ( is_det, mut_exclusive ).

append([],Y,Z) :-
        !,
        eq(Y,Z).
append(X,Y,[H|Z]) :-
        head(X,H),
        tail(X,T),
        append(T,Y,Z).

:- true pred s2l(X,L)
         : ( native_props:mshare([[L]]), var(L), ground([X]), gnd(X), term(L) )
        => ( native_props:mshare([[L]]), ground([X]), rt8(X), rt10(L) )
         + ( is_det, mut_exclusive ).

s2l(0,L) :-
        !,
        eq(L,[]).
s2l(X,[_1|Xs]) :-
        p(X,P),
        s2l(P,Xs).

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

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

:- true pred tail(_1,Xs)
         : ( native_props:mshare([[_1],[Xs]]), var(Xs), rt15(_1), term(Xs) )
        => ( native_props:mshare([[_1],[_1,Xs]]), rt19(_1), rt11(Xs) )
         + ( is_det, mut_exclusive ).

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

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

p(0,0).
p(s(X),X).

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

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

eq(X,X).


:- regtype rt9/1.

rt9(0).
rt9(A) :-
        gnd(A).
rt9(s(A)) :-
        rt9(A).


:- regtype rt8/1.

rt8(0).
rt8(s(A)) :-
        rt9(A).


:- regtype rt10/1.

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


:- regtype rt22/1.

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


:- regtype rt21/1.

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


:- regtype rt15/1.

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


:- regtype rt19/1.

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


:- regtype rt11/1.

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


:- regtype rt5/1.

rt5(0).
rt5(s(A)) :-
        gnd(A).


:- regtype rt0/1.

rt0([]).