Created
February 13, 2022 10:13
-
-
Save zesterer/9d86eb4e241ce459f2caea32988f9055 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Clone, Debug)] | |
pub enum Plural { | |
All, | |
Specific, | |
Exactly(i64), | |
} | |
#[derive(Clone, Debug)] | |
pub enum Logical { | |
And, | |
Or, | |
Conditional, | |
Then, | |
Causal, | |
} | |
#[derive(Clone, Debug)] | |
pub enum UnboundedNoun { | |
Any(Box<Noun>), | |
Within(Box<UnboundedNoun>, Box<Noun>), | |
SetMembership(Box<UnboundedNoun>, Box<Set>), | |
} | |
#[derive(Clone, Debug)] | |
pub enum Noun { | |
Just(String), | |
Double(Box<Noun>, Box<Noun>), | |
Ownership(Box<Noun>, Box<Noun>), | |
And(Box<Noun>, Box<Noun>), | |
Plural(Plural, Box<Noun>), | |
Described(String, Box<Noun>), | |
Bounded(String, UnboundedNoun), | |
} | |
#[derive(Clone, Debug)] | |
pub enum Verb { | |
Nullary(String), | |
Unary(String, Noun), | |
Binary(String, Noun, Noun), | |
Qualified(String, Box<Verb>), | |
And(Box<Verb>, Box<Verb>), | |
Or(Box<Verb>, Box<Verb>), | |
Then(Box<Verb>, Box<Verb>), | |
Conditional(Proposition, Box<Verb>), | |
} | |
#[derive(Clone, Debug)] | |
pub enum Set { | |
Adjective(String), | |
Superlative(String, Noun), | |
} | |
#[derive(Clone, Debug)] | |
pub enum Proposition { | |
SetMembership(Noun, Set), | |
Is(Noun, Noun), | |
Ownership(Noun, Noun), | |
Logical(Logical, Box<Proposition>, Box<Proposition>), | |
Not(Box<Proposition>), | |
Modified(String, Box<Proposition>), | |
} | |
#[derive(Clone, Debug)] | |
pub enum Question { | |
Who(Noun), | |
What(Noun), | |
When(Noun), | |
How(Noun), | |
Why(Proposition), | |
Is(Proposition), | |
May(Proposition), | |
} | |
#[derive(Clone, Debug)] | |
pub enum Phrase { | |
Command(Verb), | |
Fact(Proposition), | |
Question(Question), | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment