A Framework for Verified Depth-First Algorithms

Size: px
Start display at page:

Download "A Framework for Verified Depth-First Algorithms"

Transcription

1 René Neumann Technische Universität München Garching, Germany Abstract We present a framework in Isabelle/HOL for formalizing variants of depth-first search. This framework allows to easily prove non-trivial properties of these variants. Moreover, verified code in several programming languages including Haskell, Scala and Standard ML can be generated. In this paper, we present an abstract formalization of depth-first search and demonstrate how it is refined to an efficiently executable version. Further we use the emptiness-problem of Büchi-automata known from model checking as the motivation to present three Nested DFS algorithms. They are formalized, verified and transformed into executable code using our framework. 1 Introduction Model-checking is a widespread technology that is used in the analysis of a multitude of systems (e.g. software, hardware, or communication protocols) [16]. To prove certain correctness properties of a system, its state space is exhaustively analyzed. One of the approaches proposed by Vardi and Wolper [22, 23] reduces model checking problems to operations on Büchi-automata [3]. But it requires a verified or at least trusted implementation of these operations to generate trustworthy results. Therefore the CAVA-project 1, which we are part of, is working on creating verified code for these operations so that it will be eventually possible to build a model checker out of this verified code. The code can then be used as a reference implementation by more efficient implementations, i.e. the results of the efficient model checker could be verified by our implementation. That way the efficient model checker could be considered correct, with the same notion of correctness that is applied to programs after checking their results using tests. One algorithm that is fundamental in automata-theoretic model checking (and graph-theory as a whole) is depth-first search (DFS)[21]. This algorithm is especially interesting, as it is used in several different areas and with different goals (finding cycles, finding a specific node, generating the set of reachable nodes,... ) and might even be restricted by special constraints. An example of such a constraint is the need to generate the automaton on the fly, as the model checking process yields huge automata where it in general is not feasible to generate the automaton upfront and hold it in memory. All these points have to be considered to create a flexible formalization that fits all the use cases. This flexibility and the different use cases result in non-trivial proofs of many properties. Experience shows that these proofs on paper are not always free of mistakes, and even if they are, the implementations do not necessarily need to be (see for example the findings of Schimpf et al. [19]). On the other hand, some of these proofs are shared between several algorithms and it is not economical to redo them each time. In this paper, we therefore present a general verified formalization of DFS resulting in a framework that allows the formalization of different variants of DFS. This lowers the barrier of formalizing and proving DFS-based algorithms. Supported by DFG project Computergestützte Verifikation von Automatenkonstruktionen für Model Checking 1 Computer Aided Verification of Automata: 36

2 An important problem in the field of model checking is checking the emptiness of Büchiautomata. Algorithms exist to solve this problem by means of DFS. Examples are Nested DFS [6] and algorithms to find strongly connected components (SCCs) of graphs [7, 8] enhancements of Tarjan s original algorithm [21]. In this paper, we present how we embedded different variants of Nested DFS into our framework. As mentioned earlier, CAVA strives to result in a verified and executable implementation. Hence, we do not only formalize DFS and Nested DFS in the interactive theorem prover Isabelle/HOL [17], but also use the power of its code generator [10] to produce verified functional code 2. Related Work Lammich and Tuerk [15] formalized Hopcroft s algorithm to determinize NFAs as part of CAVA with the same goal of providing proven base-algorithms for model checking. Coming from the same motivation, Chou and Peled [4] and Ray et al. [18] verified other algorithms used in model checking, though without generating executable code. Furthermore Schimpf et al. [19] formalized the translation of LTL to BA, and also generate code. Outline We first present an abstract view on how to formalize general DFS and give examples of the properties we verified. Then we present a specific use case of DFS (Nested DFS to find cycles in Büchi-automata) in Section 3, before showing how to bridge the gap to executable code in Section 4. The paper is ended with an outlook of our future plans on this topic. 2 A general DFS framework 2.1 Algorithms Algorithm 1 Simple DFS 1: visited 2: procedure DFS x 3: if x / visited then 4: visited visited {x} 5: for all e succs x do 6: DFS e 7: DFS start Depth-first search is, in its most well-known formulation, a very simple algorithm (see Algorithm 1): We iterate through all nodes reachable from a given starting node 3 visiting the successors of a node in a non-deterministic order. The call-stack of the procedure also serves implicitly as the path from the starting node to the current node. In this form the algorithm can only be used to create the set of reachable nodes (= visited), which does not fulfill our requirements stated in Section 1, in particular the ability to support all use cases of DFS. Therefore we enhance this simple algorithm to modify an opaque state σ (see Alg. 2) via the three functions action (called when visiting a node), remove (called when we omit a node because it has been visited already) and post (called when having visited all successors of the 2 The Isabelle theory files and the generated code can be downloaded from 3 We do not consider depth-first forests like it is done in other places [12, 5], because their direct use complicates the proofs though the gains are neglegible. 37

3 Algorithm 2 Simple DFS with state augmentation 1: visited ; σ σ 0 2: procedure DFS x 3: if cond σ then 4: if x / visited then 5: visited visited {x}; σ action σ x 6: for all e succs x do 7: DFS e 8: else 9: σ remove σ x 10: σ post σ x 11: DFS start node and backtracking to its parent). Additionally, we introduce a fourth function cond (cf. line 3) that serves as a flag signalling an abortion of the search. With this augmentation, the search can be utilized for different use cases by implementing these functions accordingly. Example To search for a specific node, σ could be implemented as a boolean flag. This would be set to true in action if the node is encountered. And by letting cond be λ σ. σ, the loop would be aborted if the node has been found. Algorithm 3 Functionalized DFS with state augmentation 1: function DFS-step R s 2: let x :: xs = stack s and w :: ws = wl s in 3: if w = then backtrack 4: s stack xs, σ post (σ s) s x, wl ws 5: else 6: choose e w and let w = w {e} in 7: if e visited s then already visited 8: s σ remove (σ s) s e, wl w :: ws 9: else visit new node 10: s stack e :: x :: xs, wl (succs e \ R) :: w :: ws, 11: σ action (σ s) s e, visited visited s {e} 12: function DFS-start R x 13: stack [x], visited {x}, wl [succs x \ R], σ (σ 0 x) 14: function DFS R start 15: while (λ s. stack s [] cond (σ s)) (DFS-Step R) (DFS-start R start) Though reasoning about imperative algorithms is possible in Isabelle/HOL [2], reasoning about functional programs is preferred. Hence, the imperative DFS algorithm is rewritten as functions (see Alg. 3), where we encapsulate each step of the search into an explicit DFS-state s that is modified inside a while-loop. Though the concept of while-loops is primarily known from the imperative world, they are used here for conceptual and technical reasons, in particular to uncouple the modification of states from the recursion. But they do not add expressiveness and 38

