#
• • • • • • • • • • • •
∈
Camera camera = Camera.open(); Camera camera = Camera.open(); camera.setDisplayOrientation(90); camera.setDisplayOrientation(90); camera.unlock(); SurfaceHolder holder = getHolder(); holder.addCallback(this); holder.setType(SurfaceHolder.STP); MediaRecorder r = new MediaRecorder(); r.setCamera(camera); r.setAudioSource(MediaRecorder.AS); r.setVideoSource(MediaRecorder.VS); r.setOutFormat(MediaRecorder.MPEG4);
C# Java System.out.println("Hi"); Console.WriteLine("Hi") … …
function chunkData(str, step) { var colNames = []; function FZ(e, t) { var n = []; var len = str.length; var r = e.length; var i = 0; var i = 0; for (; i < r; i += t) if (i + t < for (; i < len; i += step) r) n.push(e.substring(i, i + if (i + step < len) t)); else colNames.push(str.substring(i, i + step)); n.push(e.substring(i, r)); else return n; colNames.push(str.substring(i, len)); } return colNames; }
package com.example.dbhelper class DBHelper extends package a.b.c SQLiteHelper { class a extends SQLiteHelper SQLiteDatabase db; { SQLiteDatabase b; public public DBHelper(Context ctx) { a(Context ctx) { b = db = getWritableDatabase(); getWritableDatabase(); } } Cursor c(String str) { return b.rawQuery(str); }} Cursor execSQL(String str) { return db.rawQuery(str); } }
Fundamental Problem
D f.open (“f2” | “r”); f.read(); f.open (“file” | “r”); f.open (“f2” | “w”); f. ? f.write (“c”); f.open (“f1” | “r”); f.read();
D f.open (“f2” | “r”); f.read(); f.open (“file” | “r”); f.open (“f2” | “w”); f. ? f.write (“c”); f.open (“f1” | “r”); f.read(); P( open | f. ) ~ 3/6 P( read | f. ) ~ 2/6 P( write | f. ) ~ 1/6 𝜹
D f.open (“f2” | “r”); f.read(); f.open (“file” | “r”); f.open (“f2” | “w”); f. open f.write (“c”); f.open (“f1” | “r”); f.read(); P( open | f. ) ~ 3/6 P( read | f. ) ~ 2/6 P( write | f. ) ~ 1/6 𝜹
P( read | open ) ~ 2/3 P( write | open ) ~ 1/3 D 𝜹 f.open (“f2” | “r”); f.read(); f.open (“file” | “r”); f.open (“f2” | “w”); f. ? f.write (“c”); f.open (“f1” | “r”); f.read(); P( open | f. ) ~ 3/6 P( read | f. ) ~ 2/6 P( write | f. ) ~ 1/6 𝜹
P( read | open ) ~ 2/3 P( write | open ) ~ 1/3 D 𝜹 f.open (“f2” | “r”); f.read(); f.open (“file” | “r”); f.open (“f2” | “w”); f. read f.write (“c”); f.open (“f1” | “r”); f.read(); P( open | f. ) ~ 3/6 P( read | f. ) ~ 2/6 P( write | f. ) ~ 1/6 𝜹
P( read | open ) ~ 2/3 P( write | open ) ~ 1/3 D 𝜹 f.open (“f2” | “r”); f.read(); f.open (“file” | “r”); f.open (“f2” | “w”); f. ? f.write (“c”); f.open (“f1” | “r”); f.read(); P( open | f. ) ~ 3/6 P( read | f. ) ~ 2/6 P( write | f. ) ~ 1/6 𝜹
→ 𝜹 key idea: synthesize a function f:
f best = argmin cost( D , f ) f best ∊ D f ∊ ( ) f best f best 𝜹
elem.notify({ CallExpression position: ‘top’, autoHide: false, MemberExpression ObjectExpression delay: 100 }); Identifier Property Property Property Property elem notify position autoHide delay String Boolean ‘ top’ false
TCond ::= 𝜁 | WriteOp TCond | MoveOp TCond MoveOp ::= Up, Left, Right, DownFirst, DownLast, NextDFS, PrevDFS, NextLeaf, PrevLeaf,PrevNodeType, PrevNodeValue, PrevNodeContext WriteOp ::= WriteValue, WriteType, WritePos Up Left WriteValue 𝜹 ← 𝜹 ∙
f best f best = argmin cost( D , f ) f ∊
f best f D TCond ::= 𝜁 | WriteOp TCond | MoveOp TCond MoveOp ::= Up, Left, Right, ... WriteOp ::= WriteValue, WriteType, ... ≈ 10 8 f best = argmin cost( D , f ) f ∊ P D f P(element | f ( )) cost( D , f) = ( P ) 𝑃( 𝐸 )
f best to predict program f best 𝜹 Left {} elem.notify( ... , WriteValue {hide} ... , Up {hide} { WritePos {hide, 3} position: ‘top’, Up {hide, 3} hide: false, DownFirst {hide, 3} ? DownLast {hide, 3} } WriteValue {hide, 3, notify} );
D : f best 22.2% 30.4% 66.6%
D : f best Hutter Prize Wikipedia Dataset uses a char-level DSL with state : 1.94 1.67 1.62 1.60 51% 1.44 51% 1.40 51%
• • •
∈ TCond ::= 𝜁 | WriteOp TCond | MoveOp TCond MoveOp ::= Up, Left, Right, DownFirst, DownLast, NextDFS, PrevDFS, NextLeaf, PrevLeaf, PrevNodeType, PrevNodeValue, WriteOp ::= WriteValue, WriteType, WritePos f best = argmin cost( D , f ) f best ∊ f ∊ f best ( ) f best 𝜹
Recommend
More recommend