Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.58 KB | None | 0 0
  1. iintersecta([], _, _) :- !, fail.
  2. iintersecta(AS, BS, Inter) :- append(AS, _, BS), length(AS, L), L >= 4, Inter = BS. % string_concat
  3. iintersecta([A|AS], BS, Inter) :- iintersecta(AS, BS, IInter), Inter = [A|IInter].
  4.  
  5. intersecta(AS, BS, Inter) :- iintersecta(AS, BS, Inter), !.
  6. intersecta(AS, BS, Inter) :- iintersecta(BS, AS, Inter), !.
  7.  
  8. string_iintersecta([], _, _) :- !, fail.
  9. string_iintersecta(AS, BS, Inter) :- string_concat(AS, _, BS), string_length(AS, L), L >= 4, Inter = BS. % string_concat
  10. string_iintersecta([A|AS], BS, Inter) :- iintersecta(AS, BS, IInter), Inter = [A|IInter].
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement