core.logic

Docstrings for lvaro and nonlvaro need improvement.

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Patch:
    Code

Description

Assuming the following definitions:

1. A term is ground if it does not contain unassociated logic variables.
2. Otherwise, it is non-ground.

My suggestions:

lvaro: A non-relational goal that succeeds if the supplied logic variable is fresh.

nonlvaro: A non-relational goal that succeeds if the supplied logic variable is not fresh.

In the case nonlvaro, it's important to recognize that the implementation only tests whether the supplied lvar is not fresh, and "not fresh" != grounded; the result could be partially instantiated. For example, nonlvaro succeeds here when its argument is neither fresh nor grounded:

(run* [q]
  (fresh [x]
    (== q [x])
    (nonlvaro q)))
;; => ([_0])

Activity

Hide
Austin Haas added a comment -

I added those initial definitions when I thought "groundedness" was the operative word, so they aren't directly relevant.

Show
Austin Haas added a comment - I added those initial definitions when I thought "groundedness" was the operative word, so they aren't directly relevant.
Hide
David Nolen added a comment -

Thanks, I'll happily accept docstring patches.

Show
David Nolen added a comment - Thanks, I'll happily accept docstring patches.
Hide
Austin Haas added a comment -

This patch changes the docstrings for lvaro and nonlvaro to be more accurate. This is a fix for LOGIC-131.

Show
Austin Haas added a comment - This patch changes the docstrings for lvaro and nonlvaro to be more accurate. This is a fix for LOGIC-131.
Austin Haas made changes -
Field Original Value New Value
Attachment LOGIC-131-fix.diff [ 11986 ]
Austin Haas made changes -
Patch Code [ 10001 ]
David Nolen made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: