From 2846764a93d3317b0934c61d078f54baf3a18599 Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Fri, 18 Apr 2014 10:09:15 -0600 Subject: [PATCH] Clarify Datalog/Racket interaction re Matthias --- pkgs/datalog/scribblings/racket.scrbl | 10 +++++++++- pkgs/datalog/tests/racket.rkt | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/pkgs/datalog/scribblings/racket.scrbl b/pkgs/datalog/scribblings/racket.scrbl index 3b298fa674..c66517cdbb 100644 --- a/pkgs/datalog/scribblings/racket.scrbl +++ b/pkgs/datalog/scribblings/racket.scrbl @@ -61,6 +61,8 @@ The Datalog database can be directly used by Racket programs through this API. (datalog family (? (add1 1 :- X))) + (datalog family + (? (add1 X :- 2))) (datalog family (? (#,(λ (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 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[ (datalog (make-theory) (! (:- (loop X) diff --git a/pkgs/datalog/tests/racket.rkt b/pkgs/datalog/tests/racket.rkt index 9f578d5dea..8d1ab3ac38 100644 --- a/pkgs/datalog/tests/racket.rkt +++ b/pkgs/datalog/tests/racket.rkt @@ -76,6 +76,11 @@ => (list (hasheq 'X 2)) + (datalog parent + (? (add1 X :- 2))) + => + (list) + (datalog parent (? (#,(λ (x) (+ x 1)) 1 :- X))) =>