4 can easily be replaced by direct recursive calls inside DFS-step. Besides this change, we also make the stack and a list of working sets (wl) explicit by adding them as part of the DFS-state. The latter contains the set of those successors of a particular node that still need to be processed. This list of working sets became necessary when we dropped the forall-construct, which has been hiding this kind of bookkeeping. As can be seen in line 6 the non-deterministic choice is still preserved and we will outline in Section 4 the way of implementing this construct. For this section, we consider DFS-step to return a set containing exactly the results generated for each possible e w. Note that in the same step we introduce a set R that restricts the generation of successors insofar as nodes in R are excluded from visiting. For the rest of this paper we make R implicit though, to help readibility. The Algorithm 3 does not allow to prove important properties, especially those concerning the time at which nodes are discovered or backtracked from. Therefore, we further extend it by adding more fields to the DFS-state and manipulating them accordingly (code omitted for brevity): We add a counter to represent time, and also two maps φ and δ, assigning timestamps to each finished (φ) and discovered (δ) node. As a bit of notation we further write discovered s instead of dom(δ s) and equivalently finished s for dom(φ s), thus discovered resembles the former visited. In the introduction in Section 1 we mentioned the necessary ability of generating the automaton on the fly. This is addressed by handling the function returning the successors (succs) as an argument to the DFS algorithm, similiar to action, etc. This allows the user of this DFS library to provide any graph model that fits his needs as long as he is able to provide the needed soundness proofs. 2.2 Properties From the bare algorithms we move on to constructs that allow easy and elegant proofs. We start by lifting the condition of the while-loop and its body into an explicit predicate: DFS-next s s : stack s [] cond (σ s) s DFS-step s This can further be expanded to yield the set of all DFS-states that can be generated from the starting state: DFS-constr-from x := DFS-next (DFS-start x) Thanks to this construction, we can use induction to prove predicates over all possible DFS-states. Examples of such predicates are (v \R w denotes reachability over V \ R): x s v. s DFS-constr-from x = v finished s = x \R v x s v w. s DFS-constr-from x = w v = v w = v finished s = w finished s = δ s w > φ s v φ s w < δ s v The second lemma (together with the fact that v. δ s v < φ s v holds) already is the proof of an important property: The intervals created by the discovery and the finishing time of two nodes are disjoint if neither can reach the other in the graph. We moreover formalize and proof crucial theorems (Parenthesis Theorem, White-path Theorem) regarding depth-first search trees that Cormen et al. [5, pp ] formulate 4. 4 In the Isabelle theories, these proofs can be found in the TreeDFS-theory. 39

5 Algorithm 4 Nested DFS by Courcoubetis et al. [6] 1: procedure Nested-DFS 2: DFS-blue start 3: procedure DFS-blue s 4: s.blue true 5: for all t succs s do 6: if t.blue then 7: DFS-blue t 8: if s A then s is accepting 9: DFS-red s s 10: procedure DFS-red seed s 11: s.red true 12: for all t succs s do 13: if t.red then 14: DFS-red seed t 15: else if t = seed then 16: report cycle We now define two more predicates reflecting the need to express properties about the state of a finished search: DFS-finished x s : s DFS-constr-from x s. DFS-next s s DFS-completed x s : DFS-finished x s cond (σ s) Intuitively, DFS-finished x s holds iff s is the final DFS-state starting from x. DFS-completed x s then adds the additional constraint, that the search has exhaustively discovered all reachable states, i.e. it has not been aborted beforehand. Interesting properties that can be proven now are for example: x s. DFS-completed x s = finished s = discovered s x s. DFS-completed x s = finished s = {v v = x x + \R v} x s. s DFS-constr-from x = stack s = [] = DFS-completed x s 3 Case Study: Nested DFS Nested DFS is an approach for checking emptiness of Büchi-automata: The BA is empty if and only if there is no cycle (reachable from the starting node) that contains at least one accepting state (for the rest of the section we will use A to denote the set of accepting states). Hence the general procedure of Nested DFS is to use a first DFS run (the blue one) to find the accepting nodes and then run another DFS (the red one) from each of these nodes to find a path back to that node resulting in a cycle. The first Nested DFS proposal is due to Courcoubetis et al. [6] and is presented in Alg. 4. Here the red search tries to find a path directly to the node it started from (seed in DFS-red). Note that the knowledge whether a node has been searched in a red DFS is shared globally by having the boolean red directly attached to the node (cf. line 11). This avoids searching subtrees that have been searched already in previous runs of the red DFS. Without this behavior a plain DFS with linear runtime (in the size of the edges) is started for each accepting state. As the number of them is also linear, the resulting runtime for the whole algorithm would be quadratic. But with the approach shown in Alg. 4 the result is an overall linear runtime for the whole search: We visit an edge two times in each colored DFS, once upon reaching the node and once upon backtracking. 40

6 Please also note that this omission of nodes visited in other red searches has the crucial prerequisite of triggering the red search while backtracking (see line 9). Running the red part directly in the discovery phase would result in an incomplete algorithm as possible cycles might be missed. Proving this is non-trivial (on paper). But as the ability to restrict the search by a certain set is built into the general framework of DFS (the parameter R in the algorithms of Section 2.1), it does not pose a problem in our formalization. Enhancements of the basic Nested DFS are for example given by Holzmann et al. [11], where the red search succeeds if a path to the stack of the blue one has been found, or by Schwoon and Esparza [20], where also the blue search is utilizied for cycle detection. See the latter paper for some elaborations about different implementations of Nested DFS. As it turns out, the differences between the algorithms are rather small. Hence, it is sensible to show general results over a parametrized core component first, and implement the differences thereafter. This also allows to add other implementations of Nested DFS without having to start from scratch. By using the general DFS-body described in the previous section we get most of the important properties for free, most importantly statements of reachability. The algorithm of the red phase can be abstracted to one that tries to find a non-empty path into a given set ss. We also allow to pass a (possibly empty) set of nodes R that the search must not visit. Using the definitions of Section 2.1 we get the following implementation of a DFS, where σ is just a boolean value signalling whether a path into ss has been found yet: SubDFS ss R = cond = λ σ. σ, σ 0 = λ x. false, restrict = R, action = λ σ s e. σ e ss, post = λ σ s e. σ remove = λ σ s e. σ (e = start s e ss) The remove specification is required, because the starting node of this search might be in the set ss but it is not sufficient to check this at the start, as the path should be non-empty. This can only be ensured if there is another reachable node of which the starting node is a successor. And it is not covered by action as this method is only called for non-visited nodes. For this application of a DFS it can be shown that it fullfills its specification: x s. DFS-finished x s = σ s v.v ss x + \R v Now, having the red DFS, we continue with the blue part, whose specification is: On backtracking from an accepting node run the red DFS, while sparing all nodes already visited in a red DFS. Therefore, our opaque state σ now contains two parts: a boolean value signalling the discovery of a cycle (b) and a set of all nodes visited through red depth-first searches (F ). NestedDFS M = cond = λ (b, F ). b, σ 0 = λ x. (false, ), restrict =, action = λ σ s e. σ, remove = λ σ s e. σ post = λ (b, F ) s e. if b e / A then (b, F ) else let sub = SubDFS (M s) F in if σ sub then (true, F ) else (false, F finished sub) Note that NestedDFS is parametrized over some M that returns the set into which SubDFS tries to find a path. Hence we get the implementation of Courcoubetis et al. [6] with NestedDFS (λ s. {head (stack s)}) and the implementation of Holzmann et al. [11] with NestedDFS (λ s. set (stack s)). 41

