diff --git a/collects/datalog/scribblings/datalog.scrbl b/collects/datalog/scribblings/datalog.scrbl index 79d7414..048fda4 100644 --- a/collects/datalog/scribblings/datalog.scrbl +++ b/collects/datalog/scribblings/datalog.scrbl @@ -109,7 +109,7 @@ The following BNF describes the syntax of Datalog. (nonterm "constant")) (list (nonterm "constant") (nonterm "IDENTIFIER") - (nonterm "STRING")) + (nonterm "STRING")) ] The effect of running a Datalog program is to modify the database as directed @@ -143,7 +143,7 @@ All identifiers in @racketmodname[racket/base] are available for use as predicat The following is a program: @racketmod[datalog/sexp - + (! (edge a b)) (! (edge b c)) (! (edge c d)) diff --git a/collects/datalog/scribblings/racket.scrbl b/collects/datalog/scribblings/racket.scrbl index b0d2677..70f3b33 100644 --- a/collects/datalog/scribblings/racket.scrbl +++ b/collects/datalog/scribblings/racket.scrbl @@ -16,22 +16,22 @@ The Datalog database can be directly used by Racket programs through this API. @examples[#:eval the-eval (define family (make-theory)) - + (datalog family (! (parent joseph2 joseph1)) (! (parent joseph2 lucy)) (! (parent joseph3 joseph2))) - + (datalog family (? (parent X joseph2))) - + (datalog family (? (parent joseph2 X))) - + (datalog family (? (parent joseph2 X)) (? (parent X joseph2))) - + (datalog family (! (:- (ancestor A B) (parent A B))) @@ -46,7 +46,7 @@ The Datalog database can be directly used by Racket programs through this API. (let ([x 'joseph2]) (datalog family (? (parent x X)))) - + (datalog family (? (add1 1 :- X)))] @@ -57,11 +57,11 @@ The Datalog database can be directly used by Racket programs through this API. @defform[(datalog thy-expr stmt ...) #:contracts ([thy-expr theory/c])]{ Executes the statements on the theory given by @racket[thy-expr]. Returns the answers to the final query as a list of substitution dictionaries or returns @racket[empty]. } - + @defform[(datalog! thy-expr stmt ...) #:contracts ([thy-expr theory/c])]{ Executes the statements on the theory given by @racket[thy-expr]. Prints the answers to every query in the list of statements. Returns @racket[(void)]. } - + Statements are either assertions, retractions, or queries. @defform[(! clause)]{ Asserts the clause. } @@ -70,7 +70,7 @@ Statements are either assertions, retractions, or queries. @defform[(:- literal question ...)]{ A conditional clause. } @defform[(? question)]{ Queries the literal and prints the result literals. } - + Questions are either literals or external queries. Literals are represented as @racket[identifier] or @racket[(identifier term ...)]. External queries are represented as @racket[(identifier term ... :- term ...)], where @racket[identifier] is bound to a procedure that when given the first set of terms as arguments returns the second set of terms as values.