unambiguous syntax and grammar

A forum for all topics related to constructed languages
yyqVxzb10
rupestrian
rupestrian
Posts: 4
Joined: 15 May 2017 05:00

unambiguous syntax and grammar

Post by yyqVxzb10 »

Hello! What languages do you know which declare the subject as one of its goals or which has it as a property? What languages have BNF, or EBNF, or their analogues? It is generally called `logical language', but I don't like the term, because it's quite broad. The advertisment of your own languages is welcome too.
Iyionaku
mayan
mayan
Posts: 2102
Joined: 25 May 2014 14:17

Re: unambiguous syntax and grammar

Post by Iyionaku »

No natural language has BNF or EBNF, and so far there has not been a single convincing attempt of writing a Chomsky Grammar for any natural language.

However, several attempts have been made to create a context-free conlang; you might want to have a look at Loglan and it's successor, Lojban, which is the best-known context free conlang (excluding programming languages), although some linguists apparently have disputed that Lojban is effectively context free.
Wipe the glass. This is the usual way to start, even in the days, day and night, only a happy one.
User avatar
shanoxilt
cuneiform
cuneiform
Posts: 178
Joined: 30 May 2016 06:51

Re: unambiguous syntax and grammar

Post by shanoxilt »

I second researching Lojban and similar languages like Gua\spi and Toaq.
Click here to join the Common Honey server. Or click here for a general glossopoeia server.
yyqVxzb10
rupestrian
rupestrian
Posts: 4
Joined: 15 May 2017 05:00

Re: unambiguous syntax and grammar

Post by yyqVxzb10 »

Thanks for the answer. I know that lojban has PEG and special version of BNF. I am interested in other such conlangs too, if any.
yyqVxzb10
rupestrian
rupestrian
Posts: 4
Joined: 15 May 2017 05:00

Re: unambiguous syntax and grammar

Post by yyqVxzb10 »

shanoxilt wrote: 05 Dec 2017 22:08 Gua\spi and Toaq.
Thank you for the reference, that's it! If there's more. please let me know.
User avatar
eldin raigmore
korean
korean
Posts: 6353
Joined: 14 Aug 2010 19:38
Location: SouthEast Michigan

Re: unambiguous syntax and grammar

Post by eldin raigmore »

I'm pretty sure my conlang Arpien's syntax is not only context-free but also unambiguous.
However I haven't rigorously checked it.

I'm not sure its morphology is unambiguous, nor that its morphology satisfies any other desideratum.
But maybe I'll make it isolating and analytic, so that its grammar will be all syntax and no morphology.

Also, it's still a piss-poor conlang because, though I have plans for its lexicon, I have yet to make a word in it.
I'll tell you about it if you can't find it on a search and/or just want me to.
User avatar
Creyeditor
MVP
MVP
Posts: 5091
Joined: 14 Aug 2012 19:32

Re: unambiguous syntax and grammar

Post by Creyeditor »

shanoxilt wrote: 05 Dec 2017 22:08 I second researching Lojban and similar languages like Gua\spi and Toaq.
Toaq is for once a loglang based really on Chinese.
Creyeditor
"Thoughts are free."
Produce, Analyze, Manipulate
1 :deu: 2 :eng: 3 :idn: 4 :fra: 4 :esp:
:con: Ook & Omlűt & Nautli languages & Sperenjas
[<3] Papuan languages, Morphophonology, Lexical Semantics [<3]
rgj40q
hieroglyphic
hieroglyphic
Posts: 25
Joined: 06 Oct 2018 21:14

Re: unambiguous syntax and grammar

Post by rgj40q »

Well, a year has passed. I am the topicstarter, I have lost access to that account. And my conlang is finally done and its description is pretty verbose and has examples. Appears that Toaq's parser in based on camxes program from lojban, in other words its form is PEG (parsing expression grammar).
view-source:http://www.toaq.org/parser/ wrote:<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="toaqlanguage.js"></script>
<script type="text/javascript" src="camxes_preproc.js"></script>
<script type="text/javascript" src="camxes_postproc.js"></script>
The key difference between PEG and EBNF is that the PEG's choice operator is ordered and not commutative. If the first alternative succeeds, the second alternative is ignored. Also the Wikipedia says "Unlike CFGs, PEGs cannot be ambiguous". I can cofirm that; I almost made in-sentence conjunctions ambiguous because they were coordinating (single), but figured to switch to correlative (pairwise) ones. That side of PEG is nice, but personally for me EBNF is easier to understand.

Also Toaq reminds me Ceqli a little.

Speaking of ambiguity. It is also disputed whether Lojban has it or not. I have lost the link to the author of this, but here goes a quote:
Why Lojban does not meet my requirements? The quotes are taken from the reference grammar.
1.

"All tanru are ambiguous semantically. Possible translations of:

Example 5.13.
ta klama jubme
That is-a-goer type-of-table.

include:

That is a table which goes (a wheeled table, perhaps).

That is a table owned by one who goes.

That is a table used by those who go (a sports doctor's table?).

That is a table when it goes (otherwise it is a chair?).

In each case the object referred to is a “goer type of table”, but the ambiguous “type of” relationship can mean one of many things. A speaker who uses tanru (and pragmatically all speakers must) takes the risk of being misunderstood. Using tanru is convenient because they are short and expressive; the circumlocution required to squeeze out all ambiguity can require too much effort.

No general theory covering the meaning of all possible tanru exists; probably no such theory can exist."

----

IMO the ambiguity in the place structure is syntactical, not semantical. In my conlang there is no such tool.

2.

"Similarly, in Lojban you can say:

Example 12.90.
do citme'a mi lo nanca be li xa
You are-less-young-than me by one-year multiplied-by the-number six.

You are six years less young than me.

In English, “more” comparatives are easier to make and use than “less” comparatives, but in Lojban the two forms are equally easy.

Because of their much simpler place structure, lujvo ending in -mau and -me'a are in fact used much more frequently than zmadu and mleca themselves as selbri. It is highly unlikely for such lujvo to be construed as anything other than implicit-abstraction lujvo. But there is another type of ambiguity relevant to these lujvo, and which has to do with what is being compared.

For example, does nelcymau mean “X likes Y more than X likes Z”, or “X likes Y more than Z likes Y”? Does klamau mean: “X goes to Y more than to Z”, “X goes to Y more than Z does”, “X goes to Y from Z more than from W”, or what?

We answer this concern by putting regularity above any considerations of concept usefulness: by convention, the two things being compared always fit into the first place of the seltau. In that way, each of the different possible interpretations can be expressed by SE-converting the seltau, and making the required place the new first place.

----

Again IMO the ambiguity in the place structure is syntactical, not semantical.

In my conlang it is all different:

“X likes Y more than X likes Z” - "X's liking of Y is more than X's liking of Z";
“X likes Y more than Z likes Y” - "X's liking of Y is more than Z's liking of Y";
“X goes to Y more than to Z” - "X the goer's directing to Y is more than X the goer's directing to Z";
“X goes to Y more than Z does” - "X's going to Y is more than Z's going to Y”;
“X goes to Y from Z more than from W” - "X the goer's directing to Y is sourced from Z being more than sourcing from W".

And no lujvo-alike tool.

3.

A subtle point in the semantics of tanru like Example 5.41 needs special elucidation. There are at least two possible interpretations of:

Example 5.46.
ta melbi je nixli ckule
That is-a-(beautiful and girl) type-of school.

It can be understood as:

Example 5.47.

That is a girls' school and a beautiful school.

or as:

Example 5.48.

That is a school for things which are both girls and beautiful.

The interpretation specified by Example 5.47 treats the tanru as a sort of abbreviation for:

Example 5.49.
ta ke melbi ckule ke'e je ke nixli ckule [ke'e]
That is-a-( beautiful type-of school ) and ( girl type-of school )

whereas the interpretation specified by Example 5.48 does not. This is a kind of semantic ambiguity for which Lojban does not compel a firm resolution. The way in which the school is said to be of type “beautiful and girl” may entail that it is separately a beautiful school and a girls' school; but the alternative interpretation, that the members of the school are beautiful and girls, is also possible. Still another interpretation is:

Example 5.50.

That is a school for beautiful things and also for girls.

so while the logical connectives help to resolve the meaning of tanru, they by no means compel a single meaning in and of themselves.

In general, logical connectives within tanru cannot undergo the formal manipulations that are possible with the related logical connectives that exist outside tanru; see Section 14.12 for further details.

----

Again IMO the ambiguity in the place structure is syntactical, not semantical.

In my conlang it is all different:

"That is a girls' school and a beautiful school." - "That's a beautiful school for a girl";
"That is a school for things which are both girls and beautiful." - "That's a school for a beautiful girl";
"That is a school for beautiful things and also for girls." - "That's a school for a beautiful thing and for a girl".

And no tool like logical connectives within tanru.

4.

21.1. EBNF Grammar of Lojban

<...>

10. // encloses an elidable terminator, which may be omitted (without change of meaning) if no grammatical ambiguity results.

----

This is not formalized and described properly. One may be smart enough to speak in a natlang verbosely to the point where no grammatical ambiguity results.
Of course the fourth section is not valid, since there is no actual EBNF for Lojban, only a draft of it, and the mainline form is PEG. But I agree with first three sections, in my conlang it is all the same, except that I do have logical connectives, but they are distinct from appositional connectives. Appears that it is not enough for me to have a unique abstract syntax tree for each valid text, as I thought before...
http://www.incatena.org/viewtopic.php?f=4&t=45064&p=1144042#p1144017 wrote:
mèþru wrote:Well, it means that you have less chances to make jokes. Ambiguity makes for easy jokes.
I don't think so, because it's not about semantics. It's about uniquely parsing 1-dimensional array also known as the text into the abstract syntax tree. One can still play with the polysemy.
Seems like syntax is not that much detached from semantics even in such pure languages as Lojban. That two aspects may be more coupled and connected.
rgj40q
hieroglyphic
hieroglyphic
Posts: 25
Joined: 06 Oct 2018 21:14

Re: unambiguous syntax and grammar

Post by rgj40q »

Things in my conlang I am proud of:
* its description uses traditional terminology, unlike lo**an;
* valence of words are more or less similar to English, I don't try to put everything in it, only basic and required argument slots;
* it actually has syntax described unlike many conlangs where you are lucky if you find "SVO, mostly head final"
User avatar
Creyeditor
MVP
MVP
Posts: 5091
Joined: 14 Aug 2012 19:32

Re: unambiguous syntax and grammar

Post by Creyeditor »

rgj40q wrote: 07 Nov 2018 06:11 Things in my conlang I am proud of:
[...]
* valence of words are more or less similar to English, I don't try to put everything in it, only basic and required argument slots;
[...]
Why is it a good thing to mirror English here? Is the idea to have an arbritary set of arguments for each word, such that there is at least one natlang that has a similar set of arguments for that word?
Edit: Also congratulations on your huge engelang gramar. Looks really nice, I will have to have a closer look at it.
Creyeditor
"Thoughts are free."
Produce, Analyze, Manipulate
1 :deu: 2 :eng: 3 :idn: 4 :fra: 4 :esp:
:con: Ook & Omlűt & Nautli languages & Sperenjas
[<3] Papuan languages, Morphophonology, Lexical Semantics [<3]
rgj40q
hieroglyphic
hieroglyphic
Posts: 25
Joined: 06 Oct 2018 21:14

Re: unambiguous syntax and grammar

Post by rgj40q »

Creyeditor wrote: 07 Nov 2018 10:15 Is the idea to have an arbritary set of arguments for each word, such that there is at least one natlang that has a similar set of arguments for that word?
Good wording.
Why is it a good thing to mirror English here?
Maybe it's both the fear to be alien and the comfort to use the concepts I am familiar with.
rgj40q
hieroglyphic
hieroglyphic
Posts: 25
Joined: 06 Oct 2018 21:14

Re: unambiguous syntax and grammar

Post by rgj40q »

Creyeditor wrote: 07 Nov 2018 10:15
Edit: Also congratulations on your huge engelang gramar. Looks really nice, I will have to have a closer look at it.
Thank you for appreciation!

I wish to think that grammar itself is not huge, but the description is, because it's verbose. I believe short descriptions are hard to understand and leave many aspects of a language unspecified.

Meanwhile statistics on dictionary.

0-valent words + interjections: 6
1-valent words: 334
2-valent words: 212
3-valent words: 21
4-valent words: 6

There is a clear preference for 1- and 2-valent words. The dictionary is young but still, who knows, is it really worthy to make a grammar accounting such a periphery.

Also I've drawn some lovely syntax trees under the examples. I hope it makes it easier to read.
User avatar
Leo
rupestrian
rupestrian
Posts: 21
Joined: 28 Nov 2012 19:07

Re: unambiguous syntax and grammar

Post by Leo »

When transforming "it rains heavily" into "heavy rain", does rain go full noun and heavy full adjective, or does it go more like "the heavily raining," and if both are possible what are the differences in meaning?
Also, what are the constraints on stem creation? (Sorry if I missed something you stated already.)
rgj40q
hieroglyphic
hieroglyphic
Posts: 25
Joined: 06 Oct 2018 21:14

Re: unambiguous syntax and grammar

Post by rgj40q »

[removed]
Last edited by rgj40q on 26 Nov 2018 16:22, edited 1 time in total.
rgj40q
hieroglyphic
hieroglyphic
Posts: 25
Joined: 06 Oct 2018 21:14

Re: unambiguous syntax and grammar

Post by rgj40q »

Leo wrote: 26 Nov 2018 04:24 When transforming "it rains heavily" into "heavy rain", does rain go full noun and heavy full adjective, or does it go more like "the heavily raining," and if both are possible what are the differences in meaning?
Also, what are the constraints on stem creation? (Sorry if I missed something you stated already.)
Thank you for your time and attention [:)]. It is better to pick another example with monovalent words, there is a difference. It's described in https://www.frathwiki.com/Nuliziti#Arguments starting with "A noun in apposition in Nuliziti may be translated to a noun or an adjective in English..."

For example:

NISI LUVITI XUXILI
I.N sleep.V deep.ADV
I sleep deeply.

To make it argument with the same meaning you get

LUVIRI XUXIQI NISI
sleep.INF deep.PTCP I.N
my deeply sleeping

But if you try noun with "full adjective" (apposition) the meaning is different:

FE LUVISI FE XUXISI
APP sleep.N APP deep.N
a deep one who sleeps

Because noun comes from verb subject. There is no distinct adjective class, there is apposition instead. You can't have apposition for "rain", because it is avalent.

Bug in grammar: avalent infinitives are not forbidden in the apposition. [:$]
Last edited by rgj40q on 05 Dec 2018 09:54, edited 3 times in total.
rgj40q
hieroglyphic
hieroglyphic
Posts: 25
Joined: 06 Oct 2018 21:14

Re: unambiguous syntax and grammar

Post by rgj40q »

Leo wrote: 26 Nov 2018 04:24 Also, what are the constraints on stem creation? (Sorry if I missed something you stated already.)
[[[...CV]CV]CV]CV

The last vowel must show the stem valence. O - 0, I - 1, U - 2, E - 3, A - 4. The last syllable can't be "CI", it's reserved for numerals. I believe that's it https://www.frathwiki.com/Nuliziti#Morphology_2
rgj40q
hieroglyphic
hieroglyphic
Posts: 25
Joined: 06 Oct 2018 21:14

Re: unambiguous syntax and grammar

Post by rgj40q »

Also

LUVISI XUXIQI
sleep.N deep.PTCP
the one sleeping deeply
rgj40q
hieroglyphic
hieroglyphic
Posts: 25
Joined: 06 Oct 2018 21:14

Re: unambiguous syntax and grammar

Post by rgj40q »

Hello!

Nuliziti in my opinion is pretty much unusable and the apriori lexics pushes people away. So here comes another attempt. The new one is called 'laughing succotash' (blame github for that name), and it has three goals.
1. The language should have a grammar similar to Standard Average European.
2. A text in the language should be similar to Interlingua IALA at least remotely.
3. A text should parse fast by computer.

The easiest for me is a LALR parser (Look-Ahead Left-to-Right). Probably it is the first LALR conlang. I should say, the LALR algorithm is pretty dumb and it forbids a lot of things. I.e. it warns about shift/reduce conflicts (ambiguity) when a grammar allows to omit different syntax roles in direct proximity, because it doesn't recognize what type of absence it encountered: of the first role or of the second. Despite the limitations I'm pleased with the result.

The parser does not look at the dictionary, does not understand the meanings nor translates them. It only draws the abstract syntax tree using spaces, and recognizes a part of speech by word endings or by whole words, which are little in number. But if there is at least one grammatical error in text, it will print "syntax error" and nothing more. It would be nice to show the place of error and guess what a user could have in mind, as the parser of Lojban does, but it is not a priority for me, so the implementation is pended.

The description is there: https://github.com/rgj40q/laughing-succ ... ter/doc.md
The source code is there: https://github.com/rgj40q/laughing-succotash/

e.g. The Lord's Prayer:

patri nostrel inil celes tet
e nomine tuel sanctificiaza une
e regne tuel veneza
e voluntate tuel faciaza une
inin le cele comef en superin le terre etiamef
e te daiza ain nose hodien pane nostrel quotidianel
e te pardoniza ain nose debites nostrel
e comen etiamem nose ones pardonit ain debitores nostreh
e te nonen induciza nose inin tentatione
sed te liberiza nose din le male
e amenot

and the parser output for it:

Code: Select all

[text]
    [sentence]
        [argument]
            [noun phrase]
                patri: noun, singular
                [appositive phrase]
                    nostrel: appositive, intransitive
                [appositive phrase]
                    inil: appositive, transitive
                    [subargument]
                        [noun subphrase]
                            celes: noun, plural
        tet: verb, intransitive, present
    e: conjunction for sentence
    [sentence]
        [argument]
            [noun phrase]
                nomine: noun, singular
                [appositive phrase]
                    tuel: appositive, intransitive
        sanctificiaza: verb, transitive, imperative, passive
        [argument]
            [noun phrase]
                une: noun, singular
    e: conjunction for sentence
    [sentence]
        [argument]
            [noun phrase]
                regne: noun, singular
                [appositive phrase]
                    tuel: appositive, intransitive
        veneza: verb, intransitive, imperative
    e: conjunction for sentence
    [sentence]
        [argument]
            [noun phrase]
                voluntate: noun, singular
                [appositive phrase]
                    tuel: appositive, intransitive
        faciaza: verb, transitive, imperative, passive
        [argument]
            [noun phrase]
                une: noun, singular
        [adverbA phrase]
            inin: adverb A, transitive
            [subargument]
                le: article
                [noun subphrase]
                    cele: noun, singular
                    [adverbB subphrase]
                        comef: subadverb B, intransitive
        en: conjunction for adverb A
        [adverbA phrase]
            superin: adverb A, transitive
            [subargument]
                le: article
                [noun subphrase]
                    terre: noun, singular
                    [adverbB subphrase]
                        etiamef: subadverb B, intransitive
    e: conjunction for sentence
    [sentence]
        [argument]
            [noun phrase]
                te: noun, singular
        daiza: verb, transitive, imperative
        [adverbA phrase]
            ain: adverb A, transitive
            [subargument]
                [noun subphrase]
                    nose: noun, singular
        [adverbA phrase]
            hodien: adverb A, intransitive
        [argument]
            [noun phrase]
                pane: noun, singular
                [appositive phrase]
                    nostrel: appositive, intransitive
                [appositive phrase]
                    quotidianel: appositive, intransitive
    e: conjunction for sentence
    [sentence]
        [argument]
            [noun phrase]
                te: noun, singular
        pardoniza: verb, transitive, imperative
        [adverbA phrase]
            ain: adverb A, transitive
            [subargument]
                [noun subphrase]
                    nose: noun, singular
        [argument]
            [noun phrase]
                debites: noun, plural
                [appositive phrase]
                    nostrel: appositive, intransitive
    e: conjunction for sentence
    [sentence]
        [adverbA phrase]
            comen: adverb A, intransitive
            [adverbB phrase]
                etiamem: adverb B, intransitive
        [argument]
            [noun phrase]
                nose: noun, singular
        [argument]
            [noun phrase]
                ones: noun, plural
        pardonit: verb, transitive, present
        [adverbA phrase]
            ain: adverb A, transitive
            [subargument]
                [noun subphrase]
                    debitores: noun, plural
                    [appositive subphrase]
                        nostreh: subappositive, intransitive
    e: conjunction for sentence
    [sentence]
        [argument]
            [noun phrase]
                te: noun, singular
        [adverbA phrase]
            nonen: adverb A, intransitive
        induciza: verb, transitive, imperative
        [argument]
            [noun phrase]
                nose: noun, singular
        [adverbA phrase]
            inin: adverb A, transitive
            [subargument]
                [noun subphrase]
                    tentatione: noun, singular
    sed: conjunction for sentence
    [sentence]
        [argument]
            [noun phrase]
                te: noun, singular
        liberiza: verb, transitive, imperative
        [argument]
            [noun phrase]
                nose: noun, singular
        [adverbA phrase]
            din: adverb A, transitive
            [subargument]
                le: article
                [noun subphrase]
                    male: noun, singular
    e: conjunction for sentence
    [sentence]
        amenot: verb, impersonal, present
I'd like to hear comments from you. Don't want to stay a writer into the table, so to speak. [:D]
Last edited by rgj40q on 05 Jul 2019 04:27, edited 1 time in total.
User avatar
eldin raigmore
korean
korean
Posts: 6353
Joined: 14 Aug 2010 19:38
Location: SouthEast Michigan

Re: unambiguous syntax and grammar

Post by eldin raigmore »

The R in LR and LALR means “rightmost derivation first”. The L in LR stands for “Left to right”.
It contrasts with LL , left-to-right, leftmost derivation first.
See https://en.m.wikipedia.org/wiki/LALR_parser.

If you don’t know what the difference between LL and LR is you may not know enough about parsing to make headway on this project.

If you honestly believe yours is the first LALR conlang you must be a highly insulated newb.

—————

This must be the harshest thing I’ve posted on this board in the past six years.
I hope I misunderstood everything and owe you an apology.
Otherwise I hope you’ll learn from this criticism and it will turn out to have been constructive, though not gentle.
rgj40q
hieroglyphic
hieroglyphic
Posts: 25
Joined: 06 Oct 2018 21:14

Re: unambiguous syntax and grammar

Post by rgj40q »

Thank you for the corrections, it will turn out to have been constructive. As one may observe from my posts I'm trying to escape my highly insulated newb bubble, and you've helped me today.
Post Reply