Zilincik, R. S. (2026). Formal Amortized Time Complexity Analysis of Lazy Functional Datastructures in LiquidHaskell [Diploma Thesis, Technische Universität Wien]. reposiTUm. https://doi.org/10.34726/hss.2026.146527
Complexity Analysis; Constraint Solving; Type and Effect System; Static Analysis
en
Abstract:
Amortisierte Zeitkomplexitätsschranken beschreiben die Kosten einer Folge von Operationen und nicht die einer einzelnen. Bei funktionalen Datenstrukturen, die jede frühere Version unverändert lassen, gehen diese Schranken verloren, da eine teure Operation beliebig oft aus derselben Version wiederholt werden kann. Verzögerte Auswertung stellt sie wieder her, und Okasakis Bankiersmethode verrechnet die Kosten, indem sie Schulden auf Suspensionen platziert. Seine Beweise sind informell, und in mindestens einem wurde inzwischen ein Fehler gefunden. Diese Arbeit formalisiert und maschinell verifiziert amortisierte Zeitkomplexitätsschranken für vier verzögert ausgewertete funktionale Datenstrukturen in LiquidHaskell unter Verwendung der RTick-Bibliothek: Binärzähler, Skew Heaps, Binomial Heaps sowie die Deque- und Konkatenationsoperationen von Finger Trees. Die Datenstrukturen wurdenso gewählt, dass die Schranken von der verzögerten Auswertung abhängen, was diese Arbeit von früheren Verifikationen in LiquidHaskell unterscheidet, die Persistenz nicht berücksichtigen. Jede Fallstudie wird zunächst auf Papier ausgearbeitet und anschließend formalisiert, sodass die Kapitel auch als Referenz für die Verifikation weiterer Datenstrukturen dienen. Die Schuldeninvariante jeder Datenstruktur wird in die Verfeinerung ihres Datentyps geschrieben, sodass der Compiler sie an jeder Konstruktionsstelle prüft, und die amortisierte Schranke in die Verfeinerung des Rückgabetyps der Operation. Die von RTick bereitgestellten Verfeinerungen der monadischen Kombinatoren erwiesen sich für mehrere Beweise als zu grob und wurden mit abstrakten Verfeinerungen neu hergeleitet, ohne die vertrauenswürdige Codebasis zu vergrößern. Verifiziert werden die Kosten jeder Operation samt der Maße, von denen das Kostenargument abhängt; funktionale Korrektheit liegt außerhalb des Umfangs dieser Arbeit.
de
Amortized time complexity bounds describe the cost of a sequence of operations rather than of any single one. For functional data structures, which leave every earlier version intact, these bounds are lost: an expensive operation can be repeated from the same version arbitrarily often. Lazy evaluation recovers them, and Okasaki’s banker’s method accounts for the cost by placing debits on suspensions. His proofs are informal, and at least one of them has since been found to contain an error. This thesis formalizes and machine-checks amortized time complexity bounds for four lazy functional data structures in LiquidHaskell, using the RTick library: binary counters, skew heaps, binomial heaps, and the deque and append operations of finger trees. The structures are chosen so that the bounds depend on laziness, which distinguishes the work from earlier LiquidHaskell verifications that do not account for persistence. Each case study is first worked out on paper and then formalized, so that the chapters also serve as a reference for verifying other structures. The debit invariant of each structure is written into the refinement of its data type, so that the compiler checks it at every construction site, and the amortized bound is written into the refinement of the operation’s return type. The refinements RTick provides for its monadic combinators proved too coarse for several of the proofs and were re-derived with abstract refinements, without adding to the trusted code base. What is verified is the cost of each operation together with the structural measures its cost argument depends on; functional correctness is outside the scope of this work.
en
Additional information:
Arbeit an der Bibliothek noch nicht eingelangt - Daten nicht geprüft