Sound, Heuristic Type Annotation Inference for Ruby
summary
InferDL automatically generates Ruby type annotations by combining constraint solving with checked heuristic guesses: heuristics propose nominal or precise hash types which are added to the constraint graph and rolled back if they violate constraints, preserving soundness. A key rule, Struct-to-Nominal, turns structural method sets into nominal classes (e.g. String -> String for normalize_username), while name rules like int_names map identifiers to Integer. Evaluation on 250 methods (496 types) yields about 22% more correct annotations and uncovers six real bugs; heuristics cost extra time (32s vs 9s).
AI-written summary · about
chapters (6)
- 0:00Start
- 1:53Example of Constraint Base Type Inference
- 4:03Constraint Resolution
- 4:19Solution Extraction
- 8:32Overall Heuristic Solution Extraction Procedure
- 14:42Conclusion
related talks
30mGood Enough Types: Heuristic Type Inference for Ruby
14mSimTyper: Sound Type Inference for Ruby using Type Equality Prediction
39mType Checking Ruby Programs with Annotations
32mDo LLMs dream of Type Inference?
37mTypes and Ruby Programming Language
43mType Checking Ruby
25mA Dangerous Game: Safety in Ruby
53mAn introduction to typed Ruby programming
