Verified parsing in the real world
(Talk at Parsing@SLE 2014, 20 mins)

Dr Tom Ridge

2014-09-14

This talk

Verified parsing

Verification briefly

The dream of the verifiers

Verified parsing

Verified parsing

Some example theorems

A weak statement:

A stronger statement(?):

A strong statement:

What has been done so far?

What is wrong with this?

What about verified deterministic parsers?

What would I like to see happen?

The real world

Real-world considerations

Performance of (Ridge, CPP'11) approach

Current work

(* Grammar: E -> E E E | "1" | eps *)
let rec parse_E = (fun i -> mkntparser "E" (
  ((parse_E ***> parse_E ***> parse_E) >>>> (fun (x,(y,z)) -> `Node(x,y,z)))
  |||| ((a "1") >>>> (fun _ -> `LF("1")))
  |||| ((a "") >>>> (fun _ -> `LF(""))))
  i)
  
let results = run_parser parse_E "1111111111"

Real-world performance

Real-world performance is hard to achieve. For example CYK is O(n^3) theoretically

My observations when engineering Earley for real-world performance:

Real world performance, results

E_EEE: E -> E E E | "1" | ""

Grammar|Input size|Happy/s|P3/s
E_EEE  |020       |0.14   |0.10
E_EEE  |040       |6.87   |0.13
E_EEE  |100       |2535.88|0.50

Conclusion