I need to do an exercise where I must eliminate the elements of a list that are NOT duplicated, previously I made one to eliminate the elements of a l ...
I need to do an exercise where I must eliminate the elements of a list that are NOT duplicated, previously I made one to eliminate the elements of a l ...
Got this strange behaviour. I was running these test cases: Now I get these results, where the outcome of s2 is wrong. The outcome is wrong in two ...
There is this paper: William E. Byrd, Eric Holk, Daniel P. Friedman, 2012 miniKanren, Live and Untagged Quine Generation via Relational Interprete ...
This less-than predicate in Peano arithmetic loops when Is there a better way to write less/2 (using Horn clauses only)? ...
Assume we are only looking at lists of Peano numbers. And lets assume pure_2 Prolog is not pure_1 Prolog with dif/2, but rather with pure_1 Prolog wit ...
Lets assume there is pure_2 Prolog with dif/2 and pure_1 Prolog without dif/2. Can we realize Peano apartness for values, i.e. Peano numbers, without ...
I wonder whether there is a pure Prolog meta-interpreter with only one rule. The usual Prolog vanilla meta-interpreter has two rules. It reads as foll ...
@false commented earlier: Yes, you can implement a Turing machine without dif/2. But you cannot even implement intersection or similar predicates. ...
The tag logical purity mentions (=)/2 as pure. Is it "intrinsically" pure or "operational" pure? To the best of my knowledge it can be defined by this ...
A paper about mercury says the following: The if-then-else and negation constructs in most variants of Prolog are non-logical and unsound: they ca ...
The Wikipedia section on this topic is a mess. It states: Pure Prolog is based on a subset of first-order predicate logic, Horn clauses, which is ...
(Upon the suggestion of @repeat) Consider a query of a pure program1 ?- G_0. What use if any would the query ?- G_0, G_0. have? Footnotes 1 No tablin ...
I'm writing a tokeniser and I want to use if_/3 to preserve logical-purity in my code. The code looks like the following code1 on the left—but I want ...
I have been learning Prolog in my spare time for about 8 months to a year and now I am moving on to tackle implementing some of the classic data struc ...
As noted in another StackOverflow answer that I can't seem to find anymore, this pattern emerges frequently in practical Prolog code: and many peop ...
Say I want to assert that three lists are of the same length. I could do something like this: This does the right thing when either First or Second ...
I've read quite a bit about Prolog's Negation by Failure where Prolog in order to prove that \+Goal holds tries to prove that Goal fails. This is hig ...
How would one implement a not_all_equal/1 predicate, which succeeds if the given list contains at least 2 different elements and fails otherwise? Her ...
This is my code so far. How could I optimize it so that it prints the prefix, e.g.: should return "inte" A bit rusty with Prolog, haven't done i ...
I have following clauses: When I typed the query: It only returns: which is what I want. But when I typed this query: it only returns: ...