-
Notifications
You must be signed in to change notification settings - Fork 154
Document some predicates in reif #2981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Operationalizing language.
Please suggest edits as necessary. I don't have the conceptual precision to do better than this. |
Not sure what you mean by "Operationalizing language" or which language you're talking about. Please explain further if not addressed by latest commit. |
It should have much more substance and be more correct and precise – like when you write a specification – choice of words matters. For example: % Reified equality predicate. Duh, one way it could'be been even worse is Do you see my point? With that sentence you haven't explain anything you just added to the total word count. P.S. I actually don't know how to write really good documentation, also maybe %% if_(A = B, Then_0, Else_0).
% ...
%% if_(dif(A,B), Then_0, Else_0).
% ... |
I must have done a poor job. I thought “reified” here suggests that The weird conceptual leap reif needs is that e.g. It’s not clear how better to word that but I can give it another crack tomorrow. |
I'm not really a maintainer here, I have only 1 or 2 commits merged to master, please look for someone's else approval :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reject - as before.
See also previous attempt at this: #2407. |
@bakaq Thanks for the context!
I think most people understand the more ubiquitous Unfortunately, the term "reify" seems very operational to start with. What language could I use to not "operationalize" this? Would you like to suggest a description of |
I think the documentation, whether it is Operationalizy or not, is fine the way it is and a large improvement over no documentation. I would request the PR be merged in as it is, until someone wants to improve it even more. Another improvement would be to have an example or two for each predicate. |
The author of the library already requested to point to the paper first and foremost, and to leave the documentation alone. He also said that everyone interested in explaining these features should start with a separate tutorial. Please respect these requests. |
The goal here is as a welcome mat to explain to interested user what the library is for and why to use it. As it is, the would-be user sees this skeleton of a page: https://www.scryer.pl/reif Module reif - Scryer Prolog documentation.pdf Using a file name like " Deliberately omitting documentation is user-hostile. Plus this library diverges from the predicates mentioned in the paper, so it's clear that the linked paper is at least outdated wrt this code. |
Can you please link to where the author has requested that, if they have done so in public? |
@dougransom I think the original author is Ulrich Neumerkel (UWN). He hasn't committed code to this repo, but he did contribute the same, undocumented library to SWI. https://www.swi-prolog.org/pack/file_details/reif/prolog/reif.pl |
Please see the previous attempts, which are now already repeatedly linked to in this discussion: #2407 |
I saw the previous attempts and made a good-faith attempt to document.
You can point to that, but I'm not sure what I'm supposed to take away from that discussion besides that (1) this module is confusing, not just to me (2) the documentation should not use "operationalizing language", whatever that means. I described how the pieces fit together (e.g. that Per Coding Guidelines for Prolog:
@triska, I think you have the best conceptual handle on this API and simultaneously being willing to constructively contribute. PLEASE jump in if you have better wordings for anything. |
@rotu I think the way to make Prolog, and Scryer prolog, more approachable, is to create a cookbook of examples and stick it in the scryer learn folder. The reif predicates are highly useful, and the author knows how they would like to see the predicates documented in the module documentation. A few samples of each predicate would go a long way for use to understand how we can use these predicates to our advantage. %memberd_t examples
%test for membership of a particular value
?- memberd_t('a',"abcabc",true).
true.
%test for exclusion pf a particular value
?- memberd_t('a',"abcabc",false).
false.
%more general use, relating a particular value A to a list, B being true if A is in the list, and false if A is not in the list.
?- memberd_t(A,[Y,X],B).
A = Y, B = true
; A = X, B = true, dif:dif(Y,A)
; B = false, dif:dif(Y,A), dif:dif(X,A).
%A is a member of L1, or a member of L2, but not both:
?- memberd_t(A,L1,B), memberd_t(A,L2,C), dif(C,B).
L1 = [], B = false, L2 = [A|_A], C = true
; L1 = [], B = false, L2 = [_A,A|_B], C = true, dif:dif(_A,A)
; L1 = [], B = false, L2 = [_A,_B,A|_C], C = true, dif:dif(_A,A), dif:dif(_B,A)
; ... .
?- two or three examples like that in the cookbook for each predicate in reif would give a pretty clear idea on how to use these predicates. Would a PR for such a cookbook or tutorial likely be accepted? |
@dougransom I think that sort of documentation is great. I don't know if such a PR would be accepted, especially how much of an uphill battle I've gotten with this and other attempted documentation contributions. |
Well, I submitted a few examples, #3100. Let's see. |
Reif currently lacks per-predicate documentation, only linking to external paper "Indexing dif/2".
Added some contextual docs to explain the
if_/3
,=/3
,dif/3
predicates.