Finding ¡Minimum ¡Type ¡ Error ¡Sources ¡
¡Zvonimir ¡Pavlinovic ¡ ¡ ¡ ¡ ¡Tim ¡King ¡ ¡ ¡ ¡ ¡Thomas ¡Wies ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡New ¡York ¡University ¡
Finding Minimum Type Error Sources Zvonimir Pavlinovic - - PowerPoint PPT Presentation
Finding Minimum Type Error Sources Zvonimir Pavlinovic Tim King Thomas Wies New York University
¡Zvonimir ¡Pavlinovic ¡ ¡ ¡ ¡ ¡Tim ¡King ¡ ¡ ¡ ¡ ¡Thomas ¡Wies ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡New ¡York ¡University ¡
let f(lst:move list): (float*float) list = ... let rec loop lst x y dir acc = if lst = [] then acc else print_string "foo" in List.rev (loop lst 0.0 0.0 0.0 [(0.0 ,0.0)])
[Zhang ¡& ¡Myers, ¡POPL ¡‘14] ¡
Error: ¡This ¡expression ¡has ¡type ¡‘a ¡list ¡but ¡an ¡expression ¡was ¡ expected ¡of ¡type ¡unit ¡ print_string: ¡string ¡-‑> ¡unit ¡
Bent ¡`95] ¡
Thiemann ¡`03, ¡Chen ¡& ¡Erwig ¡`14] ¡
? ¡ Error ¡Source ¡
¡
An ¡error ¡source ¡is ¡a ¡set ¡of ¡program ¡expressions ¡that, ¡
? ¡ Minimum ¡Error ¡Source ¡
¡
An ¡error ¡source ¡with ¡minimum ¡cumula3ve ¡weight ¡
? ¡(1) ¡ ? ¡(1) ¡ ? ¡(3) ¡ ? ¡(1) ¡ ? ¡(5) ¡
sa3sfiability ¡modulo ¡theories ¡ Compu/ng ¡Minimum ¡Error ¡Sources ¡
¡
Given ¡a ¡program ¡and ¡a ¡compiler-‑provided ¡ranking ¡ criterion, ¡find ¡a ¡minimum ¡error ¡source ¡subject ¡to ¡ the ¡criterion ¡
Compiler ¡ Typing ¡Constraint ¡ GeneraQon ¡ Weighted ¡MaxSMT ¡ Solver ¡
input ¡program ¡and ¡ ranking ¡criterion ¡ constraint ¡ minimum ¡error ¡ ¡ sources ¡
Input: ¡ ¡
¡ Output: ¡
cumulaQve ¡weight ¡(hard ¡clauses ¡must ¡hold) ¡
? ¡
wlet wx wapp wnot wi wnot impl
hard ¡
seconds ¡ program ¡size ¡in ¡LOC ¡
0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 100 ¡ 120 ¡ 140 ¡ 160 ¡ 180 ¡ 0-‑50 ¡ (47) ¡ 50-‑100 ¡ (102) ¡ 100-‑150 ¡ (65) ¡ 150-‑200 ¡ (57) ¡ 200-‑250 ¡ (53) ¡ 250-‑300 ¡ (28) ¡ 300-‑350 ¡ (3) ¡ 350-‑400 ¡ (1) ¡
min ¡ median ¡ max ¡
10 100 1000 10000 100000 50 100 150 200 250
Number of assertions Program size (lines of code)
Constraint size
¡