Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- head_tail(Str, Head, Tail) :-
- sub_string(Str, 0, 1, _, Head),
- string_concat(Head, Tail, Str).
- iintersecta("", _, _) :-
- !, fail.
- iintersecta(AS, BS, Inter) :-
- string_concat(AS, _, BS),
- string_length(AS, L), L >= 4,
- Inter = BS.
- iintersecta(AAS, BS, Inter) :-
- head_tail(AAS, A, AS),
- iintersecta(AS, BS, IInter),
- string_concat(A, IInter, Inter). % head_tail(Inter, A, IInter)
- intersecta(AS, BS, Inter) :-
- iintersecta(AS, BS, Inter), !.
- intersecta(AS, BS, Inter) :-
- iintersecta(BS, AS, Inter), !.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement