Questions tagged [reasoned-schemer]

The Reasoned Schemer is a book on logic programming written by Daniel P. Friedman, William E. Byrd, and Oleg Kiselyov.

10 questions
32
votes
4 answers

conda, condi, conde, condu

I'm reading the Reasoned Schemer. I have some intuition about how conde works. However, I can't find a formal definition of what conde/conda/condu/condi do. I'm aware of https://www.cs.indiana.edu/~webyrd/ but that seems to have examples rather than…
user1383359
  • 2,583
  • 2
  • 22
  • 30
7
votes
4 answers

MiniKanren support by Dr Racket

I started studying miniKanren with the book "The Reasoned Schemer - second edition" and the DrRacket scheme environment. I installed the "faster-minikanren" package, but the first examples of the book with the command run* (for example, (run* q #f))…
Schemer
  • 107
  • 6
5
votes
2 answers

The Reasoned Schemer : Not understanding Exercise 57

On Exercise (or entry?) 57, I'm just not understanding how the logic flows. The question is that this: given (define teacupo (lambda (x) (conde ((= tea x ) #s) ((= cup x ) #s) (else #u)))) where '=' is actually the…
mpettis
  • 2,468
  • 4
  • 19
  • 29
5
votes
1 answer

Clojure.logic difference with The Reasoned Schemer

I've been working through The Reasoned Schemer (TRS) using Clojure.logic and paying attention to the differences documented here. I reached frame 24 of Chapter 3, where TRS reports that (run 5 [x] (lolo '((a b) (c d) . x))) should produce '(() …
4
votes
1 answer

Why does 'The Reasoned Schemer' add an 'o' to the end of its functions?

In the reasoned schemer, they name standard lisp functions with an 'o' on the end, eg conso and appendo. My question is: Why does 'The Reasoned Schemer' add an 'o' to the end of its functions?
hawkeye
  • 31,052
  • 27
  • 133
  • 271
3
votes
2 answers

Clarify search algorithms in different minikanren implementation

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 https://github.com/miniKanren/TheReasonedSchemer PS.…
3
votes
3 answers

miniKanren: How to define #s and #u?

In miniKanren, succeed can be defined as (define succeed (== #t #t)), and fail can be defined as (define fail (=== #t #f)). But what about #s and #u as short forms of succeed and fail, as they appear in The Reasoned Schemer? (define #s succeed)…
Flux
  • 5,866
  • 4
  • 24
  • 62
2
votes
1 answer

Is a "facts database" not a core feature of miniKanren?

I have been playing around with miniKanren, trying to understand it by converting very basic Prolog tutorials into it. I use Python habitually so I started with the LogPy library, which has since been forked and improved upon as a lib actually…
2
votes
1 answer

How to explain run 5 (x) g0 g1 in The Reasoned Schemer

I don't understand how the run n (x) g0 g1 ... to run through listo the listo is defined like this (define listo (lambda (l) (conde [(nullo l) #s)] [(pairo l) (fresh (d) (cdro l d) (listo d))] [else…
Hualin
  • 63
  • 6
2
votes
1 answer

Not understanding The Reasoned Schemer Chapter 5 frame 62

I am currently learning miniKanren by learning The Reasoned Schemer. And I am stuck in an exercise in Chapter 5 frame 62: (run* (x) (flatten_o (a) x)), why there are three lists in output?
Chen Wang
  • 515
  • 4
  • 7