seqint(b(value(Seq),seq(_),_),Seq) :-
is_list(Seq).
seqint(b(value(avl_set(Seq)),seq(_),_),Value) :-
avl_to_list(Seq,List) ,
findall(Key,member(Key-true,List),Value).
seqint(b(sequence_extension([Seq]),seq(seq(_)),_),[Value]) :-
seqint(Seq,Value).
seqint(b(sequence_extension(Set),seq(_),_),Value) :-
maplist(ast_to_prob_value,Set,Value).
seqint(b(general_concat(SeqOfSeq),seq(_),_),Value) :-
seqint(SeqOfSeq,Temp) ,
flatten(Temp,Value).
seqint(b(front(Seq),seq(_),_),Value) :-
seqint(Seq,Temp) ,
remove_last(Temp,Value).
seqint(b(tail(Seq),seq(_),_),Value) :-
seqint(Seq,[_|Value]).
seqint(b(rev(Seq),seq(_),_),Value) :-
seqint(Seq,Temp) ,
reverse(Temp,Value).
seqint(b(restrict_front(Seq,RestrictBy),seq(_),_),Value) :-
seqint(Seq,Temp) ,
int(RestrictBy,RestrictValue) ,
get_first_n(Temp,RestrictValue,Value).
seqint(b(restrict_tail(Seq,RestrictBy),seq(_),_),Value) :-
seqint(Seq,Temp) ,
int(RestrictBy,RestrictValue) ,
rem_first_n(Temp,RestrictValue,Value).
seqint(b(concat(Seq1,Seq2),seq(_),_),Value) :-
seqint(Seq1,ValueSeq1) ,
seqint(Seq2,ValueSeq2) ,
append(ValueSeq1,ValueSeq2,Value).
seqint(b(insert_tail(Val,Seq),seq(_),_),Value) :-
sint(Val,Insert) ,
seqint(Seq,ValueSeq) ,
( Insert = true -> NInsert = [pred_true]
; Insert = false -> NInsert = [pred_false]
; NInsert = [Insert]) ,
append(NInsert,ValueSeq,Value).
seqint(b(insert_front(Seq,Val),seq(_),_),Value) :-
sint(Val,Insert) ,
seqint(Seq,ValueSeq) ,
( Insert = true -> NInsert = [pred_true]
; Insert = false -> NInsert = [pred_false]
; NInsert = [Insert]) ,
append(ValueSeq,NInsert,Value).