pldoc: how to specify predicates with arguments unbound.
Kuniaki Mukai <[email protected]> Tue, 16 Sep 2014 14:57:51 +0900
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
Hi, Using pldoc, how do we specify a predicate such as follows: foo(X, Y) :- (random(3) =:= 2, X==Y; true). foo is designed so that it returns information on the current state on unification (constraint) X==Y or X\==Y. So X, and Y are always unbound (var(X), var(Y) are always true). I often wrote such predicates. Reading pldoc document, the following seems only possible form for foo/2. % foo(-X, -Y) is det. Is it right ? Or, is there any other neat form of specification to tell such intention of programmer of foo above. Kuniaki Mukai -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 496 bytes Desc: Message signed with OpenPGP using GPGMail URL: <https://lists.iai.uni-bonn.de/pipermail/swi-prolog/attachments/20140916/0ddd7d53/signature.asc>