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.
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- James Cheney and Ralf Hinze. 2003. First-class phantom types. Cornell University. Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Johann Joseph Fux. 1965. The Study of Counterpoint. W. W. Norton & Company. isbn:9780393002775 Google Scholar
- 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 ScholarDigital Library
- 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 Scholar
- Anna R Karlin, Mark S Manasse, Larry Rudolph, and Daniel D Sleator. 1988. Competitive snoopy caching. Algorithmica, 3 (1988), 79–119. Google ScholarDigital Library
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- John Leo. 2022. Demo: Counterpoint Analysis and Synthesis. Presentation at FARM ’22. https://github.com/halfaya/MusicTools/blob/master/doc/farm22/abstract.pdf Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
Index Terms
- Weighted Refinement Types for Counterpoint Composition
Recommendations
A machine learning approach to two-voice counterpoint composition
Algorithmic composition of musical pieces is one of the most popular areas of computer aided music research. Various attempts have been made successfully in the area of music composition. Artificial intelligence methods have been extensively applied in ...
Gradual refinement types
POPL '17Refinement types are an effective language-based verification technique. However, as any expressive typing discipline, its strength is its weakness, imposing sometimes undesired rigidity. Guided by abstract interpretation, we extend the gradual typing ...
Gradual refinement types
POPL '17: Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming LanguagesRefinement types are an effective language-based verification technique. However, as any expressive typing discipline, its strength is its weakness, imposing sometimes undesired rigidity. Guided by abstract interpretation, we extend the gradual typing ...
Comments