Attempt to fix the near() rules.
Chris Pressey
6 years ago
49 | 49 |
|
50 | 50 |
### TODO
|
51 | 51 |
|
52 | |
* Implement a simple equality rule, `eq(?X,?X)`, as a built-in.
|
53 | |
This is basically necessary to stop characters from talking to
|
54 | |
themselves, nodding to themselves, ET CETERA.
|
|
52 |
* Implement a "wildcard" variable that will match anything *without* binding it.
|
55 | 53 |
|
56 | 54 |
### TODO for v0.3
|
57 | 55 |
|
58 | 56 |
* Consider what it would take to add a predicate that evaluates to whether
|
59 | 57 |
a given action has been taken previously or not.
|
60 | 58 |
* Consider macros.
|
61 | |
* Consider a "wildcard" variable that will match anything *without* binding it.
|
62 | 59 |
* Consider making "wildcard" work such that you can say `¬holding(?_, club)`
|
63 | 60 |
to mean "if no one is holding the club".
|
12 | 12 |
// sitting_on(?A,?S)
|
13 | 13 |
// empty(?S) ?S is a seat that is not currently occupied.
|
14 | 14 |
// fenestration(?P) ?P is a prop that can be looked out of to the outside.
|
15 | |
// near(?A,?P) ?A is an actor who is near or next to prop ?P.
|
|
15 |
// near(?A) ?A is near a prop.
|
|
16 |
// near_to(?A,?P) ?A is an actor who is near or next to prop ?P.
|
16 | 17 |
// described(?P) ?P is a prop that has been described.
|
17 | 18 |
|
18 | 19 |
// topic(?T) ?T is a topic of conversation.
|
|
44 | 45 |
|
45 | 46 |
[actor(?A),fenestration(?P)] ?A looked out the ?P. []
|
46 | 47 |
|
47 | |
[actor(?A),!sitting(?A),prop(?P),!near(?A,?P)] ?A walked over to the ?P. [near(?A,?P)] // TODO: retract all other near
|
48 | |
[actor(?A),near(?A,?P)] ?A examined the ?P closely. []
|
|
48 |
[actor(?A),!sitting(?A),prop(?P),!near(?A)] ?A walked over to the ?P. [near(?A),near_to(?A,?P)]
|
|
49 |
[actor(?A),near_to(?A,?P)] ?A examined the ?P closely. []
|
|
50 |
[actor(?A),near_to(?A,?P)] ?A walked away from the ?P. [!near(?A),!near_to(?A,?P)]
|
49 | 51 |
|
50 | 52 |
[prop(?P),!described(?P)] Nearby there was a ?P. [described(?P)]
|
51 | 53 |
|