{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2025,6,19]],"date-time":"2025-06-19T04:50:02Z","timestamp":1750308602110,"version":"3.41.0"},"reference-count":29,"publisher":"Association for Computing Machinery (ACM)","issue":"POPL","license":[{"start":{"date-parts":[[2019,12,20]],"date-time":"2019-12-20T00:00:00Z","timestamp":1576800000000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"DOI":"10.13039\/501100001659","name":"Deutsche Forschungsgemeinschaft","doi-asserted-by":"crossref","award":["282458149"],"award-info":[{"award-number":["282458149"]}],"id":[{"id":"10.13039\/501100001659","id-type":"DOI","asserted-by":"crossref"}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2020,1]]},"abstract":"<jats:p>The expression problem describes a fundamental trade-off in program design: Should a program's primary decomposition be determined by the way its domain objects are constructed (\"functional\" decomposition), or by the way they are destructed (\"object-oriented\" decomposition)? We argue that programming languages should not force one of these decompositions on the programmer; rather, a programming language should support both ways of decomposing a program in a symmetric way, with an easy translation between these decompositions. However, current programming languages are usually not symmetric and hence make it unnecessarily hard to switch the decomposition.<\/jats:p>\n          <jats:p>We propose a language that is symmetric in this regard and allows a fully automatic translation between \"functional\" and \"object-oriented\" decomposition. We present a language with algebraic data types and pattern matching for \"functional\" decomposition and codata types and copattern matching for \"object-oriented\" decomposition, together with a bijective translation that turns a data type into a codata type (\"destructorization\") or vice versa (\"constructorization\"). We present the first symmetric programming language with support for local (co)pattern matching, which includes local anonymous function or object definitions, that allows an automatic translation as described above. We also present the first mechanical formalization of such a language and prove i) that the type system is sound, that the translations between data and codata types are ii) type-preserving, iii) behavior-preserving and iv) inverses of each other. We also extract a mechanically verified implementation from our formalization and have implemented an IDE with direct support for these translations.<\/jats:p>","DOI":"10.1145\/3371098","type":"journal-article","created":{"date-parts":[[2019,12,20]],"date-time":"2019-12-20T19:45:25Z","timestamp":1576871125000},"page":"1-28","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":2,"title":["Decomposition diversity with symmetric data and codata"],"prefix":"10.1145","volume":"4","author":[{"given":"David","family":"Binder","sequence":"first","affiliation":[{"name":"University of T\u00fcbingen, Germany"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Julian","family":"Jabs","sequence":"additional","affiliation":[{"name":"University of T\u00fcbingen, Germany"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Ingo","family":"Skupin","sequence":"additional","affiliation":[{"name":"University of T\u00fcbingen, Germany"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Klaus","family":"Ostermann","sequence":"additional","affiliation":[{"name":"University of T\u00fcbingen, Germany"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"320","published-online":{"date-parts":[[2019,12,20]]},"reference":[{"doi-asserted-by":"publisher","key":"e_1_2_2_1_1","DOI":"10.1145\/2429069.2429075"},{"doi-asserted-by":"publisher","key":"e_1_2_2_2_1","DOI":"10.1145\/2500365.2500597"},{"doi-asserted-by":"publisher","key":"e_1_2_2_3_1","DOI":"10.1145\/2071368.2071370"},{"doi-asserted-by":"publisher","key":"e_1_2_2_4_1","DOI":"10.1017\/S0956796800020025"},{"key":"e_1_2_2_5_1","volume-title":"Symposium on Implementation and Application of Functional Languages. Springer, 58\u201384","author":"Boquist Urban","year":"1996","unstructured":"Urban Boquist and Thomas Johnsson . 1996 . The GRIN project: A highly optimising back end for lazy functional languages . In Symposium on Implementation and Application of Functional Languages. Springer, 58\u201384 . Urban Boquist and Thomas Johnsson. 1996. The GRIN project: A highly optimising back end for lazy functional languages. In Symposium on Implementation and Application of Functional Languages. Springer, 58\u201384."},{"doi-asserted-by":"publisher","key":"e_1_2_2_6_1","DOI":"10.1007\/978-3-540-76637-7_15"},{"key":"e_1_2_2_7_1","volume-title":"Proceedings of the REX Workshop \/ School on the Foundations of Object-Oriented Languages. Springer-Verlag, 151\u2013178","author":"Cook William R.","year":"1990","unstructured":"William R. Cook . 1990 . Object-oriented programming versus abstract data types . In Proceedings of the REX Workshop \/ School on the Foundations of Object-Oriented Languages. Springer-Verlag, 151\u2013178 . William R. Cook. 1990. Object-oriented programming versus abstract data types. In Proceedings of the REX Workshop \/ School on the Foundations of Object-Oriented Languages. Springer-Verlag, 151\u2013178."},{"doi-asserted-by":"publisher","key":"e_1_2_2_8_1","DOI":"10.1145\/1640089.1640133"},{"doi-asserted-by":"publisher","key":"e_1_2_2_9_1","DOI":"10.1145\/1929501.1929503"},{"doi-asserted-by":"publisher","key":"e_1_2_2_10_1","DOI":"10.1016\/j.scico.2007.10.007"},{"volume-title":"Proceedings of the Conference on Principles and Practice of Declarative Programming. 162\u2013174","author":"Danvy Olivier","unstructured":"Olivier Danvy and Lasse R. Nielsen . 2001. Defunctionalization at work . In Proceedings of the Conference on Principles and Practice of Declarative Programming. 162\u2013174 . Olivier Danvy and Lasse R. Nielsen. 2001. Defunctionalization at work. In Proceedings of the Conference on Principles and Practice of Declarative Programming. 162\u2013174.","key":"e_1_2_2_11_1"},{"key":"e_1_2_2_12_1","volume-title":"Codata in Action. In European Symposium on Programming. Springer, 119\u2013146","author":"Downen Paul","year":"2019","unstructured":"Paul Downen , Zachary Sullivan , Zena M Ariola , and Simon Peyton Jones . 2019 . Codata in Action. In European Symposium on Programming. Springer, 119\u2013146 . Paul Downen, Zachary Sullivan, Zena M Ariola, and Simon Peyton Jones. 2019. Codata in Action. In European Symposium on Programming. Springer, 119\u2013146."},{"key":"e_1_2_2_13_1","volume-title":"Design Patterns: Elements of Reusable Object-Oriented Software","author":"Gamma Erich","year":"1995","unstructured":"Erich Gamma , Richard Helm , Ralph Johnson , and John Vlissides . 1995 . Design Patterns: Elements of Reusable Object-Oriented Software . Addison-Wesley Publishing Co. , Boston, Massachusetts, USA. Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. 1995. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Publishing Co., Boston, Massachusetts, USA."},{"volume-title":"Types for Proofs and Programs","author":"Gim\u00e9nez Eduardo","unstructured":"Eduardo Gim\u00e9nez . 1996. An application of co-inductive types in Coq: Verification of the alternating bit protocol . In Types for Proofs and Programs , Stefano Berardi and Mario Coppo (Eds.). Springer Berlin Heidelberg . Eduardo Gim\u00e9nez. 1996. An application of co-inductive types in Coq: Verification of the alternating bit protocol. In Types for Proofs and Programs, Stefano Berardi and Mario Coppo (Eds.). Springer Berlin Heidelberg.","key":"e_1_2_2_14_1"},{"doi-asserted-by":"publisher","key":"e_1_2_2_15_1","DOI":"10.14778\/2536274.2536279"},{"doi-asserted-by":"publisher","key":"e_1_2_2_16_1","DOI":"10.1016\/S0747-7171(89)80065-3"},{"volume-title":"Object Orientation with Parallelism and Persistence","author":"Jacobs Bart","unstructured":"Bart Jacobs . 1995. Objects and classes, coalgebraically . In Object Orientation with Parallelism and Persistence . Springer-Verlag , 83\u2013103. Bart Jacobs. 1995. Objects and classes, coalgebraically. In Object Orientation with Parallelism and Persistence. Springer-Verlag, 83\u2013103.","key":"e_1_2_2_17_1"},{"volume-title":"Lambda lifting: Transforming programs to recursive equations","author":"Johnsson Thomas","unstructured":"Thomas Johnsson . 1985. Lambda lifting: Transforming programs to recursive equations . In Functional Programming Languages and Computer Architecture, Jean-Pierre Jouannaud (Ed.). Springer Berlin Heidelberg , Berlin, Heidelberg , 190\u2013203. Thomas Johnsson. 1985. Lambda lifting: Transforming programs to recursive equations. In Functional Programming Languages and Computer Architecture, Jean-Pierre Jouannaud (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg, 190\u2013203.","key":"e_1_2_2_18_1"},{"volume-title":"Proceedings of the 12th European Conference on Object-Oriented Programming (ECCOP \u201998)","author":"Krishnamurthi Shriram","unstructured":"Shriram Krishnamurthi , Matthias Felleisen , and Daniel P. Friedman . 1998. Synthesizing Object-Oriented and Functional Design to Promote Re-Use . In Proceedings of the 12th European Conference on Object-Oriented Programming (ECCOP \u201998) . Springer-Verlag, Berlin, Heidelberg, 91\u2013113. http:\/\/dl.acm.org\/citation.cfm?id=646155.679709 Shriram Krishnamurthi, Matthias Felleisen, and Daniel P. Friedman. 1998. Synthesizing Object-Oriented and Functional Design to Promote Re-Use. In Proceedings of the 12th European Conference on Object-Oriented Programming (ECCOP \u201998). Springer-Verlag, Berlin, Heidelberg, 91\u2013113. http:\/\/dl.acm.org\/citation.cfm?id=646155.679709","key":"e_1_2_2_19_1"},{"doi-asserted-by":"publisher","key":"e_1_2_2_20_1","DOI":"10.1145\/3131851.3131869"},{"doi-asserted-by":"publisher","key":"e_1_2_2_21_1","DOI":"10.1007\/978-3-540-70594-9_12"},{"volume-title":"Proceedings of the 26th European Conference on Object-Oriented Programming (ECOOP\u201912)","author":"Bruno C. d.","unstructured":"Bruno C. d. S. Oliveira and William R. Cook. 2012. Extensibility for the Masses: Practical Extensibility with Object Algebras . In Proceedings of the 26th European Conference on Object-Oriented Programming (ECOOP\u201912) . Springer-Verlag, Berlin, Heidelberg, 2\u201327. Bruno C. d. S. Oliveira and William R. Cook. 2012. Extensibility for the Masses: Practical Extensibility with Object Algebras. In Proceedings of the 26th European Conference on Object-Oriented Programming (ECOOP\u201912). Springer-Verlag, Berlin, Heidelberg, 2\u201327.","key":"e_1_2_2_22_1"},{"doi-asserted-by":"publisher","key":"e_1_2_2_23_1","DOI":"10.1007\/978-3-319-89884-1_3"},{"doi-asserted-by":"publisher","key":"e_1_2_2_24_1","DOI":"10.1145\/2784731.2784763"},{"doi-asserted-by":"publisher","key":"e_1_2_2_25_1","DOI":"10.1145\/800194.805852"},{"key":"e_1_2_2_26_1","volume-title":"New Directions in Algorithmic Languages","author":"Reynolds John C.","year":"1975","unstructured":"John C. Reynolds . 1975. User-defined types and procedural data structures as complementary approaches to data abstraction . In New Directions in Algorithmic Languages 1975 , Stephen Schuman (Ed.). IFIP Working Group 2.1 on Algol, INRIA, Rocquencourt, France, 157\u2013168. John C. Reynolds. 1975. User-defined types and procedural data structures as complementary approaches to data abstraction. In New Directions in Algorithmic Languages 1975, Stephen Schuman (Ed.). IFIP Working Group 2.1 on Algol, INRIA, Rocquencourt, France, 157\u2013168."},{"key":"e_1_2_2_27_1","volume-title":"The Expression Problem. (Nov","author":"Wadler Philip","year":"1998","unstructured":"Philip Wadler . 1998. The Expression Problem. (Nov . 1998 ). Note to Java Genericity mailing list. Philip Wadler. 1998. The Expression Problem. (Nov. 1998). Note to Java Genericity mailing list."},{"doi-asserted-by":"publisher","key":"e_1_2_2_28_1","DOI":"10.1145\/944705.944723"},{"doi-asserted-by":"publisher","key":"e_1_2_2_29_1","DOI":"10.1016\/j.apal.2008.01.001"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3371098","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3371098","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,18]],"date-time":"2025-06-18T19:05:43Z","timestamp":1750273543000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3371098"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2019,12,20]]},"references-count":29,"journal-issue":{"issue":"POPL","published-print":{"date-parts":[[2020,1]]}},"alternative-id":["10.1145\/3371098"],"URL":"https:\/\/doi.org\/10.1145\/3371098","relation":{},"ISSN":["2475-1421"],"issn-type":[{"type":"electronic","value":"2475-1421"}],"subject":[],"published":{"date-parts":[[2019,12,20]]},"assertion":[{"value":"2019-12-20","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}