diff options
Diffstat (limited to 'deprecated/old-lib/resource/mathematical')
47 files changed, 820 insertions, 0 deletions
diff --git a/deprecated/old-lib/resource/mathematical/Mathematical.gf b/deprecated/old-lib/resource/mathematical/Mathematical.gf new file mode 100644 index 000000000..65afef3b1 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/Mathematical.gf @@ -0,0 +1,31 @@ +--1 The Mathematics API to the Resource Grammar + +-- This grammar is a collection of the different modules. +-- It differs from $Lang$ in two main ways: +-- - the combinations in Noun, Verb, Adjective, Adverb, Sentence are not included +-- - instead, Symbol and Predication are used +-- +-- +-- In practice, the most important difference is that only present-tense sentences +-- are included, and that symbolic expressions are recognized as NPs. + +abstract Mathematical = + Noun - [ComplN2], --- to avoid ambiguity +-- Verb, + Adjective, + Adverb, + Numeral, +-- Sentence, + Question, + Relative, + Conjunction, + Phrase, + Text, + Idiom, + Structural, + + Symbol, + Predication, + + Lexicon + ** {} ; diff --git a/deprecated/old-lib/resource/mathematical/MathematicalCat.gf b/deprecated/old-lib/resource/mathematical/MathematicalCat.gf new file mode 100644 index 000000000..36d6985f1 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/MathematicalCat.gf @@ -0,0 +1,26 @@ +--# -path=.:present:prelude + +concrete MathematicalCat of Mathematical = + NounCat - [ComplN2], --- to avoid ambiguity +-- VerbCat, + AdjectiveCat, + AdverbCat, + NumeralCat, +-- SentenceCat, + QuestionCat, + RelativeCat, + ConjunctionCat, + PhraseCat, + TextX - [Tense,TPres,TPast,TFut,TCond], + IdiomCat, + StructuralCat, + + SymbolCat, + PredicationCat, -- - [predV3,predV2], --- gf bug + + LexiconCat + ** { + +flags startcat = Phr ; + +} ; diff --git a/deprecated/old-lib/resource/mathematical/MathematicalDan.gf b/deprecated/old-lib/resource/mathematical/MathematicalDan.gf new file mode 100644 index 000000000..7d8785b12 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/MathematicalDan.gf @@ -0,0 +1,27 @@ +--# -path=.:present:prelude + +concrete MathematicalDan of Mathematical = + NounDan - [ComplN2], --- to avoid ambiguity +-- VerbDan, + AdjectiveDan, + AdverbDan, + NumeralDan, +-- SentenceDan, + QuestionDan, + RelativeDan, + ConjunctionDan, + PhraseDan, + TextX, + IdiomDan, + + StructuralDan, + + SymbolDan, + PredicationDan, + + LexiconDan + ** { + +flags startcat = Phr ; + +} ; diff --git a/deprecated/old-lib/resource/mathematical/MathematicalEng.gf b/deprecated/old-lib/resource/mathematical/MathematicalEng.gf new file mode 100644 index 000000000..9042a3eb9 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/MathematicalEng.gf @@ -0,0 +1,26 @@ +--# -path=.:present:prelude + +concrete MathematicalEng of Mathematical = + NounEng - [ComplN2], --- to avoid ambiguity +-- VerbEng, + AdjectiveEng, + AdverbEng, + NumeralEng, +-- SentenceEng, + QuestionEng, + RelativeEng, + ConjunctionEng, + PhraseEng, + StructuralEng, + TextX, + IdiomEng, + + SymbolEng, + PredicationEng, + + LexiconEng + ** { + +flags startcat = Phr ; + +} ; diff --git a/deprecated/old-lib/resource/mathematical/MathematicalFin.gf b/deprecated/old-lib/resource/mathematical/MathematicalFin.gf new file mode 100644 index 000000000..26704d6e3 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/MathematicalFin.gf @@ -0,0 +1,26 @@ +--# -path=.:present:prelude + +concrete MathematicalFin of Mathematical = + NounFin - [ComplN2], --- to avoid ambiguity +-- VerbFin, + AdjectiveFin, + AdverbFin, + NumeralFin, +-- SentenceFin, + QuestionFin, + RelativeFin, + ConjunctionFin, + PhraseFin, + TextX, + IdiomFin, + StructuralFin, + + SymbolFin, + PredicationFin, + + LexiconFin + ** { + +flags startcat = Phr ; + +} ; diff --git a/deprecated/old-lib/resource/mathematical/MathematicalFre.gf b/deprecated/old-lib/resource/mathematical/MathematicalFre.gf new file mode 100644 index 000000000..65eb6a9b5 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/MathematicalFre.gf @@ -0,0 +1,26 @@ +--# -path=.:present:prelude + +concrete MathematicalFre of Mathematical = + NounFre - [ComplN2], --- to avoid ambiguity +-- VerbFre, + AdjectiveFre, + AdverbFre, + NumeralFre, +-- SentenceFre, + QuestionFre, + RelativeFre, + ConjunctionFre, + PhraseFre, + TextX - [Tense,TPres,TPast,TFut,TCond], + IdiomFre, + StructuralFre, + + SymbolFre, + PredicationFre - [predV3], ---- gf bug + + LexiconFre + ** { + +flags startcat = Phr ; + +} ; diff --git a/deprecated/old-lib/resource/mathematical/MathematicalGer.gf b/deprecated/old-lib/resource/mathematical/MathematicalGer.gf new file mode 100644 index 000000000..0d9eb45b5 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/MathematicalGer.gf @@ -0,0 +1,26 @@ +--# -path=.:present:prelude + +concrete MathematicalGer of Mathematical = + NounGer - [ComplN2], --- to avoid ambiguity +-- VerbGer, + AdjectiveGer, + AdverbGer, + NumeralGer, +-- SentenceGer, + QuestionGer, + RelativeGer, + ConjunctionGer, + PhraseGer, + TextX - [Tense,TPres], + IdiomGer, + StructuralGer, + + SymbolGer, + PredicationGer, + + LexiconGer + ** { + +flags startcat = Phr ; + +} ; diff --git a/deprecated/old-lib/resource/mathematical/MathematicalIta.gf b/deprecated/old-lib/resource/mathematical/MathematicalIta.gf new file mode 100644 index 000000000..0591ef6c6 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/MathematicalIta.gf @@ -0,0 +1,26 @@ +--# -path=.:present:prelude + +concrete MathematicalIta of Mathematical = + NounIta - [ComplN2], --- to avoid ambiguity +-- VerbIta, + AdjectiveIta, + AdverbIta, + NumeralIta, +-- SentenceIta, + QuestionIta, + RelativeIta, + ConjunctionIta, + PhraseIta, + TextX - [Tense,TPres,TPast,TFut,TCond], + IdiomIta, + StructuralIta, + + SymbolIta, + PredicationIta, -- - [predV3,predV2], --- gf bug + + LexiconIta + ** { + +flags startcat = Phr ; + +} ; diff --git a/deprecated/old-lib/resource/mathematical/MathematicalNor.gf b/deprecated/old-lib/resource/mathematical/MathematicalNor.gf new file mode 100644 index 000000000..383ced6eb --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/MathematicalNor.gf @@ -0,0 +1,27 @@ +--# -path=.:present:prelude + +concrete MathematicalNor of Mathematical = + NounNor - [ComplN2], --- to avoid ambiguity +-- VerbNor, + AdjectiveNor, + AdverbNor, + NumeralNor, +-- SentenceNor, + QuestionNor, + RelativeNor, + ConjunctionNor, + PhraseNor, + TextX, + IdiomNor, + + StructuralNor, + + SymbolNor, + PredicationNor, + + LexiconNor + ** { + +flags startcat = Phr ; + +} ; diff --git a/deprecated/old-lib/resource/mathematical/MathematicalSpa.gf b/deprecated/old-lib/resource/mathematical/MathematicalSpa.gf new file mode 100644 index 000000000..92cebf436 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/MathematicalSpa.gf @@ -0,0 +1,26 @@ +--# -path=.:present:prelude + +concrete MathematicalSpa of Mathematical = + NounSpa - [ComplN2], --- to avoid ambiguity +-- VerbSpa, + AdjectiveSpa, + AdverbSpa, + NumeralSpa, +-- SentenceSpa, + QuestionSpa, + RelativeSpa, + ConjunctionSpa, + PhraseSpa, + TextSpa - [Tense,TPres,TPast,TFut,TCond], + IdiomSpa, + StructuralSpa, + + SymbolSpa, + PredicationSpa, -- - [predV3,predV2], --- gf bug + + LexiconSpa + ** { + +flags startcat = Phr ; + +} ; diff --git a/deprecated/old-lib/resource/mathematical/MathematicalSwe.gf b/deprecated/old-lib/resource/mathematical/MathematicalSwe.gf new file mode 100644 index 000000000..59d5fefde --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/MathematicalSwe.gf @@ -0,0 +1,27 @@ +--# -path=.:present:prelude + +concrete MathematicalSwe of Mathematical = + NounSwe - [ComplN2], --- to avoid ambiguity +-- VerbSwe, + AdjectiveSwe, + AdverbSwe, + NumeralSwe, +-- SentenceSwe, + QuestionSwe, + RelativeSwe, + ConjunctionSwe, + PhraseSwe, + TextX, + IdiomSwe, + + StructuralSwe, + + SymbolSwe, + PredicationSwe, + + LexiconSwe + ** { + +flags startcat = Phr ; + +} ; diff --git a/deprecated/old-lib/resource/mathematical/Predication.gf b/deprecated/old-lib/resource/mathematical/Predication.gf new file mode 100644 index 000000000..f53d44005 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/Predication.gf @@ -0,0 +1,60 @@ +--1 A Small Predication Library +-- +-- (c) Aarne Ranta 2003-2006 under Gnu GPL. +-- +-- This library is a derived library built on the language-independent Ground +-- API of resource grammars. + +abstract Predication = Cat ** { + +--2 The category of atomic sentences + +-- We want to use sentences in positive and negative forms but do not care about +-- tenses. + +fun + PosCl : Cl -> S ; -- positive sentence: "x intersects y" + NegCl : Cl -> S ; -- negative sentence: "x doesn't intersect y" + +--2 Predication patterns. + + predV : V -> NP -> Cl ; -- one-place verb: "x converges" + predV2 : V2 -> NP -> NP -> Cl ; -- two-place verb: "x intersects y" + predV3 : V3 -> NP->NP-> NP -> Cl; -- three-place verb: "x intersects y at z" + predVColl : V -> NP -> NP -> Cl ; -- collective verb: "x and y intersect" + predA : A -> NP -> Cl ; -- one-place adjective: "x is even" + predA2 : A2 -> NP -> NP -> Cl ; -- two-place adj: "x is divisible by y" + predAComp : A -> NP -> NP -> Cl; -- comparative adj: "x is greater than y" + predAColl : A -> NP -> NP -> Cl ; -- collective adj: "x and y are parallel" + predN : N -> NP -> Cl ; -- one-place noun: "x is a point" + predN2 : N2 -> NP -> NP -> Cl ; -- two-place noun: "x is a divisor of y" + predNColl : N -> NP -> NP -> Cl ; -- collective noun: "x and y are duals" + predAdv : Adv -> NP -> Cl ; -- adverb: "x is inside" + predPrep : Prep -> NP -> NP -> Cl ; -- preposition: "x is outside y" + +--2 Imperatives and infinitives. + + impV2 : V2 -> NP -> Phr ; -- imperative: "solve the equation E" + infV2 : V2 -> NP -> Phr ; -- infinitive: "to solve the equation E" + +--2 Individual-valued function applications + + appN2 : N2 -> NP -> NP ; -- one-place function: "the successor of x" + appN3 : N3 -> NP -> NP -> NP ; -- two-place function: "the distance from x to y" + appColl : N2 -> NP -> NP -> NP ; -- collective function: "the sum of x and y" + +--2 Families of types + +-- These are expressed by relational nouns applied to arguments. + + famN2 : N2 -> NP -> CN ; -- one-place family: "divisor of x" + famN3 : N3 -> NP -> NP -> CN ; -- two-place family: "path from x to y" + famColl : N2 -> NP -> NP -> CN ; -- collective family: "path between x and y" + +--2 Type constructor + +-- This is similar to a family except that the argument is a type. + + typN2 : N2 -> CN -> CN ; -- constructed type: "list of integers" + +} diff --git a/deprecated/old-lib/resource/mathematical/PredicationCat.gf b/deprecated/old-lib/resource/mathematical/PredicationCat.gf new file mode 100644 index 000000000..95fd70cc0 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/PredicationCat.gf @@ -0,0 +1,4 @@ +concrete PredicationCat of Predication = CatCat ** PredicationI with + (Syntax = SyntaxCat), + (Lang = LangCat) ; + diff --git a/deprecated/old-lib/resource/mathematical/PredicationDan.gf b/deprecated/old-lib/resource/mathematical/PredicationDan.gf new file mode 100644 index 000000000..6f1ba235e --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/PredicationDan.gf @@ -0,0 +1,4 @@ +concrete PredicationDan of Predication = CatDan ** PredicationI with + (Syntax = SyntaxDan), + (Lang = LangDan) ; + diff --git a/deprecated/old-lib/resource/mathematical/PredicationEng.gf b/deprecated/old-lib/resource/mathematical/PredicationEng.gf new file mode 100644 index 000000000..c7dc12c51 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/PredicationEng.gf @@ -0,0 +1,4 @@ +concrete PredicationEng of Predication = CatEng ** PredicationI with + (Syntax = SyntaxEng), + (Lang = LangEng) ; + diff --git a/deprecated/old-lib/resource/mathematical/PredicationFin.gf b/deprecated/old-lib/resource/mathematical/PredicationFin.gf new file mode 100644 index 000000000..86982aaae --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/PredicationFin.gf @@ -0,0 +1,4 @@ +concrete PredicationFin of Predication = CatFin ** PredicationI with + (Syntax = SyntaxFin), + (Lang = LangFin) ; + diff --git a/deprecated/old-lib/resource/mathematical/PredicationFre.gf b/deprecated/old-lib/resource/mathematical/PredicationFre.gf new file mode 100644 index 000000000..da968d2b8 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/PredicationFre.gf @@ -0,0 +1,4 @@ +concrete PredicationFre of Predication = CatFre ** PredicationI with + (Syntax = SyntaxFre), + (Lang = LangFre) ; + diff --git a/deprecated/old-lib/resource/mathematical/PredicationGer.gf b/deprecated/old-lib/resource/mathematical/PredicationGer.gf new file mode 100644 index 000000000..5f870309d --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/PredicationGer.gf @@ -0,0 +1,4 @@ +concrete PredicationGer of Predication = CatGer ** PredicationI with + (Syntax = SyntaxGer), + (Lang = LangGer) ; + diff --git a/deprecated/old-lib/resource/mathematical/PredicationI.gf b/deprecated/old-lib/resource/mathematical/PredicationI.gf new file mode 100644 index 000000000..67cbcd67e --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/PredicationI.gf @@ -0,0 +1,51 @@ +incomplete concrete PredicationI of Predication = + Cat ** open ParamX, Lang, Syntax in { + +flags optimize = all_subs ; + +lin + PosCl cl = mkS cl ; + NegCl cl = mkS PNeg cl ; + +--2 Predication patterns. + + predV v x = PredVP x (UseV v) ; -- mkCl x v ; + predV2 v x y = mkCl x v y ; + predV3 v x y z = mkCl x v y z ; + predVColl v x y = mkCl (mkNP and_Conj x y) v ; + predA a x = mkCl x a ; + predA2 a x y = mkCl x a y ; + predAComp a x y = mkCl x a y ; + predAColl a x y = mkCl (mkNP and_Conj x y) a ; + predN n x = mkCl x (mkNP IndefArt (mkCN n)) ; --- Sg/Pl ? + predN2 n x y = mkCl x (mkNP IndefArt (ComplN2 n y)) ; --- Sg/Pl ? + predNColl n x y = mkCl (mkNP and_Conj x y) (mkNP IndefArt (mkCN n)) ; + predAdv a x = mkCl x a ; + predPrep p x y = mkCl x (mkAdv p y) ; + +--2 Imperatives and infinitives. + + impV2 v x = mkPhr (mkImp v x) ; + infV2 v x = mkPhr (mkUtt (mkVP v x)) ; + +--2 Individual-valued function applications + + appN2 n x = mkNP DefArt (mkCN n x) ; + appN3 n x y = mkNP DefArt (mkCN n x y) ; + appColl n x y = mkNP DefArt (mkCN n (mkNP and_Conj x y)) ; + +--2 Families of types + +-- These are expressed by relational nouns applied to arguments. + + famN2 n x = ComplN2 n x ; + famN3 n x y = ComplN2 (ComplN3 n x) y ; + famColl n x y = ComplN2 n (ConjNP and_Conj (BaseNP x y)) ; + +--2 Type constructor + +-- This is similar to a family except that the argument is a type. + + typN2 f n = ComplN2 f (DetArtPl DefArt n) ; + +} diff --git a/deprecated/old-lib/resource/mathematical/PredicationIta.gf b/deprecated/old-lib/resource/mathematical/PredicationIta.gf new file mode 100644 index 000000000..1b4123c2d --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/PredicationIta.gf @@ -0,0 +1,4 @@ +concrete PredicationIta of Predication = CatIta ** PredicationI with + (Syntax = SyntaxIta), + (Lang = LangIta) ; + diff --git a/deprecated/old-lib/resource/mathematical/PredicationNor.gf b/deprecated/old-lib/resource/mathematical/PredicationNor.gf new file mode 100644 index 000000000..6204c707a --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/PredicationNor.gf @@ -0,0 +1,4 @@ +concrete PredicationNor of Predication = CatNor ** PredicationI with + (Syntax = SyntaxNor), + (Lang = LangNor) ; + diff --git a/deprecated/old-lib/resource/mathematical/PredicationSpa.gf b/deprecated/old-lib/resource/mathematical/PredicationSpa.gf new file mode 100644 index 000000000..037e30901 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/PredicationSpa.gf @@ -0,0 +1,4 @@ +concrete PredicationSpa of Predication = CatSpa ** PredicationI with + (Syntax = SyntaxSpa), + (Lang = LangSpa) ; + diff --git a/deprecated/old-lib/resource/mathematical/PredicationSwe.gf b/deprecated/old-lib/resource/mathematical/PredicationSwe.gf new file mode 100644 index 000000000..732b11cc8 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/PredicationSwe.gf @@ -0,0 +1,4 @@ +concrete PredicationSwe of Predication = CatSwe ** PredicationI with + (Syntax = SyntaxSwe), + (Lang = LangSwe) ; + diff --git a/deprecated/old-lib/resource/mathematical/Symbol.gf b/deprecated/old-lib/resource/mathematical/Symbol.gf new file mode 100644 index 000000000..a8ac9ca1b --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/Symbol.gf @@ -0,0 +1,46 @@ +--1 Symbolic expressions + +-- *Note*. This module is not automatically included in the main +-- grammar [Lang Lang.html]. + +abstract Symbol = Cat, PredefAbs ** { + +--2 Noun phrases with symbols and numbers + +fun + + SymbPN : Symb -> PN ; -- x + IntPN : Int -> PN ; -- 27 + FloatPN : Float -> PN ; -- 3.14159 + NumPN : Card -> PN ; + CNNumNP : CN -> Card -> NP ; -- level five ; level 5 + CNSymbNP : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y + + +--2 Sentence consisting of a formula + + SymbS : Symb -> S ; -- A + +--2 Symbols as numerals + + SymbNum : Symb -> Card ; -- n + SymbOrd : Symb -> Ord ; -- n'th + +--2 Symbol lists + +-- A symbol list has at least two elements. The last two are separated +-- by a conjunction ("and" in English), the others by commas. +-- This produces "x, y and z", in English. + +cat + Symb ; + [Symb]{2} ; + +fun + MkSymb : String -> Symb ; + +--2 Obsolescent + + CNIntNP : CN -> Int -> NP ; -- level 53 (covered by CNNumNP) + +} diff --git a/deprecated/old-lib/resource/mathematical/SymbolCat.gf b/deprecated/old-lib/resource/mathematical/SymbolCat.gf new file mode 100644 index 000000000..09faff744 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolCat.gf @@ -0,0 +1,2 @@ +concrete SymbolCat of Symbol = CatCat ** SymbolRomance with + (ResRomance = ResCat) ; diff --git a/deprecated/old-lib/resource/mathematical/SymbolDan.gf b/deprecated/old-lib/resource/mathematical/SymbolDan.gf new file mode 100644 index 000000000..ef1e73c82 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolDan.gf @@ -0,0 +1,2 @@ +concrete SymbolDan of Symbol = CatDan ** SymbolScand with + (ResScand = ResDan) ; diff --git a/deprecated/old-lib/resource/mathematical/SymbolEng.gf b/deprecated/old-lib/resource/mathematical/SymbolEng.gf new file mode 100644 index 000000000..488c3fbdd --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolEng.gf @@ -0,0 +1,37 @@ +concrete SymbolEng of Symbol = CatEng ** open Prelude, ResEng in { + +lin + SymbPN i = {s = \\c => i.s ; g = Neutr} ; --- c + IntPN i = {s = \\c => i.s ; g = Neutr} ; --- c + FloatPN i = {s = \\c => i.s ; g = Neutr} ; --- c + NumPN i = {s = \\c => i.s ; g = Neutr} ; --- c + CNIntNP cn i = { + s = \\c => (cn.s ! Sg ! Nom ++ i.s) ; + a = agrgP3 Sg cn.g + } ; + CNSymbNP det cn xs = { + s = \\c => det.s ++ cn.s ! det.n ! c ++ xs.s ; + a = agrgP3 det.n cn.g + } ; + CNNumNP cn i = { + s = \\c => (cn.s ! Sg ! Nom ++ i.s) ; + a = agrgP3 Sg cn.g + } ; + + SymbS sy = sy ; + + SymbNum sy = {s = sy.s ; n = Pl ; hasCard = True} ; + SymbOrd sy = {s = sy.s ++ "th"} ; + +lincat + + Symb, [Symb] = SS ; + +lin + + MkSymb s = s ; + + BaseSymb = infixSS "and" ; + ConsSymb = infixSS "," ; + +} diff --git a/deprecated/old-lib/resource/mathematical/SymbolFin.gf b/deprecated/old-lib/resource/mathematical/SymbolFin.gf new file mode 100644 index 000000000..922b19dcb --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolFin.gf @@ -0,0 +1,42 @@ +concrete SymbolFin of Symbol = CatFin ** open Prelude, NounFin, ResFin in { + +lin + SymbPN i = {s = \\c => i.s} ; --- c + IntPN i = {s = \\c => i.s} ; --- c + FloatPN i = {s = \\c => i.s} ; --- c + NumPN i = {s = \\c => i.s!Sg!Nom } ; --- c + + CNIntNP cn i = { + s = \\c => cn.s ! NCase Sg (npform2case Sg c) ++ i.s ; + a = agrP3 Sg ; + isPron = False + } ; + CNSymbNP det cn xs = let detcn = NounFin.DetCN det cn in { + s = \\c => detcn.s ! c ++ xs.s ; + a = detcn.a ; + isPron = False + } ; + CNNumNP cn i = { + s = \\c => cn.s ! NCase Sg (npform2case Sg c) ++ i.s ! Sg ! Nom ; + a = agrP3 Sg ; + isPron = False + } ; + + SymbS sy = sy ; + + SymbNum n = {s = \\_,_ => n.s ; isNum = True ; n = Pl} ; + SymbOrd n = {s = \\_,_ => n.s ++ "."} ; + +lincat + + Symb, [Symb] = SS ; + +lin + + MkSymb s = s ; + + BaseSymb = infixSS "ja" ; + ConsSymb = infixSS "," ; + +} + diff --git a/deprecated/old-lib/resource/mathematical/SymbolFre.gf b/deprecated/old-lib/resource/mathematical/SymbolFre.gf new file mode 100644 index 000000000..ab972c039 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolFre.gf @@ -0,0 +1,2 @@ +concrete SymbolFre of Symbol = CatFre ** SymbolRomance with + (ResRomance = ResFre) ; diff --git a/deprecated/old-lib/resource/mathematical/SymbolGer.gf b/deprecated/old-lib/resource/mathematical/SymbolGer.gf new file mode 100644 index 000000000..38516d74a --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolGer.gf @@ -0,0 +1,43 @@ +concrete SymbolGer of Symbol = CatGer ** open Prelude, ResGer in { + +lin + SymbPN i = {s = \\c => i.s ; g = Neutr} ; --- c + IntPN i = {s = \\c => i.s ; g = Neutr} ; --- c + FloatPN i = {s = \\c => i.s ; g = Neutr} ; --- c + NumPN i = {s = i.s ! Neutr ; g = Neutr} ; --- c + + CNIntNP cn i = { + s = \\c => cn.s ! Weak ! Sg ! Nom ++ i.s ; + a = agrP3 Sg ; + isPron = False + } ; + CNSymbNP det cn xs = let g = cn.g in { + s = \\c => det.s ! g ! c ++ cn.s ! adjfCase det.a c ! det.n ! c ++ xs.s ; + a = agrP3 det.n ; + isPron = False + } ; + CNNumNP cn i = { + s = \\c => artDef ! (GSg cn.g) ! c ++ cn.s ! Weak ! Sg ! Nom ++ i.s ! Neutr ! c ; + a = agrP3 Sg ; + isPron = False + } ; + + SymbS sy = {s = \\_ => sy.s} ; + + SymbNum n = {s = \\_,_ => n.s ; n = Pl ; isNum = True} ; + SymbOrd n = {s = \\_ => n.s ++ "."} ; + + +lincat + + Symb, [Symb] = SS ; + +lin + + MkSymb s = s ; + + BaseSymb = infixSS "und" ; + ConsSymb = infixSS "," ; + +} + diff --git a/deprecated/old-lib/resource/mathematical/SymbolIta.gf b/deprecated/old-lib/resource/mathematical/SymbolIta.gf new file mode 100644 index 000000000..d4e9cbf52 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolIta.gf @@ -0,0 +1,2 @@ +concrete SymbolIta of Symbol = CatIta ** SymbolRomance with + (ResRomance = ResIta) ; diff --git a/deprecated/old-lib/resource/mathematical/SymbolNor.gf b/deprecated/old-lib/resource/mathematical/SymbolNor.gf new file mode 100644 index 000000000..2e446b09b --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolNor.gf @@ -0,0 +1,2 @@ +concrete SymbolNor of Symbol = CatNor ** SymbolScand with + (ResScand = ResNor) ; diff --git a/deprecated/old-lib/resource/mathematical/SymbolRomance.gf b/deprecated/old-lib/resource/mathematical/SymbolRomance.gf new file mode 100644 index 000000000..64b4e1a34 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolRomance.gf @@ -0,0 +1,41 @@ +incomplete concrete SymbolRomance of Symbol = + CatRomance ** open Prelude, CommonRomance, ResRomance in { + +lin + SymbPN i = {s = i.s ; g = Masc} ; + IntPN i = {s = i.s ; g = Masc} ; + FloatPN i = {s = i.s ; g = Masc} ; + NumPN i = {s = i.s!Masc ; g = Masc} ; + + CNIntNP cn i = { + s = \\c => cn.s ! Sg ++ i.s ; + a = agrP3 cn.g Sg ; + hasClit = False + } ; + CNSymbNP det cn xs = let g = cn.g in { + s = \\c => det.s ! g ! npform2case c ++ cn.s ! det.n ++ xs.s ; + a = agrP3 g det.n ; + hasClit = False + } ; + CNNumNP cn i = { + s = \\c => artDef cn.g Sg (npform2case c) ++ cn.s ! Sg ++ i.s ! Masc ; + a = agrP3 cn.g Sg ; + hasClit = False + } ; + SymbS sy = {s = \\_ => sy.s} ; + + SymbNum n = {s = \\_ => n.s ; isNum = True ; n = Pl} ; + SymbOrd n = {s = \\_ => n.s ++ "."} ; --- + +lincat + + Symb, [Symb] = SS ; + +lin + + MkSymb s = s ; + + BaseSymb = infixSS "et" ; ---- + ConsSymb = infixSS "," ; + +} diff --git a/deprecated/old-lib/resource/mathematical/SymbolScand.gf b/deprecated/old-lib/resource/mathematical/SymbolScand.gf new file mode 100644 index 000000000..8bde4e1a4 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolScand.gf @@ -0,0 +1,38 @@ +incomplete concrete SymbolScand of Symbol = + CatScand ** open Prelude, ResScand, CommonScand in { + +lin + SymbPN i = {s = \\c => i.s ; g = Neutr} ; --- c + IntPN i = {s = \\c => i.s ; g = Neutr} ; --- c + FloatPN i = {s = \\c => i.s ; g = Neutr} ; --- c + NumPN i = {s = \\c => i.s!neutrum ; g = Neutr} ; --- c + CNIntNP cn i = { + s = \\c => (cn.s ! Sg ! DIndef ! Nom ++ i.s) ; + a = agrP3 cn.g Sg + } ; + CNSymbNP det cn xs = let g = cn.g in { + s = \\c => det.s ! cn.isMod ! g ++ cn.s ! det.n ! det.det ! caseNP c ++ xs.s ; + a = agrP3 g det.n + } ; + CNNumNP cn i = { + s = \\c => (cn.s ! Sg ! DIndef ! Nom ++ i.s ! neutrum) ; + a = agrP3 cn.g Sg + } ; + + SymbS sy = {s = \\_ => sy.s} ; + + SymbNum n = {s = \\_ => n.s ; isDet = True ; n = Pl} ; + SymbOrd n = {s = n.s ++ ":te" ; isDet = True} ; --- + +lincat + + Symb, [Symb] = SS ; + +lin + + MkSymb s = s ; + + BaseSymb = infixSS conjAnd ; + ConsSymb = infixSS "," ; + +} diff --git a/deprecated/old-lib/resource/mathematical/SymbolSpa.gf b/deprecated/old-lib/resource/mathematical/SymbolSpa.gf new file mode 100644 index 000000000..e56343432 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolSpa.gf @@ -0,0 +1,2 @@ +concrete SymbolSpa of Symbol = CatSpa ** SymbolRomance with + (ResRomance = ResSpa) ; diff --git a/deprecated/old-lib/resource/mathematical/SymbolSwe.gf b/deprecated/old-lib/resource/mathematical/SymbolSwe.gf new file mode 100644 index 000000000..b80619c06 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolSwe.gf @@ -0,0 +1,2 @@ +concrete SymbolSwe of Symbol = CatSwe ** SymbolScand with + (ResScand = ResSwe) ; diff --git a/deprecated/old-lib/resource/mathematical/Symbolic.gf b/deprecated/old-lib/resource/mathematical/Symbolic.gf new file mode 100644 index 000000000..9d945c7c3 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/Symbolic.gf @@ -0,0 +1,64 @@ +--1 Symbolic: Noun Phrases with mathematical symbols + +incomplete resource Symbolic = open + Symbol, Grammar, PredefCnc in { + + oper + symb : overload { + symb : Str -> NP ; -- x + symb : Int -> NP ; -- 23 + symb : Float -> NP ; -- 0.99 + symb : N -> Digits -> NP ; -- level 4 + symb : N -> Card -> NP ; -- level four + symb : CN -> Card -> NP ; -- advanced level four + symb : Det -> N -> Card -> NP ; -- the number four + symb : Det -> CN -> Card -> NP ; -- the even number four + symb : Det -> N -> Str -> Str -> NP ; -- the levels i and j + symb : Det -> CN -> [Symb] -> NP ; -- the basic levels i, j, and k + symb : Symb -> S ; -- A + symb : Symb -> Card ; -- n + symb : Symb -> Ord -- n'th + } ; + + mkSymb : Str -> Symb ; + mkInt : Str -> PredefCnc.Int ; + mkFloat : Str -> PredefCnc.Float ; + +--. + + symb = overload { + symb : Str -> NP + = \s -> UsePN (SymbPN (mkSymb s)) ; + symb : Int -> NP + = \i -> UsePN (IntPN i) ; + symb : Float -> NP + = \i -> UsePN (FloatPN i) ; + symb : N -> Digits -> NP + = \c,i -> CNNumNP (UseN c) (NumDigits i) ; + symb : N -> Card -> NP + = \c,n -> CNNumNP (UseN c) n ; + symb : CN -> Card -> NP + = \c,n -> CNNumNP c n ; + symb : Det -> N -> Card -> NP + = \d,n,x -> DetCN d (ApposCN (UseN n) (UsePN (NumPN x))) ; + symb : Det -> CN -> Card -> NP + = \d,n,x -> DetCN d (ApposCN n (UsePN (NumPN x))) ; + symb : Det -> N -> Str -> Str -> NP + = \c,n,x,y -> CNSymbNP c (UseN n) (BaseSymb (mkSymb x) (mkSymb y)) ; + symb : Det -> CN -> [Symb] -> NP + = CNSymbNP ; + symb : Symb -> S = SymbS ; + symb : Symb -> Card = SymbNum ; + symb : Symb -> Ord = SymbOrd + + } ; + + mkSymb : Str -> Symb = \s -> {s = s ; lock_Symb = <>} ; + + mkInt i = {s = i ; lock_Int = <>} ; + mkFloat f = {s = f ; lock_Float = <>} ; + +-- Integer : Type = {s : Str ; lock_Int : {}} ; +-- Floating : Type = {s : Str ; lock_Float : {}} ; + +} diff --git a/deprecated/old-lib/resource/mathematical/SymbolicCat.gf b/deprecated/old-lib/resource/mathematical/SymbolicCat.gf new file mode 100644 index 000000000..de79ec2ba --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolicCat.gf @@ -0,0 +1,5 @@ +--# -path=.:present:mathematical:prelude + +resource SymbolicCat = Symbolic with + (Symbol = SymbolCat), + (Grammar = GrammarCat) ; diff --git a/deprecated/old-lib/resource/mathematical/SymbolicDan.gf b/deprecated/old-lib/resource/mathematical/SymbolicDan.gf new file mode 100644 index 000000000..cbbe7e0ad --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolicDan.gf @@ -0,0 +1,5 @@ +--# -path=.:present:mathematical:prelude + +resource SymbolicDan = Symbolic with + (Symbol = SymbolDan), + (Grammar = GrammarDan) ; diff --git a/deprecated/old-lib/resource/mathematical/SymbolicEng.gf b/deprecated/old-lib/resource/mathematical/SymbolicEng.gf new file mode 100644 index 000000000..c9b559a22 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolicEng.gf @@ -0,0 +1,5 @@ +--# -path=.:present:mathematical:prelude + +resource SymbolicEng = Symbolic with + (Symbol = SymbolEng), + (Grammar = GrammarEng) ; diff --git a/deprecated/old-lib/resource/mathematical/SymbolicFin.gf b/deprecated/old-lib/resource/mathematical/SymbolicFin.gf new file mode 100644 index 000000000..f8b88526b --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolicFin.gf @@ -0,0 +1,5 @@ +--# -path=.:present:mathematical:prelude + +resource SymbolicFin = Symbolic with + (Symbol = SymbolFin), + (Grammar = GrammarFin) ; diff --git a/deprecated/old-lib/resource/mathematical/SymbolicFre.gf b/deprecated/old-lib/resource/mathematical/SymbolicFre.gf new file mode 100644 index 000000000..ee0b2acc9 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolicFre.gf @@ -0,0 +1,5 @@ +--# -path=.:present:mathematical:prelude + +resource SymbolicFre = Symbolic with + (Symbol = SymbolFre), + (Grammar = GrammarFre) ; diff --git a/deprecated/old-lib/resource/mathematical/SymbolicGer.gf b/deprecated/old-lib/resource/mathematical/SymbolicGer.gf new file mode 100644 index 000000000..8b8d7111d --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolicGer.gf @@ -0,0 +1,5 @@ +--# -path=.:present:mathematical:prelude + +resource SymbolicGer = Symbolic with + (Symbol = SymbolGer), + (Grammar = GrammarGer) ; diff --git a/deprecated/old-lib/resource/mathematical/SymbolicIta.gf b/deprecated/old-lib/resource/mathematical/SymbolicIta.gf new file mode 100644 index 000000000..d4b578c8d --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolicIta.gf @@ -0,0 +1,5 @@ +--# -path=.:present:mathematical:prelude + +resource SymbolicIta = Symbolic with + (Symbol = SymbolIta), + (Grammar = GrammarIta) ; diff --git a/deprecated/old-lib/resource/mathematical/SymbolicNor.gf b/deprecated/old-lib/resource/mathematical/SymbolicNor.gf new file mode 100644 index 000000000..b4eff28e0 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolicNor.gf @@ -0,0 +1,5 @@ +--# -path=.:present:mathematical:prelude + +resource SymbolicNor = Symbolic with + (Symbol = SymbolNor), + (Grammar = GrammarNor) ; diff --git a/deprecated/old-lib/resource/mathematical/SymbolicSpa.gf b/deprecated/old-lib/resource/mathematical/SymbolicSpa.gf new file mode 100644 index 000000000..ae44431f5 --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolicSpa.gf @@ -0,0 +1,5 @@ +--# -path=.:present:mathematical:prelude + +resource SymbolicSpa = Symbolic with + (Symbol = SymbolSpa), + (Grammar = GrammarSpa) ; diff --git a/deprecated/old-lib/resource/mathematical/SymbolicSwe.gf b/deprecated/old-lib/resource/mathematical/SymbolicSwe.gf new file mode 100644 index 000000000..193d8e84d --- /dev/null +++ b/deprecated/old-lib/resource/mathematical/SymbolicSwe.gf @@ -0,0 +1,5 @@ +--# -path=.:present:mathematical:prelude + +resource SymbolicSwe = Symbolic with + (Symbol = SymbolSwe), + (Grammar = GrammarSwe) ; |
