-
Notifications
You must be signed in to change notification settings - Fork 139
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
Add checking mode examples for append #2773
base: master
Are you sure you want to change the base?
Conversation
My personal opinion: Illustrating list predicates is a good opportunity to show how conveniently strings can be written in Scryer Prolog. For example: ?- append("Scr", "yer", "Scryer"). true. |
This sounds good to me. Should I update the proposed PR to use your string example in both modes for |
Personally, I would favour such a change, yes. @aarroyoc I would also greatly appreciate your opinion on this. Thank you a lot! |
Regarding the wording of the documentation for https://www.complang.tuwien.ac.at/ulrich/iso-prolog/prologue#append Note how generally phrased the sufficient condition is: "... true if It doesn't say "concatenate the lists" (which would suggest only a single usage mode), but "true if ...". |
I agree with @triska that |
Co-authored-by: Markus Triska <[email protected]>
Looks excellent to me, thank you a lot! Please consider also the description of the predicate if you are interested! Ideally the description also conveys the generality. |
This looks good to me as is. I do agree with Markus' suggestion to add a wordful explanation of the possible usages of
|
offtopic: Name offtopic 2: also it can be used to create partial (or opened) lists: |
Regarding wording: I think the description in the Prologue is very close to ideal: " Personally, I see no need to bring in any imperatives or even any verbs into this. An imperative/procedural way to describe it, no matter how convoluted, is unlikely to cover all cases, and will always suggest particular directions of use. Please also see the various Examples in the document for inspiration about sensible examples: The queries using answer descriptions have a great advantage over informal descriptions in that they are automatically interpretable and testable, and they illustrate usage modes that are very hard to describe procedurally. Take for instance the last example: ?- append(Xs, Ys, [a,b|Xs]). Xs = [], Ys = "ab" ; Xs = "a", Ys = "ba" ; Xs = "ab", Ys = "ab" ; Xs = "aba", Ys = "ba" ; ... . The declarative description still fits perfectly: " In contrast, an understandable procedural description of what we see here seems almost impossible. |
P.S.: I agree the name is very bad, it's an imperative name that suggests a particular usage mode. In GUPU, the name for this relation is |
Personally, I think in an ideal set of examples, each of the examples tells us something interesting, something we do not yet know from the other examples. In this concrete case, is there true value in having two different examples for "checking", and two different examples for "appending"? I think the examples given in the Prologue are well worth studying. |
Hi, thanks for the commentary. I'll need about a week or two to find the time slot to work on this again. Till soon. |
This pull request adds a checking mode/direction example for
append
.