{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2025,6,18]],"date-time":"2025-06-18T04:19:52Z","timestamp":1750220392347,"version":"3.41.0"},"reference-count":49,"publisher":"Association for Computing Machinery (ACM)","issue":"OOPSLA","license":[{"start":{"date-parts":[[2021,10,15]],"date-time":"2021-10-15T00:00:00Z","timestamp":1634256000000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/www.acm.org\/publications\/policies\/copyright_policy#Background"}],"funder":[{"name":"IARPA BETTER Program","award":["2019-19051600006"],"award-info":[{"award-number":["2019-19051600006"]}]},{"name":"NSF","award":["DGE 1840340, CCF-1918233"],"award-info":[{"award-number":["DGE 1840340, CCF-1918233"]}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2021,10,20]]},"abstract":"<jats:p>\n            Many researchers have explored type inference for dynamic languages. However, traditional type inference computes most general types which, for complex type systems\u2014which are often needed to type dynamic languages\u2014can be verbose, complex, and difficult to understand. In this paper, we introduce SimTyper, a Ruby type inference system that aims to infer\n            <jats:italic>usable<\/jats:italic>\n            types\u2014specifically, nominal and generic types\u2014that match the types programmers write. SimTyper builds on InferDL, a recent Ruby type inference system that soundly combines standard type inference with heuristics. The key novelty of SimTyper is\n            <jats:italic>type equality prediction<\/jats:italic>\n            , a new, machine learning-based technique that predicts when method arguments or returns are likely to have the same type. SimTyper finds pairs of positions that are predicted to have the same type yet one has a verbose, overly general solution and the other has a usable solution. It then guesses the two types are equal, keeping the guess if it is consistent with the rest of the program, and discarding it if not. In this way, types inferred by SimTyper are guaranteed to be sound. To perform type equality prediction, we introduce the\n            <jats:italic>deep similarity<\/jats:italic>\n            (DeepSim) neural network. DeepSim is a novel machine learning classifier that follows the Siamese network architecture and uses CodeBERT, a pre-trained model, to embed source tokens into vectors that capture tokens and their contexts. DeepSim is trained on 100,000 pairs labeled with type similarity information extracted from 371 Ruby programs with manually documented, but not checked, types. We evaluated SimTyper on eight Ruby programs and found that, compared to standard type inference, SimTyper finds 69% more types that match programmer-written type information. Moreover, DeepSim can predict rare types that appear neither in the Ruby standard library nor in the training data. Our results show that type equality prediction can help type inference systems effectively produce more usable types.\n          <\/jats:p>","DOI":"10.1145\/3485483","type":"journal-article","created":{"date-parts":[[2021,10,15]],"date-time":"2021-10-15T19:18:28Z","timestamp":1634325508000},"page":"1-27","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":7,"title":["SimTyper: sound type inference for Ruby using type equality prediction"],"prefix":"10.1145","volume":"5","author":[{"given":"Milod","family":"Kazerounian","sequence":"first","affiliation":[{"name":"University of Maryland at College Park, USA"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Jeffrey S.","family":"Foster","sequence":"additional","affiliation":[{"name":"Tufts University, USA"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Bonan","family":"Min","sequence":"additional","affiliation":[{"name":"Raytheon BBN Technologies, USA"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"320","published-online":{"date-parts":[[2021,10,15]]},"reference":[{"key":"e_1_2_2_1_1","doi-asserted-by":"publisher","DOI":"10.1145\/99583.99621"},{"key":"e_1_2_2_2_1","doi-asserted-by":"publisher","DOI":"10.1145\/174675.177847"},{"key":"e_1_2_2_3_1","doi-asserted-by":"publisher","DOI":"10.1145\/3385412.3385997"},{"key":"e_1_2_2_4_1","doi-asserted-by":"publisher","DOI":"10.1007\/11531142_19"},{"key":"e_1_2_2_5_1","unstructured":"John Aycock. 2000. Aggressive Type Inference.  John Aycock. 2000. Aggressive Type Inference."},{"volume-title":"Advances in Neural Information Processing Systems","year":"1877","author":"Brown Tom","key":"e_1_2_2_6_1"},{"volume-title":"Journey: An online questionnaire application. https:\/\/github.com\/nbudin\/journey\/","year":"2021","author":"Budin Nat","key":"e_1_2_2_7_1"},{"key":"e_1_2_2_8_1","doi-asserted-by":"publisher","DOI":"10.1145\/113446.113469"},{"key":"e_1_2_2_9_1","unstructured":"Code.org. 2021. The code powering. code.org  Code.org. 2021. The code powering. code.org"},{"volume-title":"Combinatory Logic","year":"1968","author":"Curry H. B.","key":"e_1_2_2_10_1"},{"key":"e_1_2_2_11_1","doi-asserted-by":"publisher","DOI":"10.1145\/582153.582176"},{"key":"e_1_2_2_12_1","unstructured":"Shane Emmons and Anthony Dmitriyev. 2021. Money. https:\/\/github.com\/RubyMoney\/money  Shane Emmons and Anthony Dmitriyev. 2021. Money. https:\/\/github.com\/RubyMoney\/money"},{"key":"e_1_2_2_13_1","doi-asserted-by":"publisher","DOI":"10.18653\/v1\/2020.findings-emnlp.139"},{"key":"e_1_2_2_14_1","doi-asserted-by":"publisher","DOI":"10.1145\/258916.258937"},{"volume-title":"RDL: Types, type checking, and contracts for Ruby. https:\/\/github.com\/tupl-tufts\/rdl","year":"2018","author":"Foster Jeffrey","key":"e_1_2_2_15_1"},{"key":"e_1_2_2_16_1","unstructured":"Jeffrey S. Foster. 2021. Talks. https:\/\/github.com\/jeffrey-s-foster\/talks  Jeffrey S. Foster. 2021. Talks. https:\/\/github.com\/jeffrey-s-foster\/talks"},{"key":"e_1_2_2_17_1","doi-asserted-by":"publisher","DOI":"10.1145\/1529282.1529700"},{"key":"e_1_2_2_18_1","doi-asserted-by":"publisher","DOI":"10.1145\/2345156.2254094"},{"key":"e_1_2_2_19_1","doi-asserted-by":"publisher","DOI":"10.1145\/3236024.3236051"},{"key":"e_1_2_2_20_1","doi-asserted-by":"publisher","DOI":"10.1090\/S0002-9947-1969-0253905-6"},{"key":"e_1_2_2_21_1","unstructured":"Howard Hinnant. 2013. chrono-Compatible Low-Level Date Algorithms. https:\/\/howardhinnant.github.io\/date_algorithms.html  Howard Hinnant. 2013. chrono-Compatible Low-Level Date Algorithms. https:\/\/howardhinnant.github.io\/date_algorithms.html"},{"volume-title":"Discourse: A platform for community discussion. https:\/\/github.com\/discourse\/discourse","year":"2021","author":"Civilized Discourse Construction Kit Inc.","key":"e_1_2_2_22_1"},{"key":"e_1_2_2_23_1","volume-title":"Proceedings of the 37th International Conference on Machine Learning, Hal Daum\u00e9 III and Aarti Singh (Eds.) (Proceedings of Machine Learning Research","volume":"5121","author":"Kanade Aditya","year":"2020"},{"key":"e_1_2_2_24_1","unstructured":"Milod Kazerounian. 2021. Personal communication.  Milod Kazerounian. 2021. Personal communication."},{"key":"e_1_2_2_25_1","doi-asserted-by":"publisher","DOI":"10.5281\/zenodo.5449078"},{"key":"e_1_2_2_26_1","doi-asserted-by":"publisher","DOI":"10.1145\/3314221.3314630"},{"key":"e_1_2_2_27_1","doi-asserted-by":"publisher","DOI":"10.1145\/3426422.3426985"},{"volume-title":"Adam: A Method for Stochastic Optimization. In ICLR (Poster).","year":"2015","author":"Kingma Diederik P","key":"e_1_2_2_28_1"},{"key":"e_1_2_2_29_1","unstructured":"Gregory Koch Richard Zemel and Ruslan Salakhutdinov. 2015. Siamese neural networks for one-shot image recognition. ICML deep learning workshop. JMLR.org Online.  Gregory Koch Richard Zemel and Ruslan Salakhutdinov. 2015. Siamese neural networks for one-shot image recognition. ICML deep learning workshop. JMLR.org Online."},{"key":"e_1_2_2_30_1","doi-asserted-by":"publisher","DOI":"10.1145\/2578856.2508170"},{"key":"e_1_2_2_31_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE.2019.00045"},{"key":"e_1_2_2_32_1","doi-asserted-by":"publisher","DOI":"10.1016\/0022-0000(78)90014-4"},{"key":"e_1_2_2_33_1","unstructured":"MiniMagick. 2021. MiniMagick. https:\/\/github.com\/minimagick\/minimagick  MiniMagick. 2021. MiniMagick. https:\/\/github.com\/minimagick\/minimagick"},{"key":"e_1_2_2_34_1","unstructured":"Dmitry Petrashko. 2020. Personal communication.  Dmitry Petrashko. 2020. Personal communication."},{"key":"e_1_2_2_35_1","unstructured":"Postmodern. 2021. Ronin. https:\/\/github.com\/ronin-rb\/ronin  Postmodern. 2021. Ronin. https:\/\/github.com\/ronin-rb\/ronin"},{"key":"e_1_2_2_36_1","doi-asserted-by":"publisher","DOI":"10.1145\/291251.289448"},{"key":"e_1_2_2_37_1","unstructured":"Michael Pradel Georgios Gousios Jason Liu and Satish Chandra. 2019. TypeWriter: Neural Type Prediction with Search-based Validation. arxiv:1912.03768.  Michael Pradel Georgios Gousios Jason Liu and Satish Chandra. 2019. TypeWriter: Neural Type Prediction with Search-based Validation. arxiv:1912.03768."},{"key":"e_1_2_2_38_1","doi-asserted-by":"publisher","DOI":"10.1145\/2775051.2677009"},{"key":"e_1_2_2_39_1","doi-asserted-by":"publisher","DOI":"10.18653\/v1\/D19-1410"},{"key":"e_1_2_2_40_1","doi-asserted-by":"publisher","DOI":"10.1145\/2980983.2908127"},{"key":"e_1_2_2_41_1","unstructured":"Phil Ross. 2021. TZInfo. https:\/\/github.com\/tzinfo\/tzinfo  Phil Ross. 2021. TZInfo. https:\/\/github.com\/tzinfo\/tzinfo"},{"volume-title":"YARD: Yay! A Ruby Documentation Tool","year":"2020","author":"Segal Loren","key":"e_1_2_2_42_1"},{"volume-title":"Seventh Workshop on Scheme and Functional Programming. ACM","year":"2006","author":"Siek Jeremy","key":"e_1_2_2_43_1"},{"key":"e_1_2_2_44_1","doi-asserted-by":"publisher","DOI":"10.1145\/2775052.2661092"},{"volume-title":"Sorbet: A static type checker for Ruby. https:\/\/sorbet.org\/","year":"2020","key":"e_1_2_2_45_1"},{"key":"e_1_2_2_46_1","doi-asserted-by":"publisher","DOI":"10.1145\/1328897.1328486"},{"key":"e_1_2_2_47_1","doi-asserted-by":"publisher","DOI":"10.5555\/3295222.3295349"},{"key":"e_1_2_2_48_1","doi-asserted-by":"publisher","DOI":"10.1145\/2775052.2661101"},{"key":"e_1_2_2_49_1","doi-asserted-by":"publisher","DOI":"10.1145\/239912.239917"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3485483","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3485483","content-type":"application\/pdf","content-version":"vor","intended-application":"syndication"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3485483","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,17]],"date-time":"2025-06-17T20:18:39Z","timestamp":1750191519000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3485483"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2021,10,15]]},"references-count":49,"journal-issue":{"issue":"OOPSLA","published-print":{"date-parts":[[2021,10,20]]}},"alternative-id":["10.1145\/3485483"],"URL":"https:\/\/doi.org\/10.1145\/3485483","relation":{},"ISSN":["2475-1421"],"issn-type":[{"type":"electronic","value":"2475-1421"}],"subject":[],"published":{"date-parts":[[2021,10,15]]},"assertion":[{"value":"2021-10-15","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}