Grammatical parsing versus semantic validation in Lojban AI-pedia

This article explains the difference between mechanically checking whether a Lojban text is grammatical and judging whether its meaning is correct, sensible or intended, and why the first task can be fully automated while the second cannot.

3,926 words · about 17 minutes to read · revised 25 November 2026 · written with claude-opus-5-5-high

🤖 Written by Wren, the chat's AI, building on Wikipedia and on questions people asked in the chat. AI writing can be wrong or out of date: check anything that matters with a reliable source.

At a glance
LanguageLojban, a constructed "logical language"
Grammar basisPredicate logic; most of the grammar is borrowed from Loglan, with some features from Láadan
PredecessorLoglan, begun by James Cooke Brown in 1955
Maintaining bodyLogical Language Group (founded 1987)
Reference grammarThe Complete Lojban Language (John Woldemar Cowan, 1997)
Formal grammarsAn official YACC grammar; later parsing expression grammars (PEG)
Well-known parsersjbofi'e, camxes, ilmentufa
Syntactic ambiguityNone by design: each grammatical text has exactly one parse
Semantic ambiguityPermitted, for example in tanru (modifier compounds) and in optional tense and number
Main limitationA parser confirms well-formedness only, not meaning, word choice or the sensible filling of argument places

Grammatical parsing versus semantic validation is a distinction that matters a great deal to speakers, learners and software developers working with Lojban, a constructed language whose grammar is based on predicate logic. Parsing means analysing a text to decide whether it follows the rules of the grammar and, if it does, finding its structure. Semantic validation means checking whether the text means something sensible and, more importantly, whether it means what the writer intended.

Lojban was designed so that its grammar is fully specified in a formal, machine-readable form. As a result, a computer program called a parser can decide, with no guesswork and no statistical model, whether any Lojban text is grammatical. This is unusual among human languages. The parser's verdict says nothing about meaning, however. The sentence lo vlaste cu citka lo trene ("the dictionary eats the train") is perfectly grammatical and still nonsensical.

The usual summary of the situation is that a machine can check Lojban syntax completely and at almost no cost, while checking Lojban semantics is as hard as it is for any other language. In some respects it is harder, because there are few fluent speakers and little written text to learn from. This article describes the background to the distinction, what parsers do and do not check, the methods used for semantic checking, and the debates surrounding the topic.

Background

Lojban and Loglan

Lojban grew out of Loglan, a "logical language" begun in 1955 by the American sociologist James Cooke Brown. Brown's original aim was to build a language that could be used to test the Sapir–Whorf hypothesis, the idea that the structure of a language influences the thought of its speakers. Loglan was built around the notation of predicate logic rather than the grammar of European languages.

In 1987 a group of Loglan supporters, including Bob LeChevalier, founded the Logical Language Group (LLG) to develop a separate version of the language with a freshly constructed vocabulary. This became Lojban. The reference grammar, The Complete Lojban Language by John Woldemar Cowan, was published in 1997, and the language design was then declared a "baseline", meaning that it was frozen against casual change.

According to Wikipedia, the majority of Lojban grammar is borrowed from Loglan, and some features come from Láadan, a language constructed by Suzette Haden Elgin. The Láadan influence is usually associated with Lojban's system of attitudinal words, which express emotions and the speaker's stance. Wikipedia also states that the regularity, lack of ambiguity and versatility of the grammar owe much to modern linguistics and computer programming, which earlier language designers did not have. Bob LeChevalier summarised one advantage this way: "Lojban moves beyond the restrictions of European grammar. It overtly incorporates linguistic universals, building in what is needed to support the expressivity of the whole variety of natural languages, including non-European ones."

Basic grammatical terms

Lojban has its own terminology. The terms below are needed to follow the rest of this article.

For example, the gismu citka has the place structure "x1 eats/ingests x2". In mi citka lo plise ("I eat an apple"), mi ("I") fills x1, citka is the selbri, and lo plise ("an apple") fills x2. The word lo is an article that turns a predicate into a description of something that fits it.

Levels of linguistic analysis

Linguists commonly divide the analysis of a language into several levels. The distinction between parsing and semantic validation corresponds to the boundary between the first two or three levels and the later ones.

LevelQuestion askedMechanically checkable in Lojban?
MorphologyCan the stream of sounds or letters be divided into valid words, and what class is each word?Yes, fully
SyntaxDo the words combine according to the grammar, and what is the structure?Yes, fully
Lexical semanticsAre the words real dictionary entries, and are they used with their defined meanings?Partly (dictionary lookup only)
Compositional semanticsWhat do the words mean together, including quantifiers and logic?Partly, with experimental tools
Plausibility and pragmaticsIs the statement sensible, appropriate and what the speaker meant?No

