Skip to content

Latest commit

 

History

History
68 lines (61 loc) · 1.71 KB

File metadata and controls

68 lines (61 loc) · 1.71 KB

Question grammar

Everyone at Boolos' Brewery speaks English, but my program cannot, so we make do with a much more limited language. The grammar is as follows:

Symbol Definition
question : person : bool ?
| " question "
;
person : A | Alice
| B | Bob
| C | Charlie1
| D | Dan2
;
bool : ( bool )
| unary_op bool
| bool binary_op bool
| response cmp response
| person studies field
| 1 | true
| 0 | false
;
unary_op : ! | not
;
binary_op3 : && | and
| || | or
| => | implies
| cmp
;
cmp : == | is | iff
| != | not | xor
;
response : question
| foo
| bar
| baz2
;
field : Math | Mathematics
| Phys | Physics
| Engg | Engineering1
| Phil | Philosophy2
;

You can also ask counterfactuals referencing people by profession (thanks to @ITR13):

Alice: "Mathematician: True?" is foo?

Syntax sugar

You or U can be used to refer to the person being asked the (inner-most) question.

Alice: You study mathematics?
# translates to
Alice: Alice studies mathematics?

You may also compare a response with a bool.

Alice: Foo is true?
# translates to
Alice: "Alice: True?" is foo?

Footnotes

  1. Valid except in easy mode. 2

  2. Valid only in hard mode. 2 3

  3. Operations are sorted by operator precedence.