I have the following fact in my knowledge base: distance(c2, c5, 20, 1). But when I try to query distance(c2, c5, X-0, 1), (or any other number inste ...
I have the following fact in my knowledge base: distance(c2, c5, 20, 1). But when I try to query distance(c2, c5, X-0, 1), (or any other number inste ...
I am using Racket v8.5, with the packages for minikanren and minikanren/numbers required. Why does introducing the numbero constraint cause previously ...
. Answers to this question are eligible for a +500 reputation bounty. C ...
In prolog, the difference between A = B and A == B is that = tries to unify A with B, while == will only succeed if A and B are already unified. memb ...
I have this Prolog code: This query: returns X = c If I have this program, which is a little bit different: On the same query why does it ...
I am using swi-prolog to produce some examples for students in the context of a Prolog course. Regarding unification I want to draw their attention to ...
I have a purely functional transducer implementation in Javascript that supports loop-fusion and short circuiting. Please note that although I am usin ...
I've been working on a type validator for Javascript to enable gradual typing for a language that was originally designed for dynamic types. Type val ...
I'm learning numpy and pandas, so please forgive me if I'm not using the right terminology or I ask something silly. I've spent quite some time search ...
Here is the canonical example for a rigid type variable escaping its scope: I tried to reproduce the error by doing the unification/subsumption man ...
Datalog is easily identified with a subset of Prolog that doesn't use function symbols, but only constants and variables. But pure Datalog that doesn' ...
Inspired by this question, I am trying to harden error handling of reverse/2. So I tried this implementation: Everything works fine, until I try re ...
I tried this vanilla interpreter: Can we use it to meta-interpret some code? I tried this code, requires SWI-Prolog 8.3.19, which runs fine normall ...
A function type is higher-rank if a quantifier appears in contravariant position: f :: (forall a. [a] -> b) -> Bool Regarding the unification o ...
Originally I assumed the scope of a nested universal quantifier on the LHS of a function type can be determined purely syntactical, i.e. everything in ...
The new release 8.3.19 of SWI-Prolog introduces single sided unification inside new Picat style rules. This could be a welcome addition to any Prolog ...
I'm able to unify the following terms: But I'm stuck applying the correct rules for the following unification, because foo expects a ternary functi ...
AFAIK, unification used in the Hindley-Milner type system can be generalized to unify higher-kinded types by allowing type vars in constructor positio ...
Have a quick question regarding m.g.u (most general unifier) in prolog. We are asked what the m.g.u is of: With 2 possible answers I argued tha ...
Edit: This question assumes you enabled the occurs check. It's not about setting Prolog flags. There was a bunch of papers 30 years ago about optimiz ...