CLMBRs / ultk

A library for research in unnatural language semantics
GNU General Public License v3.0
6 stars 2 forks source link

GrammaticalExpression should not be a subclass of `Expression`? #30

Open shanest opened 3 months ago

shanest commented 3 months ago

Issue: GrammaticalExpression right now is a subclass of Expression, which primarily stores a form and a Meaning. The problem: Meanings are basically a set of Referents. This works well for GrammaticalExpressions that start from bool (e.g. subset(A, B) or all the ones in the indefinites example), since they produce functions that map a Referent to a bool. But sub-expressions thereof (e.g. the A, or an int like 5) may not return bool and so cannot be used to produce a Meaning.

I'm leaning towards making GrammaticalExpression not a busclass of Expression (and so maybe renaming it as well), and then having the evaluate method take a GE and return a Meaning. We could also introduce something like InterpretedGrammaticalExpression as a subclass of Expression which stores the GE + Meaning for GEs that are bool.

shanest commented 2 weeks ago

Note: if we adopt the proposal in #40, we can let GrammaticalExpression remain a subclass of expression and modify evaluate to look more like call_on_universe