The theory of asymptotic complexity provides an approach to characterizing the behavior of programs in terms of bounds on the number of computational steps executed or use of computational resources. We describe work using ACL2 to prove complexity properties of programs implemented in a simple imperative programming language embedding via an operational semantics in ACL2. We simultaneously prove functional properties of a program and its complexity. We illustrate our approach by describing proofs about a binary search algorithm, proving both that it implements binary search on a sorted list and that it is O(log(n)), where n is the length of the list.
翻译:简单复杂的理论提供了一种方法,用计算步骤数量或计算资源的使用界限来说明程序的行为特征。我们描述了使用ACL2来证明所执行程序的复杂性特性的工作,该工作用ACL2来证明所执行程序的复杂性,该程序通过一个操作的语义语言嵌入ACL2。我们同时证明了一个程序的功能性及其复杂性。我们通过描述二进制搜索算法的证明来说明我们的方法,证明它在排序列表中进行二进制搜索,而清单的长度是O(log(n))),而O(log(log(n))是该列表的长度。