[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-82320-en":3,"doc-seo-82320-105":29,"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":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":13,"seo_description":14,"update_tm":27,"read_time":28},82320,1374391974564,"Clementine","https://ap-avatar.wpscdn.com/avatar/14000253aa45c000a9e?x-image-process=image/resize,m_fixed,w_180,h_180&k=1779874745381141002",8,"Research & Report","Diversifying to Verify: When Task-Equivalent Programs Differ in Verifiability","Program verification is crucial for software correctness, yet fully verified programs remain hard to produce with today’s automated tools. This work examines whether implementation structure influences automated verifiability when multiple generated programs target the same task-level semantics. It introduces Diversify2Verify, a staged LLM pipeline for Why3 that infers representation-specific contracts, generates diverse recursive/imperative implementations, and performs bounded verifier-guided annotation repair. A benchmark of 73 integer/array/list tasks yields 292 variants and improves artifact verification from 32.9% to 52.7%.","arXiv :2607 .09366v 1 [ cs . SE] 10 Jul 2026  \nDiversifying to Verify: When Task-Equivalent Programs Differ in Verifiability  \nShirley Yu 1 and Ruben Martins2  \n1 Stanford University, [shirleyyu0302@gmail.com](shirleyyu0302@gmail.com)  \n2 Carnegie Mellon University, [rubenm@andrew.cmu.edu](rubenm@andrew.cmu.edu)  \nAbstract. Program verification is crucial for software correctness, but producing fully verified programs remains difficult in practice.  \nThis paper studies whether implementation structure affects automated verifiability when multiple generated programs are intended to satisfy the same task-level semantics.  \nWe present Diversify2Verify, a staged LLM-based pipeline for Why3 that infers representation-specific contracts, generates and tests diverse recursive and imperative array/list implementations, and attempts verification with bounded verifier-guided annotation repair.  \nWe also construct a verification-oriented benchmark of 73 tasks over integers, arrays, and lists, yielding 292 implementation variants. Diversify2Verify verifies 96 artifacts initially and 154 after two repair passes, improving artifact-level verification from 32 .9% to 52 .7% . Atthe task level, at least one variant verifies for 49 of 73 tasks, a 67.1% success rate. These results show that task-equivalent implementations can differ substantially in verifiability and that implementation diversity helps find verification-friendly artifacts.  \nKeywords: Program verification · Implementation diversity · Specification generation · Large language models · Why3 · Verifier-guided repair  \n1 Introduction  \nLarge Language Models (LLMs) have become increasingly effective at synthesizing executable code from natural-language prompts [4] . Generating formally verified software, however, requires more than code that passes tests. In deductive verification frameworks such as Why3 [7], a program must be paired with a formal semantic specification and proof guidance—including preconditions, postconditions, invariants, variants, assertions, helper predicates, and lemmas—sufficient for the verifier to prove correctness. This makes verified-code generation difficult to treat as ordinary code generation. Natural-language tasks are often ambiguous or incomplete, and concrete examples validate only particular inputoutput pairs. A model must therefore infer a mathematical specification [5,15], implement the algorithm [4,1,13], and synthesize the proof structure needed to connect the implementation to that specification [16,22] . In a one-shot approach,  \n2 Yu and Martins  \nthese requirements are entangled. When verification fails, feedback is often ambiguous, and unconstrained repair may change the specification rather than the implementation or proof, yielding a program that verifies for the wrong reason.  \nThis paper asks whether implementation diversity can improve LLM-assisted deductive verification. Given multiple implementations intended to solve the same task, do different data representations and control structures lead to different verification outcomes? Can generating several variants increase the chance that at least one has a verification-friendly structure? We use task-equivalent to mean that variants are generated for the same benchmark task and verified against representation-specific contracts that are intended to express the same task-level semantics. We do not prove, as an additional theorem, that the array and list contracts are equivalent to each other.  \nWe introduce Diversify2Verify, a staged LLM-based pipeline for generating and verifying Why3 artifacts from programming tasks and examples. Diversify2Verify separates contract inference, implementation generation, and proof annotation. It first generates a representation-specific contract with helper definitions and test lemmas derived from the examples, then freezes the accepted contract as the semantic target. It next generates executable WhyML candidates for the same task, varying representatio","cbCaiqzuyEdiwY5R","https://ap.wps.com/l/cbCaiqzuyEdiwY5R","pdf",422989,1,20,"English","en",105,"# Introduction\n## Problem motivation\n## Proposed approach: Diversify2Verify\n## Verification-oriented benchmark and evaluation","[{\"question\":\"What is the main question of the paper?\",\"answer\":\"The paper asks whether implementation structure affects automated verifiability when different programs are task-equivalent and are verified against representation-specific contracts.\"},{\"question\":\"What is Diversify2Verify?\",\"answer\":\"Diversify2Verify is a staged LLM-based pipeline for Why3 that separates contract inference, implementation generation, and proof annotation, then uses bounded verifier-guided repair.\"},{\"question\":\"How does the method perform in verification results?\",\"answer\":\"Across 292 generated artifacts, 96 verify initially and 154 verify after two bounded repair passes, improving artifact-level verification from 32.9% to 52.7%. At the task level, at least one variant verifies for 49 of 73 tasks (67.1%).\"}]",1784179588,50,{"code":4,"msg":30,"data":31},"ok",{"site_id":24,"language":23,"slug":32,"title":13,"keywords":33,"description":14,"schema_data":34,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":27},"diversifying-to-verify-when-task-equivalent-programs-differ-in-verifiability","",{"@graph":35,"@context":85},[36,53,68],{"@type":37,"itemListElement":38},"BreadcrumbList",[39,43,47,50],{"item":40,"name":41,"@type":42,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":44,"name":45,"@type":42,"position":46},"https://docshare.wps.com/document/","Document",2,{"item":48,"name":12,"@type":42,"position":49},"https://docshare.wps.com/document/research-report/",3,{"item":51,"name":13,"@type":42,"position":52},"https://docshare.wps.com/document/diversifying-to-verify-when-task-equivalent-programs-differ-in-verifiability/82320/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":23,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":40,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-17","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 is the main question of the paper?","Question",{"text":75,"@type":76},"The paper asks whether implementation structure affects automated verifiability when different programs are task-equivalent and are verified against representation-specific contracts.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"What is Diversify2Verify?",{"text":80,"@type":76},"Diversify2Verify is a staged LLM-based pipeline for Why3 that separates contract inference, implementation generation, and proof annotation, then uses bounded verifier-guided repair.",{"name":82,"@type":73,"acceptedAnswer":83},"How does the method perform in verification results?",{"text":84,"@type":76},"Across 292 generated artifacts, 96 verify initially and 154 verify after two bounded repair passes, improving artifact-level verification from 32.9% to 52.7%. At the task level, at least one variant verifies for 49 of 73 tasks (67.1%).","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":24},{"code":4,"msg":5,"data":92},[93,97,101,105,110,114,119,122,126,129,133],{"id":20,"doc_module":4,"doc_module_name":45,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":46,"doc_module":4,"doc_module_name":45,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":45,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":45,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":45,"category_name":112,"show_sort_weight":28,"slug":113},6,"Technology","technology",{"id":115,"doc_module":4,"doc_module_name":45,"category_name":116,"show_sort_weight":117,"slug":118},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":45,"category_name":12,"show_sort_weight":120,"slug":121},30,"research-report",{"id":123,"doc_module":4,"doc_module_name":45,"category_name":124,"show_sort_weight":21,"slug":125},9,"Religion & Spirituality","religion-spirituality",{"id":21,"doc_module":4,"doc_module_name":45,"category_name":127,"show_sort_weight":21,"slug":128},"World Cup","world-cup",{"id":130,"doc_module":4,"doc_module_name":45,"category_name":131,"show_sort_weight":130,"slug":132},10,"Lifestyle","lifestyle",{"id":134,"doc_module":4,"doc_module_name":45,"category_name":135,"show_sort_weight":106,"slug":136},19,"General","general"]