0

I have two lists

[a,b,c,d]
[c,d]

How would I implement a predicate what would return the list below

[a,b]

in Prolog.

Newbie to prolog. Finding it hard wrapping my head around recursion.

Paulo Moura
  • 18,373
  • 3
  • 23
  • 33
Krishna Kalyan
  • 1,672
  • 2
  • 20
  • 43
  • Some prologs have a readily available predicate `subtract`/3. I think it's highly unlikely this has not been asked before, too – vmg Nov 08 '15 at 04:06
  • @vmg: `subtract/3` is probably not what OP asks for: `[a,b,c,d]` and `[c,d,e]` should probably give `[a,b,e]` and not `[a,b]`. – false Nov 08 '15 at 11:29

0 Answers0