Ian P. Badtrousers

Standard dialect

This document deals with the foundation of Logos.

I should attempt and convince you that there is hardly any difference as to how we (1) read history with respect to time, (2) analyse texts, (3) and design computer systems. In a way, there is no difference at all! As long as you’re able to think of a system in terms of its language, the history aspect of it only becomes a matter of time.

This is the basis of discursive reasoning.

Introduction

Logos is not a programming language, but a language language.

Therefore, it does not attempt at programming; instead, it facilitates the unique ability to describe, compute, and interpret arbitrary logotic discourses.

So what does /logotic/ mean? As–in done in–logos, it’s a shorthand way of saying “discursively computable”, or “such that can be described in the computational model of logos.” To say of discourse that it’s logotic is simply to acknowledge there exists a form of it, which can be modeled efficiently. This occurs in a very straightforward fashion: whenever a term occurs in text, we are tempted to compute it as–is.

In programming, the actual language of the problem is substituted with some approximate programming model of it, oftentimes bloated with the leftover context of the problems to which it was applied prior.

Naturally, this invites the birth of types which would then be conditionally re-defined depending on the context of their direct application, thereby further eroding their meaning.

Logos doesn’t allow such nonsense; everything is always what it’s said to be.

Form

In natural languages, there’s written and spoken word. Although both forms readily satisfy the emerging need for language, they serve different purpose altogether. This distinction becomes clear when you study the corresponding functions of language in text vs. speech.

Logos makes a similar distinction with respect to text.

Dialect mode is the written logos. We use it to construct, compose and share abstract discursive procedures in–text. History mode, on the other hand, maketh the spoken logos, which is essentially dialect in action.

If the dialect was a set of rules, then the history would be one of the many possible games that could be played by it.

Dialect

Quid pro quo! :=
	Description.
Et cetera :=
	Another description.

This is the default text mode.

Dialect is a series of statements describing a set of signs and propositions, meant to contour the target language, or discourse, as closely as possible. Terms and propositions in-logos behave in the exact same way as words and sentences in English: lignuistic forms are case-insensitive and follow the rules of natural language grammar.

When it comes to intricacies of the English language, such as articles a/an/the, or the position of “not” within a sentence, logos will attempt to deduce the correct meaning even if the wording is not formally correct.

History

	<Alice@2020-06-09T15:29:35.142>
Quid pro quo!
	<Bob@2020-06-09T15:30:41.070>
Et cetera!
	...
	<Author@2020-12-12T24:59:59.999>
This text is essentially a signed transactions
with a timestamp.

The history above is the text representation of some concrete discourse.

Dialects and histories share the same punctuation, apart from the <> cues. The big way in which histories are different from dialects is subjectivity: propositions in histories are always spoken by concrete actors at concrete time. The logotic history reads like a regular screenplay: there’s (timestamped) cue and a line for actors to follow. True histories are hypertext, so individual propositions can be further expanded into their compounds, but for simplicity’s sake we’ll be treating them at the lowest level of resolution.

Note: whenever a text is given, unless said otherwise, assume it’s a dialect; moreover, to further avoid any confusion, histories will be colour–coded with aqua background.

Comment

{ This is an in-text commentary. }

{ This is a much longer comment,
  involving multiple
  lines. }

The comment braces are reserved for annotations such as the intermediary profound.

(This is a joke, of course.) Seriously, though, the comment is precisely what it looks like: an annotation that will never influence the surrounding text in any way.

The rest of syntax manifests itself.

Form (Cont.)

The actual specification of the standard dialect begins here.

{ 1. Void manifests itself. }
void.

To speak of void is to say nothing.

{ 2. Iota is an intangible particle distinguished from void. }
iota := void or not void.

For iota signifies meaning, void a lack thereof.

This is the first proposition to use the saying semantic :=, pronounced as “is-of.” Saying is one of the two ways to define a new sign: the term on the left is said to be of the term on the right.

Note: iota outlines the law of excluded middle.

{ 3. Boolean is a iota of truthfulness. }
boolean := iota.

Truthfulness is notably absent from the language.

Logos is a pure language: it’s limited to a set of grammatical rules, governing how the words must relate to punctuation with respect to their propositional signs. As it is the case here, boolean is simply said to be of iota.

{ 4. True and false are boolean possibilities. }
true, false := boolean.

In the standard dialect, boolean is limited to true and false. This means that a boolean sign can only be realised as either true or false, just like iota can can be realised as virtually any other sign.

Up to this point, the dialect has only dealt with atomic statements, with primitive right-hand values, but this is not necessarily the case with the saying semantic. In this case, to describe a set of logical propositions, to each and every one of them a textual right–hand value was assigned: <proposition> := <text>, with the description aligned one tab into the main text.

Further you will see how the structural semantics work.

p -> q is a structural implication, roughly understood in the following way: “if p is the case, then q is said to be the case.” When there’s nothing to the left of the symbol, it’s assumed that what’s the case has to do with the meaning of the whole text; within a propositional sign, -> q determines the meaning of the proposition.

p = q is a structural comparison; it’s the case whenever it’s the case that the abstract term p has sense of the concrete term q. For example, with boolean p the proposition p = true is only the case whenever p is true.