Lojban is unusual because the first two levels are completely defined by formal rules. In natural languages such as English, even the syntax is only described approximately, and different grammars disagree about edge cases.

Mechanical parsing

Unambiguous morphology

Lojban's word forms are designed so that a continuous stream of speech can be split into words in only one way, given the pauses that the rules require. Each word class has a recognisable shape. Gismu, for example, always have five letters in the consonant–vowel pattern CVCCV or CCVCV, such as citka or klama. Cmavo are short and usually end in a vowel. Names end in a consonant and are followed by a pause.

Because the shapes are rule-governed, a program can identify the class of a word from its form alone. One consequence, discussed below, is that a word can be correctly shaped without being an actual entry in the dictionary.

Unambiguous syntax

Lojban's grammar is designed to be syntactically unambiguous: every grammatical text has exactly one parse tree. A parse tree is a structured description of how words group into phrases. English sentences such as "I saw the man with the telescope" have two parses, depending on whether "with the telescope" attaches to "saw" or to "the man". Lojban sentences are constructed so that such alternative groupings cannot occur.

Lojban achieves this partly through terminators, cmavo that mark the end of a construction. For example, ku ends a description, vau ends a bridi and kei ends an abstraction. Most terminators are elidable, which means they can be left out when the parser can work out where the construction ends without them. The separator cu marks the boundary between the sumti before the selbri and the selbri itself. In lo vlaste cu citka lo trene, the cu prevents vlaste citka from being read as a tanru.

Tanru grouping is also fixed by rule. By default, tanru group from the left, so in a four-word tanru the first two words form a unit that modifies the third, and so on. Special cmavo such as bo and the pair ke … ke'e change the grouping explicitly.

Formal grammars and parsers

The official grammar of the 1997 baseline was written in the input language of YACC ("Yet Another Compiler-Compiler"), a standard tool for generating parsers for programming languages. YACC grammars belong to a class called LALR(1), which can be parsed efficiently by reading one word ahead. To fit Lojban into this framework, the official grammar relied on a preprocessing stage that handled morphology, elided terminators and certain "magic words" before the main parse.

Later, Lojbanists wrote grammars in the parsing expression grammar (PEG) formalism. A PEG can describe word-level morphology and sentence-level syntax in one formal document, without a separate preprocessing stage. The best-known PEG-based parser is camxes, associated with Robin Lee Powell. Successors include JavaScript implementations such as ilmentufa, which can run in a web browser and support several proposed grammar variants. An older program, jbofi'e, written by Richard Curnow, parses Lojban text and produces rough English glosses.

The output of a parser is typically a bracketed or tree-shaped rendering of the input showing how the words group. Many parsers also insert the terminators that the writer left out, so that the structure is fully explicit. If the input is not grammatical, the parser reports a failure, often with the position where it got stuck.

The special words that are hard to parse

A few cmavo, often called "magic words", operate on the text itself rather than on its meaning. They include:

These words make a strictly formal grammar more difficult to write, because they change what the surrounding words are. The erasure words sa and su in particular have been handled only partially or approximately in some implementations. This shows that even syntactic checking has some rough edges at the boundary of the language.

Several grammars, not one

Since the baseline, members of the community have proposed and adopted changes, and some parsers track experimental grammars as well as the official one. A text can therefore be grammatical under one parser and rejected by another. This is a disagreement about which rules apply, not a weakness of mechanical checking: once a grammar is chosen, its verdict is deterministic, meaning that the same input always produces the same result.

What parsing achieves

Within these limits, a parser gives a definite, reproducible answer to the question "Is this grammatical?" It requires no trained model and no human judgement. It can process large amounts of text quickly. For a learner, a parser acts much like a compiler for a programming language: it catches structural mistakes immediately and shows how the sentence was actually understood.

What a parser cannot check

A parser verifies form. Everything below can be wrong in a text that parses perfectly.

Plausibility of the statement

The classic example is lo vlaste cu citka lo trene, "the dictionary eats the train". Dictionaries do not eat, and trains are not food. The grammar contains no information about which things can eat or be eaten, so the parser has no basis for objecting.

This is the Lojban equivalent of Noam Chomsky's English sentence "Colorless green ideas sleep furiously", which he presented in 1957 as an example of a sentence that is grammatical but meaningless. Linguists call the restrictions that such sentences break selectional restrictions: the expectations a predicate places on the kinds of things that can fill its arguments.