7 Since we can show the general correctness property x s. ( s. head (stack s) M s M s set (stack s)) = DFS-finished x s = fst(σ s) v A. v + v x v we immediately get the correctness of these two implementations. We can further enhance this to also give a formalization of the Nested DFS algorithm due to Schwoon and Esparza [20], as this is the algorithm of Holzmann et al. with an additional check in the blue phase: If we encounter a node that is already on the stack and either that node or our parent node (i.e. the head of the stack) is accepting, we have found a cycle. Thus we replace the noop-implementation of remove by the following one: λ (b, F ) s e. (b (e set(stack s) (e A head (stack s) A)), F ) The results of the previous formalizations can also be used here all that remains to be shown is that the new remove implementation is well-behaved. In this section, we showed that the parametrization makes it possible to do step-wise formalization of DFS-applications. This allows to focus on the immediate problems and properties, while being able to use theorems about the lower layers in a black-box-like style. It also allows to verify different variants without needing to redo basic proofs. Though lines of code are not a very reliable measure, they give some hints about dimensions: Specifying and proving properties of the parameterized blue and red DFS took about 700 lines (this does not include the raw DFS parts), while instantiating them for the two variants is around 30 lines each. The more complex formalization of the Schwoon-Esparza-algorithm took another 250 lines. 4 Implementation The mechanized proofs of DFS presented in the previous sections are not enough to create verified model checkers: We also need to provide code that has the properties we proved. For tasks like this, Isabelle/HOL provides a code-generator [10, 9] which allows to convert functional definitions into code in a functional language (SML, OCaml, Haskell, Scala). But as the definitions from the previous sections might include constructs of higher-order logic like quantification or non-determinism, they are not necessarily expressible in a (deterministic) program as is. Thus it is not sufficient to solely pass them on to the code-generator. Moreover abstract implementations of data structures like sets, as they are provided by Isabelle, are easier to use in proofs, but tend to be inefficient for executable code. Therefore it is necessary to derive a definition that fulfills the same properties as the more abstract definition, but replaces the offending data structures and concepts by better fitted alternatives. The same holds for the algorithms itself: It is, for instance, more efficient to directly modify the set of visited nodes of the red DFS, the set F in the previous section, directly in place instead of performing rather expensive unions. This is achieved using a refinement framework by Lammich [15], that allows refinement [1] on functions given in a monadic form [24]. Here a refinement is a relation on two non-deterministic programs S and S such that S S holds if and only if all possible results of S are also results of S. 5 Data refinement is the special case, where the structure of the program is kept but data structures are replaced for example abstract sets by concrete lists. The refinement framework provides the ability to annotate abstraction relations R c a that relate concrete values c 5 We do not consider the special cases FAIL and SUCCEED here. Please refer to the work of Lammich [15]. 42

8 with abstract values a. This is then written S R S, expressing that if some x is a result of S, there exists some x such that (x, x ) R and x is a result of S. Example It is possible to replace the specification some x X by the head-operation on a list xs where set xs = X. In terms of the refinement this is expressed by set xs = X = RETURN head xs SPEC λ x. x X Lammich provides one more framework named the Isabelle Collections Framework (ICF) [13, 14]. This framework allows to create the proofs just with an interface of the operations (called locales in Isabelle) and later plugging-in different concrete implementations of abstract data structures that satisfy this interface. Furthermore, the ICF already ships with different implementations allowing to change the concrete data structures without much hassle. With these ingredients, we provide a modified version of DFS-step called DFS-step-Impl where operations on sets and maps are replaced by their counterparts of the ICF and the operations on the opaque state σ are replaced by user-specified implementations of the four operations (action by action-impl, cond by cond-impl and so on). The same is done with succs that is replaced by succs-impl. Under the assumptions that the user has proven these implementations to be correct (where α σ is the abstraction relation on the opaque states and α the abstraction relation on the DFS-states): we show that RETURN action-impl (σ s) s x α σ RETURN action (α σ (σ s)) (α s) x... cond-impl (σ s) cond (α σ (σ s)) set(succs-impl x) = succs x RETURN DFS-step-Impl s α DFS-Step (α s). This intuitively describes that the implementation of DFS-step returns a result whose abstraction is a possible result of DFS-step. Therefore, all properties on the abstract level carry over into the concrete world. Of course, this also holds for the final while-loop: RETURN DFS-Impl x α DFS x. With the help of the refinement framework one can generate code such that and by transitivity it holds that RETURN dfs-code x α RETURN DFS-Impl x RETURN dfs-code x α DFS x. In particular, it can be shown that α(dfs-code x) DFS-constr-from x. Therefore it is guaranteed that all the properties shown for elements of DFS-constr-from also hold on the result of the code-equation, and after it has been converted into executable code with the help of the Isabelle code generator also on the generated code 6. 6 We provide generated and tested code in OCaml, SML, and Haskell. Please refer to the README distributed in the archive for details. 43

9 5 Future Work In this paper we presented a formal framework for modelling, verifying, and implementing algorithms based on depth-first search. We showed the development of that framework from the well-known DFS algorithm to a while-loop with states. We then presented a show-case and implemented three different Nested DFS algorithms in that framework. Finally, we showed how this is then refined into executable code. Our framework is a good starting point for other applications besides Nested DFS. One further application we want to formalize are the different SCC-algorithms [7, 8]. However, there are also some points that we would like to see included in the framework itself: Currently action, etc. are defined as simple functions that do not support non-determinism and hence must return the same value for the same set of arguments. This is a drawback as it reduces the possibilities of what can be accomplished in them: For instance, it is not possible to return a counter-example in addition to the simple yes/no answer, because the counter-example depends on the series of non-deterministic successor-choices. Therefore, we want to embed them into the same non-deterministic monad the main DFS-loop is already in. We also expect certain proofs to become easier then. Another addition would be proofs about the complexity of the operations, for example showing that the implementations of Nested DFS presented in the previous section are running in linear time. This addition would make the set of formalized properties more complete. Finally, a proper benchmarking of the run-time of the generated code needs to be done. This benchmarking should also take into account different representations of sets. References [1] R.-J. J. Back. On the correctness of refinement steps in program development. PhD thesis, Department of Computer Science, University of Helsinki, [2] L. Bulwahn, A. Krauss, F. Haftmann, L. Erkök, and J. Matthews. Imperative functional programming with Isabelle/HOL. In O. A. Mohamed, C. Muñoz, and S. Tahar, editors, Proc. of the 21th International Conference on Theorem Proving in Higher Order Logics (TPHOL), volume 5170 of Lecture Notes in Computer Science, pages Springer, [3] J. R. Büchi. On a decision method in restricted second order arithmetic. In E. Nagel, P. Suppes, and A. Tarski, editors, Proc. of the International Congress Logic, Methodology and Philosophy of Science 1960, volume 44 of Studies in Logic and the Foundations of Mathematics, pages Elsevier, [4] C.-T. Chou and D. Peled. Formal verification of a partial-order reduction technique for model checking. Journal of Automated Reasoning, 23(3): , [5] T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Introduction to Algorithms, Third Edition. MIT Press, [6] C. Courcoubetis, M. Vardi, P. Wolper, and M. Yannakakis. Memory-efficient algorithms for the verification of temporal properties. Formal Methods in System Design, 1(2/3): , [7] J.-M. Couvreur. On-the-fly verification of linear temporal logic. In J. Wing, J. Woodcock, and J. Davies, editors, Proc. Formal Methods, volume 1708 of Lecture Notes in Computer Science, pages Springer, [8] J. Geldenhuys and A. Valmari. Tarjan s algorithm makes on-the-fly LTL verification more efficient. In K. Jensen and A. Podelski, editors, Tools and Algorithms for the Construction and Analysis of Systems, volume 2988 of Lecture Notes in Computer Science, pages Springer, [9] F. Haftmann. Code Generation from Specifications in Higher Order Logic. PhD thesis, Technische Universität München,

