Math to mathematical/Symbol

This commit is contained in:
aarne
2006-01-31 14:04:38 +00:00
parent 3f8ea1466b
commit 0f08827320
20 changed files with 31 additions and 30 deletions

View File

@@ -0,0 +1,31 @@
--1 Symbolic expressions
-- *Note*. This module is not automatically included in the main
-- grammar [Lang Lang.html].
abstract Symbol = Cat ** {
--2 Noun phrases with symbols and numbers
fun
SymbPN : Symb -> PN ; -- x
IntPN : Int -> PN ; -- 27
FloatPN : Float -> PN ; -- 3.14159
CNIntNP : CN -> Int -> NP ; -- level 53
CNSymbNP : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y
--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 ;
}

View File

@@ -0,0 +1,26 @@
concrete SymbolEng of Symbol = CatEng ** open Prelude, ResEng in {
lin
SymbPN i = {s = \\c => i.s ; a = agrP3 Sg} ; --- c
IntPN i = {s = \\c => i.s ; a = agrP3 Sg} ; --- c
CNIntNP cn i = {
s = \\c => (cn.s ! Sg ! Nom ++ i.s) ;
a = agrP3 Sg
} ;
CNSymbNP det cn xs = {
s = \\c => det.s ++ cn.s ! det.n ! c ++ xs.s ;
a = agrP3 det.n
} ;
lincat
Symb, SymbList = SS ;
lin
MkSymb s = s ;
BaseSymb = infixSS "and" ;
ConsSymb = infixSS "," ;
}

View File

@@ -0,0 +1,2 @@
concrete SymbolFre of Symbol = CatFre ** SymbolRomance with
(ResRomance = ResFre) ;

View File

@@ -0,0 +1,28 @@
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
{-
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
} ;
-}
lincat
Symb, SymbList = SS ;
lin
MkSymb s = s ;
BaseSymb = infixSS "und" ;
ConsSymb = infixSS "," ;
}

View File

@@ -0,0 +1,30 @@
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} ;
{-
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 ! g ++ cn.s ! det.n ! det.det ! caseNP c ++ xs.s ;
a = agrP3 g det.n
} ;
-}
lincat
Symb, SymbList = SS ;
lin
MkSymb s = s ;
BaseSymb = infixSS "et" ; ----
ConsSymb = infixSS "," ;
}

View File

@@ -0,0 +1,27 @@
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
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
} ;
lincat
Symb, SymbList = SS ;
lin
MkSymb s = s ;
BaseSymb = infixSS conjAnd ;
ConsSymb = infixSS "," ;
}

View File

@@ -0,0 +1,2 @@
concrete SymbolSwe of Symbol = CatSwe ** SymbolScand with
(ResScand = ResSwe) ;