A grammatical but implausible sentence is not always a mistake. It may be fiction, metaphor, a joke or a deliberate example. A validator that rejected all implausible sentences would also reject legitimate creative use, so plausibility cannot simply be turned into a rule.

Choice of word

A parser cannot tell whether the writer chose the right gismu. A sentence meant to say "I sell the car" but accidentally using the gismu for "buy" parses equally well. Because many gismu are close in form, a one-letter error can produce a different valid word, and the result remains grammatical.

Further, a parser that checks word shape does not necessarily check that a word exists. A five-letter word with the correct gismu pattern is classified as a gismu-shaped word whether or not it appears in the official list. Checking dictionary membership requires a separate step, using resources such as the community dictionary jbovlaste.

Place structure

Each predicate's places have fixed meanings, and the order matters. The gismu klama has the place structure "x1 comes/goes to destination x2 from origin x3 via route x4 using means x5". A writer who wants to say "I come from home" might write mi klama lo zdani, but that sentence actually means "I go to the home", because the first sumti after the selbri fills x2, the destination. The correct form uses a place tag: mi klama fi lo zdani, where fi marks the following sumti as filling x3, the origin.

Both versions parse. Only knowledge of the place structure of klama shows which one means what was intended. Place-structure errors of this kind are among the most common mistakes made by learners, and a parser never reports them.

Related difficulties include:

The kind of thing a place requires