10 [10] F. Haftmann and T. Nipkow. Code generation via higher-order rewrite systems. In M. Blume, N. Kobayashi, and G. Vidal, editors, Functional and Logic Programming: 10th International Symposium: FLOPS 2010, volume 6009 of Lecture Notes in Computer Science. Springer, [11] G. Holzmann, D. Peled, and M. Yannakakis. On nested depth first search. In J.-C. Grégoire, G. J. Holzmann, and D. A. Peled, editors, Proc. of the 2nd SPIN Workshop, volume 32 of Discrete Mathematics and Theoretical Computer Science, pages American Mathematical Society, [12] D. J. King and J. Launchbury. Structuring depth-first search algorithms in Haskell. In Proc. of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages (POPL), pages ACM Press, [13] P. Lammich. Collections Framework. In G. Klein, T. Nipkow, and L. Paulson, editors, Archive of Formal Proofs Formal proof development. [14] P. Lammich and A. Lochbihler. The Isabelle Collections Framework. In M. Kaufmann and L. Paulson, editors, Interactive Theorem Proving, volume 6172 of Lecture Notes in Computer Science, pages Springer, [15] P. Lammich and T. Tuerk. Applying data refinement for monadic programs to Hopcroft s algorithm. Interactive Theorem Proving (ITP 2012), to appear, [16] S. Merz. Model checking: A tutorial overview. In F. Cassez, C. Jard, B. Rozoy, and M. Ryan, editors, Modeling and Verification of Parallel Processes, volume 2067 of Lecture Notes in Computer Science, pages Springer, [17] T. Nipkow, L. C. Paulson, and M. Wenzel. Isabelle/HOL A Proof Assistant for Higher-Order Logic, volume 2283 of Lecture Notes in Computer Science. Springer, [18] S. Ray, J. Matthews, and M. Tuttle. Certifying compositional model checking algorithms in ACL2. In W. A. Hunt, Jr., M. Kaufmann, and J. S. Moore, editors, 4th International Workshop on the ACL2 Theorem Prover and its Applications, [19] A. Schimpf, S. Merz, and J.-G. Smaus. Construction of Büchi automata for LTL model checking verified in Isabelle/HOL. In S. Berghofer, T. Nipkow, C. Urban, and M. Wenzel, editors, Theorem Proving in Higher Order Logics, volume 5674 of Lecture Notes in Computer Science, pages Springer, [20] S. Schwoon and J. Esparza. A note on on-the-fly verification algorithms. In N. Halbwachs and L. Zuck, editors, Proc. of the 11th International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS), volume 3440 of Lecture Notes in Computer Science, pages Springer, [21] R. Tarjan. Depth-first search and linear graph algorithms. SIAM Journal on Computing, 1(2): , [22] M. Y. Vardi. Verification of concurrent programs: the automata-theoretic framework. Annals of Pure and Applied Logic, 51(1-2):79 98, [23] M. Y. Vardi and P. Wolper. Reasoning about infinite computations. Information and Computation, 115(1):1 37, [24] P. Wadler. The essence of functional programming. In Proc. of the 19th ACM SIGPLAN-SIGACT symposium on Principles of programming languages (POPL), pages ACM Press,

How Efficient Can Fully Verified Functional Programs Be - A Case Study of Graph Traversal Algorithms

How Efficient Can Fully Verified Functional Programs Be - A Case Study of Graph Traversal Algorithms How Efficient Can Fully Verified Functional Programs Be - A Case Study of Graph Traversal Algorithms Mirko Stojadinović Faculty of Mathematics, University of Belgrade Abstract. One approach in achieving

More information

A Refinement Framework for Monadic Programs in Isabelle/HOL

A Refinement Framework for Monadic Programs in Isabelle/HOL A Refinement Framework for Monadic Programs in Isabelle/HOL Peter Lammich TU Munich, Institut für Informatik, Theorem Proving Group Easter 2013 Peter Lammich (TUM) Refinement Framework Easter 2013 1 /

More information

Applying Data Refinement for Monadic Programs to Hopcroft s Algorithm

Applying Data Refinement for Monadic Programs to Hopcroft s Algorithm Applying Data Refinement for Monadic Programs to Hopcroft s Algorithm Peter Lammich, Thomas Tuerk ITP 2012, 13th August 2012 Background Peter Lammich (lammich@in.tum.de) Isabelle Collection Framework (ICF)

More information

On Nested Depth First Search

On Nested Depth First Search DIMACS Series in Discrete Mathematics and Theoretical Computer Science Volume 32, 1997 On Nested Depth First Search Gerard J. Holzmann, Doron Peled, and Mihalis Yannakakis The SPIN. ABSTRACT. We show in

More information

This is an author-deposited version published in : Eprints ID : 12671

This is an author-deposited version published in :   Eprints ID : 12671 Open Archive TOULOUSE Archive Ouverte (OATAO) OATAO is an open access repository that collects the work of Toulouse researchers and makes it freely available over the web where possible. This is an author-deposited

More information

Using Promela in a Fully Verified Executable LTL Model Checker

Using Promela in a Fully Verified Executable LTL Model Checker Using Promela in a Fully Verified Executable LTL Model Checker René Neumann Technische Universität München, rene.neumann@in.tum.de Abstract. In [4] we presented an LTL model checker whose code has been

More information

Lecture 10: Nested Depth First Search, Counter- Example Generation Revisited, Bit-State Hashing, On-The-Fly Model Checking

Lecture 10: Nested Depth First Search, Counter- Example Generation Revisited, Bit-State Hashing, On-The-Fly Model Checking CS 267: Automated Verification Lecture 10: Nested Depth First Search, Counter- Example Generation Revisited, Bit-State Hashing, On-The-Fly Model Checking Instructor: Tevfik Bultan Buchi Automata Language

More information

Parametricity of Inductive Predicates

Parametricity of Inductive Predicates Proposal for a Master s thesis Parametricity of Inductive Predicates Supervisors: Dr. Andreas Lochbihler, Dr. Dmitriy Traytel Professor: Prof. David Basin Issue date: May 19, 2017 Prerequisites Good skills

More information

Automata-Theoretic LTL Model Checking. Emptiness of Büchi Automata

Automata-Theoretic LTL Model Checking. Emptiness of Büchi Automata Automata-Theoretic LTL Model Checking Graph Algorithms for Software Model Checking (based on Arie Gurfinkel s csc2108 project) Automata-Theoretic LTL Model Checking p.1 Emptiness of Büchi Automata An automation

More information

From Types to Sets in Isabelle/HOL

From Types to Sets in Isabelle/HOL From Types to Sets in Isabelle/HOL Extented Abstract Ondřej Kunčar 1 and Andrei Popescu 1,2 1 Fakultät für Informatik, Technische Universität München, Germany 2 Institute of Mathematics Simion Stoilow

More information

Isabelle/HOL:Selected Features and Recent Improvements

Isabelle/HOL:Selected Features and Recent Improvements /: Selected Features and Recent Improvements webertj@in.tum.de Security of Systems Group, Radboud University Nijmegen February 20, 2007 /:Selected Features and Recent Improvements 1 2 Logic User Interface

More information

Parallel Model Checking of ω-automata

Parallel Model Checking of ω-automata Parallel Model Checking of ω-automata Vincent Bloemen Formal Methods and Tools, University of Twente v.bloemen@utwente.nl Abstract. Specifications for non-terminating reactive systems are described by

