Category:Enguage

From Rosetta Code
(Redirected from Catagory:Enguage)
Language
Enguage
This programming language may be used to instruct a computer to perform a task.
See Also:


Listed below are all of the tasks on Rosetta Code which have been solved using Enguage.

Enguage is a speech understanding algorithm, implemented in plain Java, which supports the idea that speech is Turing complete. It is informed by linguistic theory, in particular Pragmatism, Ordinary Language Philosophy and Speech Act theory. The latter two were developed in the second half of the 20th Century, that is, at the same time as the rise of traditional context-free programming languages.

While the examples here are given in English, it can be applied to any natural language. While untested, it should work with Unicode characters so it could be used to implement John Searle's Chinese Room. Enguage, therefore, refers to the interpreter and not the language which it interprets.

It can be used to process data, but it is not efficient in doing this; and it is largely unsuitable for interpreting writing, as this is not a discourse.

Background

Enguage was developed in C between 2011 and 2013, and in Java ever since. It remains experimental; however, it won the British Computer Society's Machine Intelligence Competition in 2016. The name "Enguage" is a portmanteau of the words Language and Engine - hence its unconventional spelling.

If you have make and git installed, Enguage can be downloaded from the source code repo [1], built, and run in three ways, thus:

    $ git clone https://bitbucket.org/martinwheatman/enguage.git
    $ cd enguage
    $ make jar
    $ export PATH=$PATH:./sbin # the full test suite calls scripts in ./sbin
    $ java -jar lib/enguage.jar -t
    $ java -jar lib/enguage.jar -T hello
    $ java -jar lib/enguage.jar

These three examples of running the interpreter are: -t, the full unit test suite; -T the unit test for a given concept; and, the interactive shell.

The interpretation of language is defined in written specifications, under the etc/ directory. Repertoires, each supporting a concept are under etc/rpts and unit tests are under etc/test. An 'active' dictionary, of entries with an embedded unit test, is under etc/dict. The interpretation of language can also be supplied by utterance, i.e. by speech, and some of the written specifications demostrate this style.

Linguistic Influence

Enguage draws inspiration from Semiotics and linguistic theory and is an attempt to implement Ordinary Language Philosophy. This rejects the idea the there is an underlying mathematical logic to language. The schism between the logic and semiotics is reflected in the dyadic and triadic sign models. Semiotics is the study of signs, and a sign is simply the atomic element of meaning. This is a brief synopsis of the influences.

Pragmatism

Charles Sanders Peirce devised the philosophy of Pragmatism, that things are defined by their effect, which is summarised in his Pragmatic Maxim

Dyadic Semiology

Ferdinand de Saussure created the first synchronic model of language - how a language works at any one point in time. He described a dyadic sign at the heart of this Semiology. Here, a signifier, a written or spoken artefact, signifies a mental image. There is an arbitrary link between what it said and its signified mental image.

Triadic Semiotics

Around the same time, but independently, Peirce devised a triadic model, which is composed of: a sign vehicle, or Representamen; a referent Object to which the sign vehicle refers; and, the necessary reasoning within the mind to make the connection between the two, Interpretant. Therefore, the triadic sign is a model of subjectivity.

Peirce describes the object being referenced in one of three ways, and as symbolic information, language works at the third level. So, at the first level the color red may represent danger, and at the second level there are many instances of this, such on a hot tap or stop switch on a machine, but it is at the third level in which we propagate this as an idea by saying, "red means danger".

The Meaning of Meaning

An equilateral triangle is labelled with Symbol to the left, Object to the right, and Thought or Reference to the top apex. The base line is dotted to signify the implied relationship between the Symbol and Object is only achieved through the Thought or Reference of the interpreter.
The Semiotic Triangle of Reference, figure taken from page 11 of The Meaning of Meaning.

British linguists C. K. Ogden and I. A. Richards wrote The Meaning of Meaning [2] in 1923, which draws on Peirce's Semiotics and illustrates the functioning of speech in the Semiotic Triangle. The Symbol, bottom left corner, implies the referent Object, bottom right, through the dotted baseline; but, that connection is only ever made through the top apex, by thinking.

Further, the Symbol has a 1:1 relationship with the interpretation, but those Thoughts or Reference may refer to one or more objects. This is an illustrates the difference between an arithmetical function, which has one return value, and that of a programming language which, due to its conditional processing quality, may have one of several replies.

Ogden and Richards highlighted the symbolic nature of speech: "Words, as everyone now knows, 'mean' nothing by themselves, although the belief that the did, ..., was once equally universal" (pp.9-10)

Gödel Numbering

In his Incompletenes Theorum, Kurt Gödel devised a numbering scheme, Gödel Numbering, as a representation of logical proofs, so as to show that there are statements that can be made in a system which cannot be proved by that system. This is used to express "this sentence is not provable", ultimately showing mathematics to be incomplete. This non-consecutive numbering system can be adapted to present a symbolic representations in linguistics.

Speech Act Theory

J. L. Austin used his William James' Lecture, at Harvard in 1955, to critique the traditional analysis of language towards truth statements. He introduce the idea of performative statements which include: what is uttered, locution; what is meant by this, illocution: and, the outcome of this speech act, perlocution. The successful outcome, the felicity, is dependent upon the circumstances, and by whom, the speech act is uttered. This work was published posthumously in [3] The emphasis on outcome reflects Peirce's idea of effect in Pragmaticism. This became codified in John Searle's Speech Act theory.

