microsoft / Guan

Guan is a cross-platform, general-purpose logic programming library with a C# API for external predicate implementation. It is a close approximation of Prolog, with extended capabilities and some differences.
MIT License
72 stars 6 forks source link

Named parameters are not well described. #47

Closed pvillads closed 2 years ago

pvillads commented 2 years ago

The readme file mentions named parameters:

The arguments of a compound term are named (alphanumeric characters and underscore).

However, it does not talk about why you may want to use named parameters, and what their purpose is. There are no examples that I can find, and no tests that use them, so there is no guidance at all to help the user understand this feature.

Steps to Reproduce: Open t he readme file and read the section with the title provided above.

Expected Behavior: The text explains why named parameters are useful. The examples contain cases with named parameters The tests contain examples with named parameters.

OS:

Additional information:

xunlu commented 2 years ago

The most important reason is to support optional argument. Only when an argument is present on both sides, unification will be performed. This is a major difference with regular Prolog but convenient for the diagnostics use cases we are dealing with.

GitTorre commented 2 years ago

Note added to Readme. Thanks for the feedback!