kth.sePublications
Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
A Comparative Study on Deductive Verification for Rust and C
KTH, School of Electrical Engineering and Computer Science (EECS), Computer Science.
KTH, School of Electrical Engineering and Computer Science (EECS), Computer Science.
2022 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE creditsStudent thesisAlternative title
En jämförande studie av deduktiv verifiering för Rust och C (Swedish)
Abstract [en]

In programming, deductive verification is a technique to generate proof that a function obeys a set of manually specified regulations in the form of annotations. In addition to these annotations, the verifier also utilizes the constraints of the underlying programming language to prove that the function cannot cause the program to crash unexpectedly. This thesis investigates how the type system of Rust, specifically built-in memory-safety guarantees, can affect the amount and types of annotations required for a verifier to generate a proof of the correctness of a function, as compared to C. This was done by comparing the differences in the annotations required to verify example functions in Rust and C, using their respective verification tools, Prusti and Frama-C. The results show that the number of required annotations for a function implemented in C is higher when compared to Rust. Furthermore, the annotations used in Rust were a strict subset of those in C for the functions tested. This indicates that the memory-safety guarantees present in Rust play a role in the practicality of annotating functions for deductive verification. However, future work with more data and verification tools with a richer feature set is needed to draw more precise conclusions.

Abstract [sv]

Deduktiv verifiering är en teknik inom programmering som kan generera ett bevis för att en funktion följer en uppsättning av manuellt angivna bestämmelser i form av noteringar. Utöver dessa noteringar använder verifieraren också begränsningarna för det underliggande programmeringsspråket för att bevisa att funktionen inte kan få programmet att oväntat krascha. Denna studie undersöker hur typsystemet för programmeringsspråket Rust, specifikt de inbyggda minnessäkerhetsgarantierna, kan påverka mängden och typerna av noteringar som krävs för att en verifierare ska kunna generera ett bevis för en funktion, jämfört med C. Detta gjordes genom att jämföra skillnaderna i de noteringar som krävs för att verifiera exempelfunktioner i Rust och C, med hjälp av deras respektive verifieringsverktyg Prusti och Frama-C. Resultaten visar att antalet noteringar som behövs för en funktion implementerad i C är högre jämfört med Rust. Dessutom var noteringarna som användes i Rust en strikt delmängd av de i C för de testade funktionerna. Detta indikerar att minnessäkerhetsgarantierna som finns i Rust spelar en roll för praktikaliteten att notera funktioner för deduktiv verifiering. Däremot krävs mer arbete med mer data och verifieringsverktyg med en rikare funktionsuppsättning för att kunna dra tydligare slutsatser.

Place, publisher, year, edition, pages
2022. , p. 22
Series
TRITA-EECS-EX ; 2022:465
National Category
Computer and Information Sciences
Identifiers
URN: urn:nbn:se:kth:diva-319739OAI: oai:DiVA.org:kth-319739DiVA, id: diva2:1701705
Subject / course
Computer Science
Educational program
Master of Science in Engineering - Computer Science and Technology
Supervisors
Examiners
Available from: 2022-10-10 Created: 2022-10-07 Last updated: 2022-10-10Bibliographically approved

Open Access in DiVA

fulltext(375 kB)458 downloads
File information
File name FULLTEXT01.pdfFile size 375 kBChecksum SHA-512
8b3b703b6a0471c993211dd1a1c53253a115e25ef76aaaf5e36349042981030c655e9de0cb75cd906561899d5cfd95b1696f427dc372c857a315a57c67f6a328
Type fulltextMimetype application/pdf

By organisation
Computer Science
Computer and Information Sciences

Search outside of DiVA

GoogleGoogle Scholar
Total: 458 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 417 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf