Repository logo
Log in(current)
Repository logoMIT Open ScholarshipDSpace@MIT
  1. Home
  2. MIT Open Access Articles
  3. MIT Open Access Articles
  4. TiML: a functional language for practical complexity analysis with invariants

TiML: a functional language for practical complexity analysis with invariants

Thumbnail Image
Download
Name

oopsla17-oopsla56.pdf

Description
Published version
Size

386.76 KB

Format

Adobe PDF

Checksum (MD5)

94fbe00e94b108241f38fa20fb489d73

sword-2019-05-13T18:00:45.original.xml (130 B)
Original SWORD entry document
Author(s)
Chlipala, Adam
•
Wang, Peng
•
Want, Di
Date Issued
October 2017
Journal
Proceedings of the ACM on Programming Languages
Publisher
Association for Computing Machinery (ACM)
Citation
Wang, Peng, et al. “TiML: A Functional Language for Practical Complexity Analysis with Invariants.” Proceedings of the ACM on Programming Languages 1, OOPSLA, (October 2017): pp. 1–26. © 2017 The Authors
Version
Final published version
Abstract
We present TiML (Timed ML), an ML-like functional language with time-complexity annotations in types. It uses indexed types to express sizes of data structures and upper bounds on running time of functions; and refinement kinds to constrain these indices, expressing data-structure invariants and pre/post-conditions. Indexed types are flexible enough that TiML avoids a built-in notion of "size," and the programmer can choose to index user-defined datatypes in any way that helps her analysis. TiML's distinguishing characteristic is supporting highly automated time-bound verification applicable to data structures with nontrivial invariants. The programmer provides type annotations, and the typechecker generates verification conditions that are discharged by an SMT solver. Type and index inference are supported to lower annotation burden, and, furthermore, big-O complexity can be inferred from recurrences generated during typechecking by a recurrence solver based on heuristic pattern matching (e.g. using the Master Theorem to handle divide-and-conquer-like recurrences). We have evaluated TiML's usability by implementing a broad suite of case-study modules, demonstrating that TiML, though lacking full automation and theoretical completeness, is versatile enough to verify worst-case and/or amortized complexities for algorithms and data structures like classic list operations, merge sort, Dijkstra's shortest-path algorithm, red-black trees, Braun trees, functional queues, and dynamic tables with bounds like m n logn. The learning curve and annotation burden are reasonable, as we argue with empirical results on our case studies. We formalized TiML's type-soundness proof in Coq.
MIT Department
Massachusetts Institute of Technology. Computer Science and Artificial Intelligence Laboratory
Massachusetts Institute of Technology. Department of Electrical Engineering and Computer Science
Terms of Use
Creative Commons Attribution 4.0 International license
https://creativecommons.org/licenses/by/4.0/
Persistent DSpace Link
https://hdl.handle.net/1721.1/121232
DOI of Published Version
https://doi.org/10.1145/3133903
Repository logo
PrivacyPermissionsAccessibilityContact us
Repository logo
Notify us about copyright concerns.