Questions tagged [logic-programming]
The logic-programming tag has no summary.
32 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
3
votes
0
answers
41
views
(Prolog) Warren's Abstract Machine, Argument Registers
I am currently reading "Warren's Abstract Machine: A Tutorial Reconstruction" and I'm trying to follow along with the exercise as well as code my own implementation. I am trying to ...
0
votes
0
answers
8
views
Is there an generalization of Knuth-Bendix completion to reflexive, transitive relations?
I am interested in the question of deriving decision procedures for formal theories which deal with a set $X$ equipped with a distinguished binary relation $\leq$ that is reflexive and transitive, as ...
1
vote
0
answers
59
views
How could higher-order Datalog be more expressive than first-order Datalog?
According to this paper [1], higher-order Datalog is more expressive:
... we demonstrate that on ordered databases, for all k ≥ 2,
...
0
votes
0
answers
126
views
Constrained Horn Clauses vs. "ordinary" Horn Clauses
I see why ordinary Horn clauses (of the type Prolog might accept) are first order eg something like (with all variables universally quantified)
$$
P(x) \leftarrow Q_1(x),Q_2(x,y).\\
P(x) \leftarrow ...
0
votes
1
answer
73
views
Logic Programming - A definite program for the theory of groups
I am studying theoretical computer science using Ayala's book "Fundamentos da Programação Lógica e Funcional" (the book is written in Portuguese), but the part I am studying right now is ...
10
votes
4
answers
4k
views
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, ...
0
votes
1
answer
108
views
Is it possible to encode contradictory horn clauses without goal clauses?
Intuitively, this seems impossible (because negation is forbidden in the head), but i am not sure.
A naive (and wrong) example is
p :- p
But, this just means
...
0
votes
0
answers
168
views
Sum of numbers divisible by 3 in Prolog
Give two Prolog implementations to calculate the sum of first N numbers divisible by 3. For example: N=4 -> 30 (3+6+9+12).
...
20
votes
2
answers
7k
views
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....
2
votes
1
answer
240
views
How does Warrens Abstract Machine work?
I've recently learned about Prolog and Logic programming which I find pretty cool, but the compiler is currently like magic to me and I want to know how they work.
After a little bit of research I ...
2
votes
1
answer
161
views
What is Herbrand interpreration and model?
I was reading the book "Foundations of Logic Programming" written by J.W. Lloyd. In the book, there were definitions of interpretation and model, and when it comes to herbrand interpretation and model,...
2
votes
1
answer
79
views
What algorithms for unification over (multidimensional) array terms?
I am looking for references on implementing unification over multidimensional array terms.
Are there specialized unification algorithms for those cases? I wasn't able to find satisfactory literature ...
1
vote
1
answer
12k
views
What is the sequence of numbers for N = 6? [closed]
The numbers in the table below are the result of executing an algorithm that has one parameter N, a non-negative integer, and produces sequences of integers as outputs. For values of N from 0 to 5, ...
2
votes
1
answer
156
views
Is Unification "an Implementation of Existential Quantification"?
I read a comment (I've forgotten the source), "Unification is an implementation of existential quantification." (Emphasis mine.)
If true, this point of view clears up many things.
For instance why ...
4
votes
0
answers
66
views
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 ...