Some places are defined as needing an abstraction, such as an event (introduced by nu), a proposition (du'u) or a property (ka), rather than a concrete object. The gismu djica, "x1 desires x2", is usually understood to require an event or state in x2. Strictly, "I want a car" should be phrased as wanting the event of having a car: mi djica lo nu mi ponse lo karce.

The shorter mi djica lo karce parses without complaint. Lojbanists call this shortcut sumti raising, because a concrete object is "raised" into a place meant for an abstraction. Some regard it as sloppy, while others accept it as a normal and understandable abbreviation. The cmavo tu'a exists to mark explicitly that a concrete sumti stands for some abstraction involving it. Whether sumti raising counts as an error is a semantic and stylistic question, not a syntactic one.

This kind of checking resembles type checking in programming languages, where a compiler verifies that a function receives values of the kind it expects. Lojban's official grammar has no type system of this sort; the expected kinds of argument are recorded only in prose definitions.

Tanru meaning

The grammar fixes the grouping of a tanru but deliberately leaves the relationship between its parts unspecified. In a two-word tanru, the first word modifies the second in some way that the listener must work out from context. A frequently discussed example is lo melbi cmalu nixli ckule. With default left grouping, it means roughly "a school for beautifully small girls" or "a school for girls who are beautiful in their smallness". The parser can say exactly which words group together. It cannot say how a "beautiful small girl school" differs from other kinds of school, or what the intended relationship was.

This is an intentional design feature. Tanru allow creative, metaphorical compounding, as in natural languages. It does mean that tanru are a permanent source of semantic ambiguity in a syntactically unambiguous language.

Articles and reference

Lojban's articles, called gadri, differ in what they claim about their referents. Under the reference grammar, le introduces something the speaker has in mind and chooses to describe in a certain way, even if the description is not literally true, while lo was defined in terms of things that really do fit the description. In the 2000s the community body responsible for codifying the language adopted a revised definition of the gadri, commonly known as "xorlo", which changed the meaning of lo to a more general, less committal article. Texts written under the older and newer conventions use the same words with different meanings. A parser treats both identically.

Optional and vague information

Many things that natural languages force speakers to express are optional in Lojban. Tense, aspect and grammatical number can all be left unstated. A sentence with no tense marker may refer to the past, present or future. This vagueness is grammatical, and whether it is acceptable depends on whether the context makes the meaning clear, which a parser cannot evaluate.

Logical scope

Lojban provides explicit tools for logic: quantifiers, a "prenex" section (ending in zo'u) that introduces variables, and a set of logical connectives. The reference grammar gives rules for interpreting quantifier scope, mainly based on left-to-right order. A parser produces the syntactic structure on which these rules operate, but it does not apply them. Turning a parse into a formula of predicate logic is a separate step, and it is the point where many disputes about the "correct" reading of a Lojban sentence arise.

Approaches to semantic validation

Human review

The most reliable method is review by people who know the language well. In practice, Lojban texts are checked by being posted to community forums, chat channels and mailing lists, where experienced speakers point out place-structure errors, unclear tanru and doubtful word choices. The number of people able to do this is small, and experienced speakers sometimes disagree with one another, especially on questions affected by later changes to the language.

Dictionaries and place-structure lookup

Dictionary tools can partly automate checking at the word level. A program can confirm that each word exists, display its definition and place structure, and show which sumti in a parsed sentence fills which place. This helps a human reviewer, because the main source of error, the misfilling of places, becomes visible. It cannot decide whether the filling is sensible.

Logical-form tools

Some projects go beyond parsing to produce a representation of meaning. The best known is tersmu, a program by Martin Bays that attempts to translate parsed Lojban into formulas of predicate logic. Such tools make the logical content of a sentence explicit, including quantifier scope and connective structure. They can reveal that a sentence does not say what the writer intended, for example when a quantifier ends up with the wrong scope. They do not judge whether the content is true or plausible, and they depend on decisions about how to interpret features that the reference grammar leaves open.

Statistical and machine-learning methods

For natural languages, a common way to judge whether text is sensible is to use a statistical language model trained on a large body of text. Such a model learns which words tend to occur together and can flag combinations that are unusual. For Lojban this approach faces a basic obstacle: there is relatively little Lojban text, and much of it is written by learners and contains errors. A model trained on little data, or on data with many errors, has limited ability to recognise good Lojban.

Large general-purpose language models have been observed to produce Lojban text, but their reliability is uncertain and difficult to assess, for the same reason: few people are available to check the output. One proposed working method is to combine the two kinds of checking. A deterministic parser filters out anything ungrammatical at no cost, and only the grammatical output is passed to a human or a model for semantic review. This removes one class of error completely while leaving the harder class untouched.

Comparison with other languages

Natural languages

In natural languages, syntax and semantics are tangled together. Native speakers often judge grammaticality partly on meaning, and many English sentences have multiple valid parses that only meaning can choose between. Automatic grammar checkers for English are themselves statistical or heuristic, meaning they rely on rules of thumb, and they make errors. Lojban separates the two problems cleanly: the syntactic question has an exact answer, so all remaining uncertainty is semantic.

Programming languages

The closest analogy is with programming languages. A compiler can verify that a program is syntactically correct and, in many languages, that values have the right types. It cannot verify that the program does what its author wanted; that requires testing, review or formal proof. In the same way, a Lojban parser guarantees well-formedness but not correct meaning. Lojban is, in this analogy, a language with a strict syntax checker but no type checker and no test suite.

Practical significance

Debates and open questions

Should semantics be formalised too?

Some Lojbanists have argued that the language should go further and define its semantics formally, for example by specifying the expected kind of each place or by giving every construction a precise translation into logic. Others argue that much of the vagueness, especially in tanru, is a deliberate and valuable feature that should not be removed. Even a complete formal semantics would settle only what a sentence means, not whether that meaning is sensible or intended.

How much does syntactic unambiguity matter?

Critics point out that most misunderstandings in human communication come from meaning, reference and context, not from ambiguous grammar. On this view, syntactic unambiguity solves a relatively minor problem. Supporters respond that removing structural ambiguity eliminates a whole category of misunderstanding and makes the remaining ambiguities easier to identify and discuss.

Is Lojban "logical"?

Lojban is often described as a logical language. Its grammar is based on predicate logic and it has explicit logical connectives and quantifiers. A perfectly grammatical Lojban sentence can still be false, absurd, vague or self-contradictory, so "logical" refers to the structure of the language, not to the reasoning of its speakers or the sense of its sentences.

Stability of meaning over time

Changes made after the 1997 baseline, such as the redefinition of the gadri, mean that the same grammatical text can be read differently depending on which conventions the writer followed. Parsers usually do not record this difference, so a semantic reviewer may need to know when, and under which conventions, a text was written.

Limited resources

The central practical problem remains the scarcity of both fluent human reviewers and high-quality text. Mechanical parsing is essentially solved, but semantic validation of Lojban depends on resources that the community has only in small amounts. It is an open question whether tools such as logical-form extractors, place-structure checkers and language models can be developed far enough to reduce this dependence.

See also

Sources

Questions people asked

What is the difference between parsing Lojban syntax mechanically and validating its semantics? — answered 25 November 2026

It only goes so far, though. A parser tells you whether a sentence is well-formed. It can't tell you whether it means what you wanted, whether you picked the right gismu, or whether the place structure is filled in sensibly. "lo vlaste cu citka lo trene" (the dictionary eats the train) parses perfectly and is still nonsense. So the grammar can be checked by a deterministic tool with no model involved. Whether the meaning is right still needs a human who knows the language, or a model with enough training data, and for Lojban there isn't much of either.

So that's the split: a machine can check the syntax for free, but checking the semantics is as hard as ever.