0

I have been learning prolog and often come across prolog comments that contain descriptors of a predicates argument types, i.e.

%    (list,integer,list) (+,+,-)

or:

%    (element,list,integer,list) (?,?,+,?)

the 1st set of paranthesised descriptors is pretty self explanatory but the 2nd set I am not so sure about. Is there a good resource available describing this format? My googling skills have drawn a blank..

bph
  • 10,728
  • 15
  • 60
  • 135
  • 1
    Cool question. SWI has [this](http://www.swi-prolog.org/pldoc/man?section=preddesc) to say: "there is no complete agreement on mode indicators in the Prolog community", and specifies its own set. '?' means partial instantiation. Both descriptors fit that. The term types for you second descriptor use 'element', though. I always assumed those are the expected [term types](http://www.swi-prolog.org/pldoc/man?section=typetest), but I don't recall seeing 'element' anywhere – vmg Jul 24 '15 at 15:16
  • 1
    basically, `+`means `bound`, `-` means `free`, `?` means `don't care` – CapelliC Jul 24 '15 at 15:25
  • I lifted the examples from http://www.ic.unicamp.br/~meidanis/courses/problemas-prolog/ - element appears in P21 – bph Jul 24 '15 at 15:51
  • 1
    See also [this answer](http://stackoverflow.com/a/8294290/772868). – false Jul 24 '15 at 16:50
  • is the etiquette here to leave the duplicate question or delete it ? – bph Jul 27 '15 at 13:47

0 Answers0