5 Parenthetical Datalog
This package recognizes an alternative, Scheme-like front-end syntax for Datalog. It can be required via:
(require (planet jaymccarthy/datalog:1:3/sexp)) |
5.1 Parenthetical Datalog Syntax
program | = | (begin statement ...) | ||
statement | = | assertion | ||
| | retraction | |||
| | query | |||
assertion | = | (! clause) | ||
retraction | = | (~ clause) | ||
query | = | (? literal) | ||
clause | = | (:- literal literal ...) | ||
| | literal | |||
literal | = | (datum term ...) | ||
term | = | variable | ||
| | constant | |||
variable | = | (unquotesymbol) | ||
constant | = | datum | ||
datum | = | symbol | ||
| | string |
5.2 Parethetical Parser API
(stx->term stx) → term/c |
stx : syntax? |
Parses stx as a term.
(stx->literal stx) → literal? |
stx : syntax? |
Parses stx as a literal.
(stx->clause stx) → clause? |
stx : syntax? |
Parses stx as a clause.
(stx->statement stx) → statement/c |
stx : syntax? |
Parses stx as a statement.
(stx->program stx) → program/c |
stx : syntax? |
Parses stx as a program.
stx->term composed with datum->syntax.
stx->literal composed with datum->syntax.
stx->clause composed with datum->syntax.
stx->statement composed with datum->syntax.
stx->program composed with datum->syntax.