More information

To be or not programmable Dimitri Papadimitriou, Bernard Sales Alcatel-Lucent April 2013 COPYRIGHT 2011 ALCATEL-LUCENT. ALL RIGHTS RESERVED.

To be or not programmable Dimitri Papadimitriou, Bernard Sales Alcatel-Lucent April 2013 COPYRIGHT 2011 ALCATEL-LUCENT. ALL RIGHTS RESERVED. To be or not programmable Dimitri Papadimitriou, Bernard Sales Alcatel-Lucent April 2013 Introduction SDN research directions as outlined in IRTF RG outlines i) need for more flexibility and programmability

More information

Logic Model Checking

Logic Model Checking Logic Model Checking Lecture Notes 17:18 Caltech 101b.2 January-March 2005 Course Text: The Spin Model Checker: Primer and Reference Manual Addison-Wesley 2003, ISBN 0-321-22862-6, 608 pgs. checking omega

More information

Functional Programming with Isabelle/HOL

Functional Programming with Isabelle/HOL Functional Programming with Isabelle/HOL = Isabelle λ β HOL α Florian Haftmann Technische Universität München January 2009 Overview Viewing Isabelle/HOL as a functional programming language: 1. Isabelle/HOL

More information

3.7 Denotational Semantics

3.7 Denotational Semantics 3.7 Denotational Semantics Denotational semantics, also known as fixed-point semantics, associates to each programming language construct a well-defined and rigorously understood mathematical object. These

More information

Rewriting Models of Boolean Programs

Rewriting Models of Boolean Programs Rewriting Models of Boolean Programs Javier Esparza University of Stuttgart Joint work with Ahmed Bouajjani Automatic verification using model-checking Initiated in the early 80s in USA and France. 25

More information

A Simplified Correctness Proof for a Well-Known Algorithm Computing Strongly Connected Components

A Simplified Correctness Proof for a Well-Known Algorithm Computing Strongly Connected Components A Simplified Correctness Proof for a Well-Known Algorithm Computing Strongly Connected Components Ingo Wegener FB Informatik, LS2, Univ. Dortmund, 44221 Dortmund, Germany wegener@ls2.cs.uni-dortmund.de

More information

Tarjan s Algorithm Makes On-the-Fly LTL Verification More Efficient

Tarjan s Algorithm Makes On-the-Fly LTL Verification More Efficient Tarjan s Algorithm Makes On-the-Fly LTL Verification More Efficient Jaco Geldenhuys and Antti Valmari Tampere University of Technology, Institute of Software Systems PO Box 553, FIN-33101 Tampere, FINLAND

More information

Scenario Graphs Applied to Security (Summary Paper)

Scenario Graphs Applied to Security (Summary Paper) Book Title Book Editors IOS Press, 2003 1 Scenario Graphs Applied to Security (Summary Paper) Jeannette M. Wing Computer Science Department Carnegie Mellon University Pittsburgh, PA 15213 US Abstract.

More information

The design of a programming language for provably correct programs: success and failure

The design of a programming language for provably correct programs: success and failure The design of a programming language for provably correct programs: success and failure Don Sannella Laboratory for Foundations of Computer Science School of Informatics, University of Edinburgh http://homepages.inf.ed.ac.uk/dts

More information

Turning inductive into equational specifications

Turning inductive into equational specifications Turning inductive into equational specifications Stefan Berghofer and Lukas Bulwahn and Florian Haftmann Technische Universität München Institut für Informatik, Boltzmannstraße 3, 85748 Garching, Germany

More information

Formally-Proven Kosaraju s algorithm

Formally-Proven Kosaraju s algorithm Formally-Proven Kosaraju s algorithm Laurent Théry Laurent.Thery@sophia.inria.fr Abstract This notes explains how the Kosaraju s algorithm that computes the strong-connected components of a directed graph

More information

Model Checking with Automata An Overview

Model Checking with Automata An Overview Model Checking with Automata An Overview Vanessa D Carson Control and Dynamical Systems, Caltech Doyle Group Presentation, 05/02/2008 VC 1 Contents Motivation Overview Software Verification Techniques

More information

Proof Pearl: The Termination Analysis of Terminator

Proof Pearl: The Termination Analysis of Terminator Proof Pearl: The Termination Analysis of Terminator Joe Hurd Computing Laboratory Oxford University joe.hurd@comlab.ox.ac.uk Abstract. Terminator is a static analysis tool developed by Microsoft Research

More information

Extracting the Range of cps from Affine Typing

Extracting the Range of cps from Affine Typing Extracting the Range of cps from Affine Typing Extended Abstract Josh Berdine, Peter W. O Hearn Queen Mary, University of London {berdine, ohearn}@dcs.qmul.ac.uk Hayo Thielecke The University of Birmingham

More information

Negations in Refinement Type Systems

Negations in Refinement Type Systems Negations in Refinement Type Systems T. Tsukada (U. Tokyo) 14th March 2016 Shonan, JAPAN This Talk About refinement intersection type systems that refute judgements of other type systems. Background Refinement

More information

Distributed minimum spanning tree problem

Distributed minimum spanning tree problem Distributed minimum spanning tree problem Juho-Kustaa Kangas 24th November 2012 Abstract Given a connected weighted undirected graph, the minimum spanning tree problem asks for a spanning subtree with

More information

Theorem proving. PVS theorem prover. Hoare style verification PVS. More on embeddings. What if. Abhik Roychoudhury CS 6214

Theorem proving. PVS theorem prover. Hoare style verification PVS. More on embeddings. What if. Abhik Roychoudhury CS 6214 Theorem proving PVS theorem prover Abhik Roychoudhury National University of Singapore Both specification and implementation can be formalized in a suitable logic. Proof rules for proving statements in

More information

Provably Correct Software

Provably Correct Software Provably Correct Software Max Schäfer Institute of Information Science/Academia Sinica September 17, 2007 1 / 48 The Need for Provably Correct Software BUT bugs are annoying, embarrassing, and cost gazillions

More information

Leslie Lamport: The Specification Language TLA +

Leslie Lamport: The Specification Language TLA + Leslie Lamport: The Specification Language TLA + This is an addendum to a chapter by Stephan Merz in the book Logics of Specification Languages by Dines Bjørner and Martin C. Henson (Springer, 2008). It

More information

Certifying Code Generation Runs with Coq: A Tool Description

Certifying Code Generation Runs with Coq: A Tool Description COCV 2008 Certifying Code Generation Runs with Coq: A Tool Description Jan Olaf Blech 1 University of Kaiserslautern, Germany Benjamin Grégoire 2 INRIA Sophia Antipolis, France Abstract In this tool description

More information

Programs and Proofs in Isabelle/HOL

Programs and Proofs in Isabelle/HOL Programs and Proofs in Isabelle/HOL Makarius Wenzel http://sketis.net March 2016 = Isabelle λ β α Introduction What is Isabelle? Hanabusa Itcho : Blind monks examining an elephant Introduction 2 History:

More information

Faster and Dynamic Algorithms For Maximal End-Component Decomposition And Related Graph Problems In Probabilistic Verification

Faster and Dynamic Algorithms For Maximal End-Component Decomposition And Related Graph Problems In Probabilistic Verification Faster and Dynamic Algorithms For Maximal End-Component Decomposition And Related Graph Problems In Probabilistic Verification Krishnendu Chatterjee Monika Henzinger Abstract We present faster and dynamic

