Knowledge (XXG)

Bounded quantification

Source 📝

106:. It assumes a record-based model for object classes, where every class member is a record element and all class members are named functions. Object attributes are represented as functions that take no argument and return an object. The specific behaviour is then some function name along with the types of the arguments and the return type. Bounded quantification considers all objects with such a function. An example would be a polymorphic 128:, introduced in 1989, allows for more precise typing of functions that are applied on recursive types. A recursive type is one that includes a function that uses it as a type for some argument or its return value. 796: 140:
with a generic interface. The following example demonstrates how to describe types that can be compared to each other and use this as typing information in
1052: 1033: 1007: 1057: 801: 919: 829: 47:
which are restricted ("bounded") to range only over the subtypes of a particular type. Bounded quantification is an interaction of
83: 148:
function uses simple bounded quantification and does not ensure the objects are mutually comparable, in contrast with the
980: 87: 1028: 137: 79: 16:
This article is about bounded quantification in type theory. For bounded quantification in mathematical logic, see
67: 71: 48: 878: 56: 40: 869: 966: 915: 1062: 931: 141: 99: 923: 883: 75: 995: 945: 904: 17: 973:. "Making the future safe for the past: Adding genericity to the Java programming language". In 1003: 896: 927: 888: 833: 103: 44: 806: 861: 962: 1046: 970: 853: 987:. "Design and Implementation of Generics for the .NET Common Language Runtime". In 958: 908: 857: 60: 1024: 24: 900: 52: 935: 837: 984: 940:
Conference on Functional Programming Languages and Computer Architecture
110:
function that considers all objects that are comparable to each other.
892: 533:// final Object o = fMin("cat", 3); // Does not compile 828:-bounded polymorphism for object-oriented programming. Canning, 55:. Bounded quantification has traditionally been studied in the 975:
Object-Oriented Programming: Systems, Languages, Applications
155:
In mathematical notation, the types of the two functions are
862:"On Understanding Types, Data Abstraction, and Polymorphism" 102:
to depend on some specific behaviour of objects instead of
936:"F-bounded polymorphism for object-oriented programming" 98:
The purpose of bounded quantification is to allow for
136:This kind of type constraint can be expressed in 797:Covariance and contravariance (computer science) 1038:The Cecil Language: Specification and Rationale 948:"Intersection types and bounded polymorphism". 159:min: ∀ T, ∀ S ⊆ {compareTo: T → int}. S → S → S 989:Programming Language Design and Implementation 152:function which uses F-bounded quantification. 8: 882: 838:http://dl.acm.org/citation.cfm?id=99392 818: 470:// Throws ClassCastException at runtime 7: 1014:, Chapter 26: Bounded quantification 802:Curiously recurring template pattern 126:recursively bounded quantification 14: 950:Lecture Notes in Computer Science 170:Comparable = {compareTo: T → int} 162:fMin: ∀ T ⊆ Comparable. T → T → T 1053:Polymorphism (computer science) 1000:Types and Programming Languages 1: 66:, but is available in modern 977:(OOPSLA). ACM, October 1998. 1058:Object-oriented programming 1029:Portland Pattern Repository 1079: 15: 68:object-oriented languages 1034:"F-bounded Polymorphism" 173: 114:F-bounded quantification 122:-bounded quantification 72:parametric polymorphism 49:parametric polymorphism 45:existential quantifiers 37:constrained genericity 29:bounded quantification 870:ACM Computing Surveys 142:polymorphic functions 100:polymorphic functions 1025:Bounded Polymorphism 33:bounded polymorphism 996:Pierce, Benjamin C. 832:, Hill, Olthof and 946:Benjamin C. Pierce 18:Bounded quantifier 1009:978-0-262-16209-8 893:10.1145/6041.6042 860:(December 1985). 1070: 1013: 967:David Stoutamire 928:John C. Mitchell 916:Peter S. Canning 912: 886: 866: 840: 823: 786: 783: 780: 777: 774: 771: 768: 765: 762: 759: 756: 753: 750: 747: 744: 741: 738: 735: 732: 729: 726: 723: 720: 717: 714: 711: 708: 705: 702: 699: 696: 693: 690: 687: 684: 681: 678: 675: 672: 669: 666: 663: 660: 657: 654: 651: 648: 645: 642: 639: 636: 633: 630: 627: 624: 621: 618: 615: 612: 609: 606: 603: 600: 597: 594: 591: 588: 585: 582: 579: 576: 573: 570: 567: 564: 561: 558: 555: 552: 549: 546: 543: 540: 537: 534: 531: 528: 525: 522: 519: 516: 513: 510: 507: 504: 501: 498: 495: 492: 489: 486: 483: 480: 477: 474: 471: 468: 465: 462: 459: 456: 453: 450: 447: 444: 441: 438: 435: 432: 429: 426: 423: 420: 417: 414: 411: 408: 405: 402: 399: 396: 393: 390: 387: 384: 381: 378: 375: 372: 369: 366: 363: 360: 357: 354: 351: 348: 345: 342: 339: 336: 333: 330: 327: 324: 321: 318: 315: 312: 309: 306: 303: 300: 297: 294: 291: 288: 285: 282: 279: 276: 273: 270: 267: 264: 261: 258: 255: 252: 249: 246: 243: 240: 237: 234: 231: 228: 225: 222: 219: 216: 213: 210: 207: 204: 201: 198: 195: 192: 189: 186: 183: 180: 177: 151: 147: 109: 104:type inheritance 1078: 1077: 1073: 1072: 1071: 1069: 1068: 1067: 1043: 1042: 1021: 1010: 994: 932:William Olthoff 920:William R. Cook 864: 852: 849: 844: 843: 824: 820: 815: 807:Wildcard (Java) 793: 788: 787: 784: 781: 778: 775: 772: 769: 766: 763: 760: 757: 754: 751: 748: 745: 742: 739: 736: 733: 730: 727: 724: 721: 718: 715: 712: 709: 706: 703: 700: 697: 694: 691: 688: 685: 682: 679: 676: 673: 670: 667: 664: 661: 658: 655: 652: 649: 646: 643: 640: 637: 634: 631: 628: 625: 622: 619: 616: 613: 610: 607: 604: 601: 598: 595: 592: 589: 586: 583: 580: 577: 574: 571: 568: 565: 562: 559: 556: 553: 550: 547: 544: 541: 538: 535: 532: 529: 526: 523: 520: 517: 514: 511: 508: 505: 502: 499: 497:"dog" 496: 493: 491:"cat" 490: 487: 484: 481: 478: 475: 472: 469: 466: 463: 460: 458:"cat" 457: 454: 451: 448: 445: 442: 439: 436: 433: 430: 427: 424: 421: 418: 415: 412: 409: 406: 404:"dog" 403: 400: 398:"cat" 397: 394: 391: 388: 385: 382: 379: 376: 373: 370: 367: 364: 361: 358: 355: 352: 349: 346: 343: 340: 337: 334: 331: 328: 325: 322: 319: 316: 313: 310: 307: 304: 301: 298: 295: 292: 289: 286: 283: 280: 277: 274: 271: 268: 265: 262: 259: 256: 253: 250: 247: 244: 241: 238: 235: 232: 229: 226: 223: 220: 217: 214: 211: 208: 205: 202: 199: 196: 193: 190: 187: 184: 181: 178: 175: 149: 145: 134: 116: 107: 96: 64: 21: 12: 11: 5: 1076: 1074: 1066: 1065: 1060: 1055: 1045: 1044: 1041: 1040: 1031: 1020: 1019:External links 1017: 1016: 1015: 1008: 992: 981:Andrew Kennedy 978: 963:Martin Odersky 956: 943: 924:Walter L. Hill 913: 884:10.1.1.117.695 877:(4): 471–523. 854:Cardelli, Luca 848: 845: 842: 841: 817: 816: 814: 811: 810: 809: 804: 799: 792: 789: 174: 172: 171: 164: 163: 160: 133: 130: 115: 112: 95: 92: 62: 13: 10: 9: 6: 4: 3: 2: 1075: 1064: 1061: 1059: 1056: 1054: 1051: 1050: 1048: 1039: 1035: 1032: 1030: 1026: 1023: 1022: 1018: 1011: 1005: 1002:. MIT Press. 1001: 997: 993: 990: 986: 982: 979: 976: 972: 971:Philip Wadler 968: 964: 960: 957: 954: 951: 947: 944: 941: 937: 933: 929: 925: 921: 917: 914: 910: 906: 902: 898: 894: 890: 885: 880: 876: 872: 871: 863: 859: 858:Wegner, Peter 855: 851: 850: 846: 839: 835: 831: 827: 822: 819: 812: 808: 805: 803: 800: 798: 795: 794: 790: 169: 168: 167: 161: 158: 157: 156: 153: 143: 139: 131: 129: 127: 123: 121: 113: 111: 105: 101: 93: 91: 89: 85: 81: 77: 73: 69: 65: 58: 54: 50: 46: 42: 38: 34: 30: 26: 19: 1037: 999: 988: 974: 959:Gilad Bracha 952: 949: 939: 874: 868: 825: 821: 165: 154: 135: 125: 119: 118: 117: 97: 39:) refers to 36: 32: 28: 22: 1063:Type theory 70:supporting 59:setting of 25:type theory 1047:Categories 847:References 674:Comparable 554:Comparable 443:Comparable 290:Comparable 287:implements 227:Comparable 224:implements 179:Comparable 78:) such as 57:functional 901:0360-0300 879:CiteSeerX 728:compareTo 602:compareTo 314:compareTo 305:@Override 251:compareTo 242:@Override 197:compareTo 176:interface 150:Test.fMin 53:subtyping 41:universal 998:(2002). 985:Don Syme 834:Mitchell 791:See also 683:>> 146:Test.min 94:Overview 76:generics 61:System F 1027:at the 991:, 2001. 955:, 1993. 942:, 1989. 909:2921816 671:extends 551:extends 506:Integer 413:Integer 257:Integer 233:Integer 221:Integer 132:Example 1006:  969:, and 930:, and 907:  899:  881:  770:return 752:return 662:static 659:public 644:return 626:return 542:static 539:public 476:String 383:String 368:String 356:static 353:public 341:public 332:// ... 320:String 308:public 296:String 284:String 278:public 269:// ... 245:public 215:public 166:where 144:. The 31:(also 938:. In 905:S2CID 865:(PDF) 813:Notes 740:<= 614:<= 503:final 473:final 440:final 410:final 380:final 344:class 323:other 281:class 260:other 218:class 206:other 88:Scala 63:<: 51:with 1004:ISBN 983:and 897:ISSN 830:Cook 764:else 689:fMin 677:< 665:< 638:else 557:> 545:< 515:fMin 485:fMin 371:args 362:main 359:void 347:Test 299:> 293:< 236:> 230:< 188:> 182:< 138:Java 86:and 80:Java 1036:in 953:664 889:doi 563:min 479:str 452:min 422:min 392:min 311:int 248:int 194:int 124:or 108:min 43:or 35:or 23:In 1049:: 965:, 961:, 934:. 926:, 922:, 918:, 903:. 895:. 887:. 875:17 873:. 867:. 856:; 836:. 716:if 590:if 530:); 521:10 500:); 467:); 437:); 428:10 407:); 209:); 90:. 84:C# 82:, 27:, 1012:. 911:. 891:: 826:F 785:} 782:} 779:} 776:; 773:b 767:{ 761:} 758:; 755:a 749:{ 746:) 743:0 737:) 734:b 731:( 725:. 722:a 719:( 713:{ 710:) 707:b 704:T 701:, 698:a 695:T 692:( 686:T 680:T 668:T 656:} 653:} 650:; 647:b 641:{ 635:} 632:; 629:a 623:{ 620:) 617:0 611:) 608:b 605:( 599:. 596:a 593:( 587:{ 584:) 581:b 578:S 575:, 572:a 569:S 566:( 560:S 548:S 536:} 527:3 524:, 518:( 512:= 509:i 494:, 488:( 482:= 464:3 461:, 455:( 449:= 446:c 434:3 431:, 425:( 419:= 416:b 401:, 395:( 389:= 386:a 377:{ 374:) 365:( 350:{ 338:} 335:} 329:{ 326:) 317:( 302:{ 275:} 272:} 266:{ 263:) 254:( 239:{ 212:} 203:T 200:( 191:{ 185:T 120:F 74:( 20:.

Index

Bounded quantifier
type theory
universal
existential quantifiers
parametric polymorphism
subtyping
functional
System F<:
object-oriented languages
parametric polymorphism
generics
Java
C#
Scala
polymorphic functions
type inheritance
Java
polymorphic functions
Covariance and contravariance (computer science)
Curiously recurring template pattern
Wildcard (Java)
Cook
Mitchell
http://dl.acm.org/citation.cfm?id=99392
Cardelli, Luca
Wegner, Peter
"On Understanding Types, Data Abstraction, and Polymorphism"
ACM Computing Surveys
CiteSeerX
10.1.1.117.695

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.