Probabilistic programming using first-class stores and first-class continuations
Oleg Kiselyov
FNMOC
- leg@pobox.com
Chung-chieh Shan
Rutgers University ccshan@rutgers.edu
Probabilistic programming using first-class stores and first-class - - PowerPoint PPT Presentation
Probabilistic programming using first-class stores and first-class continuations Oleg Kiselyov Chung-chieh Shan FNMOC Rutgers University oleg@pobox.com ccshan@rutgers.edu ML workshop September 26, 2010
FNMOC
Rutgers University ccshan@rutgers.edu
2/15
✾ ❂ ❀Pr✭❘❡s✉❧t ❥ ❖❜s ❂ ♦❜s✮
2/15
✾ ❂ ❀Pr✭❘❡s✉❧t ❥ ❖❜s ❂ ♦❜s✮
2/15
✾ ❂ ❀Pr✭❘❡s✉❧t ❥ ❖❜s ❂ ♦❜s✮
2/15
✾ ❂ ❀Pr✭❘❡s✉❧t ❥ ❖❜s ❂ ♦❜s✮
2/15
✾ ❂ ❀Pr✭❘❡s✉❧t ❥ ❖❜s ❂ ♦❜s✮
2/15
✾ ❂ ❀Pr✭❘❡s✉❧t ❥ ❖❜s ❂ ♦❜s✮
2/15
✾ ❂ ❀Pr✭❘❡s✉❧t ❥ ❖❜s ❂ ♦❜s✮
2/15
✾ ❂ ❀Pr✭❘❡s✉❧t ❥ ❖❜s ❂ ♦❜s✮
3/15
4/15
4/15
4/15
4/15
4/15
4/15
5/15
5/15
5/15
5/15
6/15
◮ Rich libraries: lists, arrays, database access, I/O, . . . ◮ Type system ◮ Functions as first-class values ◮ Compiler ◮ Debugger ◮ Memoization
7/15
7/15
7/15
7/15
7/15
7/15
8/15
9/15
✳✽ ✳✷ ✳✸
✳✷ . . . ✳✻ . . . ✳✸ ✳✺ not syntax tree not call tree
9/15
✳✽ ✳✷ ✳✸
✳✷ . . . ✳✻ . . . ✳✸ ✳✺ not syntax tree not call tree Depth-first enumeration = exact inference Random dive = rejection sampling Dive with look-ahead = importance sampling
9/15
✳✽ ✳✷ ✳✸
✳✷ . . . ✳✻ . . . ✳✸ ✳✺
◮ Model runs inside a thread. ◮ dist clones the thread. ◮ fail kills the thread.
9/15
✳✽ ✳✷ ✳✸
✳✷ . . . ✳✻ . . . ✳✸ ✳✺
✳✷✹
✳✺
10/15
10/15
11/15
12/15
12/15
✳✺
✳✺ ✳✺
✳✺ ✳✺ ✳✺ by delaying choices until observed
12/15
✳✺
✳✺ ✳✺
✳✺ ✳✺ ✳✺
12/15
12/15
Delimited Dynamic Binding
Oleg Kiselyov
FNMOC
Chung-chieh Shan
Rutgers University ccshan@cs.rutgers.edu
Amr Sabry
Indiana University sabry@indiana.edu
Abstract
Dynamic binding and delimited control are useful together in many settings, including Web applications, database cursors, and mobile
the semantics of their interaction is ill-defined yet not expressive enough for these uses. to any function, dynamic variables let us pass additional data into a function and its callees without bloating its interface. This mech- anism especially helps to modularise and separate concerns when applied to parameters such as line width, output port, character en- coding, and error handler. Moreover, a dynamic variable lets us not just provide but also change the environment in which a piece of
13/15
14/15
15/15
15/15