You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: this is not an issue per se, but instead background information about the semantics of variants. I will reference this issue in some later issues which contain actual suggestions.
There are two possible formal semantics for the disjunction (called variants in GF). In sections 5.2 and 5.3 of my thesis I call them "intensional" and "extensional" disjunction (https://gup.ub.gu.se/file/207628):
1. Intensional disjunction
Intensional disjunction is formally just a shorthand for defining a number of GF functions. This means that we can "push out" variants to the top-level of a linearization. So this definition:
lin f = {a = "a"; b = variants{"b1" ; "b2"}}
becomes the same as this:
lin f = variants{ {a="a"; b="b1"} ; {a="a"; b="b2"} }
which is semantically equivalent to this:
lin f1 = {a="a"; b="b1"}
lin f2 = {a="a"; b="b2"}
This is the disjunction that is implemented in GF since a couple of years.
The main advantage is of course that the current parser works for this semantics.
One drawback is that the size of the grammar can explode - for each disjunction the number of linearizations for that function doubles, so if you have a function with 10 constituents (i.e., a record with 10 labels), and every constituent contains one disjunction (i.e., variants{s1;s2}), then the function will have 210 = 1000 different linearizations. (With 20 record label, the function will have 220 = 1 million linearizations)
Another drawback is that variants{} becomes practically useless - as soon as you put it anywhere in you linearization, the function will have no linearizations at all. This is because {a = "a"; b = variants{}} is the same as variants{} according to the intensional semantics.
2. Extensional disjunction
Extensional disjunction is set union. This requires that GF linearizes syntax trees to sets of linearizations. The effect of this is that disjunctions cannot be pushed to the top-level (at least not in all cases). The formal difference with intensional disjunction is that reduplication behaves differently -- read more in my thesis if you want to know why.
The main drawback is that GF's current parsing algorithm (implemented by Krasimir) cannot handle extensional disjunction correctly. I don't know how difficult it is to change.
But the main advantage is that variants{} becomes useful: Formally, under this semantics variants{} is equivalent to a dummy element of the correct type.
Actually, this was the semantics that was implemented in GF until some years ago.
The text was updated successfully, but these errors were encountered:
Note: this is not an issue per se, but instead background information about the semantics of
variants
. I will reference this issue in some later issues which contain actual suggestions.There are two possible formal semantics for the disjunction (called
variants
in GF). In sections 5.2 and 5.3 of my thesis I call them "intensional" and "extensional" disjunction (https://gup.ub.gu.se/file/207628):1. Intensional disjunction
Intensional disjunction is formally just a shorthand for defining a number of GF functions. This means that we can "push out" variants to the top-level of a linearization. So this definition:
becomes the same as this:
which is semantically equivalent to this:
This is the disjunction that is implemented in GF since a couple of years.
The main advantage is of course that the current parser works for this semantics.
One drawback is that the size of the grammar can explode - for each disjunction the number of linearizations for that function doubles, so if you have a function with 10 constituents (i.e., a record with 10 labels), and every constituent contains one disjunction (i.e.,
variants{s1;s2}
), then the function will have 210 = 1000 different linearizations. (With 20 record label, the function will have 220 = 1 million linearizations)Another drawback is that
variants{}
becomes practically useless - as soon as you put it anywhere in you linearization, the function will have no linearizations at all. This is because{a = "a"; b = variants{}}
is the same asvariants{}
according to the intensional semantics.2. Extensional disjunction
Extensional disjunction is set union. This requires that GF linearizes syntax trees to sets of linearizations. The effect of this is that disjunctions cannot be pushed to the top-level (at least not in all cases). The formal difference with intensional disjunction is that reduplication behaves differently -- read more in my thesis if you want to know why.
The main drawback is that GF's current parsing algorithm (implemented by Krasimir) cannot handle extensional disjunction correctly. I don't know how difficult it is to change.
But the main advantage is that
variants{}
becomes useful: Formally, under this semanticsvariants{}
is equivalent to a dummy element of the correct type.Actually, this was the semantics that was implemented in GF until some years ago.
The text was updated successfully, but these errors were encountered: