Abstract
This paper presents the design of Zombie, a dependently-typed programming language that uses an adaptation of a congruence closure algorithm for proof and type inference. This algorithm allows the type checker to automatically use equality assumptions from the context when reasoning about equality. Most dependently-typed languages automatically use equalities that follow from beta-reduction during type checking; however, such reasoning is incompatible with congruence closure. In contrast, Zombie does not use automatic beta-reduction because types may contain potentially diverging terms. Therefore Zombie provides a unique opportunity to explore an alternative definition of equivalence in dependently-typed language design.
Our work includes the specification of the language via a bidirectional type system, which works "up-to-congruence,'' and an algorithm for elaborating expressions in this language to an explicitly typed core language. We prove that our elaboration algorithm is complete with respect to the source type system, and always produces well typed terms in the core language. This algorithm has been implemented in the Zombie language, which includes general recursion, irrelevant arguments, heterogeneous equality and datatypes.
Supplemental Material
- T. Altenkirch. The case of the smart case: How to implement conditional convertibility? Presentation at NII Shonan seminar 007, Japan, Sept. 2011.Google Scholar
- T. Altenkirch, C. McBride, and W. Swierstra. Observational equality, now! In PLPV '07: Programming Languages meets Program Verification, pages 57--68. ACM, 2007. Google Scholar
Digital Library
- L. Augustsson. Cayenne -- a language with dependent types. In ICFP '98: International Conference on Functional Programming, pages 239--250. ACM, 1998. Google Scholar
Digital Library
- L. Bachmair, N. Dershowitz, and D. A. Plaisted. Completion Without Failure. In A. H. Kaci and M. Nivat, editors, Resolution of Equations in Algebraic Structures, volume 2: Rewriting Techniques, pages 1--30. Academic Press, 1989.Google Scholar
Cross Ref
- B. Barras and B. Bernardo. The Implicit Calculus of Constructions as a Programming Language with Dependent Types. In 11th international conference on Foundations of Software Science and Computational Structures (FOSSACS 2008), volume 4962 of LNCS, pages 365--379. Springer, 2008. Google Scholar
Digital Library
- Y. Bertot and P. Castéran. Interactive Theorem Proving and Program Development, Coq'Art:the Calculus of Inductive Constructions. Springer-Verlag, 2004. Google Scholar
Digital Library
- G. M. Bierman, A. D. Gordon, C. Hritcu, and D. E. Langworthy. Semantic subtyping with an SMT solver. In ICFP '10: International Conference on Functional Programming, pages 105--116, 2010. Google Scholar
Digital Library
- E. C. Brady. Idris-systems programming meets full dependent types. In PLPV'11: Programming languages meets program verification, pages 43--54. ACM, 2011. ISBN 978--1--4503-0487-0. Google Scholar
Digital Library
- C. Casinghino, V. Sjöberg, and S. Weirich. Combining proofs and programs in a dependently typed langauge. In POPL '14: 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, 2014. Google Scholar
Digital Library
- P. Corbineau. Deciding equality in the constructor theory. In T. Altenkirch and C. McBride, editors, Types for Proofs and Programs, volume 4502 of Lecture Notes in Computer Science, pages 78--92. Springer Berlin Heidelberg, 2007. Google Scholar
Digital Library
- K. Crary. Type-Theoretic Methodology for Practical Programming Languages. PhD thesis, Cornell University, 1998. Google Scholar
Digital Library
- L. De Moura and N. Bjørner. Z3: An efficient SMT solver. In Proceedings of the Theory and Practice of Software, 14th International Conference on Tools and Algorithms for the Construction and Analysis of Systems, TACAS'08/ETAPS'08, pages 337--340, Berlin, Heidelberg, 2008. Springer-Verlag. Google Scholar
Digital Library
- L. de Moura, H. Rueß, and N. Shankar. Justifying equality. Electronic Notes in Theoretical Computer Science (ENTCS), 125 (3): 69--85, July 2005. Google Scholar
Digital Library
- P. J. Downey, R. Sethi, and R. E. Tarjan. Variations on the common subexpression problem. J. ACM, 27 (4): 758--771, Oct. 1980. Google Scholar
Digital Library
- J. Gallier, W. Snyder, P. Narendran, and D. Plaisted. Rigid E-unification is NP-complete. In Proceedings of the Third Annual Symposium on Logic in Computer Science (LICS '88), pages 218--227, 1988.Google Scholar
Cross Ref
- L. Jia, J. A. Vaughan, K. Mazurak, J. Zhao, L. Zarko, J. Schorr, and S. Zdancewic. AURA: A programming language for authorization and audit. In ICFP '08: International Conference on Functional Programming), pages 27--38, 2008. Google Scholar
Digital Library
- K. R. M. Leino. Dafny: an automatic program verifier for functional correctness. In Proceedings of the 16th international conference on Logic for programming, artificial intelligence, and reasoning, LPAR'10, pages 348--370. Springer-Verlag, 2010. Google Scholar
Digital Library
- C. McBride. First-order unification by structural recursion, 2001.Google Scholar
- G. Nelson and D. C. Oppen. Fast decision procedures based on congruence closure. J. ACM, 27 (2): 356--364, Apr. 1980. Google Scholar
Digital Library
- R. Nieuwenhuis and A. Oliveras. Fast congruence closure and extensions. Inf. Comput., 205 (4): 557--580, Apr. 2007. Google Scholar
Digital Library
- A. Petcher and A. Stump. Deciding Joinability Modulo Ground Equations in Operational Type Theory. In S. Lengrand and D. Miller, editors, Proof Search in Type Theories (PSTT), 2009.Google Scholar
- B. C. Pierce and D. N. Turner. Local type inference. ACM Trans. Program. Lang. Syst., 22 (1): 1--44, Jan. 2000. Google Scholar
Digital Library
- P. Sewell, F. Nardelli, S. Owens, G. Peskine, T. Ridge, S. Sarkar, and R. Strnisa. Ott: Effective tool support for the working semanticist. J. Funct. Program., 20 (1): 71--122, 2010. Google Scholar
Digital Library
- R. E. Shostak. An algorithm for reasoning about equality. Commun. ACM, 21 (7): 583--585, July 1978. Google Scholar
Digital Library
- V. Sjöberg and S. Weirich. Programming up to congruence (extended version). Technical Report MS-CIS-14--10, University of Pennsylvania, Philadelphia, PA, Oct. 2014.Google Scholar
- V. Sjöberg, C. Casinghino, K. Y. Ahn, N. Collins, H. D. Eades III, P. Fu, G. Kimmell, T. Sheard, A. Stump, and S. Weirich. Irrelevance, heterogeneous equality, and call-by-value dependent type systems. In J. Chapman and P. B. Levy, editors, MSFP '12, volume 76 of EPTCS, pages 112--162. Open Publishing Association, 2012.Google Scholar
- A. Stampoulis and Z. Shao. Static and user-extensible proof checking. In Proceedings of the 39th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL '12, pages 273--284, New York, NY, USA, 2012. ACM. Google Scholar
Digital Library
- P.-Y. Strub. Coq modulo theory. In CSL, pages 529--543, 2010. Google Scholar
Digital Library
- A. Stump and L.-Y. Tan. The algebra of equality proofs. In 16th International Conference on Rewriting Techniques and Applications (RTA'05), pages 469--483. Springer, 2005. Google Scholar
Digital Library
- N. Swamy, J. Chen, C. Fournet, P.-Y. Strub, K. Bhargavan, and J. Yang. Secure Distributed Programming with Value-dependent Types. In ICFP '11: International Conference on Functional Programming, pages 285--296. ACM, 2011. Google Scholar
Digital Library
Index Terms
Programming up to Congruence







Comments