|
|
|
# Semantics
|
|
|
|
|
|
|
|
A Prolog-like knowledge base containing only binary and unary facts. The only allowed constants are integers.
|
|
|
|
|
|
|
|
# Syntax
|
|
|
|
|
|
|
|
Prolog expressed with s-expressions, e.g.
|
|
|
|
|
|
|
|
```
|
|
|
|
(unary-fact 1)
|
|
|
|
(unary-fact 2)
|
|
|
|
(binary-fact 1 2)
|
|
|
|
(binary-fact 2 1)
|
|
|
|
```
|
|
|
|
|
|
|
|
# Queries
|
|
|
|
|
|
|
|
Similarly to Prolog, query is a conjunction of atoms:
|
|
|
|
```
|
|
|
|
((unary-fact X) (binary-fact 1 X))
|
|
|
|
```
|
|
|
|
As in Prolog, user can use both constants and variables.
|
|
|
|
The only difference from Prolog is that there should be two ways of executing the query:
|
|
|
|
* deterministic - the same as in Prolog; should be able to generate all the possible results to the query in a repeatable way
|
|
|
|
* indeterministic - generating one random result to the query |
|
|
|
\ No newline at end of file |