Skip to main content

Subtyping Without Reduction

  • Conference paper
  • First Online:
Mathematics of Program Construction (MPC 2022)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 13544))

Included in the following conference series:

  • 276 Accesses

Abstract

Subtypes are useful and ubiquitous, allowing important properties of data to be captured directly in types. However, the standard encoding of subtypes gives no control over when the reduction of subtyping proofs takes place, which can significantly impact the performance of type-checking. In this article, we show how operations on a subtype can be represented in a more efficient manner that exhibits no reduction behaviour. We present the general form of the technique in Cubical Agda by exploiting its support by higher-inductive types, and demonstrate the practical use of the technique with a number of examples.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 49.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 64.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Altenkirch, T., Ghani, N., Hancock, P., McBride, C., Morris, P.: Indexed containers. J. Funct. Program. 25 (2015)

    Google Scholar 

  2. Cockx, J., Devriese, D., Piessens, F.: Pattern matching without K. In: Proceedings of the 19th ACM SIGPLAN International Conference on Functional Programming, pp. 257–268 (2014)

    Google Scholar 

  3. Cohen, C., Coquand, T., Huber, S., Mörtberg, A.: Cubical type theory: a constructive interpretation of the univalence axiom. arXiv preprint arXiv:1611.02108 (2016)

  4. Dybjer, P., Setzer, A.: Induction-recursion and initial algebras. Ann. Pure Appl. Log. 124(1–3) (2003)

    Google Scholar 

  5. Gilbert, G., Cockx, J., Sozeau, M., Tabareau, N.: Definitional proof-irrelevance without K. Proc. ACM Program. Lang. 3(POPL) (Jan 2019). https://doi.org/10.1145/3290316

  6. Hancock, P., McBride, C., Ghani, N., Malatesta, L., Altenkirch, T.: Small induction recursion. In: Hasegawa, M. (ed.) TLCA 2013. LNCS, vol. 7941, pp. 156–172. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-38946-7_13

    Chapter  Google Scholar 

  7. Hewer, B.: Subtyping Cubical Agda Library (2022). https://tinyurl.com/f8pezwxd

  8. Kraus, N.: Ph.D. thesis, University of Nottingham (2015)

    Google Scholar 

  9. Malatesta, L., Altenkirch, T., Ghani, N., Hancock, P., McBride, C.: Small induction recursion, indexed containers and dependent polynomials are equivalent (2012)

    Google Scholar 

  10. Morris, P., Altenkirch, T.: Indexed containers. In: IEEE Symposium in Logic in Computer Science (2009)

    Google Scholar 

  11. Shulman, M.: Higher inductive-recursive univalence and type-directed definitions, June 2014. https://homotopytypetheory.org/2014/06/08/hiru-tdd/

  12. Program, T.U.F.: Homotopy type theory: univalent foundations of mathematics. Technical report, Institute for Advanced Study (2013)

    Google Scholar 

  13. Vezzosi, A., Mörtberg, A., Abel, A.: Cubical Agda: a dependently typed programming language with univalence and higher inductive types. J. Funct. Program. 31 (2021)

    Google Scholar 

Download references

Acknowledgements

We would like to thank Nicolai Kraus for many interesting discussions, and the anonymous reviewers for their useful comments and suggestions. This work was funded by the EPSRC grant EP/P00587X/1, Mind the Gap: Unified Reasoning About Program Correctness and Efficiency.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Brandon Hewer .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Hewer, B., Hutton, G. (2022). Subtyping Without Reduction. In: Komendantskaya, E. (eds) Mathematics of Program Construction. MPC 2022. Lecture Notes in Computer Science, vol 13544. Springer, Cham. https://doi.org/10.1007/978-3-031-16912-0_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-16912-0_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-16911-3

  • Online ISBN: 978-3-031-16912-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics