sEnglish - system English - is a controlled natural language, i.e. a subset of standard English with meanings of sentences defined by code in a high level programming language such as MATLAB, GNU Octave, SciLab, Python, etc. sEnglish is also an example of natural language programming as the most important feature is that a correctly formulated sEnglish text compiles into program code unambiguously if predefined sentence structures and an ontology is defined. This enables a programmer to enjoy the convenience of natural language while keeping with the usual determinism of digital programs. Once a database of sentences and ontologies are built up, the clarity and configurability of a project written sEnglish become considerably in advance of any other current programming language. Conversely errors in functionality are reduced due to sEnglish’s inherent verification mechanism.
Here is an example section of sEnglish code for a sliding mode controller of an autonomous rover vehicle:
Find your current position Pc. Define Hd as a 'heading direction'. Execute " Hd = Pnxt-Pc; ". Detect obstacle position Obst in heading direction Hd. If Obst is empty, then move with heading direction Hd. If Obst is not empty, then do the following. Compute turned heading direction Hds from Hd. Detect obstacle position Obst2 in heading direction Hds. If Obst2 is empty, then move in heading direction Hds. If Obst2 is not empty, then do the following. Compute turned heading direction Hds2 from Hds. Detect obstacle position Obst3 in heading direction Hds2. If Obst3 is empty, then move in heading direction Hds2. Finish conditional actions for second heading. Finish conditional actions for first heading.
This compiles into a high level code unambiguously when supported by suitable knowledge base of an ontology and sentence definitions.
sEnglish provides opportunity to formulate sentences for:
(1) Procedural actions where some things are available and new objects are created (2) Relation statements of any kind where the effect of interpretation can be to modify an environmental model. (3) Questions which can be interpreted as either a procedural description or and agent modelling of what another individual would like to know.
Hence sEnglish can serve as procedural and model based knowledge representation, as specification, and query language, and is intended for professionals who want to use formal descriptions of their procedures and models in their subject area. sEnglish appears perfectly natural and it can be read and understood by anybody.
sEnglish papers, books or documents are programs that can be read as ordinary engineering, scientific or legal work in English, i.e. they have title, author/affiliation/address, abstract, introduction, section(s) conceptual descriptions, sections and subsections on modeling descriptions and procedures. sEnglish creates the new concepts of publishing for machines and humans in the same documents. sEnglish document interpretation does not depend on a central database. Each document is normally self contained except if references are given to another sEnglish document which then becomes attached, i.e. part of a larger sEnglish document and thus forms a self-contained document that unambiguously compiles into a high level code MATLAB, GNU Octave, SciLab, Python, etc.
sEnglish in a Nutshell
This section is a brief account of sEnglish that
* briefly describes the vocabulary * comments on the syntax of sentences and ambiguity resolution * explains dictionary style definitions of sentence meanings by other sentences * presents sEnglish as a language of computer programming * presents sEnglish as a publication language for engineers and scientist * presents sEnglish as a language of human-computer communications * compares sEnglish with available controlled natural languages * describes its wide application areas * comments on the history of sEnglish
Vocabulary
sEnglish is the most natural in the sense that it limits the rich use of natural language phrases to the least degree from among the controlled languages. So in practice there is no limitation on the vocabulary relative to the natural English. Part of the vocabulary is a set of concepts that are defined in an ontology. All kinds of verbs expressing actions and relationships, adjectives, adverbs can be used. Use of pronouns is permitted but is of limited utility in sEnglish texts. Instead of using pronouns the important entities are named and can be hence concisely referred to.
Syntax and use sentences
There are a few syntax rules that must be kept to formulate correct sEnglish sentences. The most important are:
*Sentences must start with capital letter and end either with full stop "." or by question mark "?". *Object names must match the preceding class name when used.
Embedded objects need to obey their syntax, i.e. (1) quotes must be between '... ', (2) high level codes between "... " , (3) physical quantities start with ~ followed by a number and physical dimension without space in between, (4) pure numbers (dimensionless quantities) are described in either signed integer, fixed point or floating point formats, for instance 5, -12, 34.98, -35.1, 1.2e-6, 3.4e+10 . (5) symbolic expressions and equations must be between $..$ or $$ ... $ or between ... (6) images must be declared in format.
Base ontology
sEnglish uses a very simple ontology language (called MOL for Machine Ontology Language) that makes it compatible with all ontology languages in mainstream use such as OWL and other ones used by the Protege. Apart from its simplicity the main advantage of MOL is its simple unicode text representation without elaborate lengthy descriptions in XML. Here is an illustration of a MOL ontology section:
>physical variable @notation : char @physical dimension : char @signal correspondence : char >physical numerical vector @components : set of physical variables >signal @symbol : char @time axis : double @data : double @dimension : char @voltage range : char @handler agent : char >>measured signal @digital communication : digital port @perception post-processor : char @A2D converter : char @sensor location : char @sensor dynamics : dynamics @sensor : char >>actuator signal @actuator pre-processor : char @D2A converter : char @actuator location : char @actuator dynamics : dynamics >array : double -- s=rand(10,2) >>periodic time axis -- s=0.1*(1:1000) @@..: min(size(..))1 & length(size(..))2 >>vector >>>regressor vector >>>classification surface >>matrix -- rand(2,2) @@..:min(size(..))>1 >>>symmetric matrix -- >>time lagged array >>>scalar -- s=1000*randn(1) @@..: max(size(..))==1 >>>>learning rate -- rand(1) @@..: ..>0 >>>>integer -- s=round(1000*randn(1)) @@..:round(..)==.. >>>>positive number -- s=round(1000*rand(1)) @@..: ..>0 >>>>nonnegative number -- s=round(1000*randn(1)) @@..: ..>=0 >>>>negative number -- s=-round(1000*randn(1)) @@..: ..<0 >>>>imaginary number -- s=sqrt(-1)*round(1000*randn(1)) @@..: imag(..)~0 & real(..)0 >>>>complex number -- s=round(1000*randn(1))+sqrt( 1)*round(1000*randn(1)) @@..: imag(..)~=0 >>>>real number -- s=-round(1000*randn(1)) @@..: imag(..)~=0 >time period : physical quantity
Here the >...> mean class name definitions, larger numbers of > mean subclass of the class above. the @ sign is used for attributes with classes declared after a ":" which can be either a class name or a basic class of the underlying high level programming language (MATLAB, Octave, SciLab or Phyton) or and expression "set of ..." where the ... can be substituted by either a class name or a basic programming language class. The -- is use to define sample generators in terms of the underlying programming language.
Semantics of sentences
The meaning or semantics of an sEnglish sentence is always defined by one or more sEnglish sentences. For instance the sentence:
Use 'smc01-control' to obtain control torque T and control force U for spacecraft Spc01 from dynamical state X and guidance reference Xnow.
is defined by a set of sEnglish sentences:
If U_ is 'smc01-control', then do the following. Define surface weights Alpha as "". Initialise matrix Phi as a 'unit matrix'. Define J as the 'inertia matrix' of Spc01. Compute matrix J2 as the inverse of J. Compute position velocity error Ve and angular velocity error Oe from dynamical state X, guidance reference Xnow . Define the joint sliding surface G2 from the position velocity error Ve and angular velocity error Oe using the surface weights Alpha. Compute the smoothed sign function SG2 from the joint sliding surface G2 with sign threshold 0.01. Compute special dynamical force F from dynamical state X and surface weights Alpha. Compute control torque T and control force U from matrix J2, surface weights Alpha, special dynamical force F, smoothed sign function SG2. Finish conditional actions.
some of these sentences used in the definition are themselves defined by other sentences, the nesting of explanations can be very deep, up to a hundred or so. When no more explanation are required to explain the meaning of a sentence then a simple root sentence of the form:
Execute code " ... " .
can be used where the ... is substituted by some code of the underlying high level programming language (MATLAB, Octave, SciLab or Phyton).
sEnglish as a language of computer programming
sEnglish is ideally suited for high level computer programming. Its introduction supports the further use of digital computers for their predictability and support improved accessibility for non-professionals to computer programming. Software manufacturers (by basic instinct) have been pushing towards graphical user interfaces that prescribe functionality and limit flexibility and need skills to prepare. At the time of the start of the PC in the early 80s everyone had reasonably efficient access to computer programming. By now software writing has become an involved and expensive business that regenerates its privileges and money earning interests by making programming ever more complex.
sEnglish provides a novel route to programming for the public where predefined sentences and ontologies are available. It is a new paradigm of programming, a top-down design, where one conceptually formulates one's problem first and then defines one's most important sentences, explains those by other sentences and finally one plugs in some high level programming code that is in itself easy to read such as MATLAB, GNU Octave, SciLab or Phyton. Further information is available in a book . sEnglish fits into the history of human-computer interactions as a step forward.
sEnglish as a publication language for engineers and scientist to create knowledge bases
Another facet of sEnglish is that its "programs" are actually documents that can be compiled into .tex and pdf files that are formatted as engineering/scientific publications. The reverse is also true: the visual PDF file is also self contained for the program communicated. sEnglish is nto a markup language. When you read an sEnglish PDF document (that is actually a computer program), you do actually get the whole content of the program, there are no hidden markings to help meanings. Some types of publication documents are as follows:
(1) Procedures and skills can be published for intelligent software agents in sEnglish.
(2) System models, spatial temporal and structural relationships and system architectures can be described in a machine parse-able way in natural English.
(3) Integration documents for large engineering projects can be documented for easy sharing and transfer of knowledge in easy to understand sEnglish manuals.
Relative to other controlled natural languages (see details below) sEnglish needs very few additional data base (no central data base) of knowledge to create highly natural machine interpretable English technical text. Here are some pages from sEnglish PDF documents:
sEnglish as a language of human-computer communications
Any imperative sentence in an sEnglish program is an instruction to the computer what to do. This does not however qualify for communication between human and computer as it is defined prior to the operation of the system programmed. When sEnglish sentences are communicated in realtime to a computer program that has an sEnglish interpreter, then the meaning of the communication can be executed to achieve some required action.
Assume a human operator reads the sEnglish code that operates a machine. Then it knows what objects it uses to model its environment and what sentences it uses to do certain actions. The operator can use this knowledge to instruct the computer to carry out some required actions. For instance the program of autonomous spacecraft Sp02 clearly names the other spacecraft as Spc01 and Spc02. The operator can then send a sentence to Sp02 for execution such as "Dock with spacecraft Sp01 within ~3hours." The meaning of this sentence is explained by other sEnglish sentences in the code of Sp02, so the operator clearly know ho things work.
Apart from this direct use of sEnglish for natural language communications between humans and agents (and between agents and agents), one can use the sEnglish to define an agent communication language ACL that does not use sEnglish sentences but another interpreted language to suit the application area. This natural language description on how an agent interprets its communication, makes the epistemic nature of how an agent handles credible and not creditable information very clear to human operators. This is a unique feature of sEnglish among the controlled natural languages available today.
Comparison with other controlled natural languages
Most machine readable controlled natural languages can be compiled into other knowledge representation formats such as common logic or descriptive logic, etc. that makes that representation searchable and queried in many ways. The most notable controlled natural languages are briefly reviewed here and their relationships to sEnglish are briefly explained. In some cases there is some opportunity to connect them with sEnglish to produce an even more powerful system.
Overall sEnglish has its most important and distinctive feature that it compiles into a high level program code - and not into another knowledge representation language as other controlled English languages do that. This associates every English sentence directly to a “meaning” within a computer program. sEnglish also has the unique triple role of programming, publication and communication language. Comparison with Attempto Controlled English (ACE)
Attempto is a controlled English that compiles restricted English text into FOL, PQL, FLUX, RuleML or to OWL DL that are formal knowledge represntation languages. The semantics of these formal languages need to be further defined before sentences can have a meaning for machine. In fact this translation exercise into a formal language is only scratching the surface of what one may call agent's understanding, world modeling, planning of actions and decision making is still a major remaining task.
As opposed to Attempto, sEnglish sentences compile into a high level language. If sEnglish is used for communication then functions can be defined in this high level language to carry out world model modifications by the agent. This is a more direct approach to what an agent needs.
Yet the most important difference between Attempto and sEnglish is that
* Attempto is a language intended for formal world model descriptions and communications, it would be difficult and inefficient to write computer programs and procedures in Attempto. * sEnglish is primarily intended for describing procedures, system operations, it is primarily for programming. These fundamental differences can make Attempto a complementary system sEnglish of knowledge representation to build a joint powerful systems where underlying functionality is defined in sEnglish. Such a system can describe procedures and communication procedures of engineering systems more effectively, especially for autonomous systems or distributed engineering projects that involve large teams of human developers.
Syntactic differences are:
(i) Attempto uses basic grammar for sentence interpretation rules, sEnglish uses very small amount of grammar and recognizes sentences by their definition forms.
(ii) Attempto uses databases for word classes such as verbs, nouns, adverbs, pronouns, etc. to interpret sentences. sEnglish only needs a set of sentences each defined by a set of other sentences (dictionary like manner) and it also uses an ontology of not words but concept names that can consist of several words.
Comparison with Common Logic Controlled English (CLCE)
John Sowa's CLCE is a way to state logic formulas in English. Under certain conditions the translation is bidirectional, i.e. from first order logic (FOL) to English and from restricted English to FOL. This makes CLCE especially suitable to articulate mathematical relationships precisely in English. As ACE also compiles into FOL, CLCE is aimed at describing modelling relationships in a formal manner. Therefore the comparison points made above between Attempto and sEnglish remain valid:
(1) CLCE is a language intended for formal world model descriptions and communications, it would be difficult and inefficient to write computer programs and procedures in CLCE. On the other hand sEnglish is primarily intended for describing procedures, system operations, it is primarily for programming.
(2) CLCE uses basic grammar for sentence interpretation rules, sEnglish uses very small amount of grammar and recognizes sentences by their definition forms.
(3) CLCE can usefully rely on databases for word classes such as verbs for predicates, nouns for variables and prepositions for special predicates to interpret sentences. sEnglish operates by a self contained list of sentences each defined by a set of other sentences and it also uses an ontology for concept names that can consist of several words each.
Comparison with Processable English (PENG)
Similarly to Attempto and CLCE, Processable English translates a syntactically correct English text into first order logic (FOL) statements. Hence some of the comparison statements made above for Attempto and CLCE, are also valid for the comparison of PENG and sEnglish. To summarize, the main differences are:
(1) sEnglish has relatively small amount of grammar relative to ACE, CLCE or PENG.
(2) sEnglish focuses on meaning definition by other sentences when defining a sentences, not on forming a sentence that permits a logic representation as in ACE, CLCE and PENG. Each sEnglish sentence has a corresponding a high level program code.
(3) sEnglish relies on a sentence library for the interpretation of any text, each sentence compiles into a high level code that is a function with input-output objects.
Application areas
sEnglish is ideally suited to record numerical and symbolic procedures for sensing, signal processing, decision making and cognitive processes in general. sEnglish has been applied to build procedure libraries for
* programs of adaptive feedback control systems for variety of applications * accounting and company management automation * programs of intelligent autonomous agents * procedural knowledge descriptions for intelligent agents - knowledge libraries for intelligent agents * manuals/programs in factory automation * manuals/programs of household appliances * manuals/programs of communication devices and general gadget * manuals/programs of some car or other vehicles functionalities
etc.
These applications are generic and penetrate every walks of life and work. As digital computers are pervasive so is sEnglish.
History
Itself the idea of trying to create a programming language using natural language sentences is quite old. On discussion forums, on bulletin boards and in private conversations it has often been commented that natural language programming is "not feasible and practical because of the ambiguity of natural language" that is determined by the context and the situation model in which communication by a sentence is taking place.
How is it then possible to create a programming and publications language that is unambiguous and yet uses natural language sentences? Information is available in a book, and on the sEnglish website and community website where some sEnglish publications are kept.
The idea of the actual possibility occurred to Prof Sandor M Veres (University of Southampton, UK) during the European Control Conference in Porto, Portugal, 2001. In the following 7 years many elaborate versions of sEnglish were created and some patents submitted with regards to its use in robotics and intelligent machines. For the public the use of sEnglish is freely available. The final version that has been carefully polished to stand the test of time is now ready in the form of sEnglish. The current version has been cut to the bone for its simplicity and perfect formal verifiability. Any further enrichment of sEnglish by more grammar will not affect the interpretation of past text written in sEnglish. Its safe working is based on precise mathematical theorems and logic.
|
|
|