IDEAS ON ELECTRONIC COMMERCE John McCarthy Computer Science Department Stanford University jmc@cs.stanford.edu http://www-formal.stanford.edu/jmc/ May 12, 1999

The relevant papers are “A common business communication language”

http://www-formal.stanford.edu/jmc/cbcl.html

and “Elephant: a programming language based on speech acts”

http://www-formal.stanford.edu/jmc/elephant.html.

Common business communication language (1) a premature idea

• written 1975, published 1982, unsuccessful proposal 1988

• substantially overlaps XML and ICE

• used Lisp data format, e.g. (PRICE $1.00 ) instead of <PRICE> $5.00 </PRICE> • Could have ((DISCOUNT PRICE 10%) $1.00), because the first position in a list need not be just a tag.

• Some people like the Lisp format, but apparently most prefer the format inherited from SGML.

• Some CBCL features not in XML or ICE are likely to be needed eventually in inter-computer communication.

• See www-formal.stanford.edu/jmc/cbcl.html

Common business communication language (2)

• More semantic features of natural language will be needed for business communication than have so far been considered in the XML literature or in ICE.

• Generalized Chomsky principle: Any position may be occupied by an expression designating something of the right semantics, e.g. a price.

• Description (ι) and ϵ operators—“the” and “a”. (IOTA X)(P X) and (EPSILON X)(P X). The work of the logicians may be useful. Principle: Humans use “the” and “a”. Inter-computer will therefore need the equivalent of the these words.

• Adjectives and other modifiers.

EXAMPLES OF CBCL

a. (REQUEST-QUOTE (YOUR-STOCK A7305) (UNITS 100)) b. (REQUEST-QUOTE (PENCILS #2) (GROSS 100)) c. (WE-QUOTE (OUR-STOCK-NUMBER A7305) (QUAN-TITY 100) (DELIVERY-DATE 3-10-77) (PRICE $1.00)) The above examples correspond directly to ICE.

ADVANCED EXAMPLES OF CBCL

d. (REQUEST-QUOTE (ADJECTIVE (PENCILS #2) YELLOW) (GROSS 100))

A program not understanding YELLOW could nevertheless understand that #2 pencils were called for, and could reply that they don’t have any pencils, if that were so.

e. (PLEASE-RESERVE (EPSILON (X) (AND (IS-FLIGHT X) (DEPARTS MONDAY) (ARRIVES (BEFORE WEDNES-DAY))))).

(ϵx)P (x) stands for “an x such that P (x).

ELEPHANT 2000: A Programming Language for the Year 2005 Based on Speech Acts

I meant what I said, and I said what I meant. An Elephant’s faithful—one hundred percent.

also

An elephant never forgets. See the article.

http://www-formal.stanford.edu/jmc/elephant.html.

Thesis: The I-O statements of a programming language for inter-computer communication should be defined as speech acts.

SPEECH ACTS

Austin, J. L. HOW TO DO THINGS WITH WORDS (Oxford Univ. Press, 1962) Searle, John R. SPEECH ACTS (Cambridge Univ. Press, 1969) “I now pronounce you man and wife”. Speech acts include, offers, acceptances, statements, questions, promises, commands. One can also state, describe, assert, warn, remark, comment, apologize, sentence, argue, persuade. On the input side there is hear, read, understand, realize.

FEATURES OF ELEPHANT

• I-O is in speech acts.

• Correctness involves proper performance of speech acts.

• Programs can refer to the past. (skipped).

• Programs can be represented as sentences of logic. (skipped)

• Accomplishment and input-output specifications.

AN ELEPHANT IS FAITHFUL

To be correct, an Elephant program must at least • Keep promises

• Answer questions truthfully

• Answer questions responsively

• Make authorized commitments and not others

KINDS OF ELEPHANT I-O

• Requests (authorized, comprehensible)

• Questions (comprehensible)

• Answers to questions (truthful and responsive)

• Offers (authorized)

• Acceptances and refusals • Promises (authorized and kept)

• Input (interpreted as requests, etc.)

ELEPHANT 2000 AIRLINE RESERVATION PROGRAM (1)

\begin{matrix}if ¬full flt then \\ accept.request commit admit(psgr, flt) \end{matrix}

answer.query committed admit(psgr, flt)

accept.request decommit admit(psgr, flt)

\begin{aligned}if now = & time flt ∧ committed admit(psgr, flt) \\ & then accept.request admit(psgr, flt) \end{aligned}

\begin{matrix}full flt ≡ \\ card\{psgr|committed admit(psgr, flt)\} = capacity flt \end{matrix}

ELEPHANT 2000 AIRLINE RESERVATION PROGRAM (2)

if ¬full flt then

accept.request make commitment admit(psgr, flt)

answer.query exists commitment admit(psgr, flt)

accept.request cancel commitment admit(psgr, flt)

if now = time flt

∧ exists commitment admit(psgr, flt) ∧¬ full1 flt

then accept.request admit(psgr, flt)

\begin{aligned}full & flt ≡ \\ & card\{psgr|exists commitment admit(psgr, flt)\} = capacity flt \end{aligned}

full1 flt ≡ card{psgr|did admit(psgr, flt)} = capacity flt INTRINSIC CORRECTNESS OF ELEPHANT PROGRAMS

• Promises and internal commitments

• Keeping commitments is a form of internal correctness, i.e. not relative to an external specification.

• The mathematics is like that of input-output specifications.

• Giving true and responsive answers.

• Input-output specifications and accomplishment specifications are not intrinsic.

PROGRAMS AS SEMI-LEGAL PERSONS

• Programs act as authorized by their owners.

• Programs in commerce assume obligations and conversely.

• They need a “uniform commercial code” so that each detail of obligations doesn’t require human negotiation.

• Micro-payments suggest micro-lawsuits.

• The program will micro-sue if not paid. It will pay judgments that go against it within its authorization.

• Maybe like purchasing agents or wholly owned subsidiaries rather than as corporations.

INPUT-OUTPUT AND ACCOMPLISHMENT SPECIFICATIONS

• Illocutionary vs. perlocutionary speech acts – I tell you the meeting is tomorrow.

– I inform you that the meeting is tomorrow. (You believe it.)

– I order you to come to the meeting.

– I get you to come to the meeting.

• Input-output and accomplishment program specifications.

– It says “Cleared to land” only when it perceives that the runway is clear.

– It says “Cleared to land” only when the runway is clear.

16