vix.ing · top · new · best · stats · spec

Nested Refinements for Dynamic Languages

2011/03/25 by Ravi Chugh, Chugh, Ravi, Patrick M. Rondon +3
Computer Science · #Advanced Malware Detection Techniques #FOS: Computer and information sciences #Formal Methods in Verification #Logic, programming, and type systems #Programming Languages (cs.PL)

paper · pdf · doi:10.48550/arxiv.1103.5055

openalex publication_date 2011/03/25 · openalex created_date 2025/10/10 · openalex updated_date 2026/07/28

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 to unique technical challenges in the metatheory, which we solve with a novel stratification approach that we use to prove the soundness of System D.

Citations

Related