minikanren

miniKanren: How to define #s and #u?

我的未来我决定 提交于 2021-02-10 00:23:53
问题 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) produces an error in Racket: Welcome to Racket v7.2. > (require Racket-miniKanren/miniKanren/mk) > (define #s succeed) ; readline-input:2:8: read-syntax: expected `(`, `[`, or `{` after `#s` [,bt ; for context] #<procedure:...iniKanren/mk.rkt:337:4

miniKanren: How to define #s and #u?

≯℡__Kan透↙ 提交于 2021-02-10 00:20:46
问题 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) produces an error in Racket: Welcome to Racket v7.2. > (require Racket-miniKanren/miniKanren/mk) > (define #s succeed) ; readline-input:2:8: read-syntax: expected `(`, `[`, or `{` after `#s` [,bt ; for context] #<procedure:...iniKanren/mk.rkt:337:4

miniKanren: How to define #s and #u?

橙三吉。 提交于 2021-02-10 00:20:36
问题 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) produces an error in Racket: Welcome to Racket v7.2. > (require Racket-miniKanren/miniKanren/mk) > (define #s succeed) ; readline-input:2:8: read-syntax: expected `(`, `[`, or `{` after `#s` [,bt ; for context] #<procedure:...iniKanren/mk.rkt:337:4

miniKanren: How to define #s and #u?

谁说胖子不能爱 提交于 2021-02-10 00:20:32
问题 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) produces an error in Racket: Welcome to Racket v7.2. > (require Racket-miniKanren/miniKanren/mk) > (define #s succeed) ; readline-input:2:8: read-syntax: expected `(`, `[`, or `{` after `#s` [,bt ; for context] #<procedure:...iniKanren/mk.rkt:337:4

miniKanren: How to define #s and #u?

試著忘記壹切 提交于 2021-02-10 00:19:56
问题 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) produces an error in Racket: Welcome to Racket v7.2. > (require Racket-miniKanren/miniKanren/mk) > (define #s succeed) ; readline-input:2:8: read-syntax: expected `(`, `[`, or `{` after `#s` [,bt ; for context] #<procedure:...iniKanren/mk.rkt:337:4

miniKanren: How to define #s and #u?

雨燕双飞 提交于 2021-02-10 00:19:22
问题 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) produces an error in Racket: Welcome to Racket v7.2. > (require Racket-miniKanren/miniKanren/mk) > (define #s succeed) ; readline-input:2:8: read-syntax: expected `(`, `[`, or `{` after `#s` [,bt ; for context] #<procedure:...iniKanren/mk.rkt:337:4

Pure Prolog Scheme Quine

依然范特西╮ 提交于 2021-01-03 06:42:45
问题 There is this paper: William E. Byrd, Eric Holk, Daniel P. Friedman, 2012 miniKanren, Live and Untagged Quine Generation via Relational Interpreters http://webyrd.net/quines/quines.pdf Which uses logic programming to find a Scheme Quine. The Scheme subset that is consider here does not only contain lambda abstraction and application, but also a little list processing by the following reduction, already translated to Prolog: [quote,X] ~~> X [] ~~> [] [cons,X,Y] ~~> [A|B], for X ~~> A and Y ~~>

Pure Prolog Scheme Quine

柔情痞子 提交于 2021-01-03 06:40:14
问题 There is this paper: William E. Byrd, Eric Holk, Daniel P. Friedman, 2012 miniKanren, Live and Untagged Quine Generation via Relational Interpreters http://webyrd.net/quines/quines.pdf Which uses logic programming to find a Scheme Quine. The Scheme subset that is consider here does not only contain lambda abstraction and application, but also a little list processing by the following reduction, already translated to Prolog: [quote,X] ~~> X [] ~~> [] [cons,X,Y] ~~> [A|B], for X ~~> A and Y ~~>

MiniKanren support by Dr Racket

ぐ巨炮叔叔 提交于 2020-02-28 04:03:08
问题 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) ) produce error messages such as run*: bad syntax in: (run* q #f) . Does this mean that the "faster-minikanren" package does not provide the right definition of minikanren? Or am I making a mistake? 回答1: As the readme says, you need to put (require

What does non-relational mean in practice for core.logic?

孤街醉人 提交于 2020-01-03 20:57:04
问题 When trying to understand core.logic throgh the API docs I come across Non-Relational goals and relational goals. I have no idea what this means in practice and why it is important to annotate goals if they are relational or not. Can you explain with example how the goals are used differently depending on if they are relational or not? 回答1: In order to explain what non-relational means we need to revisit what relational means. If you consider pure functions in functional programming, they