p ? q is structural matching; it’s the general form of structural comparison, in that it covers everything: e.g. for boolean p, to the right of p ? must be a series of implications for each and every case of p, as seen below.

{ 5. Truthfulness gives rise to propositional logic. }
not p :=
	p := boolean.

	-> p ?
		true  -> false.
		false -> true.

p and q :=
	p, q := boolean.

	-> p ?
		true  -> q.
		false -> false.

p or q :=
	p, q := boolean.

	-> p ?
		true  -> true.
		false -> q.

p xor q :=
	p, q := boolean.

	-> (p or q) and not (p and q).

These propositions express the foundation of logic.

By default, their linguistic form (“not p”, “p or q”, etc.) is complete nonsense. In order to add sense, p := boolean within the description—indicates that p in the form of so said proposition has sense and such of boolean, as opposed to completely nonsensical word “not”. This allows to substitite boolean instead of the literal word “p”, as opposed to “not” which cannot be substituted.

A combination of propositional and structural semantics can be used to define logical structure to any linguistic form. This is part and parcel of discursive reasoning in–logos.

The words “not”, “or”, “and” and “xor” are nonsense, but within the corresponding propositions they have a clear function: to determine the proposition’s linguistic form. One of the many novelties of logos as a computational framework, is its high tolerance for nonsense, which makes it a good fit for discursive modelling.

{ 6. By default, all iota values are void. }
value is void :=
	value := iota.

	-> value ?
		void -> true.
		not void -> false.

So far this document has only covered the sense of different signs which determines how they relate to each other, but there’s also meaning of the sign, what’s commonly refered to as the sign’s value.

By default, all signs are described meaningless. To avoid clutter and additional nomenclature, we simply talk of meaningless (undefined) signs as void and meaningful (defined) signs as not void. The requirement on structural matching is to cover all possible cases; this means it can be used not only for sense of concrete iotas, but for the iota values too.

Note: The propositions whose values depend on one or more meaningless signs will not be computer and will yield an error.

{ 7. Text is a non-empty sequence of propositions. }
text := iota...

Text is constructed with <Tab>, look for examples above.

The only proposition defined for text is the expansion semantic text… which is meant to “read out” the text. This makes it possible to first treat text as a first–class term, analyse and aggregate it, and then process it whenever needed.

Text expansion is akin to a function call in programming languages.

{ 8. Repetition over a range of values. }
n, m := 0, 10.

i <- n..m :=
	{ This text is called 10 times with i = 0, 1 ... 9. }

The logic of any algorithm is deeply entranched in the web of sequential conditions and repetitions: whenever a certain condition is met, a set of actions further feeds the logic of execution.

In this proposition, the n..m range semantic was first introduced.

The range facilitates repetition; i <- n..m := <text>, where in text term i is bound to each of the values within the range. The text is repeatedly read out with different values of i in the order these values are arranged within the range. Both n and m must be integer terms, If n > m, the text becomes senseless.

{ 9. The intuitive if, then, else conditional construct. }
if condition, then clause :=
	condition := boolean.
	clause := text.

	condition = true -> clause...
	-> condition.

clause else alternative clause :=
	clause := boolean.
	alternative clause := text.

	clause = false -> alternative clause...

With the help of expansion semantic, more complicated procedures can be constructed. For example, there’s no arguing about the fact that “if, then, else” construct makes more sense in the context of natural languge than the structural comparison semantic.

As you can see, the value of “if then” proposition is the value of the condition, which allows the “else” condition to pick up on it (the if-then clause). Then, the else proposition does not yield a value because there’s nothing to pick up.

{ 10. Actor is a iota of subjectivity. }
actor := iota.

For discourse, one is ought to differentiate the *object*—language that is being used, from the *subject*—participants of so said discourse.

The pronouns are commonplace in natural languages, but no programming language makes a distinctions between the object and the subject of discourse. In–logos, this is done va actor, a iota of subjectivity.

Although no special propositions are defined for actors, the different terms, may be compared against each other semantically, allowing to differentiate the current speaker from the other speakers involved in discourse prior to that moment.

{ 11. This is the currently speaking actor. }
this := actor.
this <- { current speaker }

The actor obeys grammar just like everything else does.

You probably can see that the text before your eyes is invalid, deliberately so, to illustrate the assignment semantic. Previously, it was shown that all the terms in the dialect have got values associated with them. In order to mutate them, we use the <- symbol: the value of the term on the right is assigned to the term on he left.

Once the value of the sign is set, it gains meaning.

If the proposition can potentially change the state, its form must contain the ! imperative sign. You can be able to determine whether if the proposition will have any side effects on the model from the looks alone! If the text contains either <- or !, but the propositional form wouldn’t contain ! in it, logos will yield an error.

{ 12. Alien is an object from the other world. }
alien atom ::
	atom := iota.

	{ context-defined propositions }

When dealing with any structure, at some point it’s required to go beyond it, interact with the outside. In programming, we employ the concept of a black box, for which the only way of interaction with the outside is by means of an interface.

