Using the datalog reader for racklog
original commit: 12797fef41119f956e70537450a7f38339fa1d62
This commit is contained in:
parent
a89d757639
commit
96d80cf95a
|
@ -54,6 +54,7 @@
|
|||
|
||||
(provide/contract
|
||||
[current-theory (parameter/c mutable-theory/c)]
|
||||
[print-literals ((listof literal?) . -> . void)]
|
||||
[eval-program (program/c . -> . void)]
|
||||
[eval-top-level-statement (statement/c . -> . void)]
|
||||
[eval-statement (statement/c . -> . (or/c void (listof literal?)))]
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
[(color-lexer)
|
||||
(dynamic-require 'datalog/tool/syntax-color 'get-syntax-token)]
|
||||
[(configure-runtime)
|
||||
(λ ()
|
||||
(current-read-interaction even-read))]
|
||||
(λ () (current-read-interaction even-read))]
|
||||
[else (default key defval)]))
|
||||
(require datalog/parse
|
||||
datalog/private/compiler)
|
||||
|
|
|
@ -22,7 +22,7 @@ on tabling intermediate results ensures that all queries terminate.
|
|||
|
||||
@table-of-contents[]
|
||||
|
||||
@section{Datalog Module Language}
|
||||
@section[#:tag "datalog"]{Datalog Module Language}
|
||||
|
||||
@defmodulelang[datalog]
|
||||
|
||||
|
|
|
@ -538,6 +538,9 @@ This library provides facilities for evaluating Datalog. It can be required via:
|
|||
The @tech{theory} used by @racket[eval-program] and @racket[eval-stmt].
|
||||
}
|
||||
|
||||
@defproc[(print-literals [ls (listof literal?)]) void]{
|
||||
Pretty formats the literals for display. }
|
||||
|
||||
@defproc[(eval-program [p program/c])
|
||||
void]{
|
||||
Evaluates @racket[p] using @racket[(current-theory)] as the @tech{theory}, printing query answers as it goes.
|
||||
|
|
2
collects/tests/racklog/lang/laps.txt
Normal file
2
collects/tests/racklog/lang/laps.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
permit(rams, store, rams_couch).
|
||||
permit(will, fetch, rams_couch).
|
1
collects/tests/racklog/lang/long.txt
Normal file
1
collects/tests/racklog/lang/long.txt
Normal file
|
@ -0,0 +1 @@
|
|||
this_is_a_long_identifier_and_tests_the_scanners_concat_when_read_with_a_small_buffer.
|
1
collects/tests/racklog/lang/says.txt
Normal file
1
collects/tests/racklog/lang/says.txt
Normal file
|
@ -0,0 +1 @@
|
|||
says(tpme1, m1).
|
1
collects/tests/racklog/lang/true.txt
Normal file
1
collects/tests/racklog/lang/true.txt
Normal file
|
@ -0,0 +1 @@
|
|||
true.
|
Loading…
Reference in New Issue
Block a user