More information

Chapter 11 :: Functional Languages

Chapter 11 :: Functional Languages Chapter 11 :: Functional Languages Programming Language Pragmatics Michael L. Scott Copyright 2016 Elsevier 1 Chapter11_Functional_Languages_4e - Tue November 21, 2017 Historical Origins The imperative

More information

Paths, Flowers and Vertex Cover

Paths, Flowers and Vertex Cover Paths, Flowers and Vertex Cover Venkatesh Raman M. S. Ramanujan Saket Saurabh Abstract It is well known that in a bipartite (and more generally in a König) graph, the size of the minimum vertex cover is

More information

Beluga: A Framework for Programming and Reasoning with Deductive Systems (System Description)

Beluga: A Framework for Programming and Reasoning with Deductive Systems (System Description) Beluga: A Framework for Programming and Reasoning with Deductive Systems (System Description) Brigitte Pientka and Joshua Dunfield McGill University, Montréal, Canada {bpientka,joshua}@cs.mcgill.ca Abstract.

More information

1 Introduction. 3 Syntax

1 Introduction. 3 Syntax CS 6110 S18 Lecture 19 Typed λ-calculus 1 Introduction Type checking is a lightweight technique for proving simple properties of programs. Unlike theorem-proving techniques based on axiomatic semantics,

More information

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic 3.4 Deduction and Evaluation: Tools 3.4.1 Conditional-Equational Logic The general definition of a formal specification from above was based on the existence of a precisely defined semantics for the syntax

More information

Programming Languages Third Edition

Programming Languages Third Edition Programming Languages Third Edition Chapter 12 Formal Semantics Objectives Become familiar with a sample small language for the purpose of semantic specification Understand operational semantics Understand

More information

Applying Data Refinement for Monadic Programs to Hopcroft s Algorithm

Applying Data Refinement for Monadic Programs to Hopcroft s Algorithm Applying Data Refinement for Monadic Programs to Hopcroft s Algorithm Peter Lammich and Thomas Tuerk TU München, {peter.lammich,thomas.tuerk}@in.tum.de Abstract. We provide a framework for program and

More information

Biconnectivity on Symbolically Represented Graphs: A Linear Solution

Biconnectivity on Symbolically Represented Graphs: A Linear Solution Biconnectivity on Symbolically Represented Graphs: A Linear Solution Raffaella Gentilini and Alberto Policriti Università di Udine (DIMI), Via Le Scienze 206, 33100 Udine - Italy. {gentilini policriti}@dimi.uniud.it

More information

Verification Condition Generation via Theorem Proving

Verification Condition Generation via Theorem Proving Verification Condition Generation via Theorem Proving John Matthews Galois Connections Inc. J Strother Moore University of Texas at Austin Sandip Ray University of Texas at Austin Daron Vroon Georgia Institute

More information

Handout 9: Imperative Programs and State

Handout 9: Imperative Programs and State 06-02552 Princ. of Progr. Languages (and Extended ) The University of Birmingham Spring Semester 2016-17 School of Computer Science c Uday Reddy2016-17 Handout 9: Imperative Programs and State Imperative

More information

Coq with Classes. Matthieu Sozeau. Journées PPS 2011 September 5th 2011 Trouville, France. Project Team πr 2 INRIA Paris

Coq with Classes. Matthieu Sozeau. Journées PPS 2011 September 5th 2011 Trouville, France. Project Team πr 2 INRIA Paris Coq with Classes Matthieu Sozeau Project Team πr 2 INRIA Paris Journées PPS 2011 September 5th 2011 Trouville, France This talk A quick overview of Coq Elaboration Type Classes Matthieu Sozeau - Coq with

More information

Monitoring Interfaces for Faults

Monitoring Interfaces for Faults Monitoring Interfaces for Faults Aleksandr Zaks RV 05 - Fifth Workshop on Runtime Verification Joint work with: Amir Pnueli, Lenore Zuck Motivation Motivation Consider two components interacting with each

More information

Tool Presentation: Isabelle/HOL for Reachability Analysis of Continuous Systems

Tool Presentation: Isabelle/HOL for Reachability Analysis of Continuous Systems EPiC Series in Computer Science Volume 34, 2015, Pages 180 187 ARCH14-15. 1st and 2nd International Workshop on Applied verification for Continuous and Hybrid Systems Tool Presentation: Isabelle/HOL for

More information

Matching Theory. Figure 1: Is this graph bipartite?

Matching Theory. Figure 1: Is this graph bipartite? Matching Theory 1 Introduction A matching M of a graph is a subset of E such that no two edges in M share a vertex; edges which have this property are called independent edges. A matching M is said to

More information

RAISE in Perspective

RAISE in Perspective RAISE in Perspective Klaus Havelund NASA s Jet Propulsion Laboratory, Pasadena, USA Klaus.Havelund@jpl.nasa.gov 1 The Contribution of RAISE The RAISE [6] Specification Language, RSL, originated as a development

More information

arxiv: v2 [cs.ds] 9 Apr 2009

arxiv: v2 [cs.ds] 9 Apr 2009 Pairing Heaps with Costless Meld arxiv:09034130v2 [csds] 9 Apr 2009 Amr Elmasry Max-Planck Institut für Informatik Saarbrücken, Germany elmasry@mpi-infmpgde Abstract Improving the structure and analysis

More information

CS2 Algorithms and Data Structures Note 10. Depth-First Search and Topological Sorting

CS2 Algorithms and Data Structures Note 10. Depth-First Search and Topological Sorting CS2 Algorithms and Data Structures Note 10 Depth-First Search and Topological Sorting In this lecture, we will analyse the running time of DFS and discuss a few applications. 10.1 A recursive implementation

More information

SORT INFERENCE \coregular" signatures, they derive an algorithm for computing a most general typing for expressions e which is only slightly more comp

