Lojban
The Logical Language
Log in
Username:
Password:
I forgot my password |
CapsLock is on.
Log in
History: Number subgrammar
View page
Collapse Into Edit Sessions
Source of version: 5
«
»
For computer applications of Lojban, there needs to be a formal grammar of numbers. I started from ((xorxes))' grammar below, and revised it in places and made it into a ((PEG)) grammar. This meets all the rules in chapter 18 of CLL, except the one where it contradicts Lojban for Beginners, and LfB has the more useful reading. Namely, you can have a decimal point inside a "digit" (segment) of a mixed-base number like a time. This involves defining 14 new selma'o. SA is not handled yet (what should it do inside a number?) Also, letters mixed with numbers are not handled, but I consider this a feature and not a bug. The "number" rule in the existing grammar is replaced, and these rules are inserted: ^digit <- NO / TUhO digits <- digit+ thousand <- digits KIhO whole <- thousand+ digits decimal2 <- whole (PI digits (RAhE digits)?)? / PAI decimal1 <- MAhU? decimal2 / MAhU decimal <- decimal1 CEhI? digitplace <- decimal PIhE? tuple <- digitplace+ real <- decimal / tuple indef <- PI? RO / TUhO component <- real / indef fraction <- component FIhU fraction / component complex <- fraction? KAhO fraction? / fraction quantity <- component / fraction / DAhA quantity range <- SUhO quantity? fuzzy <- complex JIhI complex number <- quantity / complex / fuzzy / range / indef number NO <- pre-cmavo NO-words post-cmavo NO-words <- "no" / "pa" / "re" / "ci" / "vo" / "mu" / "xa" / "ze" / "bi" / "so" / "dau" / "fei" / "gai" / "jau" / "rei" / "vai" / "0" / "1" / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9" MAhU <- pre-cmavo MAhU-words post-cmavo MAhU-words <- "ma'u" / "ni'u" SUhO <- pre-cmavo SUhO-words post-cmavo SUhO-words <- "su'e" / "su'o" / "me'i" / "za'u" TUhO <- pre-cmavo TUhO-words post-cmavo TUhO-words <- "tu'o" / "xo" PAI <- pre-cmavo PAI-words post-cmavo PAI-words <- "pai" / "te'o" / "ci'i" CEhI <- pre-cmavo CEhI-words post-cmavo CEhI-words <- "ce'i" KIhO <- pre-cmavo KIhO-words post-cmavo KIhO-words <- "ki'o" PI <- pre-cmavo PI-words post-cmavo PI-words <- "pi" PIhE <- pre-cmavo PIhE-words post-cmavo PIhE-words <- "pi'e" RAhE <- pre-cmavo RAhE-words post-cmavo RAhE-words <- "ra'e" RO <- pre-cmavo RO-words post-cmavo RO-words <- "ro" / "so'a" / "so'e" / "so'i" / "so'o" / "so'u" / "rau" / "du'e" / "mo'a" / "no'o" JIhI <- pre-cmavo JIhI-words post-cmavo JIhI-words <- "ji'i" KAhO <- pre-cmavo KAhO-words post-cmavo KAhO-words <- "ka'o" DAhA <- pre-cmavo DAhA-words post-cmavo DAhA-words <- "da'a" FIhU <- pre-cmavo FIhU-words post-cmavo FIhU-words <- "fi'u" ^ ''mi'e ((rab.spir))'' --- Here is an informal grammar of numbers. I am not even suggesting that this should be part of the formal grammar, it is just an exercise to sort out which combinations of PA make sense and which don't. I can make some sort of sense of all combinations generated by this grammar. As for those not generated by it, maybe some meaning could eventually be found for them, but there is nothing as yet defined as far as I can tell. pre-sign = (ji'i|su'e|su'o|me'i|za'u)... sign = ma'u|ni'u digit = no|pa|re|ci|vo|mu|xa|ze|bi|so|dau|fei|gai|jau|rei|vai|ki'o|xo indef = ro|so'a|so'e|so'i|so'o|so'u|su'o|da'a|no'o|rau|du'e|mo'a bare = [[digit...][[pi [[digit...][[ra'e digit...]]|[[pi] indef real = [[pre-sign][[sign][[bare|ci'i|pai|te'o][[ce'i] fraction = [[real][[fi'u real] complex = [[fraction][[ka'o fraction] | tu'o n-tuple = [[complex][[pi'e complex]... Notes: # I didn't put the indefinites at the same level as the digits, because it doesn't really make sense to me for ''so'a'' to stand for 8 or 9, ''so'e'' for 6 or 7, etc. To me they are always full numbers, not positional digits. # I allowed ''ce'i'' in a couple of weird places, for example you could say ''muce'ifi'ucice'i'', 5%/3%, which does not have a very obvious meaning, but to restrict ''ce'i'' more would have complicated the grammar a lot and it didn't seem justified. # I chose to make ''fi'u'' more close binding than ''ka'o''. Either choice was possible. So ''cika'ovofi'umu'' is 3+(4/5)i and not (3+4i)/5. # I didn't allow double fractions, so that 3/4/5 is neither (3/4)/5 nor 3/(4/5), it is simply not meaningful in my scheme. # I allowed fractions such as 3.5/2.7, why not? # Probably ''ji'i'' needs more work, but I didn't want it as a positional digit. # I left ''xo'' as a positional digit, but I have my doubts about it. Comments welcome! ''co'o mi'e ((xorxes))'' *((tinkit)) try ((xei)) instead of rei. xo really should be an indef. oh, and what's the initial non-terminal?
History
Enable pagination
rows per page
HTML diff
Side-by-side diff
Side-by-side diff by characters
Inline diff
Inline diff by characters
Full side-by-side diff
Full side-by-side diff by characters
Full inline diff
Full inline diff by characters
Unified diff
Side-by-side view
HTML diff
Side-by-side diff
Advanced
Information
Version
Thu 15 of Jul, 2004 21:09 GMT
xorxes
from 200.49.74.2
11
Tue 13 of Jul, 2004 14:07 GMT
xorxes
from 200.49.74.2
9
Tue 13 of Jul, 2004 13:27 GMT
xorxes
from 200.49.74.2
8
Tue 13 of Jul, 2004 02:07 GMT
rab.spir
from 66.92.73.176
7
Sat 10 of Jul, 2004 19:52 GMT
xorxes
from 200.43.74.114
6
Fri 09 of Jul, 2004 18:53 GMT
rab.spir
from 66.92.73.176
5
Fri 25 of Jun, 2004 18:56 GMT
rab.spir
from 128.31.7.133
4
Mon 22 of Sep, 2003 19:52 GMT
admin
from admin
updated by the phpwiki import process
3
Fri 30 of Nov, 2001 12:31 GMT
admin
from admin
created from phpwiki import
2
Select action to perform with checked...
Remove
OK
About
Introduction
What Others Say
FAQ
Learning
Books
Vocabulary
Lojbanic Software
Community
Web/Email Forums
IRC Chat
Links
News
Dictionary
Swag
Multimedia
Lojbanic Texts
Audio
Wiki
Recent Changes
Popular Pages
How To Edit
The LLG
Official Projects
Publications
Donate!
Contact Us
Search Lojban Resources