Message Boards Message Boards


Syntax for a logical / programming / natural language mix

Posted 1 year ago
0 Replies
0 Total Likes

I heard Wolfram mention in a Twitch stream that Wolfram Research might be looking into making some kind of “human speakable” version of The Wolfram Language. Well, I’ve had an interest in constructed so called “logical languages” like Lojban for a while. Recently, as a project for myself on my free time, I worked on making up my own syntax for a language that’s kind of a mix between a specific natural language that I happen to know well, English, and a syntax more like a log like Lojban. I will jump in with am example text, then go back with a description I wrote up recently in attempt to describe how it all works.

"Atrus stepped out of the air into a huge, conical bowl of darkness.

And in the middle of that bowl, at the precise center of the massive, mile-wide hole that pierced it, a powerful column of water-as broad as a river-thundered straight up into the darkness until it was lost from sight, a great spike of brilliant, crystalline light glowing like a fierce flame at its center where it emerged from the glowing depths."

steped named@atrus, air, huge conical full(darkness, #) bowl.

inside@ri & very near(#, center very(huge & similar(#, planckLengths(2^160), width)) hole(#, t bowl), forceful@column <made(%, water) & similar(%, width #, river) & while(similar(%, thunder, sound), very quickly moved %, up & toward@darkness<until !possible see _, t@column <huge(magnificent spike %) & madeOf %, brilliant & similar(#, crystal, appearTo) light <glow <similar fierce@flame> <near(%, center part t column) & mostly %, near(#, locationOf(emerge ri, glow deep.

The second part is an attempted translation by me of a couple sentences which I happen to like, from the opening of a chapter of The Book of Atrus by Robyn and Rand Miller and David Wingrove. It's a good book, related to the Myst video games, I recommend it.

Notes on the language:

This is my attempt to describe a syntax for a logical language that sounds a lot like English (just to make it easier to learn for some people.) (Why English? Because it's my first language. Feel free to substitute English words for words from your own language. Know Esperanto? Be my guest :-)

To express a predicate with arguments, simply state the predicate, plus the arguments in parenthesis separated by commas, like this:

The person walked from the house to the school. walked(person, house, school)

Predicate slots are defined as being the same way they are in a corresponding Lojban predicate.

nonrestrictive clauses are like this:

I broke a bowl that you used. broke(i, bowl<used(you, %)>

Periods can be used to close all open parenthesis or brackets or anything at once like this:

broke(i, bowl<used(you, %.

restrictive clauses are similar:

I broke the bowl which you used. broke(i, bowl{used(you, %.

Both of these also work where, if the first argument in the relative clause is the relative pronoun, one can leave out the blank for the relative pronoun, like this:

I broke a bowl made of clay

broke(i, bowl<madeOf(clay. is the same as broke(i, bowl<madeOf(%, clay. because that relative pronoun, the %, is the first argument it can be left out in this case and is taken to have the same meaning.

One can leave predicate spaces open by using a blank like this: "_"

I walked from my home to school walked(I, my(home), school.

I walked to school walked(I, _ ,school.

To switch predicates around, you can do something like this:

I ate the apple Ate(i apple) The apple was eaten by me Ate(# apple)(i)

Also, I jumped down and yelled a curse jumped(#, down) & yelled(#, curse) (i)

& means and, | means or, ! means not.

Right grouping of parenthesis can often be implicitly assumed, so the can be eliminated sometimes, like

ate(i, big(red(tasty(apple.

can actually be just

ate i, big red tasty apple.

due to the right grouping of parenthesis.

“@” can be used to group two words more tightly.

If you want to mention again something you already mentioned, "t" is a predicate which means "the previously mentioned":

English: I went to the store. Then I left the store.

This language: then(went(i, store), left(i, t store.

One can also use "t" with just the first letter, or the first few letters, of the thing you are mentioning, such as:

then(went(i, store) left(i, t s. then(went(i, store) left(i, t sto.

If one is mixing different kinds of parethesis / brackets, one can close all of one kind of bracket by closing another, in a manner like this:

I hit the car which was near the middle of the road with my truck

hit(i, car<near middle(_, road>, my(truck.

fully expanded syntax:

hit(i, car<near(%, middle(_, road))>, my(truck))

You can also use brackets to group things together arbitrarily if other rules aren’t working in some specific case.

I'm experimenting with throwing a few lojban cmavo in, like "ri" refers to the most recently mentioned predicate argument of any kind.

I’m actually still working out how this should all actually be pronounced. Lojban like words could be used to pronounce all the symbols. Or perhaps much of the grammar implied by the symbols could be shown in a tonal way like another interesting loglang called “Toaq” does.

Also: semi related project: I’m working on translating some English vocabulary into predicate logic, which I posted about, earlier, here.

I’m certainly very curious to see what kind of natural language / Wolfram language mixes Wolfram Research might come with some day!

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract