Verifying time complexity of binary search using Dafny

Shiri Morshtein, Ran Ettinger, Shmuel Tyszberowicz

Research output: Contribution to journalConference articlepeer-review

2 Scopus citations


Formal software verification techniques are widely used to specify and prove the functional correctness of programs. However, nonfunctional properties such as time complexity are usually carried out with pen and paper. Inefficient code in terms of time complexity may cause massive performance problems in large-scale complex systems. We present a proof of concept for using the Dafny verification tool to specify and verify the worst-case time complexity of binary search. This approach can also be used for academic purposes as a new way to teach algorithms and complexity.

Original languageEnglish
Pages (from-to)68-81
Number of pages14
JournalElectronic Proceedings in Theoretical Computer Science, EPTCS
StatePublished - 6 Aug 2021
Event6th International Workshop on Formal Integrated Development Environment, F-IDE 2021 - Virtual, Online
Duration: 24 May 202125 May 2021

ASJC Scopus subject areas

  • Software


Dive into the research topics of 'Verifying time complexity of binary search using Dafny'. Together they form a unique fingerprint.

Cite this