Nested Refinements for Dynamic Languages
Ravi Chugh, Patrick M. Rondon, Ranjit Jhala

TL;DR
This paper introduces System D, a core calculus that combines syntactic and semantic reasoning through nested refinement types, enabling precise typechecking of complex dynamic language features.
Contribution
It presents System D, a novel type system merging syntactic and semantic reasoning with nested refinements, and introduces a stratification approach to prove its soundness.
Findings
System D can automatically typecheck sophisticated dynamic language programs.
Nested refinements enable precise reasoning about higher-order functions and dictionaries.
The stratification approach addresses circularity in the type system's metatheory.
Abstract
Programs written in dynamic languages make heavy use of features --- run-time type tests, value-indexed dictionaries, polymorphism, and higher-order functions --- that are beyond the reach of type systems that employ either purely syntactic or purely semantic reasoning. We present a core calculus, System D, that merges these two modes of reasoning into a single powerful mechanism of nested refinement types wherein the typing relation is itself a predicate in the refinement logic. System D coordinates SMT-based logical implication and syntactic subtyping to automatically typecheck sophisticated dynamic language programs. By coupling nested refinements with McCarthy's theory of finite maps, System D can precisely reason about the interaction of higher-order functions, polymorphism, and dictionaries. The addition of type predicates to the refinement logic creates a circularity that leads…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Formal Methods in Verification · Advanced Malware Detection Techniques
