<< Prev | - Up - | Next >> |
Consider now the selection constraint:
ProjectedAgreement={Select.fd [I1 I2 ... In] Agreement}
when p
encodes agreement tuple [G N P C Q]
and Ip
encodes the projected tuple [G N]
. The constraint above precisely implements the mapping from agreement tuples to projected tuples.
We make this particular projection facility available in functor SmallPartial
(see Section A.4), which exports PartialAgreement
(the projected product involving only gender and number) and GetPartialAgreement
which is a function taking 2 input arguments that must partially agree and returning said partial agreement.
SmallPartial.oz
>=functor
import
Select at 'x-ozlib://duchier/cp/Select.ozf'
SmallLexicon
Encode FS
export
PartialAgreement
GetPartialAgreement
define
PartialAgreement =
{New Encode.domainProduct
init([[masc fem neut]
[sing plur]])}
1#N = SmallLexicon.agreement.range
Projection = {Tuple.make o N}
for I in 1..N do
case {SmallLexicon.agreement decode(I $)}
of [[Gender Number _ _ _]] then
S = {PartialAgreement encode([[Gender Number]] $)}
[J] = {FS.reflect.lowerBoundList S}
in
Projection.I = J
end
end
proc {GetPartialAgreement A1 A2 P}
P = {Select.fd Projection A1}
P = {Select.fd Projection A2}
end
end
<< Prev | - Up - | Next >> |