There’s only so much computation you can do in logotic–symbolic fashion. Eventually, you would have to go beyond it and at some level of analysis you’ve actually got to run a computer program somewhere. Alien is the interface for propositions from within the dialect to interact with the outside systems, without having to model them inside.

This proposition introduces the showing semantic :: which is effectively the only other way signs can be constructed. (As opposed to saying what they are.) For the illustration purpose it’s also invalid. The concept of the outside is not expressible in–logos for the reason that the limit of the world is determined by the dialect.

It is shown that aliens exist.

{ 13. Whole numbers can be shown, too. }
int ::
	i, j := int.

	i + j -> int.
	i - j -> int.
	i * j -> int.
	i / j -> int.
	i ^ j -> int.   { raise to the power }
	i mod j -> int. { remainder }

	i <  j -> boolean.
	i >  j -> boolean.
	i <= j -> boolean.
	i >= j -> boolean.

	|i|  -> int. { absolute value }

{ 14. Real is a floating point number. }
real ::
	i := real.

	{ All of the integer propositions and }
	floor i -> real.
	round i -> real.
	round i to even -> real.

Integers make a perfect example of the sign that can’t be said, but can easily be shown to exist. Funny fact: any sign for which the complete list of integer propositions is defined, would qualify as an integer. In programming, they sometimes refer to this as duck typing: “If it walks like a duck and it quacks like a duck, then it must be a duck.”

Note: Neither i and j are present in the form of the integer sign. In this case we refer to them as placeholders—a short local alias for the sign.

{ 15. Rune is a text character. }
rune := int.

There’s a finite number of text characters, so each can be represented by a whole number. This is exactly what Unicode does. The rune uses Unicode, too, so it can become any letter or number of any human language, a symbol like ⧑ or ⧒, or an emoji.

No propositions are defined for runes in the standard dialect.

{ 16. List is a sequence of ordererd items. }
item list ::
	(list)
	item := iota.
	pos  := int.

	list length -> int.
	list[pos] -> item.
	item in list -> boolean.
	count item in list -> int.
	search item in list -> pos list.
	add item to list!
	add item to list before #pos!
	delete item from list!
	delete from list at #pos!

The list is a complex sign in that it’s the first sign whose form consists of multiple partially defined terms (not to be confused with propositions!)

The word in parentheses at the top is called the alias, it’s used in the definitions of complex signs to instead of multiple partially defined words, use one. In this case, regardless of what list is dealt with, in the definition it can simply be referred to as list.

{ 17. Text string is a list of runes. }
string := rune list.

{ In-text string construction:

	greeting := "Hello,  world!".
	multiline := |
		${greeting}

		In programming, they often say things like that.
		Funnily enough, that we like
		to say in–logos, too.

The multiline string will begin with "Hello world!". }

Text string is the most popular data structure in programming.

In–logos, it is expressed with a single proposition. Whenever an ad–hoc string has to be constructed in the text, it can be—using double quotes, e.g. “ad-hoc string with a line break\n”. While we’re at it, runes can be constructed, too—with single quotes.

In the example above you can see that a multiline string can be constructed with the help of | symbol. Not only does it allow to express large strings, it’s also capable of what’s knows as interpolation: all instances of ${proposition} are replaced with the string representation of the corresponding proposition. This will work automatically for the standard signs, such as int or string, but for the others, <sign> representation -> string proposition has to be defined.

{ 18. Map stores a value for each of the keys. }
for a key a value ::
	(map)
	k, v := iota.

	map length -> int.
	map[k] -> v.
	k in map -> boolean.
	remove key k in map!
	remove value v in map!

Map, commonly known as dictionary, is used whenever one needs to store and repeatedly access a set of values corresponding to unique keys. For example, if you were to create a synonym dictionary, you would probably do it like this:

Thesaurus := for a word a word list.

Where word is probably something like a string.

{ 19. Enigma is a mathematical secret. }
enigma ::
	(it)
	input, output := iota.
	somebody := actor.

	scramble input with it -> enigma.
	verify it -> bool.
	encrypt input with it -> enigma.
	decrypt input with it -> output.
	author of it -> somebody.
	is somebody author of it -> bool.
	proof of it -> enigma.

Enigma is a cryptographic secret; chameleon, defined by a set of propositions that provide a single high–level abstraction for all common operations, such as encryption, decryption, signing, 0-knowledge proofs, shared secrets, and many useful cryptographic protocols.

One should think of it as a key, hash, cipher, and a ciphertext simultaneously.

{ 20. Panic abruptly renders discourse senseless. }
panic! :=
	void <- not iota.

The most fitting mental model of logotic computation is that the text itself is executed—inside the virtual machine. Discourse is merely a vessel of computation, while propositions can be thought of transactions, pronounced in order by their corresponding actors. Whenever something happens that doesn’t make sense, it’s useful to be able to render text, and for that matter, the whole discourse—at some atomic point of time—senseless.

Once a panic is invoked, the transaction of the text that was read out at the time, is immediately rolled back.

Credits

The research of logotic computational model and the language is led by Aletheia nove, a research initiative led by Ian P. Badtrousers.

All rights reserved.