Replies: 4 comments 24 replies
-
In 13211-1:1995 the word answer is used three times. Once unrelated that a user has to answer (7.10.210 Note 1) and then twice to mean what we mean here. So
However, in logic programming the notion of answer substitution is very common. But answer substitutions represent one or more even infinitely many solutions (and in the case of an STO unification and also constraints they may also represent no solution), I'd say, that
describes one solution (even if the current standard would call this two solutions, but only indirectly because of the general introduction in 8.10 and similarly indirectly qua 7.7.3 note). In the codex there are 23 occurrences of solution. But its meaning is still flaky. I sometimes call in above query the second "solution" a redundant solution. I am a bit biased here from German where there is no satisfying translation of unique which smoothly works in French and English. But then I realized that unique solution really means solution. The uniqueness is only an artefact of the way Prolog executes a query. But it has nothing to do with the meaning as such. Looking a bit in the neighborhood of Prolog there is the notion of an answer set. From that viewpoint, Prolog produces one answer only. Even if we often do not want to look at the entire answer. So what do we call these above two answer substitutions? Not sure, but it seems this is the missing notion. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
7.12.1 states that the first argument is a term that supplies information |
Beta Was this translation helpful? Give feedback.
-
After another discussion with Markus: leaf answer |
Beta Was this translation helpful? Give feedback.
-
(Response to @triska's comment #2490 (comment))
Thank you a lot for expaining! I have some points I want to make though. First, which of those definitions are well established (like "goal", which is defined in the standard so there is no ambiguity there) and which are not consistently used? I think we should pick some terminology to be consistent even if it is not well established, but I feel knowing what those are so that we can point it out in documentation (maybe it means something else in other contexts) is very important.
This is very unfortunate, because this is precisely the distinction that we will need to make in the library interface. I feel that "answer" to mean one disjunct and "answer set"/"complete answer" to mean the whole disjunction would make the most sense to me, but as "answer" is already used to mean both, I think it's best if we used something like "answer line" for the disjunct and "complete answer" for the whole disjunction (please suggest better names if you can think of any!).
There is an ambiguity here. Is the "answer" here an answer line or a complete answer? I think a solution being a grounded answer line makes more sense. Is
X = 1; X = 2
a solution or a set of solutions?Well, that currently isn't actually the case in Scryer. If you throw an error, then the correspondent answer line is not a goal that throws an error. Is this intentional or should I file an issue?
Ok, but this assumes that residual goals are always constraints. I think they should be, but I can also see use cases for residual goals which aren't constraints. Funny one:
Wouldn't "conditional (complete answer|answer line)" be more appropriate? I don't think the resolution of the constraints needs to be grounded in this case, so it would be more consistent with the previous definition of "solution".
Beta Was this translation helpful? Give feedback.
All reactions