[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-751183-105":59,"doc-detail-751183-en":129,"doc-similar-751183":159},{"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":122,"head_meta":124,"extra_data":126,"updated_unix":128},105,"en","assignment-1-15-414-bug-catching-automated-program-verification","Assignment 1 - 15-414 Bug Catching: Automated Program Verification","","Assignment 1 focuses on automated program verification using Why3 and supported provers. It provides installation guidance and command-line and IDE workflows for proving goals, replaying sessions, and checking session statistics. The tasks require editing only program contracts for a faulty iterative summation so why3 prove-P alt-ergo sum .mlw verifies, refactoring bitvector-based integer sets to satisfy Bitset invariants, and implementing verified queue operations using a list ghost model invariant. It also covers a verified discrete-difference array function without mutating the input.",{"@graph":69,"@context":121},[70,84,104],{"@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/assignment-1-15-414-bug-catching-automated-program-verification/751183/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":98,"encodingFormat":97,"isAccessibleForFree":99,"interactionStatistic":100},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/assignment-1-15-414-bug-catching-automated-program-verification/751183.png","ImageObject",300,407,{"name":92,"@type":93},"Jacob","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-26",true,{"@type":101,"interactionType":102,"userInteractionCount":8},"InteractionCounter",{"@type":103},"ViewAction",{"@type":105,"mainEntity":106},"FAQPage",[107,113,117],{"name":108,"@type":109,"acceptedAnswer":110},"What software and provers are required before starting the assignment?","Question",{"text":111,"@type":112},"Install Why3 and the relevant provers using the course website installation instructions.","Answer",{"name":114,"@type":109,"acceptedAnswer":115},"How should proof sessions be handled when using the Why3 IDE?",{"text":116,"@type":112},"When goals are proved in a .mlw file via the IDE, a folder with the proof session is created; always save the session when exiting the IDE.",{"name":118,"@type":109,"acceptedAnswer":119},"What is required for Task 1 to verify the Sum implementation?",{"text":120,"@type":112},"Update the contracts (and only the contracts, except part 4) so that why3 prove-P alt-ergo sum .mlw succeeds in verifying the code.","https://schema.org",{"og:url":83,"og:type":123,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":125,"canonical":83},"index,follow",{"doc_id":127,"site_id":62},751183,1795725939,{"code":4,"msg":5,"data":130},{"doc_id":127,"user_id":131,"nickname":92,"user_avatar":132,"doc_module":4,"category_id":39,"category_name":40,"doc_title":65,"doc_description":67,"doc_content":133,"file_id":134,"file_url":135,"file_type":136,"file_size":137,"view_count":8,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":19,"language":138,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":139,"faqs":140,"seo_title":141,"seo_description":67,"update_tm":128,"read_time":52,"preview_page_count":19,"preview_urls":142},962084931830,"https://ap-avatar.wpscdn.com/davatar_a8503ba1806abce46bf441b54a3ca4cd","Assignment 1  \nVariations on a Theme  \n15-414: Bug Catching: Automated Program Verification  \nDue 23:59pm, Friday, September 11, 2026  \n75 pts  \nThis assignment is due on the above date and it must be submitted electronically on Gradescope. Please carefully read the policies on collaboration and credit on the course web pages at [http://www.cs.cmu.edu/](http://www.cs.cmu.edu/) ~15414/assignments.html.  \nWorking With Why3  \nBefore you begin this assignment, you will need to install Why3 and the relevant provers. To do so, please follow the installation instructions on the course website ([https://www.cs.cmu.edu/](https://www.cs.cmu.edu/)~15414/why3 _install.html) .  \nTo help you out with Why3, we’ve provided some useful commands below:  \n• To verify using the command line, run why3 prove-P \u003Cprover> \u003Cfilename> .mlw. This is useful for simple programs where more fine-grained control over the provers is unnecessary, as well as for intermediate checking. However, your final submission should include proof sessions as created by the IDE.  \n• To open the Why3 IDE, run why3 ide \u003Cfilename> .mlw.  \n– When you attempt to prove the goals in a file filename .mlw using the IDE, a folder called filename will be created, containing a proof session. Make sure that you always save the current proof session when you exit the IDE. To check your session after the fact, you can run the following two commands:  \nwhy3 replay filename \\# should print that everything replayed OK why3 session info--stats filename \\# prints a summary of the goals  \n– Although it’s not possible to modify code directly from the IDE, if you make changes in a different editor (VSCode, Atom, etc.), you can refresh the IDE session with Ctrl+R.  \nWhat To Hand In  \n[You should hand in the file](You should hand in the file asst1.zip)[ asst1.zip](You should hand in the file asst1.zip), which you can generate by running make. This will include all of the raw mlw files, as well as the proof sessions created by the IDE.  \nASSIGNMENT 1 DUE 23:59PM, FRIDAY, SEPTEMBER 11, 2026  \n1 The Fine Print (15 pts)  \nUnlike software license agreements that nobody ever reads, program contracts should be studied carefully because they might not mean what you think at first and you may be left holding the bag. The following is an incorrect attempt to implement an iterative summation function (which you can find in the file sum.mlw) .  \n1 module Sum 2  \n3 use int . Int 4  \n5 function sum (n : int) : int  \n6 axiom sum0: sum 0 = 0  \n7 axiom sumn: forall n . n > 0 -> sum n = n + sum (n - 1) 8  \n9 let sum(n: int) : int =  \n10 ensures { result = sum n }  \n11 let ref i = 0 in  \n12 let ref r = 0 in  \n13 while i \u003C n do  \n14 invariant { r = sum i }  \n15 variant { n-i }  \n16 r \u003C - r + i ;  \n17 i \u003C - i + 1 ;  \n18 done ;  \n19 r 20  \n21 end  \nTask 1 (15 pts). In each of the following sub-tasks you should change the contracts, and only the contracts (except in part 4) of the above incorrect implementation, so that the command  \nwhy3 prove-P alt-ergo sum .mlw succeeds in verifying the code.  \n1. You may remove two lines.  \n2. You may add disjunction \\/ and truth true, as many copies as you wish.  \n3. You may add comparison \u003C between variables and implication->, as many copies as you wish.  \n4. You may swap any two lines (not restricted to contracts), and add at most two contracts. Your proof in this case must be correct.  \nName your functions sum_i for 1 ≤ i ≤ 4 and place them in the file sum .mlw.  \n2 Relaxed Requirements (15 pts)  \nIn this problem we ask you to refactor the implementation of integer sets using bitvectors covered in lecture (and included in bitset.mlw) .  \nASSIGNMENT 1 DUE 23:59PM, FRIDAY, SEPTEMBER 11, 2026  \nTask 2 (15 pts). Change the data structure invariants, and if needed the implementation of test, so that Why3 is able to verify the Bitset module. You should not change the contracts on test; they should look like the following:  \n1 let test (x : int) (s : bset) : bool =  \n2 ensures { result ","cbCais33poBS9BXP","https://ap.wps.com/l/cbCais33poBS9BXP","pdf",141353,"English","# Working With Why3\n## Installation and proving commands\n## IDE proof session handling\n# What To Hand In\n# Tasks\n## Task 1: Fix contracts for Sum\n## Task 2: Verify Bitset module\n## Task 3: Verified queues with ghost model\n## Task 4: Discrete differentiation","[{\"question\":\"What software and provers are required before starting the assignment?\",\"answer\":\"Install Why3 and the relevant provers using the course website installation instructions.\"},{\"question\":\"How should proof sessions be handled when using the Why3 IDE?\",\"answer\":\"When goals are proved in a .mlw file via the IDE, a folder with the proof session is created; always save the session when exiting the IDE.\"},{\"question\":\"What is required for Task 1 to verify the Sum implementation?\",\"answer\":\"Update the contracts (and only the contracts, except part 4) so that why3 prove-P alt-ergo sum .mlw succeeds in verifying the code.\"}]","Assignment 1 - 15-414 Bug Catching: Automated Program Verification | PDF",[143,147,151,155],{"page_no":8,"url":144,"width":145,"height":146},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-26/64edcfc7147814921ecf4515ab50ae0d.webp",983,1272,{"page_no":14,"url":148,"width":149,"height":150},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-26/51ce06118273ff5462e7be584cf442ef.webp",982,1270,{"page_no":81,"url":152,"width":153,"height":154},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-26/64bd5e344d16a814c356835d8de26e75.webp",981,1269,{"page_no":19,"url":156,"width":157,"height":158},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-26/20ad291196d5d5ba023bc117a44b840e.webp",980,1268,{"list":160,"token":66},[161,168,175,182,189,196,203,210,217,224],{"doc_id":162,"doc_title":163,"file_type":136,"home_preview_img_url":164,"slug":165,"view_count":166,"category_name":40,"create_tm":167},234,"XNX Gas Detector Calibration Guide 2023","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229693727733/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796125679&Signature=bp0MPtL6pPeeBwTTjtFpo4lhB9E%3D","xnx-gas-detector-calibration-2023",7904,1776136863,{"doc_id":169,"doc_title":170,"file_type":136,"home_preview_img_url":171,"slug":172,"view_count":173,"category_name":40,"create_tm":174},227,"Sridevi Matka Chart Full Guide to Panel, Jodi & Pana Records","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229693727553/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796125679&Signature=i4VR9UXA0Afdhc7I12eoxpfY0M4%3D","sridevi-matka-chart-full-guide-to-panel-jodi-pana-records",6940,1776136851,{"doc_id":176,"doc_title":177,"file_type":136,"home_preview_img_url":178,"slug":179,"view_count":180,"category_name":40,"create_tm":181},167314,"Linear Algebra and Its Applications 6th edition Textbook by david c. lay","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229876163444/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796125679&Signature=9e85JyLAIhr8MdWXdKFnn32dgck%3D","linear-algebra-and-its-applications-sixth-edition-david-c-lay-steven-r-lay-judi-j-mcdonald",5876,1788211707,{"doc_id":183,"doc_title":184,"file_type":136,"home_preview_img_url":185,"slug":186,"view_count":187,"category_name":40,"create_tm":188},32070,"Blueprint Pengelolaan Sumber Daya Manusia Kesehatan (SDMK) Tahun 2025–2029","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229758685683/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796125679&Signature=Mmvrfc9aM0nN4PPbmCk7oisPkHs%3D","healthcare-human-resources-management-blueprint-sdmk-20252029",1293,1780779716,{"doc_id":190,"doc_title":191,"file_type":136,"home_preview_img_url":192,"slug":193,"view_count":194,"category_name":40,"create_tm":195},148514,"Developmental Biology - Twelfth Edition","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229868853261/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796125679&Signature=nYeAHFoVfSqs6tEWNcxIHox1J58%3D","developmental-biology-twelfth-edition",1251,1787780705,{"doc_id":197,"doc_title":198,"file_type":136,"home_preview_img_url":199,"slug":200,"view_count":201,"category_name":40,"create_tm":202},121,"Letter of Intent Sample for School","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229693418846/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796125679&Signature=jBYQHJ6d7ebZ%2BsSnX2c7SbKIPvQ%3D","letter-of-intent-sample-for-school",1059,1776135210,{"doc_id":204,"doc_title":205,"file_type":136,"home_preview_img_url":206,"slug":207,"view_count":208,"category_name":40,"create_tm":209},129209,"Laboratory Manual for Principles of General Chemistry - J. A. Beran - 11th Edition","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229840760175/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796125679&Signature=CIzb8OuwrE5%2FuE4XKLK2o%2B86aa0%3D","laboratory-manual-for-principles-of-general-chemistry-j-a-beran-11th-edition",887,1786011673,{"doc_id":211,"doc_title":212,"file_type":136,"home_preview_img_url":213,"slug":214,"view_count":215,"category_name":40,"create_tm":216},117724,"The Trading Edge - Vivek Bajaj","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229834707110/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796125679&Signature=rtYOw%2B6bVyUfFyZg1yl%2FecG92N8%3D","the-trading-edge-vivek-bajaj",875,1785678693,{"doc_id":218,"doc_title":219,"file_type":136,"home_preview_img_url":220,"slug":221,"view_count":222,"category_name":40,"create_tm":223},47709,"Stress, Appraisal, and Coping","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229799364477/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796125679&Signature=kMPso%2B25j%2FW19LDG7Lzq3NLOYuU%3D","stress-appraisal-and-coping",822,1783565401,{"doc_id":225,"doc_title":226,"file_type":136,"home_preview_img_url":227,"slug":228,"view_count":229,"category_name":40,"create_tm":230},23244,"The World Ahead 2026","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229716297903/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796125679&Signature=yNURZo13xcwBQc%2FXmhP24V6Ra%2BY%3D","the-world-ahead-2026",668,1777643490]