{"title":"突破n3障碍:更快的对象类型推断","authors":"F. Henglein","doi":"10.1002/(SICI)1096-9942(199901/03)5:1<57::AID-TAPO5>3.0.CO;2-U","DOIUrl":null,"url":null,"abstract":"Abadi and Cardelli [1] present a series of type systems for their object calculi, four of which are first-order. Palsberg [22] has shown how typability in each one of these systems can be decided in time O(n3) and space O(n2), where n is the size of an untyped object expression, using an algorithm based on dynamic transitive closure. \n \n \n \nIn this paper we improve each one of the four type inference problems from O(n3) to the following time complexities: [see article pdf to view table] \n \n \n \nFurthermore, our algorithms improve the space complexity from O(n2) to O(n) in each case. \n \n \n \nThe key ingredient that lets us “beat” the worst-case time and space complexity induced by general dynamic transitive closure or similar algorithmic methods is that object subtyping, in contrast to record subtyping, is invariant: an object type is a subtype of a “shorter” type with a subset of the method names if and only if the common components have equal types. © 1999 John Wiley & Sons, Inc.","PeriodicalId":293061,"journal":{"name":"Theory Pract. Object Syst.","volume":"4 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1900-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"16","resultStr":"{\"title\":\"Breaking Through the n3 Barrier: Faster Object Type Inference\",\"authors\":\"F. Henglein\",\"doi\":\"10.1002/(SICI)1096-9942(199901/03)5:1<57::AID-TAPO5>3.0.CO;2-U\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Abadi and Cardelli [1] present a series of type systems for their object calculi, four of which are first-order. Palsberg [22] has shown how typability in each one of these systems can be decided in time O(n3) and space O(n2), where n is the size of an untyped object expression, using an algorithm based on dynamic transitive closure. \\n \\n \\n \\nIn this paper we improve each one of the four type inference problems from O(n3) to the following time complexities: [see article pdf to view table] \\n \\n \\n \\nFurthermore, our algorithms improve the space complexity from O(n2) to O(n) in each case. \\n \\n \\n \\nThe key ingredient that lets us “beat” the worst-case time and space complexity induced by general dynamic transitive closure or similar algorithmic methods is that object subtyping, in contrast to record subtyping, is invariant: an object type is a subtype of a “shorter” type with a subset of the method names if and only if the common components have equal types. © 1999 John Wiley & Sons, Inc.\",\"PeriodicalId\":293061,\"journal\":{\"name\":\"Theory Pract. Object Syst.\",\"volume\":\"4 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"1900-01-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"16\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Theory Pract. Object Syst.\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1002/(SICI)1096-9942(199901/03)5:1<57::AID-TAPO5>3.0.CO;2-U\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Theory Pract. Object Syst.","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1002/(SICI)1096-9942(199901/03)5:1<57::AID-TAPO5>3.0.CO;2-U","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 16
Breaking Through the n3 Barrier: Faster Object Type Inference
Abadi and Cardelli [1] present a series of type systems for their object calculi, four of which are first-order. Palsberg [22] has shown how typability in each one of these systems can be decided in time O(n3) and space O(n2), where n is the size of an untyped object expression, using an algorithm based on dynamic transitive closure.
In this paper we improve each one of the four type inference problems from O(n3) to the following time complexities: [see article pdf to view table]
Furthermore, our algorithms improve the space complexity from O(n2) to O(n) in each case.
The key ingredient that lets us “beat” the worst-case time and space complexity induced by general dynamic transitive closure or similar algorithmic methods is that object subtyping, in contrast to record subtyping, is invariant: an object type is a subtype of a “shorter” type with a subset of the method names if and only if the common components have equal types. © 1999 John Wiley & Sons, Inc.