[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-83537-en":3,"doc-seo-83537-105":30,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":21,"is_downloadable":21,"audit_status":21,"page_count":22,"language":23,"language_code":24,"site_id":25,"html_lang":24,"table_of_contents":26,"faqs":27,"seo_title":13,"seo_description":14,"update_tm":28,"read_time":29},83537,962075006959,"Anda","https://ap-avatar.wpscdn.com/avatar/e0002397efbe92a78e?_k=1776741047341049297",8,"Research & Report","Practical Range Refinement Types with Inference","Refinement types are a static verification technique that strengthens traditional type systems by using predicates to constrain values. Adoption can be hindered by annotation overhead, which is often harder than plain type annotations in mainstream languages. This paper presents ranger, a refinement type system focused on integer range types for bounded index manipulation and in-bounds data access. A bidirectional type system with inference, lightweight flow-sensitive analysis, and smart casts reduces auxiliary annotations.","arXiv :2607 .00824v 1 [ cs .PL] 1 Jul 2026  \nPractical Range Refinement Types with Inference  \nValentin Aebi and Carlo A. Furia [0000−0003−1040−3201]  \nSoftware Institute, USI – Università della Svizzera italiana, Lugano, Switzerland  \n{valentin. aebi,[furiac}@usi. ch](furiac}@usi. ch)  \nAbstract. Refinement types are a static verification technique that aims at increasing the expressivity of traditional type systems while remaining easy and natural to use. While systems based on refinement types have been developed for several mainstream languages, their practical adoption remains limited by their annotation overhead, which is often a more significant burden than when using the “plain”  \ntype annotations of languages like Java or Scala.  \nTo improve the state of the art, this paper introduces ranger: a refinement type system designed to keep the annotation overhead small and to seamlessly integrate with imperative-style constructs like variables and loops. As the name suggests, ranger focuses on integer range types: a particular kind of refinement types that express bounded integer ranges. Such types are widely useful to verify correct index manipulation and in-bounds data accesses, among others. To combine expressiveness and succinctness, ranger is based on a bidirectional type system, which runs a type inference algorithm to provide the typechecking pass with information useful to reduce the need for user-written auxiliary annotations. ranger also integrates other forms of lightweight flow-sensitive static analysis techniques that precisely capture the program’s behavior without explicit annotations.  \nWe implemented ranger on top of the licorne experimental programming language.  \nOur experiments show that ranger’s implementation can concisely express and verify a variety of useful properties that fall beyond the capabilities of standard static type systems like those of Java and Scala. The experiments also indicate that ranger compares favorably to other extended type systems, such as the Java Checker Framework and Liquid Java, that can also check properties about ranges:  \nranger can express more complex constraints, and usually requires no auxiliary annotations beyond those to specify a function’s typed signature.  \n1 Introduction  \nStatic type systems are an integral part of many real-world programming languages, where they systematically rule out, at compile time, the presence of common programming errors. As such, they have earned a reputation as “the world’s most successful formal method” [15] . Key to their success is a delicate balance between expressiveness and ease of use: the static type systems most commonly found in mainstream programming languages target a relatively narrow class of safety properties—such as operation compatibility and syntactic subtyping—that can be expressed and analyzed with only a reasonable amount of explicit user annotations. In contrast, statically verifying more complex, behavioral properties usually requires specialized tools and detailed annotations, which makes them impractical for casual or non-expert users.  \nRefinement types an attempt to push the expressiveness of static type systems while retaining their ease of use. A refinement type uses a predicate to further constrain the set of values described by a type. In this paper, we focus on a category of refinement types that is widely useful: integer range types, which constrain integer values to be within certain bounds. For example, an array index variable should be between zero (included) and the array’s length (excluded) . As we discuss in Sec. 2, several frameworks have been developed in recent years to extend mainstream programming languages with support for refinement types. For example, the Checker Framework [25] and Liquid Java [14] offer annotations to refine Java types, both supporting at least some form of ranges. Our experiments described in Sec. 5, however, indicate that existing systems may not “play well” with so","cbCaieHEEkQY1NHd","https://ap.wps.com/l/cbCaieHEEkQY1NHd","pdf",459834,3,1,18,"English","en",105,"# Introduction\n## Refinement Types and Annotation Overhead\n## Ranger Design Principles\n## Implementation and Evaluation","[{\"question\":\"What problem does ranger aim to solve in refinement type adoption?\",\"answer\":\"Ranger targets the practical limitation of annotation overhead in refinement type systems, which can be more burdensome than standard type annotations.\"},{\"question\":\"What kind of refinement types does ranger focus on?\",\"answer\":\"Ranger focuses on integer range types that express bounded integer ranges, useful for verifying correct index manipulation and in-bounds data access.\"},{\"question\":\"How does ranger reduce the need for user-written annotations?\",\"answer\":\"It uses a bidirectional type system with type inference plus lightweight flow-sensitive static analysis and smart casts to provide sufficient information for typechecking.\"}]",1784188690,45,{"code":4,"msg":31,"data":32},"ok",{"site_id":25,"language":24,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":28},"practical-range-refinement-types-with-inference","",{"@graph":36,"@context":85},[37,53,68],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,50],{"item":41,"name":42,"@type":43,"position":21},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":20},"https://docshare.wps.com/document/research-report/",{"item":51,"name":13,"@type":43,"position":52},"https://docshare.wps.com/document/practical-range-refinement-types-with-inference/83537/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":24,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":41,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-21","2026-07-16",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"What problem does ranger aim to solve in refinement type adoption?","Question",{"text":75,"@type":76},"Ranger targets the practical limitation of annotation overhead in refinement type systems, which can be more burdensome than standard type annotations.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"What kind of refinement types does ranger focus on?",{"text":80,"@type":76},"Ranger focuses on integer range types that express bounded integer ranges, useful for verifying correct index manipulation and in-bounds data access.",{"name":82,"@type":73,"acceptedAnswer":83},"How does ranger reduce the need for user-written annotations?",{"text":84,"@type":76},"It uses a bidirectional type system with type inference plus lightweight flow-sensitive static analysis and smart casts to provide sufficient information for typechecking.","https://schema.org",{"og:url":51,"og:type":87,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":89,"canonical":51},"index,follow",{"doc_id":7,"site_id":25},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,120,123,128,131,135],{"id":21,"doc_module":4,"doc_module_name":46,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":46,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":46,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":46,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":46,"category_name":117,"show_sort_weight":118,"slug":119},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":121,"slug":122},30,"research-report",{"id":124,"doc_module":4,"doc_module_name":46,"category_name":125,"show_sort_weight":126,"slug":127},9,"Religion & Spirituality",20,"religion-spirituality",{"id":126,"doc_module":4,"doc_module_name":46,"category_name":129,"show_sort_weight":126,"slug":130},"World Cup","world-cup",{"id":132,"doc_module":4,"doc_module_name":46,"category_name":133,"show_sort_weight":132,"slug":134},10,"Lifestyle","lifestyle",{"id":136,"doc_module":4,"doc_module_name":46,"category_name":137,"show_sort_weight":106,"slug":138},19,"General","general"]