Implicature

H. Paul Grice's William James' Lecture, at Harvard in 1957, introduced his ideas on meaning outside of traditional linguistics. This includes the idea that meaning, in a wider sense, is implicated by utterances.

Algorithm

Enguage models utterances as symbols and replicates the idea of function illustrated in the Semiotic Triangle. As a symbol processing system, Enguage is grounded in symbols. Therefore, referent objects, and thoughts and references, are also symbols. Thoughts and references may also serve as symbols in further triads, like functions in a programming language may call other functions, and so there is a process of semiosis occurring.

Symbols can be represented as numeric values. In software, this is typically as consecutive numbers, such as false=0 and true=1. In a simplified representation, a string may be represented numerically, thus: "a"=1, "b"=2, ... "z"=26, "aa"=27, and so on. A full utterance is merely an array of such values, to an arbitrary base, so ["i", "need", "a", "coffee"] is simply a large integer value, in much the same way as [1,2,3,4] might represent 1,234 in base 10. Enguage is not concerned with deconstructing symbols nor with defining what a symbol, ostensibly, means.

Enguage swaps two symbols: the user's utterance, "hello", with one of the replies given in the interpretation, "hello to you too", but this is not a dyadic relationship. It can be defined, directly, by the utterance On "hello", reply "hello to you too".; but this instruction can be augmented by further implications, e.g. This implies ... . There is always the intermediate thought: the symbol always refers to (or symbolises in the above diagram) the instructions on how to reply.

As a simple arithmetic example, "what is two plus two" may imply "4, 2 + 2 is 4", but can only through the thought "{2 + 2}". This unnamed function is known as a lambda. This is why linguistic is more complex than arithmetic, and perhaps why mathematics does not underpin language. Further utterance, the lambda, requires the maintenance, and use, of a replied answer (e.g. 4) and a socially defined format within which to place it (e.g. "ANSWER, UTTERANCE is ANSWER") and the status, or felicitous outcome, of that thought to direct the processing of the lambda.

Ambiguity

Each utterance has one or more interpretations [4], which is the equivalent of a function in a traditional programming language. Each function can be specified in a .txt file, or can be created by utterance, e.g. "to the phrase hello reply hello to you too." A group of utterances, a repertoire, equivalent to an API in traditional languages supports an idea, or concept. For example, a simple repertoire might be: i need a coffee, i do not need a coffee, do i need a coffee and what do i need.

Hooks

As well as the 'on "..."' and 'reply "..."' imperatives, Enguage also has several other such 'hooks' to allow other operations available to the software to be called, such as perform "..." to access the Java classes, and run "..." to run an external command. That Enguage passes off processing to traditional software is regarded as little different to machine code operating an ALU to provide arithmetic operations.

Turing Complete Lambda

The Turing complete quality of a function is that it is represented as a list of instructions, a lambda. These instructions can form loops, and can be conditionally operated, and are implemented by the implemented language, not in source code (i.e. within the interpreter). The felicitous nature of a thought can be used by prefixing a subsequent thought with, for example, 'if so, ...', if the outcome is positive, and 'if not, ...' if it negative. So as not to create reserved words, these can be configured as required by the language. This supplies the idea of conditional processing and recalling (recursion) is used to create loops, see the FizzBuzz example. Thus, interaction with Enguage is always given as a Turing complete discourse: utterance to reply.

Concepts

A concept is supported by a repertoire of utterances.

We

The concept of we is supported by the following repertoire. This file also includes unit tests for the concept, behind the #] symbol.

Perhaps quite subtly, you and i means that we is set to i. This is because Enguage swaps the personal pronouns, internally, which perhaps needs fixing?

    On "we are you and i":
	    set the value of we to i;
	    reply "ok, we means you and i".

    On "we are THEM and i":
	    set the value of we to THEM;
	    reply "ok, we means you and THEM".

    On "who are we":
	    get the value of we;
	    if not, set the value of we to i;
	    reply "ok, we means you and ...".

This concept is built upon the concept of setting/getting values which ultimately implemented by the Enguage Value class. The truth of 'who we are' is set and used by utterance.

Holding Hands

The concept of we can be used in the concept of holding hands. What follows is a fragment of the Holding Hand concept, the portion used in the If/Then concept.

Holding hands acn use teh we concept, by asking who are we, in the first line of interpretant. There are two replies, depending on whether you and I are holding hand or I am holding someone else's hand. The 4th line shows that Enguage still swaps words to an internal version, so it swaps personal pronouns: I/you. This doesn't read correctly, and whould be address: thre is no ghost in the machine to be satisfied.

    On "we are holding hands":
	    who are we;
	    set someone to ...;
	    i am holding hands with SOMEONE;
	    is someone set to i;
	    if so, reply "ok, we are holding hands";
	    reply "ok, you are holding hands with SOMEONE".

This value can then be retrieved. There are three replies: if I am not currently holding hands; if I am holding a third person's hand; or, if I am holding your hand.

    On "whose hand am i holding":
	    perform "link exists martin holdinghands";
	    if not, reply "sorry, you are not holding anyone's hand";
	    perform "link get martin holdinghands";
	    set someone to ...;
	    is someone set to i;
	    if so, reply "ok, you are holding my hand";
	    reply "ok, you are holding SOMEONE''s hand".

References

Pages in category "Enguage"

The following 2 pages are in this category, out of 2 total.