Skip to main content

Questions tagged [logic-programming]

3 votes
0 answers
56 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 ...
kusakus's user avatar
  • 31
0 votes
0 answers
20 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 ...
Patrick Nicodemus's user avatar
1 vote
0 answers
75 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, ...
MWB's user avatar
  • 515
0 votes
0 answers
136 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 ...
Motorhead's user avatar
  • 291
0 votes
1 answer
87 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 ...
Gabriel F. Silva's user avatar
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, ...
swr52's user avatar
  • 119
0 votes
1 answer
130 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 ...
chansey's user avatar
  • 295
0 votes
0 answers
185 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). ...
hackermanwasd's user avatar
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....
MWB's user avatar
  • 515
3 votes
1 answer
269 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 ...
StackMachine's user avatar
2 votes
1 answer
173 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,...
MayaJ's user avatar
  • 31
2 votes
1 answer
103 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 ...
Raoul's user avatar
  • 205
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, ...
Saad Mohamed's user avatar
2 votes
1 answer
174 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 ...
Dennis's user avatar
  • 143
4 votes
0 answers
78 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 ...
Christopher King's user avatar

15 30 50 per page