Jump to content
Wikipedia The Free Encyclopedia

Talk:Prolog

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
Latest comment: 6 months ago by ~2026-87998-9 in topic Prolog said to be homoiconic
This is the talk page for discussing improvements to the Prolog article.
This is not a forum for general discussion of the subject of the article.
Find sources:Google (books · news · scholar · free images · WPrefs) · FENS · JSTOR · TWL
Archives (index): 1 Auto-archiving period: 31 days
Former good article nominee Prolog was a good articles nominee, but did not meet the good article criteria at the time. There may be suggestions below for improving the article. Once these issues have been addressed, the article can be renominated. Editors may also seek a reassessment of the decision if they believe there was a mistake.
Article milestones
DateProcessResult
October 17, 2006 Good article nominee Not listed
This article is rated B-class on Wikipedia's content assessment scale.
It is of interest to the following WikiProjects:
WikiProject icon Computer science Mid‐importance
WikiProject icon This article is within the scope of WikiProject Computer science , a collaborative effort to improve the coverage of Computer science related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.Computer scienceWikipedia:WikiProject Computer scienceTemplate:WikiProject Computer scienceComputer science
Mid This article has been rated as Mid-importance on the project's importance scale.
Things you can help WikiProject Computer science with:
WikiProject icon Philosophy : Logic Low‐importance
WikiProject icon This article is within the scope of WikiProject Philosophy , a collaborative effort to improve the coverage of content related to philosophy on Wikipedia. If you would like to support the project, please visit the project page, where you can get more details on how you can help, and where you can join the general discussion about philosophy content on Wikipedia.PhilosophyWikipedia:WikiProject PhilosophyTemplate:WikiProject PhilosophyPhilosophy
Low This article has been rated as Low-importance on the project's importance scale.
Associated task forces:
/
Taskforce icon
Logic
SICStus Prolog was merged into this article. The discussion was closed on 13 January 2018 with a consensus to merge. The original page is now a redirect to this article. Its history now serves to provide attribution for the content in this article, and it must not be deleted as long as this article exists.

icon To-dolistfor Prolog:edit ·history ·watch ·refresh ·Updated 2016年12月31日


Here are some tasks awaiting attention:
Index
This page has archives.Topics inactive for 31 days are automatically archived 1 or more at a time by Lowercase sigmabot III if there are more than 4.

Negation and soundness: needs reference and explanations

[edit ]
Latest comment: 11 months ago 4 comments1 person in discussion

The part https://en.wikipedia.org/wiki/Prolog#Negation, about negation and soundness, is so much important it deserves an authoritative reference, even if it may be obvious for many ones involved in this area. Also, it may require some explanations, to be understood. First and the least, about the variables, it is said it is sound if the term is ground: what if all variables are bound to ground terms? Shouldn't it mention free variables (and variable bounded to term containing free variables, transitively), instead? Then, the assertion that it is not correct/is unsound, to use `legal` to list all `legal` terms, needs explanations. I try to guess below, please tell me if it’s indeed the point.

A logic which is expressive enough, is either sound and incomplete, either complete and unsound. I feel to know the logic underlying Prolog, is sound, so may be it's incomplete, although I also feel to know an Horn clauses system is sound and complete (so not that much expressive), but may be there are additional things in Prolog, which makes it sound and incomplete. So let's assume Prolog is incomplete, hence the response we get from a query on a rule is incomplete however sound. If `illegal(X)` is incomplete, an issue arise: it may not well fail to find a solution to `illegal(X)`, making the rule fail, and then making `legal(X)` succeed. Intuitively, if `illegal` is incomplete, the simple negation of its conclusion, has no warranted soundness. In the mean time, there are cases where a simple rule seems to be complete, hence it's negation sound. Ex. a rule saying X is valid/invalid if it's a given constant and says nothing else, just as simple as that. In this case, it's hard to see a case where the rule and its negation do not form a sound system (an easy and naive assertion, I feel, so it may be wrong).

In fewer words: is the negation of `illegal`, unsound, because `illegal` is not complete? And do someone know an authoritative reference for the assertion in the related paragraph? Hibou57 (talk) 18:44, 31 August 2025 (UTC) Reply

(Reply to myself)
Another guess, just with a doubt. The said paragraph mentions `legal(X)` cannot be used to list all X which are `legal` (it may list some if `legal` has some other bodies). That's true, at least with Prolog, but to me, this does not qualify as unsoundness, rather as incompleteness. This may be seen as inconsistent if one read it as meaning it can list these solutions, while it can't ; still not unsound. Hibou57 (talk) 10:26, 1 September 2025 (UTC) Reply
Perhaps this is the answer: the first though says if the logic is incomplete, this definition of the negation leads to unsoundness, the second though says if the logic is complete, this definition of the negation leads to incompleteness, putting both together there is the path completeness -> incompleteness -> unsoundness. Is that it? Hibou57 (talk) 18:25, 2 September 2025 (UTC) Reply
This seems to be that, because it means unsoundness comes if a negation is used in a negation (which may be in an inner goal), and that's the conclusion given here: https://en.wikipedia.org/wiki/Talk:Prolog/Archive_1#Argument_is_ground%3F Hibou57 (talk) 18:52, 2 September 2025 (UTC) Reply

Prolog said to be homoiconic

[edit ]
Latest comment: 6 months ago 2 comments2 people in discussion

Unless I'm wrong, I feel dubious facing the sentence saying Prolog is homoiconic. A language is homoiconic if data and program have the same form and can be manipulated the same way. In which way something like `r(X) :- s(X)` can be manipulated with Prolog? This does not have the syntax of a term. A language like the pure untyped lambda calculus is surely homoiconic, but Prolog is not an example of such a language. Being able to program a Prolog interpreter in Prolog is not sufficient to qualify it as homoiconic, or else, if it suffices, so Ada is, since there is an Ada compiler written in Ada, C is, with most C compilers written in C, and so on. Hibou57 (talk) 10:43, 1 September 2025 (UTC) Reply

The Prolog clause r(X) :- s(X) can be naturally represented as a Prolog term with principal functor :- and two arguments, i.e., as the Prolog term :-(r(X),s(X)).
We can use the standard predicate clause/2 to inspect (public) clauses, for example: ?- clause(r(X), Body)., yielding: Body = s(X). ~2026-87998-9 (talk) 17:56, 8 February 2026 (UTC) Reply

AltStyle によって変換されたページ (->オリジナル) /