% Table * %Cons Functor % module % 5 list3_5(_l,_l2,_l3,_upvals):-_upvals=[],(subtract(_l,_l2,_l3)). % 4 list3_4(_l,_b,_upvals):-_upvals=[],(_l = [_|_b]). % 3 list3_3(_l,_a,_upvals):-_upvals=[],(_l = [_a|_]). % 2 list3_2(_l,_l2,_dup,_upvals):-_upvals=[_unique_],(call_cl(_unique_,[_l2,_l,[]])). % unique_ list3_unique_(_l,_l2,_dup,_upvals):-_upvals=[],((((true),(_l = [],_l2 = _l);_l = '[|]'(_e,_tail),(((get_(_list,"has",T15),_T14 = T15,call_cl(_T14,[_dup,_e])),(_l2 = _tail2,call(list3_unique_(_tail,_tail2,_dup),_upvals));_dup1 = '[|]'(_e,_dup),_l2 = '[|]'(_e,_tail2),call(list3_unique_(_tail,_tail2,_dup1),_upvals)))))). % every list3_every(_l,_p,_upvals):-_upvals=[],(((_l = [],_l2 = []);(dif(_l,[]),_l = [_head|_tail],call_cl(_p,[_head]),call(list3_every(_tail,_p),_upvals)))). % iterate list3_iterate(_p,_n,_x,_y,_upvals):-_upvals=[],(((_n = 0.0,_y = _x);(dif(_n,0.0),call_cl(_p,[_x,_x2]),{_n-1.0=T13},call(list3_iterate(_p,T13,_x2,_y),_upvals)))). % map list3_map(_l,_p,_l2,_upvals):-_upvals=[],(((_l = [],_l2 = []);(dif(_l,[]),_l = [_head|_tail],_l2 = [_head2|_tail2],call_cl(_p,[_head,_head2]),call(list3_map(_tail,_p,_tail2),_upvals)))). % join3 list3_join3(_l,_sep,_s2,_upvals):-_upvals=[_join2],(((_l = '[|]'(_s,_tail),call_cl(_join2,[_tail,_sep,_s,_s2]));(dif(_l,'[|]'(_s,_tail)),_s2 = "",_l = []))). % join2 list3_join2(_l,_sep,_s,_s2,_upvals):-_upvals=[],(((_l = [_b|_tail],calc(_s+_sep,T11),calc(T11+_b,T12),_s1 = T12,call(list3_join2(_tail,_sep,_s1,_s2),_upvals));(dif(_l,[_b|_tail]),_l = [],_s = _s2))). % join list3_join(_l,_sep,_s,_upvals):-_upvals=[],(((_l = [_a|[]],_s = _a);(dif(_l,[_a|[]]),(_l = [_s1|_tail],calc(_s1+_sep,T9),calc(T9+_s2,T10),_s = T10,call(list3_join(_tail,_sep,_s2),_upvals));(dif(_l,[_s1|_tail]),_l = [],_s = "")))). % fold list3_fold(_l,_pred,_a,_result,_upvals):-_upvals=[],(((_l = '[|]'(_b,_tail),call_cl(_pred,[_a,_b,_c]),call(list3_fold(_tail,_pred,_c,_result),_upvals));(dif(_l,'[|]'(_b,_tail)),_l = [],_result = _s))). % each list3_each(_l,_p,_l2,_upvals):-_upvals=[_eachIndex],(call_cl(_eachIndex,[_l,_p,0.0,_l2])). % eachIndex list3_eachIndex(_l,_p,_i,_l2,_upvals):-_upvals=[],(((_l = [],_l2 = []);(dif(_l,[]),_l = [_head|_tail],_l2 = [_head2|_tail2],call_cl(_p,[_i,_head,_head2]),calc(_i+1.0,T8),call(list3_eachIndex(_tail,_p,T8,_tail2),_upvals)))). % reverse list3_reverse(_l,_l2,_upvals):-_upvals=[_concat],(((_l = [_a|_tail],call(list3_reverse(_tail,_ltemp),_upvals),call_cl(_concat,[_ltemp,[_a|[]],_l2]));(dif(_l,[_a|_tail]),_l = [],_l2 = []))). % slice list3_slice(_l,_i,_j,_l2,_upvals):-_upvals=[],(slice(_l,_i,_j,_l2)). % last list3_last(_l,_a,_upvals):-_upvals=[_get,_size],(call_cl(_size,[_l,_T6]),{_T6-1.0=T7},call_cl(_get,[_l,T7,_a])). % findOnce list3_findOnce(_l,_e,_i,_upvals):-_upvals=[],(_l = '[|]'(_x,_tail),((_e = _x)->(_i = 0.0);(call(list3_findOnce(_tail,_e,_j),_upvals),calc(_j+1.0,T5),_i = T5,!))). % find list3_find(_l,_e,_i,_upvals):-_upvals=[],(def(_e),_l = '[|]'(_e1,_tail),((_e = _e1,_i = 0.0);(dif(_e,_e1),call(list3_find(_tail,_e,_j),_upvals),calc(_j+1.0,T4),_i = T4))). % pop list3_pop(_l,_l2,_upvals):-_upvals=[],(_l = '[|]'(_x,_tail),_l2 = _tail). % push list3_push(_l,_x,_l2,_upvals):-_upvals=[],(_l2 = '[|]'(_x,_l)). % concat list3_concat(_l,_l2,_l3,_upvals):-_upvals=[],(append(_l,_l2,_l3)). % has list3_has(_l,_e,_upvals):-_upvals=[],(((_l = [_e|_],true);(dif(_l,[_e|_]),_l = '[|]'(_,_tail),call(list3_has(_tail,_e),_upvals)))). % has2 list3_has2(_l,_e,_upvals):-_upvals=[],(((_l = [_e|_],writeln_('[|]'("e",'[|]'(_e,[]))),true);(dif(_l,[_e|_]),writeln_(_l),_l = [_|_tail],call(list3_has2(_tail,_e),_upvals)))). % remove list3_remove(_l,_n,_l2,_upvals):-_upvals=[],((((true),(_l = [],_l2 = _l);_l = '[|]'(_e,_tail),((_e = _n,_l2 = _tail);(dif(_e,_n),_l2 = '[|]'(_e,_l3),call(list3_remove(_tail,_n,_l3),_upvals)))))). % removeIndex list3_removeIndex(_l,_i,_l2,_upvals):-_upvals=[_remove2],(type(_i,"int"),call_cl(_remove2,[_l,0.0,_i,_l2])). % remove2 list3_remove2(_l,_i,_n,_l2,_upvals):-_upvals=[],((((true),(_l = [],_l2 = _l);_l = '[|]'(_e1,_tail),((_i = _n,_l2 = _tail);(dif(_i,_n),calc(_i+1.0,T3),_i2 = T3,_l2 = '[|]'(_e1,_l3),call(list3_remove2(_tail,_i2,_n,_l3),_upvals)))))). % removeAll list3_removeAll(_l,_p,_l2,_upvals):-_upvals=[],((((_l = []),(_l2 = []);_l = [_head|_tail],(((call_cl(_p,[_head])),(call(list3_removeAll(_tail,_p,_l2),_upvals));_l2 = [_head|_tail2],call(list3_removeAll(_tail,_p,_tail2),_upvals)))))). % filter list3_filter(_l,_p,_l2,_upvals):-_upvals=[],((((_l = []),(_l2 = []);_l = [_head|_tail],(((call_cl(_p,[_head])),(_l2 = [_head|_tail2],call(list3_filter(_tail,_p,_tail2),_upvals));call(list3_filter(_tail,_p,_l2),_upvals)))))). % size list3_size(_l,_n,_upvals):-_upvals=[],((((_l = []),(_n = 0.0);_l = [_|_tail],call(list3_size(_tail,_j),_upvals),calc(_j+1.0,T2),_n = T2))). % get list3_get(_l,_i,_e,_upvals):-_upvals=[],(_l = '[|]'(_x,_tail),((_i = 0.0,_e = _x);(dif(_i,0.0),{_i-1.0=T1},call(list3_get(_tail,T1,_e),_upvals)))). % main list3(X):-_get = clos([],list3_get),creq("string",_string),_size = clos([],list3_size),_filter = clos([],list3_filter),_removeAll = clos([],list3_removeAll),_remove2 = clos([],list3_remove2),_removeIndex = clos([_remove2],list3_removeIndex),_remove = clos([],list3_remove),_has2 = clos([],list3_has2),_has = clos([],list3_has),_concat = clos([],list3_concat),_push = clos([],list3_push),_pop = clos([],list3_pop),_find = clos([],list3_find),_findOnce = clos([],list3_findOnce),_last = clos([_get,_size],list3_last),_slice = clos([],list3_slice),_reverse = clos([_concat],list3_reverse),_eachIndex = clos([],list3_eachIndex),_each = clos([_eachIndex],list3_each),_fold = clos([],list3_fold),_join = clos([],list3_join),_join2 = clos([],list3_join2),_join3 = clos([_join2],list3_join3),_map = clos([],list3_map),_iterate = clos([],list3_iterate),_every = clos([],list3_every),_unique_ = clos([],list3_unique_),new(T16),set_(T16,"find",_find,T18),set_(T18,"findOnce",_findOnce,T19),set_(T19,"size",_size,T20),set_(T20,"length",_size,T21),set_(T21,"filter",_filter,T22),set_(T22,"removeIndex",_removeIndex,T23),set_(T23,"remove",_remove,T24),set_(T24,"push",_push,T25),set_(T25,"pop",_pop,T26),set_(T26,"has",_has,T27),set_(T27,"has2",_has2,T28),set_(T28,"at",_get,T29),set_(T29,"get",_get,T30),set_(T30,"concat",_concat,T31),set_(T31,"every",_every,T32),set_(T32,"forall",_every,T33),set_(T33,"map",_map,T34),set_(T34,"removeAll",_removeAll,T35),set_(T35,"join",_join3,T36),set_(T36,"fold",_fold,T37),set_(T37,"each",_each,T38),set_(T38,"eachIndex",_eachIndex,T39),set_(T39,"iterate",_iterate,T40),set_(T40,"reverse",_reverse,T41),set_(T41,"last",_last,T42),set_(T42,"unique",clos([_unique_],list3_2),T43),set_(T43,"first",clos([],list3_3),T44),set_(T44,"rest",clos([],list3_4),T45),set_(T45,"sub",clos([],list3_5),T17),_t = T17,X=_t.