Hello Aarne and Peter, especially,
> For instance, record subtyping à la Cardelli
>
http://lucacardelli.name/papers/inheritance.pdf
> would make sense, and is as Peter says already supported for linearizations.
> My dream is to try out records like this in the arguments of dependent
> types, so that one could for instance have
> NP car < NP vehicle
> when
> car < vehicle
> in Cardelli's sense. We have discussed this with Per Martin-Löf and he was
> very much in favour. The records themselves are not dependently typed.
this might be useful, but I'm not sure whether one *always* wants to
lift the subtype relation through the dependent type constructor.
My impression is that dependent types in gf are not first-class
types at all, in the sense that (in the current gf) we have
lintype NP car = lintype NP vehicle,
and actually we are only allowed to define
lintype NP = ...,
i.e. lintype assigns a type to the type constructor NP, not to the
different types (NP car), (NP vehicle) independently; as Peter said:
> - it's difficult to get lintypes to work well with dependent types --
> the current solution is the the lintype simply ignore dependencies,
> which makes dependent tpyes even less useful
I don't really understand why ignoring dependencies should be
necessary. In the grammar I attach, I wanted to implement
lintype (CN count) = { s : Num => Case => Str ; ... }
(CN mass) = { s : Case => Str ; ... }
and exclude plural for mass nouns altogether, which I couldn't in gf.
So, before you can have (NP car) < (NP vehicle), there's something
to do even to get (NP car) =/= (NP vehicle).
Another thing I was puzzled by is that for number-dependent np's
cat Number; NP Number ;
fun sg, pl : Number ;
I couldn't define
param Num = Sg | Pl ;
lincat Number = {n : Num} ;
lin sg = {n : Sg} ;
but was forced to add a Str-field: lincat Number = {s:Str; n:Num}
works. I don't see that the GF-book, C.4.7, demands an s:Str-field.
Remark: Actually I wanted the simpler definition
param Num = Sg | Pl ;
lincat Number = Num ;
lin sg = Sg ; pl = Pl ;
but then I could not use the dependent argument k as in
fun f : (k:Number) -> ...
lin f k x = ... k ... ;
apparently, the k:Number is not turned into a k:Num in the
lin-definition, at least I couldn't store k in a Num-field.
> - after 15 years of GF, almost no grammars make use of dependent types,
> so it's probably not extremely useful in practise
Below, Peter, is a little example grammar that uses dependent types in
syntax to separate NPs into (NP sg), (NP pl) [and artificial, empty (NP
any)] and distinguishes between verbs (and VP,VPSlash) that impose
number restrictions on their arguments. The point is to exclude singular
NPs from positions where a plural is demanded, either by lexical
properties of verbs or by reciprocal constructions.
In some sense, there is a nice, uniform dependency on number going on,
which makes the use of dependent types attractive, but on the other
hand, many verb/VPSlash arguments don't care about number, and there we
would need better subtyping (than the (VP any) as (VP sg) + (VP pl) I am
using, plus some extra grammar rules dealing with number=any).
To complete this exercise, one should add a Montague-semantics showing
that the plural quantifier cannot be reduced to the singular quantifier,
in sentences like
some/these lines don't intersect (each other).
[ * some/this line does not intersect ]
But this would be more work ...
Best,
Hans