Clarify Datalog/Racket interaction re Matthias

This commit is contained in:
Jay McCarthy 2014-04-18 10:09:15 -06:00
parent 9e7b013a7d
commit 2846764a93
2 changed files with 14 additions and 1 deletions

View File

@ -61,6 +61,8 @@ The Datalog database can be directly used by Racket programs through this API.
(datalog family (datalog family
(? (add1 1 :- X))) (? (add1 1 :- X)))
(datalog family
(? (add1 X :- 2)))
(datalog family (datalog family
(? (#,(λ (x) (+ x 1)) 1 :- X)))] (? (#,(λ (x) (+ x 1)) 1 :- X)))]
@ -107,7 +109,13 @@ for a variable symbol, or @RACKET[#,expr] where @racket[expr]
evaluates to a constant datum. Bound identifiers in terms are treated evaluates to a constant datum. Bound identifiers in terms are treated
as the datum they are bound to. as the datum they are bound to.
External queries invalidate Datalog's guaranteed termination. For example, this program does not terminate: External queries fail if any logic variable is not fully resolved to a
datum on the Datalog side. In other words, unbound logic variables
never flow to Racket.
External queries invalidate Datalog's guaranteed termination. For
example, this program does not terminate:
@racketblock[ @racketblock[
(datalog (make-theory) (datalog (make-theory)
(! (:- (loop X) (! (:- (loop X)

View File

@ -76,6 +76,11 @@
=> =>
(list (hasheq 'X 2)) (list (hasheq 'X 2))
(datalog parent
(? (add1 X :- 2)))
=>
(list)
(datalog parent (datalog parent
(? (#,(λ (x) (+ x 1)) 1 :- X))) (? (#,(λ (x) (+ x 1)) 1 :- X)))
=> =>