Click here for more information

SAMPLE Language & Programming Technology






Build a program immediately from data processing examples



Please go to http://sampletalk.8m.com , which is updated version of this homepage. Information below is out-of-date and remains here only for keeping old links.


Build a program immediately from data processing examples

A.Gleibman andrew@nsimail.com: SAMPLE Language & Programming Technology


This is a short description of AI language SAMPLE and of the corresponding programming technology. I came to this language and technology several years ago doing research in the area of inductive program synthesis. Surprisingly for me at that time, SAMPLE turned out to be as suitable for programming by a human as for automatic program construction. Now I am convinced that it is more suitable for humans than many of the existing programming environments.

SAMPLE is related to AI, Linguistics, Mathematics, and, more specifically, to Logic Programming, Program Synthesis, Corpus Linguistics, Machine Translation. It rises interesting technological and philosophical questions: SAMPLE provides the most natural way of programming in many areas beginning from text processing. It appeals to human intuition and demonstrates absolutely unexpected power over algorithm creation.

The most intriguing features of SAMPLE are almost complete absence of syntax (!) and extreme similarity of program code elements to samples of the data being processed. Now as I have intrigued you (as I hope), let's consider a brief description of SAMPLE in the form of an ad:














S A M P L E: Programming Technology and AI Language.

Data processing example abstraction immediately becomes a useful program if text matching is in focus.

Language Interpreter, Ver. 2.0. (experimental) for IBM PC. Haifa 1999.


The following program example demonstrates a small knowledge base written in SAMPLE. All its facts, rules and queries are extracted from English phrases:


where is new york? % Goal (query)

where is X? in Y :- X is situated in Y.
% Inference rules

who is X? Y :- X is Y.

new york is situated in america.
% Facts in a natural language form

st. petersburg is situated in russia.

a book is situated on a table.

joe is son of maria and peter.

julia is daughter of maria and peter.

peter 2 is son of maria and peter 1.

jack 2 is son of julia and jack 1.


You can consider :- as a border between a procedure head and body or as "if" condition: the head holds if the body holds. You see 7 heads without bodies - they always hold. Although this program consists only of 9 clauses (2 rules, 7 facts without bodies), you may ask a number of questions (queries), e.g.:

where is new york?
(the result see below)

who is julia? (the answer will be "daughter of maria and peter")

X is son of maria and Y (X will match "joe", then "peter 2")

Jack N is Y of Z (Y will match "son", Z - "julia and jack 1")

X 2 is son of Y and X 1 (X will match "peter", then "jack"; the father and the son have similar names; so, we can express concept abstractions as well as object names and relations).


The result of this program will be resolved goal: "where is new york? in america". Now imagine that you want to expand this knowledge base for answering the question: "what is on the table?" -- and you will get your first lesson for programming in SAMPLE.



Note that SAMPLE almost does not have syntax! Symbol ":- " (and several symbols like [,],{,}) is almost all its syntax. Important is matching of program elements to other program elements, which may contain slots, or variables, like X and Y above. You can imagine programming in SAMPLE as extraction of reasoning rules from natural sources. Consider the rule were is X? in Y :- X is situated in Y. This is a simple paraphrasing of an obvious reasoning like I know that X is situated in Y. Then, if asked "where is X?", I should answer "in Y". This reasoning, in its turn, may be obtained as a generalization of still more natural example: I know that Paris is situated in France. Then, if asked, "where is Paris?" I should answer "in France".


SAMPLE simplifies and ties concepts from Pattern Matching, Databases, Knowledge Representation, Natural Language Processing, Logic Programming. The data are hierarchical text structures with possibilities of text matching, composition, and generalization. Specific knowledge data is taken immediately from domain expressions: natural language descriptions, formulas, code lines etc., so the programming is surprisingly straightforward: build a program immediately from data processing examples. I believe this is an ideal instrument for creation of interpreters, compilers, and natural language processing software.


Below several SAMPLE program examples are given. They may provide an image of the language. Some theoretic analysis of the language and technology is done in papers [3] and [5]. Please email me at andrew@nsimail.com or andr@zcentral.com in the meantime.


REFERENCES


1. Gleibman, A.H. SAMPLE: New Programming Technology and AI Language (Subtitle: Data processing example abstraction immediately becomes a useful program if text matching is in focus). ACM SIGSAM Bulletin, 1993, No.2, 10 pp.

2. Gleibman, A.H. SAMPLE: The Simplest Language for Artificial Intelligence Problems. Preprint of the Institute of Theoretical Astronomy of the Russian Academy of Sciences No. 19, 1992, 54 pp. In Russian.

3. Gleibman, A.H. Synthesis of Text Processing Programs by Example: The SAMPLE Language. Preprint of the Institute of Theoretical Astronomy of the USSR Academy of Sciences No.15, 27 pp., 1991. In Russian.

4. Gleibman, A.H. Reasoning about Equations: Towards Physical Discovery. Preprint of the Institute of Theoretical Astronomy of the Russian Academy of Sciences No.18, 1992, 37 pp. In Russian.

5. Gleibman, A.H. Text example generalization: Inductive Synthesis of SAMPLE Language Programs. (Manuscript; this is an English translation and development of paper [3]. 31 pp., 1999. (Will be sent in Word format if requested by email)


The interpreter, additional program examples, various unpublished (and still worked-on) documents can be obtained from the author.


SAMPLE Program Examples:


(press a button below to go directly to the corresponding example)


Natural language understanding, parsing; parts inventory in NL form: http://www.webspawner.com/users/samplexnl/

Transformation of logic expressions; recognition of regularities in word codes: http://www.webspawner.com/users/samplexlogic/

Miscellaneous programs (lists, sorting, word processing etc): http://www.webspawner.com/users/samplexmisc/

About the Author: http://www.webspawner.com/users/samplexauthor/

Metaphoric conclusions about SAMPLE Language and Technology: http://www.webspawner.com/users/samplexmetaphor/





Examples: Natural language understanding
Examples: Transformation of logic expressions
Examples: Miscellaneous programs
About the Author
Metaphoric Conclusions about SAMPLE Technology
SAMPLE Compiler Download page

Send E-Mail to: andr@planet-mai.com

Free Webpages This page created using the webpage creation facilities of Webspawner.
Copyright © 2001 Andrew Gleibman. All Rights Reserved