skip to main content
10.1145/3546186.3549930acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Executable contracts for Elixir

Published: 06 September 2022 Publication History

Abstract

This paper introduces a new library for implementing executable contracts in Elixir. In addition to classical contract constructs such as preconditions and postconditions, the library permits e.g. to specify exceptional behaviour (i.e. which exceptions are thrown and under which conditions), and to associate timers with function calls to detect non-terminating or too slow computations.

References

[1]
Sergio Antoy and Michael Hanus. 2012. Contracts and Specifications for Functional Logic Programming. In PADL 2012, Claudio V. Russo and Neng-Fa Zhou (Eds.) (LNCS, Vol. 7149). Springer, 33–47. https://doi.org/10.1007/978-3-642-27694-1_4
[2]
Mauricio Cassola, Agustín Talagorria, Alberto Pardo, and Marcos Viera. 2020. A Gradual Type System for Elixir. In Proceedings of the 24th Brazilian Symposium on Context-Oriented Programming and Advanced Modularity (SBLP ’20). Association for Computing Machinery, New York, NY, USA. 17–24. isbn:9781450389433 https://doi.org/10.1145/3427081.3427084
[3]
Lars-Åke Fredlund, Julio Mariño, Sergio Pérez, and Salvador Tamarit. 2018. Runtime Verification in Erlang by Using Contracts. In Functional and Constraint Logic Programming - 26th International Workshop, WFLP 2018, Frankfurt/Main, Germany, September 6, 2018, Revised Selected Papers, Josep Silva (Ed.) (Lecture Notes in Computer Science, Vol. 11285). Springer, 56–73. https://doi.org/10.1007/978-3-030-16202-3_4
[4]
K. Rustan M. Leino. 2010. Dafny: An Automatic Program Verifier for Functional Correctness. In Logic for Programming, Artificial Intelligence, and Reasoning - 16th International Conference, LPAR-16, Dakar, Senegal, April 25-May 1, 2010, Revised Selected Papers, Edmund M. Clarke and Andrei Voronkov (Eds.) (Lecture Notes in Computer Science, Vol. 6355). Springer, 348–370. https://doi.org/10.1007/978-3-642-17511-4_20
[5]
Tobias Lindahl and Konstantinos Sagonas. 2006. Practical type inference based on success typings. In Proceedings of the 8th International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming, July 10-12, 2006, Venice, Italy, Annalisa Bossi and Michael J. Maher (Eds.). ACM, 167–178. https://doi.org/10.1145/1140335.1140356
[6]
Bertrand Meyer. 1992. Applying "Design by Contract". IEEE Computer, 25, 10 (1992), 40–51. https://doi.org/10.1109/2.161279
[7]
Erlang Solutions. 2021. https://github.com/esl/gradient Accessed: 2022-06-21
[8]
Josef Svenningsson. 2019. https://github.com/josefs/Gradualizer Accessed: 2022-06-21
[9]
Elixir Toniq. 2019. https://github.com/elixir-toniq/norm Accessed: 2022-06-21
[10]
Jose Valim. 2011. https://hexdocs.pm/ex_unit/1.12/ExUnit.html Accessed: 2022-06-21
[11]
Wiebe-Marten Wijnja. 2022. TypeCheck - Effortless runtime type-checking. https://github.com/Qqwy/elixir-type_check In Elixir EU 2022.

Cited By

View all
  • (2024)Controlled Scheduling of Concurrent Elixir ProgramsProceedings of the 23rd ACM SIGPLAN International Workshop on Erlang10.1145/3677995.3678195(67-75)Online publication date: 28-Aug-2024
  • (2024)Consolidating Smart Contracts with Behavioral ContractsProceedings of the ACM on Programming Languages10.1145/36564168:PLDI(965-989)Online publication date: 20-Jun-2024
  • (2023)Generation and Refinement of Testing ModelsProceedings of the 22nd ACM SIGPLAN International Workshop on Erlang10.1145/3609022.3609415(14-23)Online publication date: 30-Aug-2023

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
Erlang 2022: Proceedings of the 21st ACM SIGPLAN International Workshop on Erlang
September 2022
46 pages
ISBN:9781450394352
DOI:10.1145/3546186
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 06 September 2022

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Elixir
  2. Program Contracts
  3. Program Tracing

Qualifiers

  • Research-article

Conference

Erlang '22
Sponsor:

Acceptance Rates

Overall Acceptance Rate 51 of 68 submissions, 75%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)11
  • Downloads (Last 6 weeks)3
Reflects downloads up to 08 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Controlled Scheduling of Concurrent Elixir ProgramsProceedings of the 23rd ACM SIGPLAN International Workshop on Erlang10.1145/3677995.3678195(67-75)Online publication date: 28-Aug-2024
  • (2024)Consolidating Smart Contracts with Behavioral ContractsProceedings of the ACM on Programming Languages10.1145/36564168:PLDI(965-989)Online publication date: 20-Jun-2024
  • (2023)Generation and Refinement of Testing ModelsProceedings of the 22nd ACM SIGPLAN International Workshop on Erlang10.1145/3609022.3609415(14-23)Online publication date: 30-Aug-2023

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media