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

Weighted Refinement Types for Counterpoint Composition

Published:31 August 2023Publication History

ABSTRACT

Refinement types are useful for describing specifications of programs. When applied to music theory, however, refinement types are too restrictive in that they do not allow breaking of rules. To relax this restriction, we propose weighted refinement types, a variation of refinement types where each refinement predicate carries a weight representing the importance of that predicate. In this paper, we present a weighted refinement type system that has core features required for composing species counterpoint. We also discuss potential applications of weighted refinement types in non-musical domains.

References

  1. Robert Atkey. 2018. Syntax and Semantics of Quantitative Type Theory. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS ’18). Association for Computing Machinery, New York, NY, USA. 56–65. isbn:9781450355834 https://doi.org/10.1145/3209108.3209189 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Amotz Bar-Noy and Baruch Schieber. 1991. The canadian traveller problem. In Proceedings of the second annual ACM-SIAM Symposium on Discrete Algorithms (SODA ’91). 261–270. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Kevin Batz, Adrian Gallus, Benjamin Lucien Kaminski, Joost-Pieter Katoen, and Tobias Winkler. 2022. Weighted Programming: A Programming Paradigm for Specifying Mathematical Models. Proc. ACM Program. Lang., 6, OOPSLA1 (2022), Article 66, apr, 30 pages. https://doi.org/10.1145/3527310 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Manuel M. T. Chakravarty, Gabriele Keller, and Simon Peyton Jones. 2005. Associated Type Synonyms. In Proceedings of the Tenth ACM SIGPLAN International Conference on Functional Programming (ICFP ’05). Association for Computing Machinery, New York, NY, USA. 241–253. isbn:1595930647 https://doi.org/10.1145/1086365.1086397 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. James Cheney and Ralf Hinze. 2003. First-class phantom types. Cornell University. Google ScholarGoogle Scholar
  6. Youyou Cong and John Leo. 2019. Demo: Counterpoint by Construction. In Proceedings of the 7th ACM SIGPLAN International Workshop on Functional Art, Music, Modeling, and Design (FARM ’19). Association for Computing Machinery, New York, NY, USA. 22–24. isbn:9781450368117 https://doi.org/10.1145/3331543.3342578 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Tim Freeman and Frank Pfenning. 1991. Refinement Types for ML. In Proceedings of the ACM SIGPLAN 1991 Conference on Programming Language Design and Implementation (PLDI ’91). Association for Computing Machinery, New York, NY, USA. 268–277. isbn:0897914287 https://doi.org/10.1145/113445.113468 Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Johann Joseph Fux. 1965. The Study of Counterpoint. W. W. Norton & Company. isbn:9780393002775 Google ScholarGoogle Scholar
  9. Cordelia V. Hall, Kevin Hammond, Simon L. Peyton Jones, and Philip L. Wadler. 1996. Type Classes in Haskell. ACM Trans. Program. Lang. Syst., 18, 2 (1996), mar, 109–138. issn:0164-0925 https://doi.org/10.1145/227699.227700 Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Natasha Jaques, Shixiang Gu, Richard E Turner, and Douglas Eck. 2016. Generating Music by Fine-Tuning Recurrent Neural Networks with Reinforcement Learning. In Deep Reinforcement Learning Workshop, NIPS. https://storage.googleapis.com/pub-tools-public-publication-data/pdf/45871.pdf Google ScholarGoogle Scholar
  11. Anna R Karlin, Mark S Manasse, Larry Rudolph, and Daniel D Sleator. 1988. Competitive snoopy caching. Algorithmica, 3 (1988), 79–119. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Maciej Komosinski and Piotr Szachewicz. 2015. Automatic species counterpoint composition by means of the dominance relation. Journal of Mathematics and Music, 9, 1 (2015), 75–94. Google ScholarGoogle ScholarCross RefCross Ref
  13. Nico Lehmann, Adam T. Geller, Niki Vazou, and Ranjit Jhala. 2023. Flux: Liquid Types for Rust. Proc. ACM Program. Lang., 7, PLDI (2023), Article 169, jun, 25 pages. https://doi.org/10.1145/3591283 Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. John Leo. 2022. Demo: Counterpoint Analysis and Synthesis. Presentation at FARM ’22. https://github.com/halfaya/MusicTools/blob/master/doc/farm22/abstract.pdf Google ScholarGoogle Scholar
  15. José Pedro Magalhães and W. Bas de Haas. 2011. Functional Modelling of Musical Harmony: An Experience Report. In Proceedings of the 16th ACM SIGPLAN International Conference on Functional Programming (ICFP ’11). Association for Computing Machinery, New York, NY, USA. 156–162. isbn:9781450308656 https://doi.org/10.1145/2034773.2034797 Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Nadia Polikarpova, Ivan Kuraj, and Armando Solar-Lezama. 2016. Program Synthesis from Polymorphic Refinement Types. In Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’16). Association for Computing Machinery, New York, NY, USA. 522–538. isbn:9781450342612 https://doi.org/10.1145/2908080.2908093 Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Georg Stefan Schmid and Viktor Kuncak. 2016. SMT-Based Checking of Predicate-Qualified Types for Scala. In Proceedings of the 2016 7th ACM SIGPLAN Symposium on Scala (Scala 2016). Association for Computing Machinery, New York, NY, USA. 31–40. isbn:9781450346481 https://doi.org/10.1145/2998392.2998398 Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Kris Shaffer and Mark Gotham. [n. d.]. First-Species Counterpoint - Open Music Theory. https://viva.pressbooks.pub/openmusictheory/chapter/first-species-counterpoint/ Accessed on May 27, 2023 Google ScholarGoogle Scholar
  19. Wendy Suiter. 2010. The promise of fuzzy logic in generalised music composition. In Cultural Computing, Ryohei Nakatsu, Naoko Tosa, Fazel Naghdy, Kok Wai Wong, and Philippe Codognet (Eds.). Springer Berlin Heidelberg, 118–127. Google ScholarGoogle Scholar
  20. Dmitrij Szamozvancev and Michael B. Gale. 2017. Well-Typed Music Does Not Sound Wrong (Experience Report). In Proceedings of the 10th ACM SIGPLAN International Symposium on Haskell (Haskell 2017). Association for Computing Machinery, New York, NY, USA. 99–104. isbn:9781450351829 https://doi.org/10.1145/3122955.3122964 Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Niki Vazou, Patrick M Rondon, and Ranjit Jhala. 2013. Abstract refinement types. In Programming Languages and Systems: 22nd European Symposium on Programming (ESOP ’13). 209–228. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Niki Vazou, Eric L. Seidel, Ranjit Jhala, Dimitrios Vytiniotis, and Simon Peyton-Jones. 2014. Refinement Types for Haskell. In Proceedings of the 19th ACM SIGPLAN International Conference on Functional Programming (ICFP ’14). Association for Computing Machinery, New York, NY, USA. 269–282. isbn:9781450328739 https://doi.org/10.1145/2628136.2628161 Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Hongwei Xi. 2007. Dependent ML An approach to practical programming with dependent types. Journal of Functional Programming, 17, 2 (2007), 215–286. https://doi.org/10.1017/S0956796806006216 Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Hongwei Xi, Chiyan Chen, and Gang Chen. 2003. Guarded Recursive Datatype Constructors. In Proceedings of the 30th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’03). Association for Computing Machinery, New York, NY, USA. 224–235. isbn:1581136285 https://doi.org/10.1145/604131.604150 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Weighted Refinement Types for Counterpoint Composition

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        FARM 2023: Proceedings of the 11th ACM SIGPLAN International Workshop on Functional Art, Music, Modelling, and Design
        August 2023
        46 pages
        ISBN:9798400702952
        DOI:10.1145/3609023
        • General Chair:
        • Mae Milano,
        • Program Chair:
        • John Leo

        Copyright © 2023 ACM

        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].

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 31 August 2023

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate19of23submissions,83%

        Upcoming Conference

        ICFP '24
      • Article Metrics

        • Downloads (Last 12 months)75
        • Downloads (Last 6 weeks)8

        Other Metrics

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader