Software Verification with ACL2
|
|
- Kathryn Dixon
- 5 years ago
- Views:
Transcription
1 Software Verification with ACL2 Francisco Palomo Lozano Software Verification and Validation Department of Computer Science
2 Summary Introduction 1 Introduction 2 First Steps 3 Atoms and Lists 4 Sorted Lists 5 Sorting by Insertion 6 Sorting by Merging 7 Parallelism Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
3 What is ACL2? Introduction 1 A Computational Logic for an Applicative Common Lisp 2 ACL2 is three things under the same name A pure functional programming language A computational logic formalizing this language An automated reasoning system for formal verification 3 ACL2 is regarded as an incarnation of McCarthy s dream 4 Landmarks A dream came true Reasoning about Lisp functions Successor of NQTHM, the Boyer-Moore theorem prover Developed by Moore and Kaufmann for more than 20 years ACM Software System Award 2005 Annual conferences Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
4 Introduction Where has ACL2 been used? I 1996 Motorola CAP DSP 20-bit, used in radio, 1024-point complex FFT in 131 µs Verification of microcode DSP programs 1998 IBM 4758 PCI Cryptographic Coprocessor Used in ATMs Security model and formal analysis of bootstrapping code 2000 AMD Athlon Microprocessor Floating-point addition, subtraction, multiplication, and division Floating-point square root 2002 IBM Power4 Microprocessor Floating-point division and square-root algorithms 2005 Rockwell Collins AAMP7G Cryptoprocessor NSA MILS certified, used by the DoD in military avionics Verification of security policies implemented by microcode Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
5 Introduction Where has ACL2 been used? II 2008 Freescale Semiconductor Inc. Flash memory verification 2010 Centaur VIA Nano Microprocessor Low-power, used in netbooks, a direct competitor of Intel Atom Verification of instructions in the Media Unit Floating-point addition, subtraction and comparison Integer and floating-point conversions Integer multiplication 2011 AMD Llano Microprocessor Next-generation AMD mobile processor Integer division Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
6 Introduction Why so much interest in hardware verification? 1994 Intel Pentium FDIV error buggy Dismissed as «not serious» when uncovered Defective chips had to be eventually recalled Intel recognised USD in losses Moreover, the company s prestige was damaged Intel Pentium jokes became famous 1997 Intel Pentium F00F error Q: Know how the Republicans can cut taxes and pay the deficit at the same time? A: Their spreadsheet runs on a Pentium computer. Intel shares fell 5% in a week in December 1994 F00F C7C8 [lock cmpxchg8b eax] Processor hang! Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
7 Introduction Sure they learnt the lesson, didn t they? 2007 Intel Core 2 Specification Update Reflections Intel lists 129 design errors OpenBSD identified more than 20 of them as unfixable A few of them, for which no workaround exist, seem exploitable 1 These problems are not exclusive to Intel 2 It is likely that any complex hardware is buggy 3 As hardware gets more complex it resembles software 4 It has to do with the sheer complexity of new products 5 It has to do with processes and time-to-market pressure 6 It has to do with the status of our current tools and technology Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
8 Introduction What about software verification? 1 Nowadays the line between hardware and software is thinning Algorithm Microcode Algorithm HDL/RTL NDL Silicon 2 Real Lisp code can be verified and executed with ACL2 ACL2 code is directly executable in its host Lisp system ACL2 is a pure subset of Common Lisp with some extensions 3 Custom languages can be embedded or translated into ACL2 Java Bytecode ACL2 Several models of the JVM are available for ACL2 In general, this approach requires considerable effort The first silicon JVM was produced in 1997 by Rockwell Collins 4 Algorithms can be verified with ACL2 Complex algorithms are usually hard to test or validate Being able to execute algorithms modelled in ACL2 is a plus Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
9 Summary First Steps 1 Introduction 2 First Steps 3 Atoms and Lists 4 Sorted Lists 5 Sorting by Insertion 6 Sorting by Merging 7 Parallelism Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
10 ACL2 features First Steps 1 ACL2 is a pure functional language Reasoning is easier on pure functional languages Function execution only depends on its arguments 2 ACL2 is a logic of total recursive functions Function termination must be proven Even on inputs outside the intended domain 3 ACL2 functions can be annotated with guards 4 ACL2 functions may abort when executed like a program Guard violation Resource exhaustion, as stack overflow or memory full 5 ACL2 functions are Lisp functions 6 The reciprocal is not always true Lisp functions may not terminate Lisp functions can depend on state and even modify it Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
11 First Steps Your first steps in ACL2 1 Installing ACL2 Debian and Ubuntu sudo apt-get install acl2 Detailed instructions available for other systems 2 Executing ACL2 and running your first program acl2... ACL2!> (defun f (n) (if (zp n) 1 (* n (f (- n 1)))))... ACL2!> (f 32) Finishing the ACL2 session ACL2!> (exit) Also C-d, (quit) or (good-bye) Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
12 Development in ACL2 First Steps 1 You do not usually work at the ACL2 prompt Typically you use an editor and save to.lisp files However the ACL2 command line is useful for other tasks 2 ACL2.lisp files can be Fed into ACL2 acl2 < file.lisp Loaded inside ACL2 (ld "file.lisp") Converted in books and included (include-book "file") 3 Development environments Emacs with a shell buffer ACL2 Sedan DrACuLa 4 Dual mode of operation It can be used as an interpreter for rapid development Code can be compiled for efficient execution when desired Compiled and interpreted code can be used together at will Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
13 The Lisp host system First Steps 1 ACL2 runs on top of a Lisp host system 2 CCL, SBCL, GCL, Allegro CL, CLISP, and CMUCL supported 3 The ACL2 command loop is a typical Lisp read-eval-print loop Exiting to the host Lisp system ACL2!> :q Exiting the ACL2 read-eval-print loop. To re-enter, execute (LP). ACL2> Resuming from a correctable error or interruption ACL2!> ^C User C-c interruption Correctable error: Console interrupt.... ACL2[RAW LISP]>> :q ACL2!> Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
14 First Steps Dissecting your first program 1 The mathematical factorial function f (0) = 1 f (n) = nf (n 1) if n > 0 2 The ACL2 factorial function (defun f (n) function name and arguments (if (zp n) conditional expression 1 then branch value (* n (f (- n 1))))) else branch value A fundamental difference The mathematical function is implicitly defined on N The ACL2 function is defined on the universe of ACL2 objects Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
15 First Steps Expression evaluation 1 Lisp syntax ACL2!> (+ (* 5 (- 4 1)) 1) prefix notation 16 2 Guards ACL2!> (/ 1 0) ACL2 Error in TOP-LEVEL: The guard for the function call (UNARY-/ X), which is (AND (ACL2-NUMBERP X) (NOT (EQUAL X 0))), is violated by the arguments in the call (/ 0)... ACL2!> (set-guard-checking :none)... ACL2 > (/ 1 0) all functions are total 0 Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
16 First Steps Guarded and unguarded evaluation 1 Some functions have attached a guard Guards warns about evaluations outside the intended domain Guards are checked during evaluation by default Guards are not used when proving properties 2 No guard was explicitly attached to f but... ACL2!> (f -1) ACL2 Error in TOP-LEVEL: The guard for the function call (ZP X), which is (AND (INTEGERP X) (<= 0 X)), is violated by the arguments in the call (ZP -1)... ACL2!> (set-guard-checking :none)... ACL2 > (f -1) (zp -1) is t 1 Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
17 First Steps Your first formal verification 1 Another function for computing factorials (defun g (n p) (if (zp n) p (g (- n 1) (* p n)))) (defun f* (n) (g n 1)) 2 Function g is just a certain generalisation of f (defthm g-generalises-f (implies (and (integerp n) (integerp p)) (equal (g n p) (* p (f n))))) 3 Functions f* and f are simply equivalent (defthm equivalence-of-f*-and-f (equal (f* n) (f n))) Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
18 Summary Atoms and Lists 1 Introduction 2 First Steps 3 Atoms and Lists 4 Sorted Lists 5 Sorting by Insertion 6 Sorting by Merging 7 Parallelism Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
19 Atoms and Lists Common data types 1 Atoms predicate atom Form the basic components of pairs and lists Include booleans, characters, strings, numbers and symbols 2 Pairs or conses predicate consp ACL2!> (cons 1 2) (1. 2) dotted pair ACL2!> (car (cons 1 2)) also first 1 ACL2!> (cdr (cons 1 2)) also rest 2 3 Lists predicate listp ACL2!> (cons 1 (cons 2 '())) (1 2) (1. (2. ())) ACL2!> (consp '(1. (2. (3. ()))))) '(1 2 3) T Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
20 Booleans Atoms and Lists 1 Booleans predicate booleanp Literals nil and t Unary not Conditional n-ary and and or Binary implies and iff 2 Generalised booleans Just a useful convention Anything different than false is regarded as true 3 Formal definitions (not x) (if x nil t) (or x y) (if x x y) (and x y) (if x y nil) Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
21 Atoms and Lists Characters, strings, numbers, and symbols 1 Characters predicate characterp 2 Strings predicate stringp 3 Numbers Integers predicate integerp Rationals predicate rationalp Complex rationals predicate complex-rationalp ACL2 numbers of any kind predicate acl2-numberp 4 Symbols predicate symbolp Can be used as names of functions and variables Live in packages, akin to namespaces in other languages Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
22 Equality Atoms and Lists 1 Different notions of equality equal is general eql is just for characters, symbols or numbers eq requires that one of the arguments is a symbol = is just for numbers 2 Specialised versions for some types char-equal is case insensitive string-equal is case insensitive int= is just for integers and very fast 3 Equality to zero zerop requires that the argument is a number zp means zero or not natural basis for recursion on naturals zip means zero or not integer basis for recursion on integers Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
23 Summary Sorted Lists 1 Introduction 2 First Steps 3 Atoms and Lists 4 Sorted Lists 5 Sorting by Insertion 6 Sorting by Merging 7 Parallelism Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
24 Orders Sorted Lists 1 Non-strict orders x y y x x = y x y y z x z x y y x 2 Commonly used orders char<= is just for characters string<= is just for strings <= is just for integers and rationals 3 Total order on ACL2 atoms alphorder 4 Total order on ACL2 objects lexorder Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
25 Sorted lists Sorted Lists (defun sortedp (x) (if (atom x) (null x) empty lists are sorted (if (atom (rest x)) (null (rest x)) one-element lists are sorted (and (lexorder (first x) (second x)) first two in order (sortedp (rest x)))))) the rest is sorted Question Is this enough to specify the correctness of a sorting algorithm? Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
26 Summary Sorting by Insertion 1 Introduction 2 First Steps 3 Atoms and Lists 4 Sorted Lists 5 Sorting by Insertion 6 Sorting by Merging 7 Parallelism Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
27 Sorting by Insertion Insertion in a sorted list (defun insertion (x y) (if (atom y) (list x) (if (lexorder x (first y)) (cons x y) (cons (first y) (insertion x (rest y)))))) (defthm sortedp-insertion (implies (sortedp y) (sortedp (insertion x y)))) Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
28 Insertion sort Sorting by Insertion (defun insertion-sort (x) (if (atom x) nil (insertion (first x) (insertion-sort (rest x))))) (defthm sortedp-insertion-sort (sortedp (insertion-sort x))) Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
29 Summary Sorting by Merging 1 Introduction 2 First Steps 3 Atoms and Lists 4 Sorted Lists 5 Sorting by Insertion 6 Sorting by Merging 7 Parallelism Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
30 Sorting by Merging Merging sorted lists (defun merging (x y) (if (atom x) y (insertion (first x) (merging (rest x) y)))) (defthm sortedp-merging (implies (and (sortedp x) (sortedp y)) (sortedp (merging x y)))) Question Why is this way of merging not efficient and why use it? Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
31 Sorting by Merging Splitting a list into two halves (defun split (x) (if (atom x) (list nil nil) (if (atom (rest x)) (list x nil) (let ((s (split (rest (rest x))))) (list (cons (first x) (first s)) (cons (second x) (second s))))))) Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
32 Mergesort Sorting by Merging (defconst *N0* 8) threshold (defun merge-sort (x) (if (or (atom x) (atom (rest x)) (< (len x) *N0*)) (insertion-sort x) insertion sorting under the threshold (let ((s (split x))) (merging (merge-sort (first s)) (merge-sort (second s)))))) Fail! ACL2 cannot prove termination without our help. Which is the informal argument for termination here? Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
33 The missing link Sorting by Merging (defthm split-decreases-size (implies (and (consp x) (consp (rest x))) (and (< (acl2-count (first (split x))) (acl2-count x)) (< (acl2-count (second (split x))) (acl2-count x))))) Success! ACL2 can prove termination now. Why is so important for ACL2 avoiding functions whose termination is not established? Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
34 Sorting by Merging Joining the pieces of the puzzle 1 Mergesort returns sorted lists (defthm sortedp-merge-sort (sortedp (merge-sort x))) 2 Inductive step Subgoal *1/2 (IMPLIES (AND (NOT (OR (ATOM X) (ATOM (CDR X)) (< (LEN X) 8))) (SORTEDP (MERGE-SORT (CAR (SPLIT X)))) (SORTEDP (MERGE-SORT (CADR (SPLIT X))))) (SORTEDP (MERGE-SORT X))). But simplification reduces this to T, using the :definitions ATOM, LEN and MERGE-SORT, the :rewrite rule SORTEDP-MERGING and the :type-prescription rule SORTEDP. Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
35 Summary Parallelism 1 Introduction 2 First Steps 3 Atoms and Lists 4 Sorted Lists 5 Sorting by Insertion 6 Sorting by Merging 7 Parallelism Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
36 Parallel constructs Parallelism 1 Experimental feature Requires a special ACL2 image Great for multicore programming Simple but efficient parallel model 2 Parallel constructs Parallel argument evaluation parg Parallel let plet Lazy parallel or por Lazy parallel and pand 3 Granularity control through declarations Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
37 Parallel mergesort Parallelism 1 Parallel argument evaluation (defun merge-sort (x) (if (or (atom x) (atom (rest x)) (< (len x) *N0*)) (insertion-sort x) (let ((s (split x))) (pargs (merging (merge-sort (first s)) (merge-sort (second s)))))) 2 Granularity control (defun merge-sort (x) (let ((n (len x))) (if (or (atom x) (atom (rest x)) (< n *N0*)) (insertion-sort x) (let ((s (split x))) (pargs (declare (granularity (>= n *N1*))) (merging (merge-sort (first s)) (merge-sort (second s)))))))) Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
38 References D. S. Hardin, editor. Design and Verification of Microprocessor Systems for High-Assurance Applications. Springer, M. Kaufmann, P. Manolios, and J S. Moore, editors. Computer-Aided Reasoning: ACL2 Case Studies. Kluwer Academic Publishers, M. Kaufmann, P. Manolios, and J S. Moore. Computer-Aided Reasoning: An Approach. Kluwer Academic Publishers, S. Ray, editor. Scalable Techniques for Formal Verification. Springer, Francisco Palomo (UCA) Software Verification with ACL2 Version / 39
Introduction to ACL2. CS 680 Formal Methods for Computer Verification. Jeremy Johnson Drexel University
Introduction to ACL2 CS 680 Formal Methods for Computer Verification Jeremy Johnson Drexel University ACL2 www.cs.utexas.edu/~moore/acl2 ACL2 is a programming language, logic, and theorem prover/checker
More informationReasoning About Programs Panagiotis Manolios
Reasoning About Programs Panagiotis Manolios Northeastern University March 22, 2012 Version: 58 Copyright c 2012 by Panagiotis Manolios All rights reserved. We hereby grant permission for this publication
More informationProof-Pattern Recognition and Lemma Discovery in ACL2
Proof-Pattern Recognition and Lemma Discovery in ACL2 Jónathan Heras (joint work with K. Komendantskaya, M. Johansson and E. Maclean) University of Dundee http://staff.computing.dundee.ac.uk/jheras/acl2ml/
More informationMachines Reasoning about Machines
Machines Reasoning about Machines A Personal Perspective J Strother Moore Department of Computer Sciences University of Texas at Austin 1 Prologue For forty years I have been working toward one goal: to
More informationFunctional programming with Common Lisp
Functional programming with Common Lisp Dr. C. Constantinides Department of Computer Science and Software Engineering Concordia University Montreal, Canada August 11, 2016 1 / 81 Expressions and functions
More informationhandled appropriately. The design of MILS/MSL systems guaranteed to perform correctly with respect to security considerations is a daunting challenge.
A Separation Kernel Formal Security Policy David Greve, Matthew Wilding, and W. Mark Vanfleet Rockwell Collins Advanced Technology Center Cedar Rapids, IA 52498 USA fdagreve,mmwilding@rockwellcollins.com
More informationGene Kim 9/9/2016 CSC 2/444 Lisp Tutorial
Gene Kim 9/9/2016 CSC 2/444 Lisp Tutorial About this Document This document was written to accompany an in-person Lisp tutorial. Therefore, the information on this document alone is not likely to be sufficient
More informationBacktracking and Induction in ACL2
Backtracking and Induction in ACL2 John Erickson University of Texas at Austin jderick@cs.utexas.edu ABSTRACT This paper presents an extension to ACL2 that allows backtracking to occur when a proof fails.
More informationA Futures Library and Parallelism Abstractions for a Functional Subset of Lisp
A Futures Library and Parallelism Abstractions for a Functional Subset of Lisp David L. Rager {ragerdl@cs.utexas.edu} Warren A. Hunt, Jr. {hunt@cs.utexas.edu} Matt Kaufmann {kaufmann@cs.utexas.edu} The
More informationFunctional Programming. Pure Functional Programming
Functional Programming Pure Functional Programming Computation is largely performed by applying functions to values. The value of an expression depends only on the values of its sub-expressions (if any).
More informationINF4820: Algorithms for Artificial Intelligence and Natural Language Processing. Common Lisp Fundamentals
INF4820: Algorithms for Artificial Intelligence and Natural Language Processing Common Lisp Fundamentals Stephan Oepen & Murhaf Fares Language Technology Group (LTG) August 30, 2017 Last Week: What is
More informationImperative, OO and Functional Languages A C program is
Imperative, OO and Functional Languages A C program is a web of assignment statements, interconnected by control constructs which describe the time sequence in which they are to be executed. In Java programming,
More informationIndustrial Hardware and Software Verification with ACL2
Industrial Hardware and Software Verification with ACL2 Warren A. Hunt, Jr. 1, Matt Kaufmann 1, J Strother Moore 1, and Anna Slobodova 2 1 Department of Computer Science University of Texas at Austin and
More informationParameterized Congruences in ACL2
Parameterized Congruences in ACL2 David Greve Rockwell Collins Advanced Technology Center Cedar Rapids, IA dagreve@rockwellcollins.com ABSTRACT Support for congruence-based rewriting is built into ACL2.
More informationReasoning About Programs Panagiotis Manolios
Reasoning About Programs Panagiotis Manolios Northeastern University April 2, 2016 Version: 95 Copyright c 2016 by Panagiotis Manolios All rights reserved. We hereby grant permission for this publication
More informationHomework 1. Notes. What To Turn In. Unix Accounts. Reading. Handout 3 CSCI 334: Spring, 2017
Homework 1 Due 14 February Handout 3 CSCI 334: Spring, 2017 Notes This homework has three types of problems: Self Check: You are strongly encouraged to think about and work through these questions, but
More informationReasoning About Programs Panagiotis Manolios
Reasoning About Programs Panagiotis Manolios Northeastern University February 26, 2017 Version: 100 Copyright c 2017 by Panagiotis Manolios All rights reserved. We hereby grant permission for this publication
More informationA Tool for Simplifying ACL2 Definitions
1/27 A Tool for Simplifying ACL2 Definitions Matt Kaufmann The University of Texas at Austin May 3, 2016 2/27 INTRODUCTION (1) In this talk we present a tool for simplifying ACL2 definitions. Used in Kestrel
More informationPierce Ch. 3, 8, 11, 15. Type Systems
Pierce Ch. 3, 8, 11, 15 Type Systems Goals Define the simple language of expressions A small subset of Lisp, with minor modifications Define the type system of this language Mathematical definition using
More informationReasoning About Programs Panagiotis Manolios
Reasoning About Programs Panagiotis Manolios Northeastern University March 1, 2017 Version: 101 Copyright c 2017 by Panagiotis Manolios All rights reserved. We hereby grant permission for this publication
More informationA Simple Java Code Generator for ACL2 Based on a Deep Embedding of ACL2 in Java
A Simple Java Code Generator for ACL2 Based on a Deep Embedding of ACL2 in Java Alessandro Coglio Kestrel Institute Workshop 2018 ATJ (ACL2 To Java) Java code generator for ACL2 based on AIJ (ACL2 In Java)
More informationCommon LISP Tutorial 1 (Basic)
Common LISP Tutorial 1 (Basic) CLISP Download https://sourceforge.net/projects/clisp/ IPPL Course Materials (UST sir only) Download https://silp.iiita.ac.in/wordpress/?page_id=494 Introduction Lisp (1958)
More informationHomework 1. Reading. Problems. Handout 3 CSCI 334: Spring, 2012
Homework 1 Due 14 February Handout 3 CSCI 334: Spring, 2012 Reading 1. (Required) Mitchell, Chapter 3. 2. (As Needed) The Lisp Tutorial from the Links web page, as needed for the programming questions.
More informationFinite Set Theory. based on Fully Ordered Lists. Jared Davis UT Austin. ACL2 Workshop 2004
Finite Set Theory based on Fully Ordered Lists Jared Davis UT Austin ACL2 Workshop 2004 Motivation (1/2) Unique representation for each set No mutual recursion needed for membership, subset, and set equality
More informationRefinement and Theorem Proving
Refinement and Theorem Proving Panagiotis Manolios College of Computing Georgia Institute of Technology Atlanta, GA, 30318 manolios@cc.gatech.edu 1 Introduction In this chapter, we describe the ACL2 theorem
More informationSymbolic Programming. Dr. Zoran Duric () Symbolic Programming 1/ 89 August 28, / 89
Symbolic Programming Symbols: +, -, 1, 2 etc. Symbolic expressions: (+ 1 2), (+ (* 3 4) 2) Symbolic programs are programs that manipulate symbolic expressions. Symbolic manipulation: you do it all the
More informationProving Theorems about Java and the JVM
Proving Theorems about Java and the JVM with ACL2 J Strother Moore Department of Computer Sciences, University of Texas at Austin, Taylor Hall 2.124, Austin, Texas 78712 DRAFT June 16, 2002 Abstract. We
More informationVerifying Centaur s Floating Point Adder
Verifying Centaur s Floating Point Adder Sol Swords sswords@cs.utexas.edu April 23, 2008 Sol Swords () Verifying Centaur s Floating Point Adder April 23, 2008 1 / 21 Problem Given: Verilog RTL for the
More informationFunctional Programming. Pure Functional Languages
Functional Programming Pure functional PLs S-expressions cons, car, cdr Defining functions read-eval-print loop of Lisp interpreter Examples of recursive functions Shallow, deep Equality testing 1 Pure
More informationLecture Notes on Lisp A Brief Introduction
Why Lisp? Lecture Notes on Lisp A Brief Introduction Because it s the most widely used AI programming language Because Prof Peng likes using it Because it s good for writing production software (Graham
More informationInduction Schemes. Math Foundations of Computer Science
Induction Schemes Math Foundations of Computer Science Topics Induction Example Induction scheme over the naturals Termination Reduction to equational reasoning ACL2 proof General Induction Schemes Induction
More informationACL2: A Program Verifier for Applicative Common Lisp. Matt Kaufmann - AMD, Austin, TX J Strother Moore UT CS Dept, Austin, TX
ACL2: A Program Verifier for Applicative Common Lisp Matt Kaufmann - AMD, Austin, TX J Strother Moore UT CS Dept, Austin, TX 1 Instead of debugging a program, one should prove that it meets its specifications,
More informationAn Industrially Useful Prover
An Industrially Useful Prover J Strother Moore Department of Computer Science University of Texas at Austin July, 2017 1 Recap Yesterday s Talk: ACL2 is used routinely in the microprocessor industry to
More informationOrc and ACL2. Nathan Wetzler May 4, University of Texas, Austin
Orc and ACL2 Nathan Wetzler nwetzler@cs.utexas.edu University of Texas, Austin May 4, 2008 Outline Orc Problem Overview of Orc Sites Combinators Parallel Combinator Sequential Combinator Pruning Combinator
More informationCompositional Cutpoint Verification
Compositional Cutpoint Verification Eric Smith (Stanford University) Collaborators: David Dill (Stanford University) David Hardin (Rockwell Collins) Contact ewsmith@stanford.edu Background Based on A Symbolic
More informationA Mechanically Checked Proof of the Correctness of the Boyer-Moore Fast String Searching Algorithm
A Mechanically Checked Proof of the Correctness of the Boyer-Moore Fast String Searching Algorithm J Strother MOORE a,1 and Matt MARTINEZ a a Department of Computer Sciences, University of Texas at Austin,
More informationAnnouncement. Overview. LISP: A Quick Overview. Outline of Writing and Running Lisp.
Overview Announcement Announcement Lisp Basics CMUCL to be available on sun.cs. You may use GNU Common List (GCL http://www.gnu.org/software/gcl/ which is available on most Linux platforms. There is also
More informationFunctional Programming. Pure Functional Languages
Functional Programming Pure functional PLs S-expressions cons, car, cdr Defining functions read-eval-print loop of Lisp interpreter Examples of recursive functions Shallow, deep Equality testing 1 Pure
More informationCommon Lisp. Blake McBride
Contents Common Lisp Blake McBride (blake@mcbride.name) 1 Data Types 2 2 Numeric Hierarchy 3 3 Comments 3 4 List Operations 4 5 Evaluation and Quotes 5 6 String Operations 5 7 Predicates 6 8 Math Predicates
More informationImproving Eliminate-Irrelevance for ACL2
1/19 Improving Eliminate-Irrelevance for ACL2 Matt Kaufmann (Joint Work with J Moore) The University of Texas at Austin October 14, 2016 2/19 OUTLINE Organization of this talk. 2/19 OUTLINE Organization
More informationCSCI337 Organisation of Programming Languages LISP
Organisation of Programming Languages LISP Getting Started Starting Common Lisp $ clisp i i i i i i i ooooo o ooooooo ooooo ooooo I I I I I I I 8 8 8 8 8 o 8 8 I \ `+' / I 8 8 8 8 8 8 \ `-+-' / 8 8 8 ooooo
More informationLook at the outermost list first, evaluate each of its arguments, and use the results as arguments to the outermost operator.
LISP NOTES #1 LISP Acronymed from List Processing, or from Lots of Irritating Silly Parentheses ;) It was developed by John MacCarthy and his group in late 1950s. Starting LISP screen shortcut or by command
More informationAn Overview of the DE Hardware Description Language and Its Application in Formal Verification of the FM9001 Microprocessor
An Overview of the DE Hardware Description Language and Its Application in Formal Verification of the FM9001 Microprocessor Cuong Chau ckcuong@cs.utexas.edu Department of Computer Science The University
More information11/6/17. Functional programming. FP Foundations, Scheme (2) LISP Data Types. LISP Data Types. LISP Data Types. Scheme. LISP: John McCarthy 1958 MIT
Functional programming FP Foundations, Scheme (2 In Text: Chapter 15 LISP: John McCarthy 1958 MIT List Processing => Symbolic Manipulation First functional programming language Every version after the
More informationby the evening of Tuesday, Feb 6
Homework 1 Due 14 February Handout 6 CSCI 334: Spring 2018 Notes This homework has three types of problems: Self Check: You are strongly encouraged to think about and work through these questions, and
More informationLisp. Versions of LISP
Lisp Versions of LISP Lisp is an old language with many variants Lisp is alive and well today Most modern versions are based on Common Lisp LispWorks is based on Common Lisp Scheme is one of the major
More informationTEITP User and Evaluator Expectations for Trusted Extensions. David Hardin Rockwell Collins Advanced Technology Center Cedar Rapids, Iowa USA
TEITP 2010 User and Evaluator Expectations for Trusted Extensions David Hardin Rockwell Collins Advanced Technology Center Cedar Rapids, Iowa USA Outline What Does a Security Evaluation Entail? Example:
More informationMachines Reasoning About Machines (2015) J Strother Moore Department of Computer Science University of Texas at Austin
Machines Reasoning About Machines (2015) J Strother Moore Department of Computer Science University of Texas at Austin 1 Boyer-Moore Project McCarthy s Theory of Computation Edinburgh Pure Lisp Theorem
More informationACL2 Challenge Problem: Formalizing BitCryptol April 20th, John Matthews Galois Connections
ACL2 Challenge Problem: Formalizing BitCryptol April 20th, 2005 John Matthews Galois Connections matthews@galois.com Roadmap SHADE verifying compiler Deeply embedding Cryptol semantics in ACL2 Challenge
More informationFunctional Programming Languages (FPL)
Functional Programming Languages (FPL) 1. Definitions... 2 2. Applications... 2 3. Examples... 3 4. FPL Characteristics:... 3 5. Lambda calculus (LC)... 4 6. Functions in FPLs... 7 7. Modern functional
More informationTopic III. LISP : functions, recursion, and lists References: Chapter 3 of Concepts in programming languages by J. C. Mitchell. CUP, 2003.
Topic III LISP : functions, recursion, and lists References: Chapter 3 of Concepts in programming languages by J. C. Mitchell. CUP, 2003. Chapters 5( 4.5) and 13( 1) of Programming languages: Design and
More informationIntroduction to Functional Programming and basic Lisp
Introduction to Functional Programming and basic Lisp Based on Slides by Yves Lespérance & Peter Roosen-Runge 1 Functional vs Declarative Programming declarative programming uses logical statements to
More informationFunctional Programming
Functional Programming CS331 Chapter 14 Functional Programming Original functional language is LISP LISt Processing The list is the fundamental data structure Developed by John McCarthy in the 60 s Used
More information15 Unification and Embedded Languages in Lisp
15 Unification and Embedded Languages in Lisp Chapter Objectives Chapter Contents Pattern matching in Lisp: Database examples Full unification as required for Predicate Calculus problem solving Needed
More informationCommon LISP-Introduction
Common LISP-Introduction 1. The primary data structure in LISP is called the s-expression (symbolic expression). There are two basic types of s-expressions: atoms and lists. 2. The LISP language is normally
More informationA Small Interpreted Language
A Small Interpreted Language What would you need to build a small computing language based on mathematical principles? The language should be simple, Turing equivalent (i.e.: it can compute anything that
More informationScheme Tutorial. Introduction. The Structure of Scheme Programs. Syntax
Scheme Tutorial Introduction Scheme is an imperative language with a functional core. The functional core is based on the lambda calculus. In this chapter only the functional core and some simple I/O is
More informationDocumentation for LISP in BASIC
Documentation for LISP in BASIC The software and the documentation are both Copyright 2008 Arthur Nunes-Harwitt LISP in BASIC is a LISP interpreter for a Scheme-like dialect of LISP, which happens to have
More informationScheme: Data. CS F331 Programming Languages CSCE A331 Programming Language Concepts Lecture Slides Monday, April 3, Glenn G.
Scheme: Data CS F331 Programming Languages CSCE A331 Programming Language Concepts Lecture Slides Monday, April 3, 2017 Glenn G. Chappell Department of Computer Science University of Alaska Fairbanks ggchappell@alaska.edu
More informationUsing Hashtables to Find the Generation Point of a Problematic Cons
Using Hashtables to Find the Generation Point of a Problematic Cons Often when you generate a piece of bad data, you don t see a failure until after the program makes a lot of progress. In this case, issuing
More informationCOP4020 Programming Languages. Functional Programming Prof. Robert van Engelen
COP4020 Programming Languages Functional Programming Prof. Robert van Engelen Overview What is functional programming? Historical origins of functional programming Functional programming today Concepts
More informationModern Programming Languages. Lecture LISP Programming Language An Introduction
Modern Programming Languages Lecture 18-21 LISP Programming Language An Introduction 72 Functional Programming Paradigm and LISP Functional programming is a style of programming that emphasizes the evaluation
More informationScheme. Functional Programming. Lambda Calculus. CSC 4101: Programming Languages 1. Textbook, Sections , 13.7
Scheme Textbook, Sections 13.1 13.3, 13.7 1 Functional Programming Based on mathematical functions Take argument, return value Only function call, no assignment Functions are first-class values E.g., functions
More informationLECTURE 16. Functional Programming
LECTURE 16 Functional Programming WHAT IS FUNCTIONAL PROGRAMMING? Functional programming defines the outputs of a program as a mathematical function of the inputs. Functional programming is a declarative
More informationMilawa an extensible proof checker
Milawa an extensible proof checker Jared Davis ACL2 Seminar, November 16, 2005 Outline The Milawa logic A primitive proof checker An extended proof checker Soundness of the extended checker A reflection
More informationSummer 2017 Discussion 10: July 25, Introduction. 2 Primitives and Define
CS 6A Scheme Summer 207 Discussion 0: July 25, 207 Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme programs,
More informationCSCE476/876 Fall Homework 3: Programming Assignment Using Emacs and Common Lisp. 1 Exercises (15 Points) 2. 2 Find (6 points) 4
CSCE476/876 Fall 2018 Homework 3: Programming Assignment Using Emacs and Common Lisp Assigned on: Monday, September 10 th, 2018. Due: Monday, September 24 th, 2018. Contents 1 Eercises (15 Points) 2 2
More informationRecursion & Iteration
Recursion & Iteration York University Department of Computer Science and Engineering 1 Overview Recursion Examples Iteration Examples Iteration vs. Recursion Example [ref.: Chap 5,6 Wilensky] 2 Recursion
More informationCS 314 Principles of Programming Languages
CS 314 Principles of Programming Languages Lecture 16: Functional Programming Zheng (Eddy Zhang Rutgers University April 2, 2018 Review: Computation Paradigms Functional: Composition of operations on data.
More informationExample Scheme Function: equal
ICOM 4036 Programming Languages Functional Programming Languages Mathematical Functions Fundamentals of Functional Programming Languages The First Functional Programming Language: LISP Introduction to
More informationScheme: Expressions & Procedures
Scheme: Expressions & Procedures CS F331 Programming Languages CSCE A331 Programming Language Concepts Lecture Slides Friday, March 31, 2017 Glenn G. Chappell Department of Computer Science University
More informationChapter 15. Functional Programming Languages
Chapter 15 Functional Programming Languages Copyright 2009 Addison-Wesley. All rights reserved. 1-2 Chapter 15 Topics Introduction Mathematical Functions Fundamentals of Functional Programming Languages
More informationLambda Calculus. Gunnar Gotshalks LC-1
Lambda Calculus LC-1 l- Calculus History Developed by Alonzo Church during 1930 s-40 s One fundamental goal was to describe what can be computed. Full definition of l-calculus is equivalent in power to
More informationSCHEME 8. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. March 23, 2017
SCHEME 8 COMPUTER SCIENCE 61A March 2, 2017 1 Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme programs,
More informationFall 2018 Discussion 8: October 24, 2018 Solutions. 1 Introduction. 2 Primitives
CS 6A Scheme Fall 208 Discussion 8: October 24, 208 Solutions Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write
More informationCPS 506 Comparative Programming Languages. Programming Language Paradigm
CPS 506 Comparative Programming Languages Functional Programming Language Paradigm Topics Introduction Mathematical Functions Fundamentals of Functional Programming Languages The First Functional Programming
More informationCS 480. Lisp J. Kosecka George Mason University. Lisp Slides
CS 480 Lisp J. Kosecka George Mason University Lisp Slides Symbolic Programming Symbols: +, -, 1, 2 etc. Symbolic expressions: (+ 1 2), (+ (* 3 4) 2) Symbolic programs are programs that manipulate symbolic
More informationLambda Calculus see notes on Lambda Calculus
Lambda Calculus see notes on Lambda Calculus Shakil M. Khan adapted from Gunnar Gotshalks recap so far: Lisp data structures basic Lisp programming bound/free variables, scope of variables Lisp symbols,
More informationCS A331 Programming Language Concepts
CS A331 Programming Language Concepts Lecture 10 Alternative Programming Languages (Functional LISP Declarative - PROLOG) March 24, 2014 Sam Siewert Functional PL Concepts Based on Lambda Calculus Output
More informationLambda Calculus and Lambda notation in Lisp II. Based on Prof. Gotshalks notes on Lambda Calculus and Chapter 9 in Wilensky.
λ Calculus Basis Lambda Calculus and Lambda notation in Lisp II Based on Prof. Gotshalks notes on Lambda Calculus and Chapter 9 in Wilensky Mathematical theory for anonymous functions» functions that have
More informationFunction Memoization and Unique Object Representation for ACL2 Functions
Function Memoization and Unique Object Representation for ACL2 Functions ABSTRACT Robert S. Boyer Department of Computer Sciences The University of Texas Austin, Texas USA boyer@cs.utexas.edu We have developed
More informationAn ACL2 Proof of Write Invalidate Cache Coherence
An ACL2 Proof of Write Invalidate Cache Coherence J Strother Moore 1 Department of Computer Sciences The University of Texas at Austin Austin, TX 78712-1188 moore@cs.utexas.edu Abstract. As a pedagogical
More informationFunctional Languages. Hwansoo Han
Functional Languages Hwansoo Han Historical Origins Imperative and functional models Alan Turing, Alonzo Church, Stephen Kleene, Emil Post, etc. ~1930s Different formalizations of the notion of an algorithm
More informationAllegro CL Certification Program
Allegro CL Certification Program Lisp Programming Series Level I Review David Margolies 1 Summary 1 A lisp session contains a large number of objects which is typically increased by user-created lisp objects
More informationCreating Formally Verified Components for Layered Assurance with an LLVM-to-ACL2 Translator
Creating Formally Verified Components for Layered Assurance with an LLVM-to-ACL2 Translator Jennifer Davis, David Hardin, Jedidiah McClurg December 2013 Introduction Research objectives: Reduce need to
More informationSpring 2018 Discussion 7: March 21, Introduction. 2 Primitives
CS 61A Scheme Spring 2018 Discussion 7: March 21, 2018 1 Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme
More informationFunctional Programming. Big Picture. Design of Programming Languages
Functional Programming Big Picture What we ve learned so far: Imperative Programming Languages Variables, binding, scoping, reference environment, etc What s next: Functional Programming Languages Semantics
More informationDevelopment of a Translator from LLVM to ACL2
Development of a Translator from LLVM to ACL2 David Hardin, Jennifer Davis, David Greve, and Jedidiah McClurg July 2014 Introduction Research objectives: Reason about machine code generated from high-level
More informationEfficient execution in an automated reasoning environment
JFP 18 (1): 15 46, 2008. c 2007 Cambridge University Press doi:10.1017/s0956796807006338 First published online 23 April 2007 Printed in the United Kingdom 15 Efficient execution in an automated reasoning
More informationAn ACL2 Tutorial. Matt Kaufmann and J Strother Moore
An ACL2 Tutorial Matt Kaufmann and J Strother Moore Department of Computer Sciences, University of Texas at Austin, Taylor Hall 2.124, Austin, Texas 78712 {kaufmann,moore}@cs.utexas.edu Abstract. We describe
More informationMechanized Operational Semantics
Mechanized Operational Semantics J Strother Moore Department of Computer Sciences University of Texas at Austin Marktoberdorf Summer School 2008 (Lecture 2: An Operational Semantics) 1 M1 An M1 state consists
More informationFP Foundations, Scheme
FP Foundations, Scheme In Text: Chapter 15 1 Functional Programming -- Prelude We have been discussing imperative languages C/C++, Java, Fortran, Pascal etc. are imperative languages Imperative languages
More informationIntroduction 2 Lisp Part I
Introduction 2 Lisp Part I Andreas Wichert LEIC-T (Página da cadeira: Fenix) Corpo docente n Andreas (Andrzej) Wichert Praticas n andreas.wichert@tecnico.ulisboa.pt n tel: 214233231 n room: N2 5-7 n http://web.tecnico.ulisboa.pt/andreas.wichert/
More informationFall 2017 Discussion 7: October 25, 2017 Solutions. 1 Introduction. 2 Primitives
CS 6A Scheme Fall 207 Discussion 7: October 25, 207 Solutions Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write
More informationFunctions, Conditionals & Predicates
Functions, Conditionals & Predicates York University Department of Computer Science and Engineering 1 Overview Functions as lambda terms Defining functions Variables (bound vs. free, local vs. global)
More informationA little bit of Lisp
B.Y. Choueiry 1 Instructor s notes #3 A little bit of Lisp Introduction to Artificial Intelligence CSCE 476-876, Fall 2017 www.cse.unl.edu/~choueiry/f17-476-876 Read LWH: Chapters 1, 2, 3, and 4. Every
More informationProgress Report: Term Dags Using Stobjs
Progress Report: Term Dags Using Stobjs J.-L. Ruiz-Reina, J.-A. Alonso, M.-J. Hidalgo and F.-J. Martín-Mateos http://www.cs.us.es/{~jruiz, ~jalonso, ~mjoseh, ~fmartin} Departamento de Ciencias de la Computación
More information;; definition of function, fun, that adds 7 to the input (define fun (lambda (x) (+ x 7)))
Homework 1 Due 13 September Handout 2 CSC 131: Fall, 2006 6 September Reading 1. Read Mitchell, Chapter 3. 2. The Scheme Tutorial and the Scheme Quick Reference from the Links web page, as needed for the
More informationSymbolic Computation and Common Lisp
Symbolic Computation and Common Lisp Dr. Neil T. Dantam CSCI-56, Colorado School of Mines Fall 28 Dantam (Mines CSCI-56) Lisp Fall 28 / 92 Why? Symbolic Computing: Much of this course deals with processing
More informationCOP4020 Programming Assignment 1 - Spring 2011
COP4020 Programming Assignment 1 - Spring 2011 In this programming assignment we design and implement a small imperative programming language Micro-PL. To execute Mirco-PL code we translate the code to
More information