Publicação
A Textbook of Verified OCaml Programs. A deductive study on algorithms and data structures
| Resumo: | We live in a society that has an ever-increasing dependency on critical software. Even minor programming oversights can have disastrous consequences, ranging from endangering human and animal lives to economic loss. Thus, it is crucial to verify the correctness of such programs, which can be achieved with deductive verification techniques. However, the teaching of such techniques is hampered by the small number of bibliographical works in this field. Our goal with this work is ambitious: to write a textbook on verified algorithms and data structures, fully automated or as close to it as possible. We believe that OCaml is the perfect programming language choice for this endeavour, due to its multi-paradigm nature, and its status as a general-purpose language with use cases in both academia and the industry. And, most importantly, it has good support for automated deductive verification with Cameleer and GOSPEL. The current version of the textbook includes more than 1000 lines of verified OCaml code spread across 6 chapters and more than 40 programs. Moreover, we offer a blend of functional and imperative case studies, and, overall, a substantial subset of constructs found in OCaml, including its module system. In this document, we discuss our thought process and design decisions behind the creation of a textbook on verified OCaml algorithms. Namely, identifying which classes of algorithms to tackle, which algorithms were chosen within those classes, and how to orga- nize the contents of the textbook, to name a few topics. Additionally, this is accompanied by an overview of theoretical and practical concepts concerning programming languages, algorithm analysis, deductive verification, and the selected tools. |
|---|---|
| Autores principais: | Gasparinho, Pedro Ramos |
| Assunto: | Deductive Verification OCaml GOSPEL Cameleer Why3 Algorithms |
| Ano: | 2025 |
| País: | Portugal |
| Tipo de documento: | dissertação de mestrado |
| Tipo de acesso: | acesso aberto |
| Instituição associada: | Universidade Nova de Lisboa |
| Idioma: | inglês |
| Origem: | Repositório Institucional da UNL |
| _version_ | 1869923389138796544 |
|---|---|
| author | Gasparinho, Pedro Ramos |
| author_facet | Gasparinho, Pedro Ramos |
| author_role | author |
| contributor_name_str_mv | Pereira, Mário RUN |
| country_str | PT |
| creators_json_txt | [{\"Person.name\":\"Gasparinho, Pedro Ramos\"}] |
| datacite.contributors.contributor.contributorName.fl_str_mv | Pereira, Mário RUN |
| datacite.creators.creator.creatorName.fl_str_mv | Gasparinho, Pedro Ramos |
| datacite.date.Accepted.fl_str_mv | 2025-12-18T00:00:00Z |
| datacite.date.available.fl_str_mv | 2026-07-01T09:34:55Z |
| datacite.date.embargoed.fl_str_mv | 2026-07-01T09:34:55Z |
| datacite.rights.fl_str_mv | http://purl.org/coar/access_right/c_abf2 |
| datacite.subjects.subject.fl_str_mv | Deductive Verification OCaml GOSPEL Cameleer Why3 Algorithms |
| datacite.titles.title.fl_str_mv | A Textbook of Verified OCaml Programs. A deductive study on algorithms and data structures |
| dc.contributor.none.fl_str_mv | Pereira, Mário RUN |
| dc.creator.none.fl_str_mv | Gasparinho, Pedro Ramos |
| dc.date.Accepted.fl_str_mv | 2025-12-18T00:00:00Z |
| dc.date.available.fl_str_mv | 2026-07-01T09:34:55Z |
| dc.date.embargoed.fl_str_mv | 2026-07-01T09:34:55Z |
| dc.description.none.fl_str_mv | Vivemos numa sociedade cada vez mais dependente de software crítico. Por menor que um erro de programação possa ser, as suas consequências podem ser desastrosas, desde colocar vidas humanas e animais em perigo até provocar perdas económicas. Por isso, é fundamental garantir a correção de tais programas, o que pode ser efetuado através de técnicas de verificação dedutiva. No entanto, o ensino destas técnicas é dificultado pela escassez de livros científicos nesta área. O nosso objectivo para este trabalho é ambicioso: escrever um livro de algoritmos e estruturas de dados verificadas, de forma totalmente automática ou tão perto disso quanto possível. Acreditamos que OCaml é linguagem de programação perfeita para este efeito. Isto deve-se à sua natureza multi-paradigma e estatuto como linguagem de âmbito geral amplamente utilizada tanto na academia como na indústria. Acima de tudo, porque tem bom suporte para verificação dedutiva automática com Cameleer e GOSPEL. A versão atual deste livro inclui mais de 1000 linhas de código OCaml verificado, distribuídas por 6 capítulos e mais de 40 programas. Para além disso, disponibilizamos uma combinação de casos de estudo funcionais e imperativos. De forma geral, um subconjunto substancial das funcionalidades encontradas em OCaml, incluindo o sistema de módulos. Neste documento, apresentamos a fundamentação e as decisões de design na base da criação de um livro de algoritmos em OCaml verificados. Em particular, identificamos quais as classes de algoritmos a cobrir, quais os algoritmos escolhidos dentro dessas classes, e a forma como os conteúdos do livro estão organizados, entre outros aspetos. Ademais, isto é acompanhado por um resumo dos conceitos teóricos e práticos relativamente a linguagens de programação, análise de algoritmos, verificação dedutiva e as ferramentas selecionadas. |
| dc.format.none.fl_str_mv | application/pdf |
| dc.identifier.none.fl_str_mv | http://hdl.handle.net/10362/204230 |
| dc.language.none.fl_str_mv | eng |
| dc.rights.cclincense.fl_str_mv | http://creativecommons.org/licenses/by/4.0/ |
| dc.rights.none.fl_str_mv | http://purl.org/coar/access_right/c_abf2 |
| dc.subject.none.fl_str_mv | Deductive Verification OCaml GOSPEL Cameleer Why3 Algorithms |
| dc.title.fl_str_mv | A Textbook of Verified OCaml Programs. A deductive study on algorithms and data structures |
| dc.type.none.fl_str_mv | http://purl.org/coar/resource_type/c_bdcc |
| description | We live in a society that has an ever-increasing dependency on critical software. Even minor programming oversights can have disastrous consequences, ranging from endangering human and animal lives to economic loss. Thus, it is crucial to verify the correctness of such programs, which can be achieved with deductive verification techniques. However, the teaching of such techniques is hampered by the small number of bibliographical works in this field. Our goal with this work is ambitious: to write a textbook on verified algorithms and data structures, fully automated or as close to it as possible. We believe that OCaml is the perfect programming language choice for this endeavour, due to its multi-paradigm nature, and its status as a general-purpose language with use cases in both academia and the industry. And, most importantly, it has good support for automated deductive verification with Cameleer and GOSPEL. The current version of the textbook includes more than 1000 lines of verified OCaml code spread across 6 chapters and more than 40 programs. Moreover, we offer a blend of functional and imperative case studies, and, overall, a substantial subset of constructs found in OCaml, including its module system. In this document, we discuss our thought process and design decisions behind the creation of a textbook on verified OCaml algorithms. Namely, identifying which classes of algorithms to tackle, which algorithms were chosen within those classes, and how to orga- nize the contents of the textbook, to name a few topics. Additionally, this is accompanied by an overview of theoretical and practical concepts concerning programming languages, algorithm analysis, deductive verification, and the selected tools. |
| dirty | 0 |
| eu_rights_str_mv | openAccess |
| format | masterThesis |
| fulltext.url.fl_str_mv | https://run.unl.pt/bitstreams/c6182a00-6a72-4123-9b0c-330cedb7f34c/download |
| id | run_3c91c3e6f3d60d72a5499ff42e32cabb |
| identifier.url.fl_str_mv | http://hdl.handle.net/10362/204230 |
| inst_facet_str | urn:organizationAcronym:unl{{{_:::_}}}Universidade Nova de Lisboa |
| instacron_str | unl |
| institution | Universidade Nova de Lisboa |
| instname_str | Universidade Nova de Lisboa |
| language | eng |
| network_acronym_str | run |
| network_name_str | Repositório Institucional da UNL |
| oai_identifier_str | oai:run.unl.pt:10362/204230 |
| organization_str_mv | urn:organizationAcronym:unl |
| person_str_mv | Gasparinho, Pedro Ramos |
| publishDate | 2025 |
| repo_facet_str | urn:repositoryAcronym:run{{{_:::_}}}Repositório Institucional da UNL |
| reponame_str | Repositório Institucional da UNL |
| repository_id_str | urn:repositoryAcronym:run |
| service_str_mv | urn:repositoryAcronym:run |
| spelling | engengWe live in a society that has an ever-increasing dependency on critical software. Even minor programming oversights can have disastrous consequences, ranging from endangering human and animal lives to economic loss. Thus, it is crucial to verify the correctness of such programs, which can be achieved with deductive verification techniques. However, the teaching of such techniques is hampered by the small number of bibliographical works in this field. Our goal with this work is ambitious: to write a textbook on verified algorithms and data structures, fully automated or as close to it as possible. We believe that OCaml is the perfect programming language choice for this endeavour, due to its multi-paradigm nature, and its status as a general-purpose language with use cases in both academia and the industry. And, most importantly, it has good support for automated deductive verification with Cameleer and GOSPEL. The current version of the textbook includes more than 1000 lines of verified OCaml code spread across 6 chapters and more than 40 programs. Moreover, we offer a blend of functional and imperative case studies, and, overall, a substantial subset of constructs found in OCaml, including its module system. In this document, we discuss our thought process and design decisions behind the creation of a textbook on verified OCaml algorithms. Namely, identifying which classes of algorithms to tackle, which algorithms were chosen within those classes, and how to orga- nize the contents of the textbook, to name a few topics. Additionally, this is accompanied by an overview of theoretical and practical concepts concerning programming languages, algorithm analysis, deductive verification, and the selected tools.porVivemos numa sociedade cada vez mais dependente de software crítico. Por menor que um erro de programação possa ser, as suas consequências podem ser desastrosas, desde colocar vidas humanas e animais em perigo até provocar perdas económicas. Por isso, é fundamental garantir a correção de tais programas, o que pode ser efetuado através de técnicas de verificação dedutiva. No entanto, o ensino destas técnicas é dificultado pela escassez de livros científicos nesta área. O nosso objectivo para este trabalho é ambicioso: escrever um livro de algoritmos e estruturas de dados verificadas, de forma totalmente automática ou tão perto disso quanto possível. Acreditamos que OCaml é linguagem de programação perfeita para este efeito. Isto deve-se à sua natureza multi-paradigma e estatuto como linguagem de âmbito geral amplamente utilizada tanto na academia como na indústria. Acima de tudo, porque tem bom suporte para verificação dedutiva automática com Cameleer e GOSPEL. A versão atual deste livro inclui mais de 1000 linhas de código OCaml verificado, distribuídas por 6 capítulos e mais de 40 programas. Para além disso, disponibilizamos uma combinação de casos de estudo funcionais e imperativos. De forma geral, um subconjunto substancial das funcionalidades encontradas em OCaml, incluindo o sistema de módulos. Neste documento, apresentamos a fundamentação e as decisões de design na base da criação de um livro de algoritmos em OCaml verificados. Em particular, identificamos quais as classes de algoritmos a cobrir, quais os algoritmos escolhidos dentro dessas classes, e a forma como os conteúdos do livro estão organizados, entre outros aspetos. Ademais, isto é acompanhado por um resumo dos conceitos teóricos e práticos relativamente a linguagens de programação, análise de algoritmos, verificação dedutiva e as ferramentas selecionadas.application/pdfengA Textbook of Verified OCaml Programs. A deductive study on algorithms and data structuresGasparinho, Pedro RamosPereira, MárioHostingInstitutionOrganizationalRUNe-mailmailto:run@unl.ptrun@unl.pt2026-07-01T09:34:55Z2025-12-182025-12-18T00:00:00ZHandlehttp://hdl.handle.net/10362/204230http://purl.org/coar/access_right/c_abf2open accessDeductive VerificationOCamlGOSPELCameleerWhy3Algorithms1703328 bytesliteraturehttp://purl.org/coar/resource_type/c_bdccmaster thesis2025-12-18http://creativecommons.org/licenses/by/4.0/http://purl.org/coar/access_right/c_abf2application/pdffulltexthttps://run.unl.pt/bitstreams/c6182a00-6a72-4123-9b0c-330cedb7f34c/download |
| spellingShingle | A Textbook of Verified OCaml Programs. A deductive study on algorithms and data structures Gasparinho, Pedro Ramos Deductive Verification OCaml GOSPEL Cameleer Why3 Algorithms |
| status | SINGLETON |
| subject.fl_str_mv | Deductive Verification OCaml GOSPEL Cameleer Why3 Algorithms |
| title | A Textbook of Verified OCaml Programs. A deductive study on algorithms and data structures |
| title_full | A Textbook of Verified OCaml Programs. A deductive study on algorithms and data structures |
| title_fullStr | A Textbook of Verified OCaml Programs. A deductive study on algorithms and data structures |
| title_full_unstemmed | A Textbook of Verified OCaml Programs. A deductive study on algorithms and data structures |
| title_short | A Textbook of Verified OCaml Programs. A deductive study on algorithms and data structures |
| title_sort | A Textbook of Verified OCaml Programs. A deductive study on algorithms and data structures |
| topic | Deductive Verification OCaml GOSPEL Cameleer Why3 Algorithms |
| topic_facet | Deductive Verification OCaml GOSPEL Cameleer Why3 Algorithms |
| url | http://hdl.handle.net/10362/204230 |
| visible | 1 |