[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-397257-105":59,"doc-detail-397257-en":130},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","dependent-type-theory-of-stateful-higher-order-functions","Dependent Type Theory of Stateful Higher-Order Functions","","Dependent Hoare Type Theory (HTT) supports reasoning about programs with higher-order functions and effects, including non-termination, state with aliasing, and pointer arithmetic. HTT encodes effectful commands using a monad indexed by pre- and post-conditions in Hoare-logic style. The theory separates definitional from propositional equality to preserve relative decidability of type-checking while enabling specifications to depend on effectful computations.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":40,"@type":76,"position":81},"https://docshare.wps.com/document/research-report/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/dependent-type-theory-of-stateful-higher-order-functions/397257/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/dependent-type-theory-of-stateful-higher-order-functions/397257.png","ImageObject",300,407,{"name":92,"@type":93},"Rowan","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-16","2026-09-26",true,{"@type":102,"interactionType":103,"userInteractionCount":34},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What is HTT and what does it enable?","Question",{"text":112,"@type":113},"HTT is a dependent Hoare Type Theory that supports reasoning about higher-order programs with effects. It covers non-termination, state with aliasing, and pointer arithmetic.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How does HTT represent effectful commands?",{"text":117,"@type":113},"HTT uses an indexed monad whose type is parameterized by pre- and post-conditions, following the style of Hoare logic. Executing a computation updates state in a way constrained by the post-condition.",{"name":119,"@type":110,"acceptedAnswer":120},"Why does HTT distinguish definitional equality from propositional equality?",{"text":121,"@type":113},"The distinction is used to maintain relative decidability of type-checking. It also helps align soundness between the type system and the specification logic.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},397257,1791307940,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":39,"category_name":40,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":34,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":139,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":144,"read_time":41,"preview_page_count":19,"preview_urls":145},1099514067415,"https://ap-avatar.wpscdn.com/avatar/100002539d78ffe74a7?x-image-process=image/resize,m_fixed,w_180,h_180&k=1779092875211072502","Dependent Type Theory of Stateful Higher-Order Functions  \nAleksandar Nanevski and Greg Morrisett Harvard University  \n[f](faleksj gregg@eecs.harvard.edu)[aleks](faleksj gregg@eecs.harvard.edu)[j](faleksj gregg@eecs.harvard.edu)[ greg](faleksj gregg@eecs.harvard.edu)[g](faleksj gregg@eecs.harvard.edu)[@eecs.harvard.edu](faleksj gregg@eecs.harvard.edu)  \nAbstract  \nWe present a dependent Hoare Type Theory (HTT) which provides supportfor reasoning about programs with higherorder functions and effects, including non-termination, state with aliasing and pointer arithmetic. The type structure encapsulates effectful commands using a monad indexed by pre- and post-conditions in the style of Hoare logic. The theory carefully distinguishes between an appropriate notion of deﬁnitional equality and propositional equality, in order to maintain the relative decidability of type-checking.  \n1 Introduction  \nThis paper describes a type theoretic approach to developing a programming language for higher-order stateful functions together with its associated program logic.  \nHoare logic [10] has been most successfully employed to reason about 􀀂rst-order imperative programs, whereas extensions to programs with procedures and more generally higher-order functions have been known to be subtle [5, 7, 6, 1, 2] . As discussed by Apt in his survey of Hoare Logic, the problems usually appear because 􀂓 ... the semantics of parameter passing is always modeled syntactically by some form of variable substitution in a program, and this leads to various subtle problems concerning variable clashes. These difﬁculties are especially acute in the presence of recursion and static scoping􀂔 [2, page 462] . That is, the modularity features that make typed lambda calculus so successful appear to be in direct con􀀃ict with Hoare-style reasoning.  \nThe goal of this work is to marry dependent type theory and Hoare logic in a fashion that preserves the strengths of each. In particular, we seek a Hoare-like logic for higher-order, imperative programs while retaining the proof-theoretic reasoning of the Curry-Howard isomorphism. To that end, we describe a system called HTT (short for Hoare Type Theory) that revolves around a pure, dependently-typed functional core extended with impera-  \ntive commands, together with the associated type theory which is extended to account for encapsulation of effects and logical speci􀀂cations of their behavior. The speci􀀂 -cations are based upon the classical work of Cartwright and Oppen [6](􀀂rst-order, multi-sorted classical logic with McCarthy-style arrays [16]) . We use classical, rather thana substructural logic (e.g. Separation logic [22, 25, 23]), mainly because it has a well-studied proof theory, and has been employed in several practical veri􀀂cation systems, like ESC/Java [14, 8] and Cyclone [12], but we believe the framework is extensible to other logics.  \nAt any rate, our main focus and contribution is not any particular assertion logic, but the formulation of HTT as a dependent type theory which reconciles state and higherorder functions. This formulation has several important consequences: First, the treatment of variables at the term, command, type, and speci􀀂cation levels is handled uniformly which avoids many inconvenient side conditions that are usually present in Hoare logics. Second, the encapsulation of effects, via an indexed monad [17, 27, 13], makes it possible for both types and speci􀀂cations to depend upon terms (including effectful computations) . Third, the language treats heap addresses as natural numbers, and thus easily supports reasoning about aliasing and pointer arithmetic. Fourth, the separation of de􀀂nitional and propositional equality on terms makes it possible to reduce the decidability of type-checking to provability in the speci􀀂cation logic, and soundness of the type system to soundness of the speci􀀂cation logic. Fifth, HTT re-establishes the CurryHoward isomorphism between logic and higher-order functi","cbCaickmrXgFBeck","https://ap.wps.com/l/cbCaickmrXgFBeck","pdf",191338,12,"English","# Introduction\n## Goal and contributions of HTT\n## HTT fragments: pure functional core and stateful commands\n## Indexed monads for encapsulating effects\n## Equality and decidability in the type system","[{\"question\":\"What is HTT and what does it enable?\",\"answer\":\"HTT is a dependent Hoare Type Theory that supports reasoning about higher-order programs with effects. It covers non-termination, state with aliasing, and pointer arithmetic.\"},{\"question\":\"How does HTT represent effectful commands?\",\"answer\":\"HTT uses an indexed monad whose type is parameterized by pre- and post-conditions, following the style of Hoare logic. Executing a computation updates state in a way constrained by the post-condition.\"},{\"question\":\"Why does HTT distinguish definitional equality from propositional equality?\",\"answer\":\"The distinction is used to maintain relative decidability of type-checking. It also helps align soundness between the type system and the specification logic.\"}]","Dependent Type Theory of Stateful Higher-Order Functions | PDF",1790460809,[146,150,154,158],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/034e029a8894334abff10c83a30a7cf8.webp",983,1272,{"page_no":14,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/f8099ed35cb3e61f8afb11bdec779380.webp",982,1270,{"page_no":81,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/ce68f1cd28d9efea71d88c0045c3bf9f.webp",981,1269,{"page_no":19,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/10ce64f32e95ee3a8d03ae7553add155.webp",980,1268]