Questions tagged [logic-programming]
31 questions
29
votes
2 answers
How to implement a Prolog interpreter in a purely functional language?
Is there a clear reference, with pseudo-code, on how to go about implementing a Prolog interpreter in a purely functional language? That which I have found so far seems to deal only with imperative languages, is merely a demonstration of Prolog…
Jimster
- 393
- 1
- 3
- 4
23
votes
2 answers
What makes PROLOG Turing-complete?
I know that it can be proven PROLOG is Turing-complete by constructing a program that simulates a Turing machine like this:
turing(Tape0, Tape) :-
perform(q0, [], Ls, Tape0, Rs),
reverse(Ls, Ls1),
append(Ls1, Rs, Tape).
perform(qf, Ls,…
Lenar Hoyt
- 333
- 2
- 7
20
votes
2 answers
Paradox? Pure Prolog is Turing-complete and yet incapable of expressing list intersection?
Pure Prolog (Prolog limited to Horn clauses only) is Turing-complete. In fact, a single Horn clause is enough for Turing-completeness.
However, pure Prolog is incapable of expressing list intersection. (Disequality, dif/2, would allow it to do it,…
MWB
- 515
- 3
- 11
17
votes
4 answers
Can constraint satisfaction problems be solved with Prolog?
Is "party attendance" type of problems solvable in Prolog? For example:
Burdock Muldoon and Carlotta Pinkstone both said they would come if Albus Dumbledore came. Albus Dumbledore and Daisy Dodderidge both said they would come if Carlotta Pinkstone…
Tegiri Nenashi
- 475
- 4
- 7
10
votes
4 answers
What are some interesting/important Programming Language Concepts I could teach myself in the coming semester?
I’m a CS senior with and Individual Study period this coming semester, and I’ve decided I’d like to learn more about Programming Language Concepts. More specifically, different programming paradigms, like Functional and Logic programming.
Not sure…
swr52
- 119
- 1
- 6
9
votes
2 answers
What is the state of the art in encapsulated search in functional logic programming?
I am particularly interested in solutions to the problem that encapsulated search can depend on the order of evaluation.
According to [1], encapsulated search in PAKCS depends on the order of evaluation, while in MCC, it does not, but using it…
Robin Green
- 703
- 2
- 7
- 11
9
votes
1 answer
Term Rewriting vs Unification
How is term rewriting different from unification, and what's the difference between term rewriting languages and logic programming, like Prolog?
MWB
- 515
- 3
- 11
6
votes
2 answers
Proper terminology in Prolog/logical programming theory?
I have a good understanding of how to program using logic languages, but I'm currently writing up a paper describing some of my work, and I wanted to ensure that I wasn't abusing the proper terminology when describing logic languages. I have a few…
Joey Eremondi
- 30,277
- 5
- 67
- 122
4
votes
1 answer
What is the difference between control flow and control logic?
I'm trying to learn about declarative programming, and while reading the wiki it said the following:
In computer science, declarative programming is a programming paradigm—a style of building the structure and elements of computer programs—that…
Sam
- 143
- 4
4
votes
0 answers
"Programing in goals" as an alternative to defining APIs (from B. Victor's talk The Future of Programming )
In his talk The Future of Programming, in the third section of the talk about "programming using goals", Bret Victor says this:
https://vimeo.com/71278954 [15:20]
What won't work, what would be a total disaster, is---I'm gonna make up a term…
user7610
- 143
- 7
4
votes
1 answer
Abduction in ASP
Well, forgive my ignorance about the matter as I have been playing with ASP for the last couple of days.
Consider this simple example
p.
s :- p.
And the corresponding output generated after running the program in clingo:
$ ./clingo.exe ex.lp…
astazed
- 151
- 3
4
votes
0 answers
How does negation as failure work with variables?
Let's say we have the following rule:
p -: X ≠ Y, X = Y
Stating that $\forall x.y. x \neq y \land x = y \implies p$. Now let us suppose that we are searching for a proof of $p$. Such a proof does not exist, of course, but we will search for it.
Our…
Christopher King
- 788
- 1
- 5
- 19
3
votes
0 answers
Expressing definite clauses (Horn rules, logic programming) in lambda terms?
There is paper which expresses lambda terms in the terms of logic programming http://www.cse.unt.edu/~tarau/teaching/PL/docs/dbx.pdf Is there conversion in the other direction - expressing definite clauses / Horn rules / logic programming sentences…
TomR
- 1,411
- 8
- 17
3
votes
1 answer
Generalization of Horn clauses in logic programming?
As far as I understand, Prolog and related languages are restricted to inference rules of the form
$$ p_1 \land \dots \land p_n \rightarrow q$$
which is equivalent to the Horn clause
$$ \neg p_1 \lor \dots \lor \neg p_n \lor q$$
I'm wondering if…
Roland
- 153
- 4
3
votes
0 answers
Open Standard Prolog Knowledge Bases
Are there any standard Prolog knowledge bases available anywhere that have the same purpose as Cyc, namely to encode generally accepted common sense and human knowledge?
Typically containing generally accepted facts such as the ones given…
Nordlöw
- 131
- 5