SLIDE 1 Restoring Natural Language as a Computerised Mathematics Input Method
Robert Lamar
joint work with Fairouz Kamareddine Manuel Maarek
ULTRA group, Heriot-Watt University http://www.macs.hw.ac.uk/ultra/
30 June 2007 Mathematical Knowledge Management conference RISC, Hagenburg, Austria
SLIDE 2
A Bit of Mathematics
CML There is an element −a in R such that a + (−a) = 0 for all a in R.
SLIDE 3
A Bit of Mathematics
In a variety of languages
CML There is an element −a in R such that a + (−a) = 0 for all a in R. Mizar ex b being Element of R st a + b = 0. Isar a ∈ R = ⇒ -a ∈ R ∧ a + -a = 0 . Omega (inverse-exist R op (struct-unit R op)).
SLIDE 4
A Bit of Mathematics
In a variety of languages
CML There is an element −a in R such that a + (−a) = 0 for all a in R. Mizar ex b being Element of R st a + b = 0. Isar a ∈ R = ⇒ -a ∈ R ∧ a + -a = 0 . Omega (inverse-exist R op (struct-unit R op)). Goal: Smoothing and strengthening transitions.
SLIDE 5
MathLang grammatical categories
term Common mathematical objects. “R”, “0”, “a + b” set Sets of mathematical objects. “R” noun Categories to classify terms “ring” adjective Modifiers for nouns “Abelian” statement Assertions of truth “a = b” declaration Type signature designations “Addition is denoted a + b” definition New symbol introductions “A ring is. . . ” step A group of mathematical “We have. . . assertions. . . . and also. . . ” context Assertions preliminary to a step “Given a ring R, . . . ”
SLIDE 6
Example
There is an element - a in R such that a + ( - a ) = 0 for all a in R .
SLIDE 7
Example
There is an element - a in R such that a + ( - a ) = 0 for all a in R .
SLIDE 8
Example
There is an element - a in R such that a + ( - a ) = 0 for all a in R .
SLIDE 9
Example
There is an element - a in R such that a + ( - a ) = 0 for all a in R .
SLIDE 10
Example
There is an element - a in R such that a + ( - a ) = 0 for all a in R .
SLIDE 11
Example
There is an element - a in R such that a + ( - a ) = 0 for all a in R .
SLIDE 12
Example
There is an element - a in R such that a + ( - a ) = 0 for all a in R .
SLIDE 13
Example
There is an element - a in R such that a + ( - a ) = 0 for all a in R .
SLIDE 14
Example
There is an element - a in R such that a + ( - a ) = 0 for all a in R .
SLIDE 15
Example
There is an element - a in R such that a + ( - a ) = 0 for all a in R .
SLIDE 16
Example
There is an element - a in R such that a + ( - a ) = 0 for all a in R .
SLIDE 17
Example
There is an element - a in R such that a + ( - a ) = 0 for all a in R .
SLIDE 18 Anatomy of a box
<interp>contents
Color Grammatical category Contents Original mathematics <interp> Logical interpretation
SLIDE 19 Anatomy of a box
<interp>contents
Color Grammatical category Contents Original mathematics <interp> Logical interpretation Examples:
<equal> a is equal to b <equal> a = b <ident> a = b <A>A <reals>R <inter> <apples>A ∩ <oranges>O
SLIDE 20
Another Example
a = b = c
SLIDE 21
Another Example
a = b = c
SLIDE 22
Another Example
a = b = c
SLIDE 23
Another Example
a = b = c What next?
SLIDE 24
Another Example
a = b b = c ?
SLIDE 25
Another Example
a = b b = c ?
SLIDE 26
What does this mean?
How do we cope?
a = b = c
SLIDE 27 What does this mean?
How do we cope?
a = b = c
◮ Compound statement ◮ Short for “a = b and b = c” ◮ Must be translated before computerisation
SLIDE 28 The ULTRA Solution
Syntax Sugaring
Syntax sugaring:
◮ Common in many computer languages ◮ Used for pretty-printing ◮ Eases human use of languages ◮ Always: nice for computers −
→ nice for humans
SLIDE 29 The ULTRA Solution
Syntax Sugaring vs. Syntax Souring
Syntax sugaring:
◮ Common in many computer languages ◮ Used for pretty-printing ◮ Eases human use of languages ◮ Always: nice for computers −
→ nice for humans Syntax souring:
◮ A new transformation: Syntax souring ◮ Syntax souring solves the problem of a = b = c. ◮ Other direction: nice for humans −
→ nice for computers
SLIDE 30 The ULTRA Solution
Another look at the problem
a = b = c
◮ The relation “=” is binary: it takes two arguments ◮ The term “b”:
◮ Appears only once ◮ Is actually provided as argument twice ◮ Is “shared”
◮ Goal: tell = to be nice and share
SLIDE 31
The ULTRA Solution
a = b = c
SLIDE 32
The ULTRA Solution
a = b = c
SLIDE 33
The ULTRA Solution
a = b = c
SLIDE 34 The ULTRA Solution
a =
<share> b
= c
SLIDE 35 The ULTRA Solution
a =
<share> b
= c a = b b = c
SLIDE 36 Kinds of Souring
share Natural splitting of single argument chain More flexible forwarding of entities fold Recursion upon lists map Iteration over lists position Reordering of arguments
- Duplication
- List operations
- Reordering
SLIDE 37 Kinds of Souring: Duplication
share • chain • fold • map • position
<eq> a <shared> b <eq> c souring
− − − − → <eq> a b
<eq> b c
SLIDE 38 Kinds of Souring: Duplication
share • chain • fold • map • position
and and eq w = hook x eq loop = hook y eq loop = z and and eq w x eq x y eq y z
SLIDE 39 Kinds of Souring: Lists
share • chain • fold • map • position
fold-right forall for all list a a, b b in R R base eq a + b = b + a forall a R forall b R eq a + b = b + a fold-right abstrλ list x , y . base x + y . abstrλ x . abstrλ y . x + y
SLIDE 40 Kinds of Souring: Lists
share • chain • fold • map • position
map Let list aa and bb belong to Ra ring R a R b R
SLIDE 41 Kinds of Souring: Reordering
share • chain • fold • map • position
in position 2 RR
contains
position 1 aa in a R
SLIDE 42 Conclusion
◮ Five kinds of souring:
share • chain • fold • map • position
◮ Common goal: elucidating the intent of language ◮ Future Work:
◮ Look for other souring needs ◮ Automate the annotation process ◮ Identify appropriate granularity for annotation ◮ Arrive at recommendations/conventions for annotation ◮ Cope with ellipsis.
n times
22...2 1 1 +
1 1+···
SLIDE 43
Text and Symbol Box Annotation Souring annotation Souring Examples Conclusion