ppt - Microsoft Research

advertisement
Dimensions in Synthesis
Part 2: Applications
(Intelligent Tutoring Systems)
Sumit Gulwani
sumitg@microsoft.com
Microsoft Research, Redmond
May 2012
Recap
Domain
Insight
Bit-vector
Algorithms
Geometry
Constructions
Testing &
Symbolic verification
Testing is
Verification runs in reasonable time probabilistically
sound
Synthesis
Strategy
Counter-example
guided inductive
synthesis
Brute-force search:
Generate and Test
1
Potential Users of Synthesis Technology
Algorithm
Designers
Software Developers
Most Useful
Target
Most
Transformational
Target
End-Users
Students and Teachers
• Vision for End-users: Enable people to have (automated)
personal assistants.
• Vision for Education: Enable every student to have
access to free & high-quality education.
2
Intelligent Tutoring Systems
• Motivation
– Online learning sites: Khan academy, Edx, Udacity, Coursera
• Increasing class sizes with even less personal attention
– New technologies: Tablets/Smartphones, NUI, Cloud
• Various Aspects
–
–
–
–
Solution Generation
Problem Generation
Automated Grading/Feedback
Content Entry
• Various Domains
– K-12: Mathematics, Physics, Chemistry
– Undergraduate: Introductory Programming, Automata Theory
– Language Learning
3
Intelligent Tutoring Systems
• Aspects
–
–
–
–
Solution Generation
Problem Generation
Automated Grading
Content Entry
• Domains
–
–
–
–
–
–
Geometry
Algebra
Introductory Programming
Automata Theory
Physics
Chemistry
โ‹ฎ
Joint work with: Cerny, Henzinger, Radhakrishna, Zufferey
4
Classic Problem in Automata Theory Course
Let L be the language containing all strings over {a,b}
that have the same number of occurrences of “ab” as
occurrences of “ba”. Construct an automata that accepts
L, or prove that L is non-regular.
Solution Generation Engine
“Regular”, <Automata for L>
5
Classic Problem in Automata Theory Course
Let L be the language containing all strings over {a,b}
that have the same number of occurrences of “a” as
occurrences of “b”. Construct an automata that accepts
L, or prove that L is non-regular.
Solution Generation Engine
“Non-regular”, <Proof of non-regularity>
6
Outline
๏ƒ˜ Formal Description of Input
• Regular Languages
– Algorithm for automata synthesis.
• Non-regular Languages
– Formal description of non-regularity proof.
– Algorithm for proof synthesis.
7
Formal Description of Input
Problem Description Languages
Examples
• User-friendly logic
• Context-free grammar
Interfaces
• Membership Test
– Required for inductive synthesis of automata or
non-regularity proof.
• Symbolic Membership Test
– Required for verification of non-regularity proof.
8
User-friendly Logic
• same number of occurrences of “ab” as that of “ba”.
– ๐‘๐‘œ๐‘ข๐‘›๐‘ก(๐‘ค, “๐‘Ž๐‘”) = ๐‘๐‘œ๐‘ข๐‘›๐‘ก(๐‘ค, “๐‘๐‘Ž”)
• all occurrences of “ab” start on an even position.
– ∀๐‘: ((1 < ๐‘ < ๐ฟ๐‘’๐‘›๐‘”๐‘กโ„Ž ๐‘ค ∧ ๐‘๐‘œ๐‘›๐‘ก๐‘Ž๐‘–๐‘›๐‘  ๐‘ค, “๐‘Ž๐‘”, ๐‘) ⇒
๐‘ ๐‘š๐‘œ๐‘‘ 2 = 0 )
• consists of n a’s followed by n b’s.
– ๐‘ค = ๐‘๐‘œ๐‘›๐‘๐‘Ž๐‘ก๐‘’๐‘›๐‘Ž๐‘ก๐‘’(๐‘Ÿ๐‘’๐‘๐‘’๐‘Ž๐‘ก(“๐‘Ž”, ๐‘›), ๐‘Ÿ๐‘’๐‘๐‘’๐‘Ž๐‘ก(“๐‘”, ๐‘›))
9
Outline
• Formal Description of Input
• Regular Languages
๏ƒ˜ Algorithm for automata synthesis.
• Non-regular Languages
– Formal description of non-regularity proof.
– Algorithm for proof synthesis.
10
Automata Generation for Regular Languages
We use Angluin’s L* algorithm.
• Membership Oracle
– Provided by the PDL interface.
• Equivalence Oracle
– Can be simulated using Membership Oracle on bit-strings
of size at most 2n, where n is the # of automata states.
– Theorem: Let ๐ด be a DFA with ๐‘˜1 states, let ๐ต be a DFA
with ๐‘˜2 states. If ๐ฟ ๐ด ≠ ๐ฟ ๐ต , then there exists a word
๐‘ค in L A − L B ∪ ๐ฟ ๐ต − ๐ฟ ๐ด , such that the length
of ๐‘ค is at most ๐‘˜1 + ๐‘˜2 − 1.
11
Distribution of Automata sizes
35
30
25
# of 20
problems 15
10
5
0
0
1
2
3
4
5
6
7
8
9 10 11 12 13 14 15 16
Automata Size
The automata size of educational problems is small!
12
Distribution of counterexample lengths
(relative to automata size)
40
35
30
25
# of
20
problems
15
10
5
0
-11 -10 -9 -8 -7 -6 -5 -4 -3 -2
-1
0
1
2
Counterexample length – automata size
The counterexample lengths are quite smaller than
worst-case possibility of twice the automata size.
13
Outline
• Formal Description of Input
• Regular Languages
– Algorithm for automata synthesis.
• Non-regular Languages
๏ƒ˜ Formal description of non-regularity proof.
– Algorithm for proof synthesis.
14
Myhill-Nerode Theorem: Non-regularity Condition
A language ๐ฟ is non-regular iff there exist functions
๐น: ๐‘ → Σ ∗ and ๐บ: ๐‘ → Σ ∗ such that:
∀๐‘–, ๐‘—: 1 ≤ ๐‘— < ๐‘– ⇒
๐น ๐‘– ๐บ ๐‘–, ๐‘— ∈ ๐ฟ ∧ ๐น ๐‘— ๐บ ๐‘–, ๐‘— ∉ ๐ฟ
๐‘œ๐‘Ÿ
๐น ๐‘– ๐บ ๐‘–, ๐‘— ∉ ๐ฟ ∧ ๐น ๐‘— ๐บ ๐‘–, ๐‘— ∈ ๐ฟ
The above characterization can be shown equivalent to:
∀๐‘–, ๐‘—: 1 ≤ ๐‘— < ๐‘– ⇒ ๐น ๐‘– ๐บ ๐‘–, ๐‘— ∈ ๐ฟ ∧ ๐น ๐‘— ๐บ ๐‘–, ๐‘— ∉ ๐ฟ
๐‘œ๐‘Ÿ
∀๐‘–, ๐‘—: 1 ≤ ๐‘— < ๐‘– ⇒ ๐น ๐‘– ๐บ ๐‘–, ๐‘— ∉ ๐ฟ ∧ ๐น ๐‘— ๐บ ๐‘–, ๐‘— ∈ ๐ฟ
This allows for automation!
We refer to F/G as congruence/witness functions.
15
Examples of Congruence/Witness Functions
• Same number of occurrences of “a” as that of “b”.
Congruence Function: ๐‘Ž๐‘–
Witness Function: ๐‘ ๐‘–
• Same number of occurrences of “a” as that of “b”.
Congruence Function: ๐‘Ž๐‘– ๐‘Ž
Witness Function: ๐‘ ๐‘–
• ๐‘ค๐‘ค ๐‘… ๐‘ค ∈ 0,1 ∗ }.
Congruence Function: ๐‘Ž๐‘– ๐‘
Witness Function: ๐‘๐‘Ž๐‘–
16
Language for Congruence/Witness Functions
The following language is expressive enough to
represent Congruence function F(i) and Witness
Function G(i,j) for several classroom problems.
๐‘† โ‰” ๐‘ก1 ๐‘ก2 … ๐‘ก๐‘›
๐‘ก โ‰” ๐‘ ๐‘๐‘– ๐‘๐‘—
where c is any alphabet.
17
Outline
• Formal Description of Input
• Regular Languages
– Algorithm for automata synthesis.
• Non-regular Languages
– Formal description of non-regularity proof.
๏ƒ˜ Algorithm for proof synthesis.
18
Algorithm for constructing Congruence/Witness Fns.
1. Approximation
–
Run L* algorithm using counterexamples of size ≤ ๐‘˜.
2. Generation (using Inductive Synthesis)
– For each eq. class, generate all congruence functions
that evaluate to a string in that class. Intersect pairs of
such sets to generate candidates.
– For each candidate congruence fn., use similar
methodology to generate candidate witness fn.
3. Testing based Validation
–
Test correctness of candidate fns. on 1 ≤ ๐‘— < ๐‘– ≤ 10
4. Verification
–
Use symbolic inference rules to verify correctness.
5. Refinement
–
If any of steps 2,3,4 fail, repeat with larger value of k.
19
Experimental Results
Id
PDL
1
UFPDL
5
0.1
๐‘Ž๐‘–
๐‘๐‘–
0.1
0.1
2
UFPDL
5
0.2
๐‘Ž๐‘–
๐‘๐‘–
0.1
0.1
3
UFPDL
5
0.9
๐‘Ž๐‘–
๐‘๐‘–
0.1
0.1
3
CFG
5
0.4
๐‘Ž๐‘–
๐‘๐‘–
0.1
0.1
4
UFPDL
5
1.6
๐‘๐‘–
๐‘Ž๐‘–
0.1
0.2
5
CFG
10
0.2
๐‘Ž๐‘– ๐‘
๐‘๐‘Ž๐‘–
0.1
0.1
6
CFG
5
0.1
๐‘๐‘–
๐‘Ž๐‘–
0.1
0.1
9
CFG
10
0.1
๐‘Ž๐‘– ๐‘
๐‘Ž๐‘–
0.1
0.1
11
UFPDL
8
12.1
๐‘Ž๐‘ ๐‘–
๐‘๐‘–
0.4
0.1
12
UFPDL
5
10.1
๐‘Ž๐‘
๐‘Ž๐‘–
0.4
0.2
13
UFPDL
5
6.4
๐‘Ž๐‘–
๐‘๐‘– ๐‘ ๐‘—
0.2
0.1
15
UFPDL
7
7.8
๐‘Ž๐‘– ๐‘
๐‘Ž๐‘–
1.1
0.1
15
CFG
7
0.1
๐‘Ž๐‘–
๐‘๐‘Ž๐‘–
0.1
0.1
16
CFG
5
0.2
๐‘Ž๐‘–
๐‘๐‘–
0.1
0.1
17
UFPDL
5
1.6
๐‘Ž๐‘–
๐‘๐‘–
0.4
0.1
18
CFG
5
0.3
๐‘Ž๐‘– ๐‘
๐‘Ž๐‘–
0.1
0.1
19
UFPDL
10
15.8
๐‘Ž๐‘ ๐‘–
๐‘๐‘–
4.5
1.7
21
CFG
5
0.5
(๐‘–
)๐‘–
0.1
0.1
๐‘ต≡
Generation
Congruence Fn.
๐‘–
Witness Fn. Test Verify
20
Intelligent Tutoring Systems
• Aspects
–
–
–
–
Solution Generation
Problem Generation
Automated Grading
Content Entry
• Domains
–
–
–
–
–
–
Geometry
Algebra
Introductory Programming
Automata Theory
Physics
Chemistry
โ‹ฎ
AAAI 2012: Singh, Gulwani, Rajamani.
21
Trigonometry Problem
Example Problem: sec ๐‘ฅ + cos ๐‘ฅ
Query: ๐‘‡1 ๐‘ฅ ± ๐‘‡2 (๐‘ฅ)
๐‘‡1 ≠ ๐‘‡5
sec ๐‘ฅ − cos ๐‘ฅ = tan2 ๐‘ฅ + sin2 ๐‘ฅ
๐‘‡3 ๐‘ฅ ± ๐‘‡4 ๐‘ฅ
= ๐‘‡52 ๐‘ฅ ± ๐‘‡62 (๐‘ฅ)
New problems generated:
csc ๐‘ฅ + cos ๐‘ฅ csc ๐‘ฅ − cos ๐‘ฅ = cot 2 ๐‘ฅ + sin2 ๐‘ฅ
(csc ๐‘ฅ − sin ๐‘ฅ)(csc ๐‘ฅ + sin ๐‘ฅ) = cot 2 ๐‘ฅ + cos 2 ๐‘ฅ
(sec ๐‘ฅ + sin ๐‘ฅ)(sec ๐‘ฅ − sin ๐‘ฅ) = tan2 ๐‘ฅ + cos 2 ๐‘ฅ
:
(tan ๐‘ฅ + sin ๐‘ฅ)(tan ๐‘ฅ − sin ๐‘ฅ) = tan2 ๐‘ฅ − sin2 ๐‘ฅ
(csc ๐‘ฅ + cos ๐‘ฅ)(csc ๐‘ฅ − cos ๐‘ฅ) = csc 2 ๐‘ฅ − cos 2 ๐‘ฅ
:
22
Algebra Problem Generation
Example Problem
Query Generation
Query
Refined Query
Query Execution
New Problems
Results OK?
No
Query Refinement
Yes
Similar Problems
23
Limits/Series Problem
๐‘›
Example Problem:
๐‘›
Query:
lim
๐‘›→∞
๐‘–=0
lim
๐‘›→∞
๐‘–=0
2๐‘– 2 + ๐‘– + 1
5
=
๐‘–
2
5
๐ถ0 ๐‘– 2 + ๐ถ1 ๐‘– + ๐ถ2
๐ถ3 ๐‘–
๐ถ4
=
๐ถ5
C0 ≠ 0 ∧ gcd ๐ถ0 , ๐ถ1 , ๐ถ2 = gcd ๐ถ4 , ๐ถ5 = 1
New problems generated:
๐‘›
lim
๐‘›→∞
๐‘–=0
๐‘›
lim
๐‘›→∞
๐‘–=0
๐‘›
2
3๐‘– + 2๐‘– + 1
7
=
๐‘–
3
7
lim
๐‘›→∞
๐‘›
2
๐‘–
3
=
๐‘–
2
3
๐‘–=0
lim
๐‘›→∞
๐‘–=0
3๐‘– 2 + 3๐‘– + 1
=4
๐‘–
4
5๐‘– 2 + 3๐‘– + 3
=6
๐‘–
6
24
Integration Problem
Example Problem:
Query:
(csc ๐‘ฅ) (csc ๐‘ฅ − cot ๐‘ฅ) ๐‘‘๐‘ฅ = csc ๐‘ฅ − cot ๐‘ฅ
๐‘‡0 ๐‘ฅ ๐‘‡1 ๐‘ฅ ± ๐‘‡2 ๐‘ฅ ๐‘‘๐‘ฅ = ๐‘‡4 ๐‘ฅ ± ๐‘‡5 (๐‘ฅ)
๐‘‡1 ≠ ๐‘‡2 ∧ ๐‘‡4 ≠ ๐‘‡5
New problems generated:
(tan ๐‘ฅ) (cos ๐‘ฅ + sec ๐‘ฅ) ๐‘‘๐‘ฅ = sec ๐‘ฅ − cos ๐‘ฅ
(sec ๐‘ฅ) (tan ๐‘ฅ + sec ๐‘ฅ) ๐‘‘๐‘ฅ = sec ๐‘ฅ + cot ๐‘ฅ
(cot ๐‘ฅ) (sin ๐‘ฅ + csc ๐‘ฅ) ๐‘‘๐‘ฅ = sin ๐‘ฅ − csc ๐‘ฅ
25
Determinant Problem
Ex. Problem
๐‘ฅ+๐‘ฆ
๐‘ง๐‘ฅ
๐‘ฆ๐‘ง
2
๐‘ง๐‘ฅ
๐‘ฆ+๐‘ง
๐‘ฅ๐‘ฆ
๐น0 (๐‘ฅ, ๐‘ฆ, ๐‘ง) ๐น1 (๐‘ฅ, ๐‘ฆ, ๐‘ง)
Query ๐น3 (๐‘ฅ, ๐‘ฆ, ๐‘ง) ๐น4 (๐‘ฅ, ๐‘ฆ, ๐‘ง)
๐น6 (๐‘ฅ, ๐‘ฆ, ๐‘ง) ๐น7 (๐‘ฅ, ๐‘ฆ, ๐‘ง)
2
๐‘ง๐‘ฆ
๐‘ฅ๐‘ฆ
๐‘ง+๐‘ฅ
= 2๐‘ฅ๐‘ฆ๐‘ง ๐‘ฅ + ๐‘ฆ + ๐‘ง
3
2
๐น2 (๐‘ฅ, ๐‘ฆ, ๐‘ง)
๐น5 (๐‘ฅ, ๐‘ฆ, ๐‘ง)
๐น8 (๐‘ฅ, ๐‘ฆ, ๐‘ง)
= ๐ถ10 ๐น9 (๐‘ฅ, ๐‘ฆ, ๐‘ง)
๐น๐‘– โ‰” ๐น๐‘— ๐‘ฅ → ๐‘ฆ; ๐‘ฆ → ๐‘ง; ๐‘ง → ๐‘ฅ ๐‘คโ„Ž๐‘’๐‘Ÿ๐‘’ ๐‘–, ๐‘— ∈ { 4,0 , 8,4 , 5,1 , … }
New problems generated:
๐‘ฆ2
๐‘ง+๐‘ฆ
๐‘ง2
2
๐‘ฆ๐‘ง + ๐‘ฆ 2
๐‘ฆ๐‘ง
๐‘ง๐‘ฅ
๐‘ฅ2
๐‘ง2
๐‘ฅ+๐‘ง
๐‘ฅ๐‘ฆ
๐‘ง๐‘ฅ + ๐‘ง 2
๐‘ง๐‘ฅ
2
๐‘ฆ+๐‘ฅ
๐‘ฆ2
๐‘ฅ2
๐‘ฅ๐‘ฆ
๐‘ฆ๐‘ง
๐‘ฅ๐‘ฆ + ๐‘ฅ 2
2
= 2 ๐‘ฅ๐‘ฆ + ๐‘ฆ๐‘ง + ๐‘ง๐‘ฅ
3
= 4๐‘ฅ 2 ๐‘ฆ 2 ๐‘ง 2
26
Intelligent Tutoring Systems
• Aspects
–
–
–
–
Solution Generation
Problem Generation
Automated Grading
Content Entry
• Domains
–
–
–
–
–
–
Geometry
Algebra
Introductory Programming
Automata Theory
Physics
Chemistry
โ‹ฎ
Arxiv TR 2012: Rishabh Singh, Gulwani, Armando Solar-Lezama .
27
Background: PexForFun
28
Buggy Program for Array Reverse
using System;
6:28::50 AM
public class Program {
public static int[] Puzzle(int[] a) {
int[] b = new int[a.Length];
int count = 0;
for(int i=a.Length; i < a.Length; i--)
{
b[count] = a[i];
count++;
}
return b;
}}
29
Buggy Program for Array Reverse
using System;
6:32::01 AM
public class Program {
public static int[] Puzzle(int[] a) {
int[] b = new int[a.Length];
int count = 0;
for(int i=a.Length-1; i < a.Length-1; i--)
{
b[count] = a[i];
count++;
}
return b;
}}
30
Buggy Program for Array Reverse
using System;
6:32::32 AM
public class Program {
public static int[] Puzzle(int[] a) {
int[] b = new int[a.Length];
int count = 0;
for(int i=a.Length-1; i < a.Length-1; i--)
{
b[count] = a[i];
count++;
}
return b;
}}
No change! Sign of Frustation?
31
Buggy Program for Array Reverse
using System;
6:33::19 AM
public class Program {
public static int[] Puzzle(int[] a) {
int[] b = new int[a.Length];
int count = 0;
for(int i=a.Length; i <= a.Length; i--)
{
b[count] = a[i];
count++;
}
return b;
}}
32
Buggy Program for Array Reverse
using System;
6:33::55 AM
public class Program {
public static int[] Puzzle(int[] a) {
int[] b = new int[a.Length];
int count = 0;
for(int i=a.Length; i < a.Length; i--)
{
Console.Writeline(i);
b[count] = a[i];
count++;
}
return b;
}}
Same as initial attempt except Console.Writeline!
33
Buggy Program for Array Reverse
using System;
6:34::06 AM
public class Program {
public static int[] Puzzle(int[] a) {
int[] b = new int[a.Length];
int count = 0;
for(int i=a.Length; i < a.Length; i--)
{
Console.Writeline(i);
b[count] = a[i];
count++;
}
return b;
}}
No change! Sign of Frustation?
34
Buggy Program for Array Reverse
using System;
6:34::56 AM
public class Program {
public static int[] Puzzle(int[] a) {
int[] b = new int[a.Length];
int count = 0;
for(int i=a.Length; i <= a.Length; i--)
{
Console.Writeline(i);
b[count] = a[i];
count++;
}
return b;
}}
The student has tried this before!
35
Buggy Program for Array Reverse
using System;
6:36::24 AM
public class Program {
public static int[] Puzzle(int[] a) {
int[] b = new int[a.Length];
int count = 0;
for(int i=a.Length; i < a.Length; i--)
{
b[count] = a[i];
count++;
}
return b;
}}
Same as initial attempt!
36
Buggy Program for Array Reverse
using System;
6:37::39 AM
public class Program {
public static int[] Puzzle(int[] a) {
int[] b = new int[a.Length];
int count = 0;
for(int i=a.Length-1; i < a.Length-1; i--)
{
b[count] = a[i];
count++;
}
return b;
}}
The student has tried this before!
37
Buggy Program for Array Reverse
using System;
6:38::11 AM
public class Program {
public static int[] Puzzle(int[] a) {
int[] b = new int[a.Length];
int count = 0;
for(int i=a.Length; i > 0; i--)
{
b[count] = a[i];
count++;
}
return b;
}}
Almost correct! (a[i-1] instead of a[i] in loop body)
38
Buggy Program for Array Reverse
using System;
6:38::44 AM
public class Program {
public static int[] Puzzle(int[] a) {
int[] b = new int[a.Length];
int count = 0;
for(int i=a.Length; i >= 0; i--)
{
b[count] = a[i];
count++;
}
return b;
}}
Student going in wrong direction!
39
Buggy Program for Array Reverse
using System;
6:39::33 AM
public class Program {
public static int[] Puzzle(int[] a) {
int[] b = new int[a.Length];
int count = 0;
for(int i=a.Length; i < a.Length; i--)
{
b[count] = a[i];
count++;
}
return b;
}}
Back to bigger error!
40
Buggy Program for Array Reverse
using System;
6:39::45 AM
public class Program {
public static int[] Puzzle(int[] a) {
int[] b = new int[a.Length];
int count = 0;
for(int i=a.Length; i < a.Length; i--)
{
b[count] = a[i];
count++;
}
return b;
}}
No change! Frustation!
41
Buggy Program for Array Reverse
using System;
6:40::27 AM
public class Program {
public static int[] Puzzle(int[] a) {
int[] b = new int[a.Length];
int count = 0;
for(int i=a.Length; i < a.Length; i--)
{
b[count] = a[i];
count++;
}
return b;
}}
No change! More Frustation!!
42
Buggy Program for Array Reverse
using System;
6:40::57 AM
public class Program {
public static int[] Puzzle(int[] a) {
int[] b = new int[a.Length];
int count = 0;
for(int i=a.Length; i < a.Length; i--)
{
b[count] = a[i];
count++;
}
return b;
}}
No change! Too Frustated now!!! Gives up.
43
Proposal: Semantic Grading
Provides additional value over counterexample
feedback.
• More friendly feedback.
– Helpful for students who give up after several tries
(with only counterexample feedback).
• Grading
– Counterexample feedback does not distinguish
between a slightly incorrect solution and one that is
very far off from being correct.
44
Demo
45
Relation with Automated Bug Fixing
Simplifying Assumptions
• Correct solution is known.
• Errors are predictable.
• Programs are small.
Challenging Aspects
• No logical specification.
– Instead program equivalence.
• Higher density of errors than production code.
• Generate multiple fixes
– To remain faithful to the student’s thought process.
46
Technique
• Teacher provides:
– A reference implementation
– Model of errors that students make
• Sketch encoding:
– Fuzz the program using error model.
– Use a counter to keep track of number of changes.
• Sketch solving:
– To generate minimal fixes, assert (counter = i) for
increasing values of i.
– Use off-the-shelf SAT solver to explore the state
space of possible corrections.
47
Error Model for Array Reverse Problem
Array Index Fuzzing:
v[a] -> v[{a+1, a-1, v.Length-a-1}]
Initialization Fuzzing:
v=n -> v={n+1, n-1, 0}
Increment Fuzzing:
v++ -> { ++v, v--, --v }
Return Value Fuzzing:
return v -> return ?v
Conditional Fuzzing:
a op b -> a’ ops { a+1, a-1, 0 }
where ops = { <, >, <=, >=, ==, != }
48
Fraction of Programs fixed
Effectiveness of Error Models
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
Array Reverse
Palindrome
Max
Factorial
isIncreasing
Sort
F1
F2
F3
F4
F5
Error Models
49
Efficiency of Error Models
Running Time (in s)
35
30
Array Reverse
25
Palindrome
20
Max
15
isIncreasing
10
Factorial
Sort
5
0
F1
F2
F3
F4
F5
Error Models
50
Number of Programs Fixed
Generality of Error Models
80
70
60
50
40
30
20
Specific Error
Model
Array Reverse
Error Model
10
0
51
Experimental Results
Benchmark
Total Fixed
Changes Time(s)
Array Reverse
305
254
1.73
2.69
String Palindrome
86
64
1.28
3.52
Array Maximum
99
68
1.25
7.47
Is Increasing Order
51
38
1.72
3.56
Array Sort
74
35
1.17
32.46
Factorial
70
30
1.25
4.99
Friday Rush
17
4
1
12.42
52
Potential Workflow
Teacher grades an ungraded answer-script.
System generalizes corrections into error models.
System performs automated grading by
considering all possible combinations and
instantiations of all error models.
Any ungraded
answer scripts?
Yes
No
53
Intelligent Tutoring Systems
• Aspects
–
–
–
–
Solution Generation
Problem Generation
Automated Grading
Content Entry
• Domains
–
–
–
–
–
–
Geometry
Algebra
Introductory Programming
Automata Theory
Physics
Chemistry
โ‹ฎ
Joint work with: Alex Polozov and Sriram Rajamani
54
Mathematical Intellisense
State-of-the-art Mathematical Editors
• Text editors like Latex
– Unreadable text in prefix notation
• WYSIWIG editors like Microsoft Word
– Change of cursor positions multiple times.
– Back and forth switching between mouse & keyboard
Our proposal: An intelligent predictive editor.
• Mathematical text has low entropy and hence
amenable to prediction!
55
Reducing (Term) Prediction to Learning-By-Examples
Terms connected by the same AC operator can be
thought of as terms belonging to a sequence.
There are 2 opportunities for predicting such terms.
Sequence Creation: T1, T2, T3, …
• Learn a function F such that F(Ti) = Ti+1
Sequence Transformation: T1, T2, T3, T4 -> S1, S2, …
• Learn a function F such that F(Ti) = Si
56
Mathematical (Syntactic) Intellisense
tan 3๐‘ฅ tan 2๐‘ฅ tan ๐‘ฅ = tan 3๐‘ฅ − tan 2๐‘ฅ − tan ๐‘ฅ
๐‘ฆ๐‘ง − ๐‘ฅ 2
๐‘ง๐‘ฅ − ๐‘ฆ 2
๐‘ฅ๐‘ฆ − ๐‘ง 2
๐ด1 sin3 ๐›ผ
๐ด2 sin ๐›ผ
๐‘ง๐‘ฅ − ๐‘ฆ 2
๐‘ฅ๐‘ฆ − ๐‘ง 2
๐‘ฆ๐‘ง − ๐‘ฅ 2
๐ต1 sin3 ๐›ฝ
๐ต2 sin ๐›ฝ
๐‘ฅ๐‘ฆ − ๐‘ง 2
๐‘ฆ๐‘ง − ๐‘ฅ 2
๐‘ง๐‘ฅ − ๐‘ฆ 2
๐ถ1 sin3 ๐›พ
๐ถ2 sin ๐›พ
57
Mathematical (Semantic) Intellisense
Prove (csc ๐‘ฅ − sin ๐‘ฅ)(sec ๐‘ฅ − cos ๐‘ฅ)(tan ๐‘ฅ + cot ๐‘ฅ) = 1
L.H.S. =
1
− sin ๐‘ฅ
sin ๐‘ฅ
=
1 − sin2 ๐‘ฅ
sin ๐‘ฅ
=
cos 2 ๐‘ฅ
sin ๐‘ฅ
1
− cos ๐‘ฅ
cos ๐‘ฅ
1 − cos2 ๐‘ฅ
cos ๐‘ฅ
sin2 ๐‘ฅ
cos ๐‘ฅ
sin ๐‘ฅ cos ๐‘ฅ
+
cos ๐‘ฅ sin ๐‘ฅ
sin2 ๐‘ฅ + cos 2 ๐‘ฅ
cos ๐‘ฅ sin ๐‘ฅ
1
cos ๐‘ฅ sin ๐‘ฅ
=1
58
Long-term Goals
• Ultra-intelligent computer
• Model of human mind
• Inter-stellar travel ๏Š
59
Download