SORT INFERENCE \coregular signatures, they derive an algorithm for computing a most general typing for expressions e which is only slightly more comp Haskell Overloading is DEXPTIME{complete Helmut Seidl Fachbereich Informatik Universitat des Saarlandes Postfach 151150 D{66041 Saarbrucken Germany seidl@cs.uni-sb.de Febr., 1994 Keywords: Haskell type

More information

Distributed Systems Programming (F21DS1) Formal Verification

Distributed Systems Programming (F21DS1) Formal Verification Distributed Systems Programming (F21DS1) Formal Verification Andrew Ireland Department of Computer Science School of Mathematical and Computer Sciences Heriot-Watt University Edinburgh Overview Focus on

More information

On Meaning Preservation of a Calculus of Records

On Meaning Preservation of a Calculus of Records On Meaning Preservation of a Calculus of Records Emily Christiansen and Elena Machkasova Computer Science Discipline University of Minnesota, Morris Morris, MN 56267 chri1101, elenam@morris.umn.edu Abstract

More information

Dartmouth Computer Science Technical Report TR Chain Match: An Algorithm for Finding a Perfect Matching of a Regular Bipartite Multigraph

Dartmouth Computer Science Technical Report TR Chain Match: An Algorithm for Finding a Perfect Matching of a Regular Bipartite Multigraph Dartmouth Computer Science Technical Report TR2014-753 Chain Match: An Algorithm for Finding a Perfect Matching of a Regular Bipartite Multigraph Stefanie Ostrowski May 28, 2014 Abstract We consider the

More information

Chapter 13: Reference. Why reference Typing Evaluation Store Typings Safety Notes

Chapter 13: Reference. Why reference Typing Evaluation Store Typings Safety Notes Chapter 13: Reference Why reference Typing Evaluation Store Typings Safety Notes References Computational Effects Also known as side effects. A function or expression is said to have a side effect if,

More information

Parameterized graph separation problems

Parameterized graph separation problems Parameterized graph separation problems Dániel Marx Department of Computer Science and Information Theory, Budapest University of Technology and Economics Budapest, H-1521, Hungary, dmarx@cs.bme.hu Abstract.

More information

The Maude LTL Model Checker and Its Implementation

The Maude LTL Model Checker and Its Implementation The Maude LTL Model Checker and Its Implementation Steven Eker 1,José Meseguer 2, and Ambarish Sridharanarayanan 2 1 Computer Science Laboratory, SRI International Menlo Park, CA 94025 eker@csl.sri.com

More information

Transforming Programs into Recursive Functions

Transforming Programs into Recursive Functions SBMF 2008 Transforming Programs into Recursive Functions Magnus O. Myreen, Michael J. C. Gordon 1 Computer Laboratory, University of Cambridge 15 JJ Thomson Avenue, Cambridge, UK Abstract This paper presents

More information

Joint Entity Resolution

Joint Entity Resolution Joint Entity Resolution Steven Euijong Whang, Hector Garcia-Molina Computer Science Department, Stanford University 353 Serra Mall, Stanford, CA 94305, USA {swhang, hector}@cs.stanford.edu No Institute

More information

Lecture 10: Strongly Connected Components, Biconnected Graphs

Lecture 10: Strongly Connected Components, Biconnected Graphs 15-750: Graduate Algorithms February 8, 2016 Lecture 10: Strongly Connected Components, Biconnected Graphs Lecturer: David Witmer Scribe: Zhong Zhou 1 DFS Continued We have introduced Depth-First Search

More information

Chordal deletion is fixed-parameter tractable

Chordal deletion is fixed-parameter tractable Chordal deletion is fixed-parameter tractable Dániel Marx Institut für Informatik, Humboldt-Universität zu Berlin, Unter den Linden 6, 10099 Berlin, Germany. dmarx@informatik.hu-berlin.de Abstract. It

More information

Proving Properties on Programs From the Coq Tutorial at ITP 2015

Proving Properties on Programs From the Coq Tutorial at ITP 2015 Proving Properties on Programs From the Coq Tutorial at ITP 2015 Reynald Affeldt August 29, 2015 Hoare logic is a proof system to verify imperative programs. It consists of a language of Hoare triples

More information

Foundations of Computer Science Spring Mathematical Preliminaries

Foundations of Computer Science Spring Mathematical Preliminaries Foundations of Computer Science Spring 2017 Equivalence Relation, Recursive Definition, and Mathematical Induction Mathematical Preliminaries Mohammad Ashiqur Rahman Department of Computer Science College

More information

CS 275 Automata and Formal Language Theory. First Problem of URMs. (a) Definition of the Turing Machine. III.3 (a) Definition of the Turing Machine

CS 275 Automata and Formal Language Theory. First Problem of URMs. (a) Definition of the Turing Machine. III.3 (a) Definition of the Turing Machine CS 275 Automata and Formal Language Theory Course Notes Part III: Limits of Computation Chapt. III.3: Turing Machines Anton Setzer http://www.cs.swan.ac.uk/ csetzer/lectures/ automataformallanguage/13/index.html

More information

EECS 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization

EECS 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization EECS 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization Dataflow Lecture: SDF, Kahn Process Networks Stavros Tripakis University of California, Berkeley Stavros Tripakis: EECS

More information

A Simpl Shortest Path Checker Verification

A Simpl Shortest Path Checker Verification A Simpl Shortest Path Checker Verification Christine Rizkallah Max-Planck-Institut für Informatik, Saarbrücken, Germany Abstract. Verification of complex algorithms with current verification tools in reasonable

More information

Bicriteria Network Design via Iterative Rounding

Bicriteria Network Design via Iterative Rounding Bicriteria Network Design via Iterative Rounding Piotr Krysta Department of Computer Science, Dortmund University Baroper Str. 301, 44221 Dortmund, Germany piotr.krysta@cs.uni-dortmund.de Abstract. We

More information

Constrained Types and their Expressiveness

Constrained Types and their Expressiveness Constrained Types and their Expressiveness JENS PALSBERG Massachusetts Institute of Technology and SCOTT SMITH Johns Hopkins University A constrained type consists of both a standard type and a constraint

More information

Lecture 22 Tuesday, April 10

Lecture 22 Tuesday, April 10 CIS 160 - Spring 2018 (instructor Val Tannen) Lecture 22 Tuesday, April 10 GRAPH THEORY Directed Graphs Directed graphs (a.k.a. digraphs) are an important mathematical modeling tool in Computer Science,

More information

A Graph Library for Isabelle

A Graph Library for Isabelle A Graph Library for Isabelle Lars Noschinski Abstract. In contrast to other areas of mathematics such as calculus, number theory or probability theory, there is currently no standard library for graph

More information

Topic 1: What is HoTT and why?

Topic 1: What is HoTT and why? Topic 1: What is HoTT and why? May 5, 2014 Introduction Homotopy type theory (HoTT) is a newly emerging field of mathematics which is currently being developed as a foundation of mathematics which is in

More information

CS 6110 S11 Lecture 25 Typed λ-calculus 6 April 2011

CS 6110 S11 Lecture 25 Typed λ-calculus 6 April 2011 CS 6110 S11 Lecture 25 Typed λ-calculus 6 April 2011 1 Introduction Type checking is a lightweight technique for proving simple properties of programs. Unlike theorem-proving techniques based on axiomatic

More information

Reducing Directed Max Flow to Undirected Max Flow and Bipartite Matching

Reducing Directed Max Flow to Undirected Max Flow and Bipartite Matching Reducing Directed Max Flow to Undirected Max Flow and Bipartite Matching Henry Lin Division of Computer Science University of California, Berkeley Berkeley, CA 94720 Email: henrylin@eecs.berkeley.edu Abstract

More information

Functional Languages. Hwansoo Han

Functional 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 information

Outline. Definition. 2 Height-Balance. 3 Searches. 4 Rotations. 5 Insertion. 6 Deletions. 7 Reference. 1 Every node is either red or black.

Outline. Definition. 2 Height-Balance. 3 Searches. 4 Rotations. 5 Insertion. 6 Deletions. 7 Reference. 1 Every node is either red or black. Outline 1 Definition Computer Science 331 Red-Black rees Mike Jacobson Department of Computer Science University of Calgary Lectures #20-22 2 Height-Balance 3 Searches 4 Rotations 5 s: Main Case 6 Partial

More information

An Improved Algorithm for Finding the Strongly Connected Components of a Directed Graph

An Improved Algorithm for Finding the Strongly Connected Components of a Directed Graph An Improved Algorithm for Finding the Strongly Connected Components of a Directed Graph David J. Pearce Computer Science Group Victoria University, NZ david.pearce@mcs.vuw.ac.nz Keywords: Graph Algorithms,

More information

Areas related to SW verif. Trends in Software Validation. Your Expertise. Research Trends High level. Research Trends - Ex 2. Research Trends Ex 1

Areas related to SW verif. Trends in Software Validation. Your Expertise. Research Trends High level. Research Trends - Ex 2. Research Trends Ex 1 Areas related to SW verif. Trends in Software Validation Abhik Roychoudhury CS 6214 Formal Methods Model based techniques Proof construction techniques Program Analysis Static Analysis Abstract Interpretation

More information

CLASS-ROOM NOTES: OPTIMIZATION PROBLEM SOLVING - I

CLASS-ROOM NOTES: OPTIMIZATION PROBLEM SOLVING - I Sutra: International Journal of Mathematical Science Education, Technomathematics Research Foundation Vol. 1, No. 1, 30-35, 2008 CLASS-ROOM NOTES: OPTIMIZATION PROBLEM SOLVING - I R. Akerkar Technomathematics

More information

Specification and Analysis of Real-Time Systems Using Real-Time Maude

Specification and Analysis of Real-Time Systems Using Real-Time Maude Specification and Analysis of Real-Time Systems Using Real-Time Maude Peter Csaba Ölveczky1,2 and José Meseguer 1 1 Department of Computer Science, University of Illinois at Urbana-Champaign 2 Department

More information

An algorithm for Performance Analysis of Single-Source Acyclic graphs

An algorithm for Performance Analysis of Single-Source Acyclic graphs An algorithm for Performance Analysis of Single-Source Acyclic graphs Gabriele Mencagli September 26, 2011 In this document we face with the problem of exploiting the performance analysis of acyclic graphs

More information

CS422 - Programming Language Design

CS422 - Programming Language Design 1 CS422 - Programming Language Design Denotational Semantics Grigore Roşu Department of Computer Science University of Illinois at Urbana-Champaign 2 Denotational semantics, alsoknownasfix-point semantics,

More information

Efficient validation and construction of border arrays

Efficient validation and construction of border arrays Efficient validation and construction of border arrays Jean-Pierre Duval Thierry Lecroq Arnaud Lefebvre LITIS, University of Rouen, France, {Jean-Pierre.Duval,Thierry.Lecroq,Arnaud.Lefebvre}@univ-rouen.fr

More information

tempo2hsal: Converting Tempo Models into HybridSal Tool Description

tempo2hsal: Converting Tempo Models into HybridSal Tool Description tempo2hsal: Converting Tempo Models into HybridSal Tool Description Ashish Tiwari Bruno Dutertre Computer Science Laboratory SRI International Menlo Park CA 94025 USA Report submitted under Honeywell subcontract

More information

M. Vardi IBM Almaden P. Wolper. M. Yannakakis AT&T Bell Labs

M. Vardi IBM Almaden P. Wolper. M. Yannakakis AT&T Bell Labs Appears in: Formal Methods in System Design, vol. 1, 1992, pp. 275--288. Memory-Efficient Algorithms for the Verification of Temporal Properties C. Courcoubetis Inst. of Comp. Sci., FORTH, Crete, Greece

More information

Model Checking with Abstract State Matching

Model Checking with Abstract State Matching Model Checking with Abstract State Matching Corina Păsăreanu QSS, NASA Ames Research Center Joint work with Saswat Anand (Georgia Institute of Technology) Radek Pelánek (Masaryk University) Willem Visser

More information

14.1 Encoding for different models of computation

14.1 Encoding for different models of computation Lecture 14 Decidable languages In the previous lecture we discussed some examples of encoding schemes, through which various objects can be represented by strings over a given alphabet. We will begin this

More information

Cover Page. The handle holds various files of this Leiden University dissertation

Cover Page. The handle   holds various files of this Leiden University dissertation Cover Page The handle http://hdl.handle.net/1887/22891 holds various files of this Leiden University dissertation Author: Gouw, Stijn de Title: Combining monitoring with run-time assertion checking Issue

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016 Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016 Lecture 15 Ana Bove May 23rd 2016 More on Turing machines; Summary of the course. Overview of today s lecture: Recap: PDA, TM Push-down

More information

MIT Specifying Languages with Regular Expressions and Context-Free Grammars. Martin Rinard Massachusetts Institute of Technology

MIT Specifying Languages with Regular Expressions and Context-Free Grammars. Martin Rinard Massachusetts Institute of Technology MIT 6.035 Specifying Languages with Regular essions and Context-Free Grammars Martin Rinard Massachusetts Institute of Technology Language Definition Problem How to precisely define language Layered structure

More information

MIT Specifying Languages with Regular Expressions and Context-Free Grammars

MIT Specifying Languages with Regular Expressions and Context-Free Grammars MIT 6.035 Specifying Languages with Regular essions and Context-Free Grammars Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology Language Definition Problem How to precisely

More information

Property-Based Testing for Coq. Cătălin Hrițcu

Property-Based Testing for Coq. Cătălin Hrițcu Property-Based Testing for Coq Cătălin Hrițcu Prosecco Reading Group - Friday, November 29, 2013 The own itch I m trying to scratch hard to devise correct safety and security enforcement mechanisms (static

More information

Temporal Refinement Using SMT and Model Checking with an Application to Physical-Layer Protocols

Temporal Refinement Using SMT and Model Checking with an Application to Physical-Layer Protocols Temporal Refinement Using SMT and Model Checking with an Application to Physical-Layer Protocols Lee Pike (Presenting), Galois, Inc. leepike@galois.com Geoffrey M. Brown, Indiana University geobrown@cs.indiana.edu

More information

On Covering a Graph Optimally with Induced Subgraphs

On Covering a Graph Optimally with Induced Subgraphs On Covering a Graph Optimally with Induced Subgraphs Shripad Thite April 1, 006 Abstract We consider the problem of covering a graph with a given number of induced subgraphs so that the maximum number

More information

Formalization of Incremental Simplex Algorithm by Stepwise Refinement

Formalization of Incremental Simplex Algorithm by Stepwise Refinement Formalization of Incremental Simplex Algorithm by Stepwise Refinement Mirko Spasić, Filip Marić Faculty of Mathematics, University of Belgrade FM2012, 30. August 2012. Overview 1 Introduction 2 Approach

More information

Memory Efficient Algorithms for the Verification of Temporal Properties

Memory Efficient Algorithms for the Verification of Temporal Properties Memory Efficient Algorithms for the Verification of Temporal Properties C. Courcoubetis Inst. of Comp. Sci. of Crete M. Vardi IBM Almaden P. Wolper Un. de Liège M. Yannakakis AT&T Bell Labs Abstract This

More information

Rule Formats for Nominal Modal Transition Systems

Rule Formats for Nominal Modal Transition Systems Rule Formats for Nominal Modal Transition Systems Anke Stüber Universitet Uppsala, Uppsala, Sweden anke.stuber@it.uu.se Abstract. Modal transition systems are specification languages that allow the expression

More information

A Type System for Functional Traversal-Based Aspects

A Type System for Functional Traversal-Based Aspects A Type System for Functional Traversal-Based Aspects Bryan Chadwick College of Computer & Information Science Northeastern University, 360 Huntington Avenue Boston, Massachusetts 02115 USA chadwick@ccs.neu.edu

More information

LECTURE 16. Functional Programming

LECTURE 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 information

Computing least common subsumers for FLE +

Computing least common subsumers for FLE + Computing least common subsumers for FLE + Sebastian Brandt and Anni-Yasmin Turhan Theoretical Computer Science, TU Dresden, Germany Email: {brandt, turhan}@tcs.inf.tu-dresden.de Abstract Transitive roles

More information