summaryrefslogtreecommitdiff
path: root/old-lib/resource/romance
diff options
context:
space:
mode:
authoraarne <aarne@chalmers.se>2009-06-22 15:39:08 +0000
committeraarne <aarne@chalmers.se>2009-06-22 15:39:08 +0000
commite89fdae2fa1626348d8025824a7469252fa85e42 (patch)
treec7d46bbd0494043b4bd6f917a25a7687517d0547 /old-lib/resource/romance
parent3049b59b35b25381a7c6787444165c200d66e08b (diff)
next-lib renamed to lib, lib to old-lib
Diffstat (limited to 'old-lib/resource/romance')
-rw-r--r--old-lib/resource/romance/AdjectiveRomance.gf41
-rw-r--r--old-lib/resource/romance/AdverbRomance.gf26
-rw-r--r--old-lib/resource/romance/CatRomance.gf106
-rw-r--r--old-lib/resource/romance/CommonRomance.gf215
-rw-r--r--old-lib/resource/romance/ConjunctionRomance.gf70
-rw-r--r--old-lib/resource/romance/DiffRomance.gf115
-rw-r--r--old-lib/resource/romance/ExtRomance.gf14
-rw-r--r--old-lib/resource/romance/ExtraRomance.gf21
-rw-r--r--old-lib/resource/romance/ExtraRomanceAbs.gf7
-rw-r--r--old-lib/resource/romance/NounRomance.gf210
-rw-r--r--old-lib/resource/romance/PhraseRomance.gf27
-rw-r--r--old-lib/resource/romance/QuestionRomance.gf113
-rw-r--r--old-lib/resource/romance/RelativeRomance.gf50
-rw-r--r--old-lib/resource/romance/ResRomance.gf299
-rw-r--r--old-lib/resource/romance/SentenceRomance.gf94
-rw-r--r--old-lib/resource/romance/VerbRomance.gf119
16 files changed, 1527 insertions, 0 deletions
diff --git a/old-lib/resource/romance/AdjectiveRomance.gf b/old-lib/resource/romance/AdjectiveRomance.gf
new file mode 100644
index 000000000..5ff9babb0
--- /dev/null
+++ b/old-lib/resource/romance/AdjectiveRomance.gf
@@ -0,0 +1,41 @@
+incomplete concrete AdjectiveRomance of Adjective =
+ CatRomance ** open CommonRomance, ResRomance, Prelude in {
+
+ lin
+
+ PositA a = {
+ s = a.s ! Posit ;
+ isPre = a.isPre
+ } ;
+ ComparA a np = {
+ s = \\af => a.s ! Compar ! af ++ conjThan ++ np.s ! Ton Nom ;
+ isPre = False
+ } ;
+
+-- $SuperlA$ belongs to determiner syntax in $Noun$.
+
+ ComplA2 adj np = {
+ s = \\af => adj.s ! Posit ! af ++ appCompl adj.c2 np.s ;
+ isPre = False
+ } ;
+
+ ReflA2 adj = {
+ s = \\af =>
+ adj.s ! Posit ! af ++ adj.c2.s ++
+ adj.c2.s ++ prepCase adj.c2.c ++ reflPron Sg P3 Nom ; --- agr
+ isPre = False
+ } ;
+
+ SentAP ap sc = {
+ s = \\a => ap.s ! a ++ sc.s ; --- mood
+ isPre = False
+ } ;
+
+ AdAP ada ap = {
+ s = \\a => ada.s ++ ap.s ! a ;
+ isPre = ap.isPre
+ } ;
+
+ UseA2 a = a ** {isPre = False} ;
+
+}
diff --git a/old-lib/resource/romance/AdverbRomance.gf b/old-lib/resource/romance/AdverbRomance.gf
new file mode 100644
index 000000000..4fe30e707
--- /dev/null
+++ b/old-lib/resource/romance/AdverbRomance.gf
@@ -0,0 +1,26 @@
+incomplete concrete AdverbRomance of Adverb =
+ CatRomance ** open CommonRomance, ResRomance, Prelude in {
+
+ lin
+ PositAdvAdj a = {
+ s = a.s ! Posit ! AA
+ } ;
+ ComparAdvAdj cadv a np = {
+ s = cadv.s ++ a.s ! Posit ! AA ++ conjThan ++ np.s ! Ton Nom
+ } ;
+ ComparAdvAdjS cadv a s = {
+ s = cadv.s ++ a.s ! Posit ! AA ++ conjThan ++ s.s ! Conjunct --- ne
+ } ;
+
+ PrepNP prep np = {s = prep.s ++ np.s ! case2npform prep.c} ;
+
+ AdAdv = cc2 ;
+
+ SubjS subj s = {
+ s = subj.s ++ s.s ! subj.m
+ } ;
+---b AdvSC s = s ;
+
+ AdnCAdv cadv = {s = cadv.s ++ conjThan} ;
+
+}
diff --git a/old-lib/resource/romance/CatRomance.gf b/old-lib/resource/romance/CatRomance.gf
new file mode 100644
index 000000000..4a88dd082
--- /dev/null
+++ b/old-lib/resource/romance/CatRomance.gf
@@ -0,0 +1,106 @@
+incomplete concrete CatRomance of Cat =
+ CommonX - [Tense,TPres,TPast,TFut,TCond]
+ ** open Prelude, CommonRomance, ResRomance, (R = ParamX) in {
+
+ flags optimize=all_subs ;
+
+ lincat
+
+-- Tensed/Untensed
+
+ S = {s : Mood => Str} ;
+ QS = {s : QForm => Str} ;
+ RS = {s : Mood => Agr => Str ; c : Case} ;
+ SSlash = {
+ s : AAgr => Mood => Str ;
+ c2 : Compl
+ } ;
+
+
+-- Sentence
+
+ Cl = {s : Direct => RTense => Anteriority => Polarity => Mood => Str} ;
+ ClSlash = {
+ s : AAgr => Direct => RTense => Anteriority => Polarity => Mood => Str ;
+ c2 : Compl
+ } ;
+ Imp = {s : Polarity => ImpForm => Gender => Str} ;
+
+-- Question
+
+ QCl = {s : RTense => Anteriority => Polarity => QForm => Str} ;
+ IP = {s : Case => Str ; a : AAgr} ;
+ IComp = {s : AAgr => Str} ;
+ IDet = {s : Gender => Case => Str ; n : Number} ;
+ IQuant = {s : Number => Gender => Case => Str} ;
+
+-- Relative
+
+ RCl = {
+ s : Agr => RTense => Anteriority => Polarity => Mood => Str ;
+ c : Case
+ } ;
+ RP = {s : Bool => AAgr => Case => Str ; a : AAgr ; hasAgr : Bool} ;
+
+-- Verb
+
+ VP = ResRomance.VP ;
+ VPSlash = ResRomance.VP ** {c2 : Compl} ;
+ Comp = {s : Agr => Str} ;
+
+-- Adjective
+
+ AP = {s : AForm => Str ; isPre : Bool} ;
+
+-- Noun
+
+ CN = {s : Number => Str ; g : Gender} ;
+ NP,Pron = Pronoun ;
+ Det = {s : Gender => Case => Str ; n : Number} ;
+--- QuantSg = {s : Gender => Case => Str} ;
+--- QuantPl = {s : Bool => Gender => Case => Str} ;
+ Quant = {s : Number => Gender => Case => Str} ;
+ Art = {s : Bool => Number => Gender => Case => Str} ;
+ Predet = {s : AAgr => Case => Str ; c : Case} ; -- c : la plupart de
+ Num = {s : Gender => Str ; isNum : Bool ; n : Number} ;
+ Card = {s : Gender => Str ; n : Number} ;
+ Ord = {s : AAgr => Str} ;
+
+-- Numeral
+
+ Numeral = {s : CardOrd => Str ; n : Number} ;
+ Digits = {s : CardOrd => Str ; n : Number} ;
+
+-- Structural
+
+---b Conj = {s : Str ; n : Number} ;
+---b DConj = {s1,s2 : Str ; n : Number} ;
+ Conj = {s1,s2 : Str ; n : Number} ;
+ Subj = {s : Str ; m : Mood} ;
+ Prep = {s : Str ; c : Case ; isDir : Bool} ;
+
+-- Open lexical classes, e.g. Lexicon
+
+ V, VQ, VA = Verb ;
+ V2, VV, V2S, V2Q = Verb ** {c2 : Compl} ;
+ V3, V2A, V2V = Verb ** {c2,c3 : Compl} ;
+ VS = Verb ** {m : Polarity => Mood} ;
+
+ A = {s : Degree => AForm => Str ; isPre : Bool} ;
+ A2 = {s : Degree => AForm => Str ; c2 : Compl} ;
+
+ N = Noun ;
+ N2 = Noun ** {c2 : Compl} ;
+ N3 = Noun ** {c2,c3 : Compl} ;
+ PN = {s : Str ; g : Gender} ;
+
+-- tense augmented with passé simple
+
+ Tense = {s : Str ; t : RTense} ;
+ lin
+ TPres = {s = []} ** {t = RPres} ;
+ TPast = {s = []} ** {t = RPast} ; --# notpresent
+ TFut = {s = []} ** {t = RFut} ; --# notpresent
+ TCond = {s = []} ** {t = RCond} ; --# notpresent
+
+}
diff --git a/old-lib/resource/romance/CommonRomance.gf b/old-lib/resource/romance/CommonRomance.gf
new file mode 100644
index 000000000..f167f38fa
--- /dev/null
+++ b/old-lib/resource/romance/CommonRomance.gf
@@ -0,0 +1,215 @@
+----1 Auxiliary operations common for Romance languages
+--
+-- This module contains operations that are shared by the Romance
+-- languages. The complete set of auxiliary operations needed to
+-- implement [Test Test.html] is defined in [ResRomance ResRomance.html],
+-- which depends on [DiffRomance DiffRomance.html].
+--
+
+resource CommonRomance = ParamX ** open Prelude in {
+
+ flags optimize=all ;
+
+--2 Enumerated parameter types for morphology
+--
+-- These types are the ones found in school grammars.
+-- Their parameter values are atomic.
+
+param
+
+ Gender = Masc | Fem ;
+
+ Mood = Indic | Conjunct ;
+
+ Direct = DDir | DInv ;
+
+-- Adjectives are inflected in gender and number, and there is also an
+-- adverbial form (e.g. "infiniment"), which has different paradigms and
+-- can even be irregular ("bien").
+-- Comparative adjectives are moreover inflected in degree
+-- (which in Romance is usually syntactic, though).
+
+ AForm = AF Gender Number | AA ;
+
+-- Gender is not morphologically determined for first and second person pronouns.
+
+ PronGen = PGen Gender | PNoGen ;
+
+-- Cardinal numerals have gender, ordinal numerals have full number as well.
+
+ CardOrd = NCard Gender | NOrd Gender Number ;
+
+-- The following coercions are useful:
+
+oper
+ prongen2gender : PronGen -> Gender = \p -> case p of {
+ PGen g => g ;
+ PNoGen => variants {Masc ; Fem} --- the best we can do for je, tu, nous, vous
+ } ;
+
+
+ aform2gender : AForm -> Gender = \a -> case a of {
+ AF g _ => g ;
+ _ => Masc -- "le plus lentement"
+ } ;
+ aform2number : AForm -> Number = \a -> case a of {
+ AF _ n => n ;
+ _ => Sg -- "le plus lentement"
+ } ;
+
+ conjGender : Gender -> Gender -> Gender = \m,n ->
+ case m of {
+ Fem => n ;
+ _ => Masc
+ } ;
+
+ conjAgr : Agr -> Agr -> Agr = \a,b -> {
+ g = conjGender a.g b.g ;
+ n = conjNumber a.n b.n ;
+ p = conjPerson a.p b.p
+ } ;
+
+
+--3 Verbs
+--
+-- In the current syntax, we use
+-- a reduced conjugation with only the present tense infinitive,
+-- indicative, subjunctive, and imperative forms.
+-- But our morphology has full Bescherelle conjunctions:
+-- so we use a coercion between full and reduced verbs.
+-- The full conjugations and the coercions are defined separately for French
+-- and Italian, since they are not identical. The differences are mostly due
+-- to Bescherelle structuring the forms in different groups; the
+-- gerund and the present participles show real differences.
+--
+-- For Italian contracted forms, $VInfin$ should have
+-- an alternative form, whose proper place is $Diff$.
+
+param
+ VF =
+ VInfin Bool
+ | VFin TMood Number Person
+ | VImper NumPersI
+ | VPart Gender Number
+ | VGer
+ ;
+
+ TMood =
+ VPres Mood
+ | VImperf Mood --# notpresent
+ | VPasse --# notpresent
+ | VFut --# notpresent
+ | VCondit --# notpresent
+ ;
+
+ NumPersI = SgP2 | PlP1 | PlP2 ;
+
+ VPForm =
+ VPFinite TMood Anteriority
+ | VPImperat
+ | VPGerund
+ | VPInfinit Anteriority Bool ;
+
+ RTense =
+ RPres
+ | RPast --# notpresent
+ | RPasse --# notpresent
+ | RFut --# notpresent
+ | RCond --# notpresent
+ ;
+
+-- Agreement of adjectives, verb phrases, and relative pronouns.
+
+oper
+ AAgr : Type = {g : Gender ; n : Number} ;
+ Agr : Type = AAgr ** {p : Person} ;
+
+param
+ RAgr = RAg {g : Gender ; n : Number} | RNoAg ; --- AAgr
+
+-- Clitic slots.
+
+ CAgr = CPron Gender Number Person | CRefl | CNone ; --- Agr
+--- CAgr = CPron {g : Gender ; n : Number ; p : Person} | CRefl | CNone ; --- Agr
+
+oper
+ aagr : Gender -> Number -> AAgr = \g,n ->
+ {g = g ; n = n} ;
+ agrP3 : Gender -> Number -> Agr = \g,n ->
+ aagr g n ** {p = P3} ;
+
+
+ vf2numpers : VF -> (Number * Person) = \v -> case v of {
+ VFin _ n p => <n,p> ;
+ _ => <Sg,P3> ----
+ } ;
+
+ presInd = VPres Indic ;
+
+-- The imperative forms depend on number and person.
+
+ vImper : Number -> Person -> VF = \n,p -> case <n,p> of {
+ <Sg,P2> => VImper SgP2 ;
+ <Pl,P1> => VImper PlP1 ;
+ <Pl,P2> => VImper PlP2 ;
+ _ => VInfin False
+ } ;
+
+---
+
+ oper
+ genForms : Str -> Str -> Gender => Str = \bon,bonne ->
+ table {
+ Masc => bon ;
+ Fem => bonne
+ } ;
+
+ aagrForms : (x1,_,_,x4 : Str) -> (AAgr => Str) = \tout,toute,tous,toutes ->
+ table {
+ {g = g ; n = Sg} => genForms tout toute ! g ;
+ {g = g ; n = Pl} => genForms tous toutes ! g
+ } ;
+
+ Noun = {s : Number => Str ; g : Gender} ;
+
+ Adj = {s : AForm => Str} ;
+
+ appVPAgr : VPAgr -> AAgr -> AAgr = \vp,agr ->
+ case vp of {
+ VPAgrSubj => agr ;
+ VPAgrClit g n => {g = g ; n = n}
+ } ;
+
+ vpAgrNone : VPAgr = VPAgrClit Masc Sg ;
+
+ oper
+ mkOrd : {s : Degree => AForm => Str} -> {s : AAgr => Str} ;
+ mkOrd x = {s = \\ag => x.s ! Posit ! AF ag.g ag.n} ;
+
+-- This is used in Spanish and Italian to bind clitics with preceding verb.
+
+ bindIf : Bool -> Str = \b -> if_then_Str b BIND [] ;
+
+ param
+ VPAgr =
+ VPAgrSubj -- elle est partie, elle s'est vue
+ | VPAgrClit Gender Number ; -- elle a dormi; elle les a vues
+
+ oper
+ VPC : Type = {
+ s : VPForm => {
+ fin : Agr => Str ; -- ai
+ inf : AAgr => Str -- dit
+ } ;
+ agr : VPAgr ; -- dit/dite dep. on verb, subj, and clitic
+ neg : Polarity => (Str * Str) ; -- ne-pas
+ clAcc : CAgr ; -- le/se
+ clDat : CAgr ; -- lui
+ clit2 : Str ; -- y en
+ comp : Agr => Str ; -- content(e) ; à ma mère ; hier
+ ext : Polarity => Str ; -- que je dors / que je dorme
+ } ;
+
+
+}
+
diff --git a/old-lib/resource/romance/ConjunctionRomance.gf b/old-lib/resource/romance/ConjunctionRomance.gf
new file mode 100644
index 000000000..894fccefa
--- /dev/null
+++ b/old-lib/resource/romance/ConjunctionRomance.gf
@@ -0,0 +1,70 @@
+incomplete concrete ConjunctionRomance of Conjunction =
+ CatRomance ** open CommonRomance, ResRomance, Coordination, Prelude in {
+
+ flags optimize=all_subs ;
+
+ lin
+
+{---b
+ ConjS conj ss = conjunctTable Mood conj ss ;
+ DConjS conj ss = conjunctDistrTable Mood conj ss ;
+
+ ConjAdv conj ss = conjunctSS conj ss ;
+ DConjAdv conj ss = conjunctDistrSS conj ss ;
+
+ ConjNP conj ss = conjunctTable NPForm conj ss ** {
+ a = {g = ss.a.g ; n = conjNumber conj.n ss.a.n ; p = ss.a.p} ;
+ hasClit = False
+ } ;
+ DConjNP conj ss = conjunctDistrTable NPForm conj ss ** {
+ a = {g = ss.a.g ; n = conjNumber conj.n ss.a.n ; p = ss.a.p} ;
+ hasClit = False
+ } ;
+
+ ConjAP conj ss = conjunctTable AForm conj ss ** {
+ isPre = ss.isPre
+ } ;
+ DConjAP conj ss = conjunctDistrTable AForm conj ss ** {
+ isPre = ss.isPre
+ } ;
+---}
+
+ ConjS conj ss = conjunctDistrTable Mood conj ss ;
+
+ ConjAdv conj ss = conjunctDistrSS conj ss ;
+
+ ConjNP conj ss = conjunctDistrTable NPForm conj ss ** {
+ a = {g = ss.a.g ; n = conjNumber conj.n ss.a.n ; p = ss.a.p} ;
+ hasClit = False
+ } ;
+ ConjAP conj ss = conjunctDistrTable AForm conj ss ** {
+ isPre = ss.isPre
+ } ;
+
+
+-- These fun's are generated from the list cat's.
+
+ BaseS = twoTable Mood ;
+ ConsS = consrTable Mood comma ;
+ BaseAdv = twoSS ;
+ ConsAdv = consrSS comma ;
+ BaseNP x y = {
+ s1 = \\c => x.s ! stressedCase c ;
+ s2 = \\c => y.s ! (conjunctCase c) ;
+ a = conjAgr x.a y.a
+ } ;
+ ConsNP x xs = {
+ s1 = \\c => x.s ! stressedCase c ++ comma ++ xs.s1 ! (conjunctCase c) ;
+ s2 = \\c => xs.s2 ! (conjunctCase c) ;
+ a = conjAgr x.a xs.a
+ } ;
+ BaseAP x y = twoTable AForm x y ** {isPre = andB x.isPre y.isPre} ;
+ ConsAP xs x = consrTable AForm comma xs x ** {isPre = andB xs.isPre x.isPre} ;
+
+ lincat
+ [S] = {s1,s2 : Mood => Str} ;
+ [Adv] = {s1,s2 : Str} ;
+ [NP] = {s1,s2 : NPForm => Str ; a : Agr} ;
+ [AP] = {s1,s2 : AForm => Str ; isPre : Bool} ;
+
+}
diff --git a/old-lib/resource/romance/DiffRomance.gf b/old-lib/resource/romance/DiffRomance.gf
new file mode 100644
index 000000000..7f43f7639
--- /dev/null
+++ b/old-lib/resource/romance/DiffRomance.gf
@@ -0,0 +1,115 @@
+--1 Differences between Romance languages
+
+interface DiffRomance = open CommonRomance, Prelude in {
+
+-- The first eight constants show the essential differences
+-- between French, Italian, and Romance syntaxes (as regards the
+-- resource API). The other constants are either derivatively
+-- dependent, or have as values strings, which are language-dependent
+-- anyway.
+
+
+--2 Constants whose definitions fundamentally depend on language
+
+-- Prepositions that fuse with the article
+-- (Fre, Spa "de", "a"; Ita also "con", "da", "in", "su).
+
+ param Prepos ;
+
+-- Which types of verbs exist, in terms of auxiliaries.
+-- (Fre, Ita "avoir", "être", and refl; Spa only "haber" and refl).
+
+ param VType ;
+
+-- Derivatively, if/when the participle agrees to the subject.
+-- (Fre "elle est partie", Ita "lei è partita", Spa not)
+
+ oper partAgr : VType -> VPAgr ;
+
+-- Whether participle agrees to foregoing clitic.
+-- (Fre "je l'ai vue", Spa "yo la he visto")
+
+ oper vpAgrClit : Agr -> VPAgr ;
+
+-- Whether a preposition is repeated in conjunction
+-- (Fre "la somme de 3 et de 4", Ita "la somma di 3 e 4").
+
+ oper conjunctCase : NPForm -> NPForm ;
+
+-- How infinitives and clitics are placed relative to each other
+-- (Fre "la voir", Ita "vederla"). The $Bool$ is used for indicating
+-- if there are any clitics.
+
+ oper clitInf : Bool -> Str -> Str -> Str ;
+
+-- To render pronominal arguments as clitics and/or ordinary complements.
+-- Returns $True$ if there are any clitics.
+
+ oper pronArg : Number -> Person -> CAgr -> CAgr -> Str * Str * Bool ;
+
+-- To render imperatives (with their clitics etc).
+
+ oper mkImperative : Bool -> Person -> VPC -> {s : Polarity => AAgr => Str} ;
+
+--2 Constants that must derivatively depend on language
+
+ param NPForm = Ton Case | Aton Case | Poss Gender Number ; --- AAgr
+
+ oper dative : Case ;
+ oper genitive : Case ;
+
+ vRefl : VType ;
+ isVRefl : VType -> Bool ;
+
+
+--2 Strings
+
+ prepCase : Case -> Str ;
+
+ partitive : Gender -> Case -> Str ;
+
+ artDef : Gender -> Number -> Case -> Str ;
+ artIndef : Gender -> Number -> Case -> Str ;
+
+-- This is the definite article in Italian, $prepCase c$ in French and Spanish.
+
+ possCase : Gender -> Number -> Case -> Str ;
+
+ auxVerb : VType -> (VF => Str) ;
+ negation : Polarity => (Str * Str) ;
+ copula : Verb ;
+
+ conjThan : Str ;
+ conjThat : Str ;
+
+ subjIf : Str ;
+
+ relPron : Bool => AAgr => Case => Str ;
+ pronSuch : AAgr => Str ;
+
+ partQIndir : Str ; -- ce, ciò
+
+ reflPron : Number -> Person -> Case -> Str ;
+-- argPron : Gender -> Number -> Person -> Case -> Str ;
+
+ auxPassive : Verb ;
+
+
+--2 Contants needed in type signatures above
+
+param
+ Case = Nom | Acc | CPrep Prepos ;
+
+oper
+ Verb = {s : VF => Str ; vtyp : VType} ;
+
+--2 Workarounds, to be eliminated
+
+-- This should be provided by $pronArg$ above, but causes trouble in compilation.
+-- (AR 16/8/2008)
+
+ oper infForm : Number -> Person -> CAgr -> CAgr -> Bool ;
+
+
+}
+
diff --git a/old-lib/resource/romance/ExtRomance.gf b/old-lib/resource/romance/ExtRomance.gf
new file mode 100644
index 000000000..a5586d715
--- /dev/null
+++ b/old-lib/resource/romance/ExtRomance.gf
@@ -0,0 +1,14 @@
+incomplete concrete ExtRomance of ExtRomanceAbs =
+ CatRomance ** open DiffRomance, ResRomance in {
+
+ lin
+ DefSgN predet noun = let g = noun.g in {
+ s = \\c => predet.s ! gennum g Sg ++ noun.s ! Sg ! Def ! caseNP c ;
+ a = agrP3 g Sg
+ } ;
+ DefPlN predet noun = let g = noun.g in {
+ s = \\c => predet.s ! Plg ++ noun.s ! Pl ! Def ! caseNP c ;
+ a = agrP3 g Sg
+ } ;
+
+}
diff --git a/old-lib/resource/romance/ExtraRomance.gf b/old-lib/resource/romance/ExtraRomance.gf
new file mode 100644
index 000000000..9bddb29f3
--- /dev/null
+++ b/old-lib/resource/romance/ExtraRomance.gf
@@ -0,0 +1,21 @@
+incomplete concrete ExtraRomance of ExtraRomanceAbs = CatRomance **
+ open
+ CommonRomance,
+ Coordination,
+ ResRomance in {
+
+ lin TPasseSimple = {s = []} ** {t = RPasse} ; --# notpresent
+
+ lincat
+ VPI = {s : Str} ;
+ [VPI] = {s1,s2 : Str} ;
+ lin
+ BaseVPI = twoSS ;
+ ConsVPI = consrSS comma ;
+
+ MkVPI vp = {s = infVP vp (agrP3 Masc Sg)} ;
+ ConjVPI = conjunctDistrSS ;
+ ComplVPIVV v vpi =
+ insertComplement (\\a => prepCase v.c2.c ++ vpi.s) (predV v) ;
+
+}
diff --git a/old-lib/resource/romance/ExtraRomanceAbs.gf b/old-lib/resource/romance/ExtraRomanceAbs.gf
new file mode 100644
index 000000000..ff5263e98
--- /dev/null
+++ b/old-lib/resource/romance/ExtraRomanceAbs.gf
@@ -0,0 +1,7 @@
+abstract ExtraRomanceAbs = Cat, Extra[
+ VPI,ListVPI,BaseVPI,ConsVPI,MkVPI,ComplVPIVV,ConjVPI,
+ VV,VP,Conj] ** {
+
+ fun TPasseSimple : Tense ; --# notpresent
+
+}
diff --git a/old-lib/resource/romance/NounRomance.gf b/old-lib/resource/romance/NounRomance.gf
new file mode 100644
index 000000000..b505cb5ca
--- /dev/null
+++ b/old-lib/resource/romance/NounRomance.gf
@@ -0,0 +1,210 @@
+incomplete concrete NounRomance of Noun =
+ CatRomance ** open CommonRomance, ResRomance, Prelude in {
+
+ flags optimize=all_subs ;
+
+ lin
+ DetCN det cn =
+ let
+ g = cn.g ;
+ n = det.n
+ in {
+ s = \\c => let cs = npform2case c in
+ det.s ! g ! cs ++ cn.s ! n ;
+ a = agrP3 g n ;
+ hasClit = False
+ } ;
+
+ UsePN = pn2np ;
+
+ UsePron p = p ;
+
+ PredetNP pred np = {
+ s = \\c => pred.s ! aagr (np.a.g) (np.a.n) ! npform2case c ++ --- subtype
+ np.s ! case2npform pred.c ;
+ a = np.a ;
+ hasClit = False
+ } ;
+
+ PPartNP np v2 = {
+ s = \\c => np.s ! c ++ v2.s ! VPart np.a.g np.a.n ;
+ a = np.a ;
+ hasClit = False
+ } ;
+
+ RelNP np rs = {
+ s = \\c => np.s ! c ++ rs.s ! Indic ! np.a ;
+ a = np.a ;
+ hasClit = False
+ } ;
+
+ AdvNP np adv = {
+ s = \\c => np.s ! c ++ adv.s ;
+ a = np.a ;
+ hasClit = False
+ } ;
+
+ DetQuantOrd quant num ord = {
+ s = \\g,c => quant.s ! num.n ! g ! c ++ num.s ! g ++
+ ord.s ! aagr g num.n ;
+ n = num.n
+ } ;
+
+ DetQuant quant num = {
+ s = \\g,c => quant.s ! num.n ! g ! c ++ num.s ! g ;
+ n = num.n
+ } ;
+
+{---b
+ DetSg quant ord = {
+ s = \\g,c => quant.s ! False ! Sg ! g ! c ++ ord.s ! aagr g Sg ;
+ n = Sg
+ } ;
+ DetPl quant num ord = {
+ s = \\g,c => quant.s ! num.isNum ! num.n ! g ! c ++ num.s ! g ++
+ ord.s ! aagr g Pl ;
+ n = num.n
+ } ;
+-}
+
+ DetNP det =
+ let
+ g = Masc ; ---- Fem in Extra
+ n = det.n
+ in {
+ s = \\c => let cs = npform2case c in
+ det.s ! g ! cs ;
+ a = agrP3 g n ;
+ hasClit = False
+ } ;
+
+ PossPron p = {
+ s = \\n,g,c => possCase g n c ++ p.s ! Poss g n ---- il mio!
+ } ;
+
+ NumSg = {s = \\_ => [] ; isNum = False ; n = Sg} ;
+ NumPl = {s = \\_ => [] ; isNum = False ; n = Pl} ;
+---b NoNum = {s = \\_ => [] ; isNum = False ; n = Pl} ;
+---b NoOrd = {s = \\_ => []} ;
+
+---b NumInt n = {s = \\_ => n.s ; isNum = True ; n = Pl} ;
+---b OrdInt n = {s = \\_ => n.s ++ "."} ; ---
+
+ NumCard n = n ** {isNum = True} ;
+
+ NumDigits nu = {s = \\g => nu.s ! NCard g ; n = nu.n} ;
+ OrdDigits nu = {s = \\a => nu.s ! NOrd a.g a.n} ;
+
+ NumNumeral nu = {s = \\g => nu.s ! NCard g ; n = nu.n} ;
+ OrdNumeral nu = {s = \\a => nu.s ! NOrd a.g a.n} ;
+
+ AdNum adn num = {s = \\a => adn.s ++ num.s ! a ; isNum = num.isNum ; n = num.n} ;
+
+ OrdSuperl adj = {s = \\a => adj.s ! Superl ! AF a.g a.n} ;
+
+ DetArtOrd quant num ord = {
+ s = \\g,c => quant.s ! num.isNum ! num.n ! g ! c ++ num.s ! g ++
+ ord.s ! aagr g num.n ;
+ n = num.n
+ } ;
+
+ DetArtCard quant num = {
+ s = \\g,c => quant.s ! True ! num.n ! g ! c ++ num.s ! g ;
+ n = num.n
+ } ;
+
+ DetArtSg det cn =
+ let
+ g = cn.g ;
+ n = Sg
+ in {
+ s = \\c => let cs = npform2case c in
+ det.s ! False ! n ! g ! cs ++ cn.s ! n ;
+ a = agrP3 g n ;
+ hasClit = False
+ } ;
+
+ DetArtPl det cn =
+ let
+ g = cn.g ;
+ n = Pl
+ in {
+ s = \\c => let cs = npform2case c in
+ det.s ! False ! n ! g ! cs ++ cn.s ! n ;
+ a = agrP3 g n ;
+ hasClit = False
+ } ;
+
+ DefArt = {
+ s = \\_,n,g,c => artDef g n c
+ } ;
+
+ IndefArt = {
+ s = \\b,n,g,c => if_then_Str b [] (artIndef g n c) ;
+ } ;
+
+ MassNP cn = let
+ g = cn.g ;
+ n = Sg
+ in {
+ s = \\c => partitive g (npform2case c) ++ cn.s ! n ;
+ a = agrP3 g n ;
+ hasClit = False
+ } ;
+
+{---b
+ MassDet = {
+ s = \\b,n,g,c => case <b,n> of {
+ <False,Sg> => partitive g c ;
+ _ => prepCase genitive ----
+ }
+ } ;
+-}
+
+-- This is based on record subtyping.
+
+ UseN, UseN2 = \noun -> noun ;
+---b UseN3 = \noun -> noun ;
+
+ Use2N3 f = f ;
+
+ Use3N3 f = f ** {c2 = f.c3} ;
+
+ ComplN2 f x = {
+ s = \\n => f.s ! n ++ appCompl f.c2 x.s ;
+ g = f.g ;
+ } ;
+
+ ComplN3 f x = {
+ s = \\n => f.s ! n ++ appCompl f.c2 x.s ;
+ g = f.g ;
+ c2 = f.c3
+ } ;
+
+ AdjCN ap cn =
+ let
+ g = cn.g
+ in {
+ s = \\n => preOrPost ap.isPre (ap.s ! (AF g n)) (cn.s ! n) ;
+ g = g ;
+ } ;
+
+ RelCN cn rs = let g = cn.g in {
+ s = \\n => cn.s ! n ++ rs.s ! Indic ! agrP3 g n ; --- mood
+ g = g
+ } ;
+ SentCN cn sc = let g = cn.g in {
+ s = \\n => cn.s ! n ++ sc.s ;
+ g = g
+ } ;
+ AdvCN cn sc = let g = cn.g in {
+ s = \\n => cn.s ! n ++ sc.s ;
+ g = g
+ } ;
+
+ ApposCN cn np = let g = cn.g in {
+ s = \\n => cn.s ! n ++ np.s ! Ton Nom ;
+ g = g
+ } ;
+
+}
diff --git a/old-lib/resource/romance/PhraseRomance.gf b/old-lib/resource/romance/PhraseRomance.gf
new file mode 100644
index 000000000..4de6b28e5
--- /dev/null
+++ b/old-lib/resource/romance/PhraseRomance.gf
@@ -0,0 +1,27 @@
+incomplete concrete PhraseRomance of Phrase =
+ CatRomance ** open CommonRomance, ResRomance, Prelude in {
+
+ flags optimize = all_subs ;
+
+ lin
+ PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
+
+ UttS s = {s = s.s ! Indic} ;
+ UttQS qs = {s = qs.s ! QDir} ;
+ UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg False ! Fem} ;
+ UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Pl False ! Fem} ;
+ UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg True ! Fem} ;
+
+ UttIP ip = {s = ip.s ! Nom} ; --- Acc also
+ UttIAdv iadv = iadv ;
+ UttNP np = {s = np.s ! Ton Nom} ;
+ UttVP vp = {s = infVP vp (agrP3 Fem Sg)} ; --- Agr
+ UttAdv adv = adv ;
+
+ NoPConj = {s = []} ;
+ PConjConj conj = {s = conj.s2} ;
+
+ NoVoc = {s = []} ;
+ VocNP np = {s = "," ++ np.s ! Ton Nom} ;
+
+}
diff --git a/old-lib/resource/romance/QuestionRomance.gf b/old-lib/resource/romance/QuestionRomance.gf
new file mode 100644
index 000000000..6d2fa8669
--- /dev/null
+++ b/old-lib/resource/romance/QuestionRomance.gf
@@ -0,0 +1,113 @@
+incomplete concrete QuestionRomance of Question =
+ CatRomance ** open CommonRomance, ResRomance, Prelude in {
+
+ flags optimize=all_subs ;
+
+ lin
+
+ QuestCl cl = {
+ s = \\t,a,p =>
+ let cls = cl.s ! DDir ! t ! a ! p ---- DInv?
+ in table {
+ QDir => cls ! Indic ;
+ QIndir => subjIf ++ cls ! Indic
+ }
+ } ;
+
+ QuestVP qp vp = {
+ s = \\t,a,b,_ =>
+ let
+ cl = mkClause (qp.s ! Nom) False (agrP3 qp.a.g qp.a.n) vp
+ in
+ cl.s ! DDir ! t ! a ! b ! Indic
+ } ;
+
+ QuestSlash ip slash = {
+ s = \\t,a,p =>
+ let
+ cls : Direct -> Str =
+ \d -> slash.s ! ip.a ! d ! t ! a ! p ! Indic ;
+ who = slash.c2.s ++ ip.s ! slash.c2.c
+ in table {
+ QDir => who ++ cls DInv ;
+ QIndir => who ++ cls DDir
+ }
+ } ;
+
+ QuestIAdv iadv cl = {
+ s = \\t,a,p,q =>
+ let
+ ord = case q of {
+ QDir => DInv ;
+ QIndir => DDir
+ } ;
+ cls = cl.s ! ord ! t ! a ! p ! Indic ;
+ why = iadv.s
+ in why ++ cls
+ } ;
+
+ QuestIComp icomp np = {
+ s = \\t,a,p,_ =>
+ let
+ vp = predV copula ;
+ cls = (mkClause (np.s ! Aton Nom) np.hasClit np.a vp).s !
+ DInv ! t ! a ! p ! Indic ;
+ why = icomp.s ! {g = np.a.g ; n = np.a.n}
+ in why ++ cls
+ } ;
+
+ PrepIP p ip = {
+ s = p.s ++ ip.s ! p.c
+ } ;
+
+ AdvIP ip adv = {
+ s = \\c => ip.s ! c ++ adv.s ;
+ a = ip.a
+ } ;
+
+ IdetCN idet cn =
+ let
+ g = cn.g ;
+ n = idet.n ;
+ a = aagr g n
+ in {
+ s = \\c => idet.s ! g ! c ++ cn.s ! n ;
+ a = a
+ } ;
+
+ IdetIP idet =
+ let
+ g = Masc ; ---- Fem in Extra
+ n = idet.n ;
+ a = aagr g n
+ in {
+ s = \\c => idet.s ! g ! c ;
+ a = a
+ } ;
+
+ IdetQuant idet num =
+ let
+ n = num.n ;
+ in {
+ s = \\g,c => idet.s ! n ! g ! c ++ num.s ! g ;
+ n = n
+ } ;
+
+
+ CompIAdv a = {s = \\_ => a.s} ;
+
+ CompIP p = {s = \\_ => p.s ! Nom} ;
+
+}
+
+{- ---b
+ IDetCN idet num ord cn =
+ let
+ g = cn.g ;
+ n = idet.n ;
+ a = aagr g n
+ in {
+ s = \\c => idet.s ! g ! c ++ num.s ! g ++ ord.s ! a ++ cn.s ! n ;
+ a = a
+ } ;
+-}
diff --git a/old-lib/resource/romance/RelativeRomance.gf b/old-lib/resource/romance/RelativeRomance.gf
new file mode 100644
index 000000000..40b83c1b3
--- /dev/null
+++ b/old-lib/resource/romance/RelativeRomance.gf
@@ -0,0 +1,50 @@
+incomplete concrete RelativeRomance of Relative =
+ CatRomance ** open Prelude, CommonRomance, ResRomance in {
+
+ flags optimize=all_subs ;
+
+ lin
+
+ RelCl cl = {
+ s = \\ag,t,a,p,m => pronSuch ! ag ++ conjThat ++
+ cl.s ! DDir ! t ! a ! p ! m ;
+ c = Nom
+ } ;
+
+ --- more efficient to compile than case inside mkClause; see log.txt
+ RelVP rp vp = case rp.hasAgr of {
+ True => {s = \\ag =>
+ (mkClause
+ (rp.s ! False ! {g = ag.g ; n = ag.n} ! Nom) False
+ {g = rp.a.g ; n = rp.a.n ; p = P3}
+ vp).s ! DDir ; c = Nom} ;
+ False => {s = \\ag =>
+ (mkClause
+ (rp.s ! False ! {g = ag.g ; n = ag.n} ! Nom) False
+ ag
+ vp).s ! DDir ; c = Nom
+ }
+ } ;
+
+ RelSlash rp slash = {
+ s = \\ag,t,a,p,m =>
+ let aag = {g = ag.g ; n = ag.n}
+ in
+ slash.c2.s ++
+ rp.s ! False ! aag ! slash.c2.c ++
+ slash.s ! aag ! DDir ! t ! a ! p ! m ; --- ragr
+ c = Acc
+ } ;
+
+ FunRP p np rp = {
+ s = \\_,a,c => np.s ! Ton Nom ++ p.s ++ rp.s ! True ! a ! p.c ;
+ a = {g = np.a.g ; n = np.a.n} ;
+ hasAgr = True
+ } ;
+ IdRP = {
+ s = relPron ;
+ a = {g = Masc ; n = Sg} ;
+ hasAgr = False
+ } ;
+
+}
diff --git a/old-lib/resource/romance/ResRomance.gf b/old-lib/resource/romance/ResRomance.gf
new file mode 100644
index 000000000..73ec6c8db
--- /dev/null
+++ b/old-lib/resource/romance/ResRomance.gf
@@ -0,0 +1,299 @@
+--1 Romance auxiliary operations.
+--
+
+interface ResRomance = DiffRomance ** open CommonRomance, Prelude in {
+
+flags optimize=all ;
+
+--2 Constants uniformly defined in terms of language-dependent constants
+
+oper
+
+ nominative : Case = Nom ;
+ accusative : Case = Acc ;
+
+ Pronoun = {s : NPForm => Str ; a : Agr ; hasClit : Bool} ;
+
+ Compl : Type = {s : Str ; c : Case ; isDir : Bool} ;
+
+ complAcc : Compl = {s = [] ; c = accusative ; isDir = True} ;
+ complGen : Compl = {s = [] ; c = genitive ; isDir = False} ;
+ complDat : Compl = {s = [] ; c = dative ; isDir = True} ;
+
+ pn2np : {s : Str ; g : Gender} -> Pronoun = \pn -> {
+ s = \\c => prepCase (npform2case c) ++ pn.s ;
+ a = agrP3 pn.g Sg ;
+ hasClit = False
+ } ;
+
+ npform2case : NPForm -> Case = \p -> case p of {
+ Ton x => x ;
+ Poss _ _ => genitive ;
+ Aton x => x
+ } ;
+
+ case2npform : Case -> NPForm = \c -> case c of {
+ Nom => Ton Nom ;
+ Acc => Ton Acc ;
+ _ => Ton c
+ } ;
+
+-- Pronouns in $NP$ lists are always in stressed forms.
+
+ stressedCase : NPForm -> NPForm = \c -> case c of {
+ Aton k => Ton k ;
+ _ => c
+ } ;
+
+ appCompl : Compl -> (NPForm => Str) -> Str = \comp,np ->
+ comp.s ++ np ! Ton comp.c ;
+
+ oper
+
+ VP : Type = {
+ s : Verb ;
+ agr : VPAgr ; -- dit/dite dep. on verb, subj, and clitic
+ neg : Polarity => (Str * Str) ; -- ne-pas
+ clAcc : CAgr ; -- le/se
+ clDat : CAgr ; -- lui
+ clit2 : Str ; -- y en
+ comp : Agr => Str ; -- content(e) ; à ma mère ; hier
+ ext : Polarity => Str ; -- que je dors / que je dorme
+ } ;
+
+
+ useVP : VP -> VPC = \vp ->
+ let
+ verb = vp.s ;
+ vfin : TMood -> Agr -> Str = \tm,a -> verb.s ! VFin tm a.n a.p ;
+ vpart : AAgr -> Str = \a -> verb.s ! VPart a.g a.n ;
+ vinf : Bool -> Str = \b -> verb.s ! VInfin b ;
+ vger = verb.s ! VGer ;
+
+ typ = verb.vtyp ;
+ aux = auxVerb typ ;
+
+ habet : TMood -> Agr -> Str = \tm,a -> aux ! VFin tm a.n a.p ;
+ habere : Str = aux ! VInfin False ;
+
+ vimp : Agr -> Str = \a -> case <a.n,a.p> of {
+ <Pl,P1> => verb.s ! VImper PlP1 ;
+ <_, P3> => verb.s ! VFin (VPres Conjunct) a.n P3 ;
+ <Sg,_> => verb.s ! VImper SgP2 ;
+ <Pl,_> => verb.s ! VImper PlP2
+ } ;
+
+ vf : (Agr -> Str) -> (AAgr -> Str) -> {
+ fin : Agr => Str ;
+ inf : AAgr => Str
+ } =
+ \fin,inf -> {
+ fin = \\a => fin a ;
+ inf = \\a => inf a
+ } ;
+
+ in {
+ s = table {
+ VPFinite t Simul => vf (vfin t) (\_ -> []) ;
+ VPFinite t Anter => vf (habet t) vpart ; --# notpresent
+ VPInfinit Anter b=> vf (\_ -> []) (\a -> habere ++ vpart a) ; --# notpresent
+ VPImperat => vf vimp (\_ -> []) ;
+ VPGerund => vf (\_ -> []) (\_ -> vger) ;
+ VPInfinit Simul b=> vf (\_ -> []) (\_ -> vinf b)
+ } ;
+ agr = vp.agr ; -- partAgr typ ;
+ neg = vp.neg ; -- negation ;
+ clAcc = vp.clAcc ; -- case isVRefl typ of {
+ -- True => CRefl ;
+ -- _ => CNone
+ -- } ;
+ clDat = vp.clDat ; -- CNone ; --- no dative refls
+ clit2 = vp.clit2 ; -- [] ;
+ comp = vp.comp ; -- \\a => [] ;
+ ext = vp.ext -- \\p => []
+ } ;
+
+ predV : Verb -> VP = \verb ->
+ let
+ typ = verb.vtyp ;
+ in {
+ s = {s = verb.s ; vtyp = typ} ;
+ agr = partAgr typ ;
+ neg = negation ;
+ clAcc = case isVRefl typ of {
+ True => CRefl ;
+ _ => CNone
+ } ;
+ clDat = CNone ; --- no dative refls
+ clit2 = [] ;
+ comp = \\a => [] ;
+ ext = \\p => []
+ } ;
+
+ insertObject : Compl -> Pronoun -> VP -> VP = \c,np,vp ->
+ let
+ vpacc = vp.clAcc ;
+ vpdat = vp.clDat ;
+ vpagr = vp.agr ;
+ npa = np.a ;
+ cpron = CPron npa.g npa.n npa.p ;
+ noNewClit = <vpacc, vpdat, appCompl c np.s, vpagr> ;
+
+ cc : CAgr * CAgr * Str * VPAgr = case <np.hasClit,c.isDir> of {
+ <True,True> => case c.c of {
+ Acc => <cpron, vpdat, [], vpAgrClit npa> ;
+ _ => <vpacc, cpron, [], vpagr> -- must be dat
+ } ;
+ _ => noNewClit
+ } ;
+
+ in {
+ s = vp.s ;
+ agr = cc.p4 ;
+ clAcc = cc.p1 ;
+ clDat = cc.p2 ;
+ clit2 = vp.clit2 ;
+ neg = vp.neg ;
+ comp = \\a => cc.p3 ++ vp.comp ! a ;
+ ext = vp.ext ;
+ } ;
+
+ insertComplement : (Agr => Str) -> VP -> VP = \co,vp -> {
+ s = vp.s ;
+ agr = vp.agr ;
+ clAcc = vp.clAcc ;
+ clDat = vp.clDat ;
+ clit2 = vp.clit2 ;
+ neg = vp.neg ;
+ comp = \\a => vp.comp ! a ++ co ! a ;
+ ext = vp.ext ;
+ } ;
+
+
+-- Agreement with preceding relative or interrogative:
+-- "les femmes que j'ai aimées"
+
+ insertAgr : AAgr -> VP -> VP = \ag,vp -> {
+ s = vp.s ;
+ agr = vpAgrClit (agrP3 ag.g ag.n) ;
+ clAcc = vp.clAcc ;
+ clDat = vp.clDat ;
+ clit2 = vp.clit2 ;
+ neg = vp.neg ;
+ comp = vp.comp ;
+ ext = vp.ext ;
+ } ;
+
+ insertRefl : VP -> VP = \vp -> {
+ s = {s = vp.s.s ; vtyp = vRefl} ;
+ agr = vp.agr ;
+ clAcc = CRefl ;
+ clDat = vp.clDat ;
+ clit2 = vp.clit2 ;
+ neg = vp.neg ;
+ comp = vp.comp ;
+ ext = vp.ext ;
+ } ;
+
+ insertAdv : Str -> VP -> VP = \co,vp -> {
+ s = vp.s ;
+ agr = vp.agr ;
+ clAcc = vp.clAcc ;
+ clDat = vp.clDat ;
+ clit2 = vp.clit2 ;
+ neg = vp.neg ;
+ comp = \\a => vp.comp ! a ++ co ;
+ ext = vp.ext ;
+ } ;
+
+ insertAdV : Str -> VP -> VP = \co,vp -> {
+ s = vp.s ;
+ agr = vp.agr ;
+ clAcc = vp.clAcc ;
+ clDat = vp.clDat ;
+ clit2 = vp.clit2 ;
+ neg = \\b => let vpn = vp.neg ! b in {p1 = vpn.p1 ; p2 = vpn.p2 ++ co} ;
+ comp = vp.comp ;
+ ext = vp.ext ;
+ } ;
+
+ insertClit2 : Str -> VP -> VP = \co,vp -> {
+ s = vp.s ;
+ agr = vp.agr ;
+ clAcc = vp.clAcc ;
+ clDat = vp.clDat ;
+ clit2 = vp.clit2 ++ co ; ---- y en
+ neg = vp.neg ;
+ comp = vp.comp ;
+ ext = vp.ext ;
+ } ;
+
+ insertExtrapos : (Polarity => Str) -> VP -> VP = \co,vp -> {
+ s = vp.s ;
+ agr = vp.agr ;
+ clAcc = vp.clAcc ;
+ clDat = vp.clDat ;
+ clit2 = vp.clit2 ;
+ neg = vp.neg ;
+ comp = vp.comp ;
+ ext = \\p => vp.ext ! p ++ co ! p ;
+ } ;
+
+ mkVPSlash : Compl -> VP -> VP ** {c2 : Compl} = \c,vp -> vp ** {c2 = c} ;
+
+ mkClause : Str -> Bool -> Agr -> VP ->
+ {s : Direct => RTense => Anteriority => Polarity => Mood => Str} =
+ \subj,hasClit,agr,vpr -> {
+ s = \\d,t,a,b,m =>
+ let
+ tm = case t of {
+ RPast => VImperf m ; --# notpresent
+ RFut => VFut ; --# notpresent
+ RCond => VCondit ; --# notpresent
+ RPasse => VPasse ; --# notpresent
+ RPres => VPres m
+ } ;
+ vp = useVP vpr ;
+ vps = vp.s ! VPFinite tm a ;
+ verb = vps.fin ! agr ;
+ inf = vps.inf ! (appVPAgr vp.agr (aagr agr.g agr.n)) ; --- subtype bug
+ neg = vp.neg ! b ;
+ clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
+ compl = clpr.p2 ++ vp.comp ! agr ++ vp.ext ! b
+ in
+ case d of {
+ DDir =>
+ subj ++ neg.p1 ++ clpr.p1 ++ vp.clit2 ++ verb ++ neg.p2 ++ inf ;
+ DInv =>
+ neg.p1 ++ clpr.p1 ++ vp.clit2 ++ verb ++
+ preOrPost hasClit subj (neg.p2 ++ inf)
+ }
+ ++ compl
+ } ;
+--- in French, pronouns should
+--- have a "-" with possibly a special verb form with "t":
+--- "comment fera-t-il" vs. "comment fera Pierre"
+
+ infVP : VP -> Agr -> Str = \vpr,agr ->
+ let
+ vp = useVP vpr ;
+ clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
+ iform = infForm agr.n agr.p vp.clAcc vp.clDat ;
+ inf = (vp.s ! VPInfinit Simul iform).inf ! (aagr agr.g agr.n) ;
+ neg = vp.neg ! Pos ; --- Neg not in API
+ obj = neg.p2 ++ clpr.p2 ++ vp.comp ! agr ++ vp.ext ! Pos ---- pol
+ in
+ clitInf clpr.p3 (clpr.p1 ++ vp.clit2) inf ++ obj ;
+
+}
+
+-- insertObject:
+-- p -cat=Cl -tr "la femme te l' envoie"
+-- PredVP (DetCN (DetSg DefSg NoOrd) (UseN woman_N))
+-- (ComplV3 send_V3 (UsePron he_Pron) (UsePron thou_Pron))
+-- la femme te l' a envoyé
+--
+-- p -cat=Cl -tr "la femme te lui envoie"
+-- PredVP (DetCN (DetSg DefSg NoOrd) (UseN woman_N))
+-- (ComplV3 send_V3 (UsePron thou_Pron) (UsePron he_Pron))
+-- la femme te lui a envoyée
diff --git a/old-lib/resource/romance/SentenceRomance.gf b/old-lib/resource/romance/SentenceRomance.gf
new file mode 100644
index 000000000..66b9ed8dd
--- /dev/null
+++ b/old-lib/resource/romance/SentenceRomance.gf
@@ -0,0 +1,94 @@
+incomplete concrete SentenceRomance of Sentence =
+ CatRomance ** open Prelude, CommonRomance, ResRomance in {
+
+ flags optimize=all_subs ;
+
+ lin
+ PredVP np vp = mkClause (np.s ! Aton Nom) np.hasClit np.a vp ;
+
+ PredSCVP sc vp = mkClause sc.s False (agrP3 Masc Sg) vp ;
+
+ ImpVP vpr = let vp = useVP vpr in {
+ s = \\p,i,g => case i of {
+ ImpF n b => (mkImperative b P2 vp).s ! p ! (aagr g n)
+ }
+ } ;
+
+ SlashVP np v2 =
+ -- agreement decided afterwards: la fille qu'il a trouvée
+ {s = \\ag =>
+ let vp = case <v2.c2.c, v2.c2.isDir> of {
+ <Acc,True> => insertAgr ag v2 ;
+ _ => v2
+ }
+ in (mkClause (np.s ! Aton Nom) np.hasClit np.a vp).s ;
+ c2 = v2.c2
+ } ;
+
+{---b
+ SlashV2 np v2 =
+ {s = \\d,ag =>case <v2.c2.c,v2.c2.isDir> of {
+ <Acc,True> =>
+ (mkClause (np.s ! Aton Nom) np.hasClit np.a
+ (insertAgr ag (predV v2))).s ! d ;
+ _ => (mkClause (np.s ! Aton Nom) np.hasClit np.a (predV v2)).s ! d
+ } ;
+ c2 = v2.c2
+ } ;
+
+ SlashVVV2 np vv v2 =
+ {s = \\d,_ =>
+ (mkClause
+ (np.s ! Aton Nom) np.hasClit np.a
+ (insertComplement
+ (\\a => prepCase vv.c2.c ++ v2.s ! VInfin False) (predV vv))).s ! d;
+ c2 = v2.c2
+ } ;
+-}
+ AdvSlash slash adv = {
+ s = \\ag,d,t,a,b,m => slash.s ! ag ! d ! t ! a ! b ! m ++ adv.s ;
+ c2 = slash.c2
+ } ;
+
+ SlashPrep cl prep = {
+ s = \\_ => cl.s ;
+ c2 = {s = prep.s ; c = prep.c ; isDir = False}
+ } ;
+
+ SlashVS np vs slash =
+ {s = \\ag =>
+ (mkClause
+ (np.s ! Aton Nom) np.hasClit np.a
+ (insertExtrapos (\\b => conjThat ++ slash.s ! ag ! (vs.m ! b))
+ (predV vs))
+ ).s ;
+ c2 = slash.c2
+ } ;
+
+ EmbedS s = {s = conjThat ++ s.s ! Indic} ; --- mood
+ EmbedQS qs = {s = qs.s ! QIndir} ;
+ EmbedVP vp = {s = infVP vp (agrP3 Masc Sg)} ; --- agr ---- compl
+
+ UseCl t a p cl = {
+ s = \\o => t.s ++ a.s ++ p.s ++ cl.s ! DDir ! t.t ! a.a ! p.p ! o
+ } ;
+ UseQCl t a p cl = {
+ s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! q
+ } ;
+ UseRCl t a p cl = {
+ s = \\r,ag => t.s ++ a.s ++ p.s ++ cl.s ! ag ! t.t ! a.a ! p.p ! r ;
+ c = cl.c
+ } ;
+ UseSlash t a p cl = {
+ s = \\ag,mo =>
+ t.s ++ a.s ++ p.s ++ cl.s ! ag ! DDir ! t.t ! a.a ! p.p ! mo ;
+ c2 = cl.c2
+ } ;
+
+ AdvS a s = {s = \\o => a.s ++ "," ++ s.s ! o} ;
+
+ RelS s r = {
+ s = \\o => s.s ! o ++ "," ++ partQIndir ++ r.s ! Indic ! agrP3 Masc Sg
+ } ;
+
+}
diff --git a/old-lib/resource/romance/VerbRomance.gf b/old-lib/resource/romance/VerbRomance.gf
new file mode 100644
index 000000000..96992bd35
--- /dev/null
+++ b/old-lib/resource/romance/VerbRomance.gf
@@ -0,0 +1,119 @@
+incomplete concrete VerbRomance of Verb =
+ CatRomance ** open Prelude, CommonRomance, ResRomance in {
+
+ flags optimize=all_subs ;
+
+ lin
+ UseV = predV ;
+
+ ComplVV v vp =
+ insertComplement (\\a => prepCase v.c2.c ++ infVP vp a) (predV v) ;
+ ComplVS v s = insertExtrapos (\\b => conjThat ++ s.s ! (v.m ! b)) (predV v) ;
+ ComplVQ v q = insertExtrapos (\\_ => q.s ! QIndir) (predV v) ;
+ ComplVA v ap =
+ insertComplement (\\a => ap.s ! AF a.g a.n) (predV v) ;
+
+ SlashV2a v = mkVPSlash v.c2 (predV v) ;
+
+ Slash2V3 v np = mkVPSlash v.c3 (insertObject v.c2 np (predV v)) ;
+ Slash3V3 v np = mkVPSlash v.c2 (insertObject v.c3 np (predV v)) ;
+
+ SlashV2V v vp =
+ mkVPSlash v.c2
+ (insertComplement
+ (\\a => prepCase v.c2.c ++ infVP vp a)
+ (predV v)) ;
+
+ SlashV2S v s =
+ mkVPSlash v.c2
+ (insertExtrapos
+ (\\b => conjThat ++ s.s ! Indic) ---- mood
+ (predV v)) ;
+
+ SlashV2Q v q =
+ mkVPSlash v.c2
+ (insertExtrapos
+ (\\_ => q.s ! QIndir)
+ (predV v)) ;
+
+ {- ---- lincat should be fixed
+ SlashV2A v ap =
+
+ let af = case v.c3.isDir of {
+ True => AF np.a.g np.a.n ; -- ... bleues
+ _ => AF Masc Sg -- il les peint en bleu
+ }
+ -}
+
+ SlashV2A v ap =
+ let af = AF Masc Sg
+ in
+ mkVPSlash v.c2
+ (insertComplement
+ (\\_ => v.c3.s ++ prepCase v.c3.c ++ ap.s ! af)
+ (predV v)) ;
+
+ ComplSlash vp np = insertObject vp.c2 np vp ;
+
+ ReflVP v = case v.c2.isDir of {
+ True => insertRefl v ;
+ False => insertComplement
+ (\\a => v.c2.s ++ reflPron a.n a.p v.c2.c) v
+ } ;
+
+ SlashVV v vp =
+ mkVPSlash vp.c2
+ (insertComplement (\\a => prepCase v.c2.c ++ infVP vp a) (predV v)) ;
+
+ SlashV2VNP v np vp =
+ mkVPSlash vp.c2
+ (insertComplement
+ (\\a => prepCase v.c2.c ++ infVP vp a)
+ (insertObject v.c2 np (predV v))) ;
+
+ UseComp comp = insertComplement comp.s (predV copula) ;
+
+ CompAP ap = {s = \\ag => ap.s ! AF ag.g ag.n} ;
+ CompNP np = {s = \\_ => np.s ! Ton Acc} ;
+ CompAdv a = {s = \\_ => a.s} ;
+
+ AdvVP vp adv = insertAdv adv.s vp ;
+ AdVVP adv vp = insertAdV adv.s vp ;
+
+ PassV2 v = insertComplement (\\a => v.s ! VPart a.g a.n) (predV auxPassive) ;
+
+}
+
+{---b
+ ComplV2 v np1 = insertObject v.c2 np1 (predV v) ;
+ ComplV3 v np1 np2 = insertObject v.c3 np2 (insertObject v.c2 np1 (predV v)) ;
+
+ ComplV2V v np vp =
+ insertComplement (\\a => prepCase v.c2.c ++ infVP vp a)
+ (insertObject v.c2 np (predV v)) ;
+ ComplV2S v np s =
+ insertExtrapos (\\b => s.s ! Indic) ---- mood
+ (insertObject v.c2 np (predV v)) ;
+ ComplV2Q v np q =
+ insertExtrapos (\\_ => q.s ! QIndir)
+ (insertObject v.c2 np (predV v)) ;
+
+ ComplV2A v np ap =
+ let af = case v.c3.isDir of {
+ True => AF np.a.g np.a.n ; -- ... bleues
+ _ => AF Masc Sg -- il les peint en bleu
+ }
+ in
+ insertComplement
+ (\\a => v.c3.s ++ prepCase v.c3.c ++ ap.s ! af)
+ (insertObject v.c2 np (predV v)) ;
+
+ ReflV2 v = case v.c2.isDir of {
+ True => predV {s = v.s ; vtyp = vRefl} ;
+ False => insertComplement
+ (\\a => v.c2.s ++ reflPron a.n a.p v.c2.c) (predV v)
+ } ;
+
+ UseVS, UseVQ = \vv -> {s = vv.s ; c2 = complAcc ; vtyp = vv.vtyp} ;
+-}
+