logic-programming Questions

1

Solved

I started to learn Prolog and I just read that the atom at the beginning of an structure is usually called functor. I'm also familiar with the term functor from Category Theory and Functional Progr...

1

Solved

Recently I am learning SMT solver. Although SMT solver is a new concept to me, it reminds me of logic programming, e.g. Prolog and minikanren. So I tried a classic example of logic programming in S...
Garland asked 20/7, 2021 at 6:58

6

Is there any newer language than Prolog specialized for logical programming?
Arbor asked 16/1, 2011 at 16:7

2

Solved

I am currently learning miniKanren by The Reasoned Schemer and Racket. I have three versions of minikanren implementation: The Reasoned Schemer, First Edition (MIT Press, 2005). I called it TRS1 h...

5

Solved

I need to find all triples of 16-bit numbers (x, y, z) (well, actually only bits which perfectly match up in different triples with bits on same positions), such that y | x = 0x49ab (y >> 2) ...
Cranial asked 6/2, 2021 at 16:39

4

Solved

I'm trying to understand the relation between a logic programming language(Prolog in my case) and Haskell's type system. I know both use unification and variables to find values(or types, in Haske...
Daudet asked 16/12, 2012 at 8:1

3

Solved

As far as I can tell, with sound unification, SLD resolution should not create cyclic data structures (Is this correct?) If so, one could, in theory, implement Prolog in such a way that it wouldn't...

3

Solved

The Wikipedia article for Prolog states: Higher-order programming style in Prolog was pioneered in HiLog and λProlog. The motivation for HiLog includes its ability to implement higher-order...
Taproom asked 14/11, 2020 at 3:47

5

Solved

I currently have the need to execute prolog code in an application I am making. I am aware that Apple probably never would allow something like this in the App Store, but that is not the intention ...
Liverish asked 11/10, 2010 at 10:55

8

Solved

By Logic Programming I mean the a sub-paradigm of declarative programming languages. Don't confuse this question with "What problems can you solve with if-then-else?" A language like Prolog is ver...

10

Solved

I'm a longtime python developer and recently have been introduced to Prolog. I love the concept of using relationship rules for certain kinds of tasks, and would like to add this to my repertoire. ...
Galina asked 16/12, 2009 at 20:50

0

There is a video where minikanren is used to go from data to programs. That is, given data, it generates the program that generates the data. So is it possible to generate a universal function su...

1

Considering https://speakerdeck.com/folone/theres-a-prolog-in-your-scala, I would like to "abuse" the Scala type system to find all instances of e.g. CanBuildFrom that match a given criteria. Prolo...

11

Solved

I read somewhere that Pattern Matching like that supported by the match/case feature in Scala was actually borrowed from Logic languages like Prolog. Can you use Scala to elegantly solve problems l...

1

This is the question find value A. inverse([],[]). inverse([H|T],D) :- inverse(T,Z), append(Z,[H],D). append([],X,X). append([X|L],M,[X|N]) :- append(L,M,N). This is the answer: ...
Syst asked 17/12, 2018 at 14:50

3

Is there a way to do logic programming (think of Prolog) in Lua? In particular: is there any Lua module for logic programming (miniKanren implemenatation will be the best, but it isn't strictly re...
Curtal asked 18/2, 2012 at 8:34

1

Solved

Some of core.logic constructs (matcha, matche, matchu, defne, fne) use pattern matching expressions as body and can be used such as: (run* [q] (fresh [a o] (== a [1 2 3 4 5]) (matche [a] ([ [1...
Hercegovina asked 24/10, 2014 at 13:14

2

Solved

Does MiniKanren have the "not" operator? For example, how would one represent Prolog's a :- b, not(c) a is true if b is true and c is not (Prolog uses negation as failure, i.e. not(c) is consid...

1

Solved

What is the difference between logic programming and automated theorem proving (ATP) (e.g. with E-Prover, Spass or Princess)? I searched a lot and the only information I found is that ATP is the p...
Nelle asked 31/3, 2016 at 14:0

4

I'm reading this tutorial on context free grammars in Prolog, and they mention at the bottom of the page implementing a context free grammar in Prolog using difference lists, with the following cod...
Nila asked 12/5, 2015 at 22:29

2

Solved

A typical code example of list processing in Prolog is append: append([], Ys, Ys). append([X | Xs], Ys, [X | Zs]) :- append(Xs, Ys, Zs). My question is whether this program is tail recursive or ...
Rolandorolandson asked 5/7, 2013 at 13:2

3

Solved

Exercise 1.3 of the book Structure and Interpretation of Computer Programs asks the following: Define a procedure that takes three numbers as arguments and returns the sum of the squares of the ...
Amphi asked 13/4, 2015 at 19:46

2

Solved

When I want to read up on logic programming I always stumble over two "main" ways to do it nowadays: miniKanren, a minilanguage introduced in The Reasoned Schemer and popular at the moment ...
Stalagmite asked 12/2, 2015 at 0:4

2

Solved

I know that var/1, nonvar/1 and !/0 are impure primitives, but does their use make every program that uses them impure? I wrote the following predicate plus/3 that behaves as if it were pure or at...
Olav asked 12/1, 2015 at 17:26

2

Solved

I read the question asked in Herbrand universe, Herbrand Base and Herbrand Model of binary tree (prolog) and the answers given, but I have a slightly different question more like a confirmation and...
Clostridium asked 27/1, 2014 at 15:19

© 2022 - 2025 — McMap. All rights reserved.