Information Processing Letters Vol. 30, No. 2, pp , January Acad. Andrei Ershov, ed. Partial Evaluation of Pattern Matching in Strings

Size: px
Start display at page:

Download "Information Processing Letters Vol. 30, No. 2, pp , January Acad. Andrei Ershov, ed. Partial Evaluation of Pattern Matching in Strings"

Transcription

1 Information Processing Letters Vol. 30, No. 2, pp , January 1989 Acad. Andrei Ershov, ed. Partial Evaluation of Pattern Matching in Strings Charles Consel Olivier Danvy LITP DIKU { Computer Science Department University of Paris VI University of Copenhagen 4 place Jussieu, couloir 45-55, 2e etage Universitetsparken Paris Cedex Copenhagen France Denmark chac@litp.ibp.fr danvy@diku.dk Abstract This article describes how automatically specializing a fairly naive pattern matcher by partial evaluation leads to the Knuth, Morris & Pratt algorithm. Interestingly enough, no theorem proving is needed to achieve the partial evaluation, as was previously argued, and it is sucient to identify a static component in the computation to get the result { a deterministic nite automaton. This experiment illustrates how a small insight and partial evaluation can achieve a non-trivial result. Keywords Partial evaluation, program specialization, Knuth, Morris & Pratt algorithm. Introduction Finding whether a given string occurs within another is a typical problem to which partial evaluation can be applied. Given a general pattern matching program PM whose semantics is a function: Pattern-String Subject-String! Boolean one can specialize PM with respect to a given pattern string, and obtain by partial evaluation a program whose semantics has the functionality: where, for some alphabet, Subject-String! Boolean Pattern-String = Subject-String = We propose such an approach here, and more precisely to demonstrate that specializing a fairly simpleminded pattern matcher yields the ecient Knuth, Morris & Pratt algorithm [Knuth, Morris & Pratt 77]. Partial evaluation is a semantics-preserving program transformation based on propagating constants, unfolding and specializing procedures. Presently, partially evaluating the program PM with respect to a pattern string pat: 1

2 Mix PM pat gives a so-called residual program whose functionality is: Subject-String! Boolean and which performs all the operations of PM on the subject string { all those depending only on the pattern have been achieved by the partial evaluator. Further, self-applying the partial evaluator [Futamura 71], that is, specializing the partial evaluator with respect to the pattern matching program: Mix Mix PM makes it generate a program compiling a pattern into the program above 1. The semantics of the residual program is a function: Pattern-String! (Subject-String! Boolean) which illustrates that a self-applicable partial evaluator implements the Curry function. Self-applicable partial evaluators exist since [Jones, Sestoft & Sndergaard 85]. All the programs described here have been run with the partial evaluator of [Jones, Sestoft & Sndergaard 88] and with the Schism partial evaluator [Consel 88], both of which are self-applicable. We will use Mix generically for naming any partial evaluator. Below, we reproduce the parts processed with Schism because they are written in Scheme [Rees & Clinger 86] and are thus readable without further description. Section 1 presents the naive algorithm and section 2 proposes one single transformation and its partial evaluation. Section 4 optimizes further the construction. Section 5 compares the present approach with related work and puts it into perspective. 1 A naive approach A fairly simple-minded approach to the problem of nding whether a given pattern occurs within another string is to iteratively compare it with every sux of the second string. (define (kmp p d) (define (loop p d pp dd) (or (null? p) (or (null? p) (start p d))) (define (start p d) (loop (cdr p) (cdr d) pp dd) (restart pp (cdr dd)))))) ; naive! (restart p d))) (define (restart p d) (loop (cdr p) (cdr d) p d) (start p (cdr d)))) This strategy is not optimal. It is a strong starting point in [Knuth, Morris & Pratt 77] to have remarked that where to restart after a mismatch could be deduced from the pattern alone. The result is a much better algorithm: a preprocessing time of order O(m) and a matching time of order O(n) rather than O(m n), m and n being the length of the pattern string and the subject string, respectively. Let us illustrate this, by partially evaluating that program with respect to a pattern string (a b a). By Mix's binding time analysis [Jones, Sestoft & Sndergaard 85] [Jones, Sestoft & Sndergaard 88], 1 In Mix Mix PM, Mix designates a program text and Mix designates its meaning, that is an input-output function. The result is a (residual) program text. 2

3 variables p and pp are identied as static { that is, computable from the pattern alone. The residual program's functions are versions of the original functions specialized to values of p and pp, renamed to be distinguished from the original versions. They are of form kmp p (d), loop p;pp (d; dd), start p (d) and restart p (d), where pp = (a b a) and p ranges over suxes of (a b a). (define (kmp-0 d) (start-1 d)) (define (start-1 d) (define (restart-2 d) (loop-3 (cdr d) d) (define (loop-3 d dd) (loop-4 (cdr d) dd) (restart-2 (cdr dd))))) (define (loop-4 d dd) (loop-5 (cdr d) dd) (restart-2 (cdr dd))))) (define (loop-5 d dd) '#t) The resulting code is poor. Up to the occurrence of a mismatch, a substring of the subject string is known (since it has been proven iteratively to be equal to the pattern so far, and the pattern is known) but this knowledge is thrown away and the subject string re-scanned at the state start-1. 2 A still naive approach Noticing that up to the point of mismatch, the pattern string is identical to the subject string, we propose to iterate rst on two instances of the pattern string up to the point of mismatch and then on pattern and the subject strings, rather than only iterating along the pattern and the subject strings. This is exactly equivalent since the pattern and the subject string are identical up to that mismatch point. To express it graphically: Pattern String mismatch Subject String On the left of the mismatch, the pattern string and the subject string are equal. What we propose is, rather than shifting the pattern one place to the right and re-scanning the pattern and the subject strings up to the mismatch point and further: ----> ----> Pattern String Subject String > ----> we instead match two instances of the pattern string up to the point of mismatch and then scan the pattern and the subject strings further. ----> ----> Pattern String Subject String Pattern String > ----> To match the pattern against a part of itself, any algorithm will do. We use the same strategy of going iteratively along the pattern string. The number of iterations, however, is already given (the length of the substring that matched before the mismatch occurred). 3

4 (define (kmp p d) (define (restart p d) (or (null? p) (start p d))) (or (null? (cdr p)) (define (start p d) (loop (cdr p) (cdr d) p))) (start p (cdr d)))) (restart p d))) (define (loop p d pp) (or (null? (cdr p)) (loop (cdr p) (cdr d) pp))) (let ((np (static-kmp pp (cdr pp) (- (length (cdr pp)) (length p))))) (if (equal? np pp) ; any match at all? (if (equal? (car pp) (car p)) ; where to continue? (start pp (cdr d)) (restart pp d)) (loop np d pp))))) (define (static-kmp p d n) (static-loop p d n p d n)) ; n records the number of elements to match (define (static-loop p d n pp dd nn) (if (zero? n) p (static-loop (cdr p) (cdr d) (sub1 n) pp dd nn) (static-kmp pp (cdr dd) (sub1 nn))))) This meaning-preserving transformation has the eect that in the rst part of the algorithm (loop), control is determined by the subject string and in the second (static-loop), it is determined by the pattern string, that is, intensionally, by the \static" variables p, pp, n and nn. That situation is ideal for a partial evaluator. 3 Partial evaluation Partially evaluating the code given in the end of section 2 with respect to a pattern has the eect to specialize it and produces a surprisingly optimized code. In particular, it does not \back up" the input string. Here is the new residual program for the string (a b a): (define (kmp-0 d) (define (loop-3 d) (start-1 d)) (define (start-1 d) (loop-4 (cdr d))) (define (loop-4 d) (define (restart-2 d) (or (equal? 'a (car d)) (loop-3 (cdr d))) The partial evaluator has processed everything that depends on the pattern string, leaving only the actions depending on the subject string. The resulting program expects a string and scans it linearly. 4

5 What we get is a deterministic nite automaton: it is deterministic because the original program is deterministic; and it is nite because the pattern is nite. At this point we can state a conclusion: the eect of the Knuth, Morris & Pratt algorithm has been automatically achieved by simply identifying a part of the program that depends solely on the pattern string, which is static { that is: available at partial evaluation time. In particular, we have not needed to compute any next or failure table to drive the pattern matching. More generally, this has been done quite naively and automatically rather than cleverly and by hand, as in the original algorithm. Further, any pattern will be compiled into a non-backtracking matcher, running in time O(length(subject-string)). Still one information has not been exploited: the character causing the mismatch. 4 Further optimization Because the character causing the mismatch is ignored, we can expect some redundancy to remain in the residual program, and actually this redundancy can be pointed out. Specializing the program with respect to (a b a b c) yields: (define (kmp-0 d) (define (loop-4 d) (start-1 d)) (define (start-1 d) (loop-5 (cdr d))) (define (loop-5 d) (define (restart-2 d) (loop-6 (cdr d))) (loop-3 (cdr d))) (loop-3 d))) (define (loop-6 d) (define (loop-3 d) (or (equal? 'c (car d)) (loop-4 d))) (loop-4 (cdr d))) where in state loop-5, we go to state loop-3 and repeat the same test, to see whether (car d) is b. We can use the information about the last mismatch, taking it into account while statically matching the pattern against itself: (define (static-loop p d n pp dd nn) (if (zero? n) (if (and (> nn 0) ; possible to continue? (equal? (car p) (car d))) ; mismatch again? (static-restart pp (cdr dd) (sub1 nn)) p) (static-loop (cdr p) (cdr d) (sub1 n) pp dd nn) (static-restart pp (cdr dd) (sub1 nn))))) Specializing this new algorithm with respect to (a b a b c), we obtain a residual program identical to the one above except at the state loop-5, where the redundancy has vanished: 5

6 (define (loop-5 d) (loop-6 (cdr d))) The full eect of the Knuth, Morris & Pratt algorithm is now achieved, and we include in the appendix the same optimal code as section 3 of [Knuth, Morris & Pratt 77]. 5 Comparison with related work [Knuth, Morris & Pratt 77] is the seminal paper on fast pattern matching in strings. Because partial evaluation is essentially program specialization, we get algorithmic (\compiled") versions of the original next table that determines which character in the pattern should be tested after a mismatch. Further, by partially evaluating the original Knuth, Morris & Pratt algorithm with respect to a next table, we have obtained a residual program structurally equivalent to the one above. During the rst workshop on Partial Evaluation and Mixed Computation [Bjrner, Ershov & Jones 88], the question was asked recurrently whether a partial evaluator could treat the Knuth, Morris & Pratt algorithm. It is argued in [Futamura & Nogi 88] that it needs using a theorem prover. This note shows that theorem proving it is not necessary for this, and that separating out the portion of the algorithm that will be repeated statically is sucient to obtain straightforwardly the Knuth, Morris & Pratt algorithm. Conclusion This paper illustrates how partial evaluation can be used for obtaining the Knuth, Morris & Pratt pattern matching algorithm from a fairly naive method. Interestingly enough, this has been done automatically whereas it was done by hand originally. To conclude, let us underline that the Knuth, Morris & Pratt algorithm is two-fold: it oers both ecient processing in time O(m) and ecient matching in time O(n), m and n being the length of the pattern string and the subject string, respectively. Presently, we get the latter by partial evaluation, so the generated matcher also runs in time O(n). Generating a matcher generator can be done at an earlier stage by self-applying Mix. Generating the matcher 2 takes more time than O(m) (apparently O(m 2 )), which is less ecient than the sophisticated Knuth, Morris & Pratt construction of the next table. This is not unreasonable, since a partial evaluator can specialize any program at all. It will not matter in the common situation where the same (short) pattern is to be matched against many (long) subject strings. Finally let us point out that a pattern matching program could be specialized as well with respect to the subject string. However the residual program can be huge. This would need some better insight into sux trees [Weiner 72]. It is our hope that this work contributes to present partial evaluation as an active help for creating and designing algorithms and programs. Acknowledgements To Neil D. Jones for his thoughtful interaction and support, and Peter Sestoft and Andrzej Filinski for their re-reading. This work has been achieved while the rst author was visiting DIKU. 2 Either by applying the matcher generator to a pattern string or by partially evaluating the general pattern matcher with respect to a pattern string. 6

7 References [Bjrner, Ershov & Jones 88] Dines Bjrner, Andrei P. Ershov, Neil D. Jones (eds.): Partial Evaluation and Mixed Computation, Gl. Averns, Denmark, North-Holland (1988) [Consel 88] Charles Consel: New Insights into Partial Evaluation: the Schism Experiment, proceedings of the second European Symposium on Programming ESOP '88, Lecture Notes in Computer Science No 300 pp , Harald Ganzinger (ed.), Nancy, France (March 1988) [Futamura 71] Yoshihiko Futamura: Partial Evaluation of Computation Process { an Approach to a Compiler-Compiler, Systems, Computers, Controls Vol. 2, No 5 pp (1971) [Futamura & Nogi 88] Yoshihiko Futamura, Kenroku Nogi: Generalized Partial Computation, from Partial Evaluation and Mixed Computation pp , Dines Bjrner, Andrei P. Ershov and Neil D. Jones (eds.), North-Holland (1988) [Knuth, Morris & Pratt 77] Donald E. Knuth, James H. Morris, Vaughan R. Pratt: Fast Pattern Matching in Strings, SIAM Journal on Computing, Vol. 6, No 2 pp (June 1977) [Jones, Sestoft & Sndergaard 85] Neil D. Jones, Peter Sestoft, Harald Sndergaard: An Experiment in Partial Evaluation: the Generation of a Compiler Generator, proceedings of the First International Conference on Rewriting Techniques and Applications, Jean-Pierre Jouannaud (ed.), Lecture Notes in Computer Science No 202 pp , Dijon, France (June 1985) [Jones, Sestoft & Sndergaard 88] Neil D. Jones, Peter Sestoft, Harald Sndergaard: MIX: a Self- Applicable Partial Evaluator for Experiments in Compiler Generation, to appear in the international journal LISP and Symbolic Computation (1988) [Rees & Clinger 86] Jonathan Rees, William Clinger (eds.): Revised 3 Report on the Algorithmic Language Scheme, Sigplan Notices, Vol. 21, No 12 pp (December 1986) [Weiner 72] P. Weiner: Linear Pattern Matching Algorithms, IEEE Symposium on Switching and Automata Theory, Vol. 14 pp 1-11, IEEE, New York (1972) 7

8 Appendix This appendix presents the residual program obtained by specializing our pattern matching program with respect to the string (a b c a b c a c a b). This example is interesting because it is isomorphic to the one in section 3 of [Knuth, Morris & Pratt 77]. (define (kmp-0 d) (start-1 d)) (define (loop-7 d) (define (start-1 d) (if (equal? 'c (car d)) (loop-8 (cdr d))) (define (restart-2 d) (define (loop-8 d) (loop-3 (cdr d))) (loop-9 (cdr d))) (define (loop-3 d) (define (loop-9 d) (if (equal? 'c (car d)) (loop-4 (cdr d))) (loop-10 (cdr d))) (define (loop-4 d) (loop-6 d))) (if (equal? 'c (car d)) (define (loop-10 d) (loop-5 (cdr d))) (loop-11 (cdr d))) (define (loop-5 d) (define (loop-11 d) (or (equal? 'b (car d)) (loop-6 (cdr d))) ) (define (loop-6 d) (loop-7 (cdr d))) 8

Generating a Pattern Matching Compiler by Partial Evaluation

Generating a Pattern Matching Compiler by Partial Evaluation Generating a Pattern Matching Compiler by Partial Evaluation Jesper Jørgensen DIKU, Department of Computer Science University of Copenhagen Universitetsparken 1, DK-2100 Copenhagen Ø Denmark e-mail: knud@diku.dk

More information

More about Formatting. Olivier Danvy. Aarhus University. December Abstract

More about Formatting. Olivier Danvy. Aarhus University. December Abstract More about Formatting Olivier Danvy Computer Science Department Aarhus University (danvy@daimi.aau.dk) December 1993 Abstract This is an extension of the \format" example, in our POPL tutorial [2]. The

More information

Knuth-Morris-Pratt. Kranthi Kumar Mandumula Indiana State University Terre Haute IN, USA. December 16, 2011

Knuth-Morris-Pratt. Kranthi Kumar Mandumula Indiana State University Terre Haute IN, USA. December 16, 2011 Kranthi Kumar Mandumula Indiana State University Terre Haute IN, USA December 16, 2011 Abstract KMP is a string searching algorithm. The problem is to find the occurrence of P in S, where S is the given

More information

Thunks (continued) Olivier Danvy, John Hatcli. Department of Computing and Information Sciences. Kansas State University. Manhattan, Kansas 66506, USA

Thunks (continued) Olivier Danvy, John Hatcli. Department of Computing and Information Sciences. Kansas State University. Manhattan, Kansas 66506, USA Thunks (continued) Olivier Danvy, John Hatcli Department of Computing and Information Sciences Kansas State University Manhattan, Kansas 66506, USA e-mail: (danvy, hatcli)@cis.ksu.edu Abstract: Call-by-name

More information

New Insights into Partial Evaluation: the SCHISM Experiment

New Insights into Partial Evaluation: the SCHISM Experiment New Insights into Partial Evaluation: the SCHISM Experiment Charte~ CONSEL LITP - Universitd Paris 6 (Couloir 45-55, 2~me @rage) 4 place Jussieu, 75252 Paris CEDEX 05, FRANCE uucp :...!mcvax!inrla!titp!chac

More information

Applied Databases. Sebastian Maneth. Lecture 14 Indexed String Search, Suffix Trees. University of Edinburgh - March 9th, 2017

Applied Databases. Sebastian Maneth. Lecture 14 Indexed String Search, Suffix Trees. University of Edinburgh - March 9th, 2017 Applied Databases Lecture 14 Indexed String Search, Suffix Trees Sebastian Maneth University of Edinburgh - March 9th, 2017 2 Recap: Morris-Pratt (1970) Given Pattern P, Text T, find all occurrences of

More information

A Practical Distributed String Matching Algorithm Architecture and Implementation

A Practical Distributed String Matching Algorithm Architecture and Implementation A Practical Distributed String Matching Algorithm Architecture and Implementation Bi Kun, Gu Nai-jie, Tu Kun, Liu Xiao-hu, and Liu Gang International Science Index, Computer and Information Engineering

More information

Traditional partial evaluation of functional programs [JGS93] uses constant propagation; this was shown to be less powerful than partial evaluation in

Traditional partial evaluation of functional programs [JGS93] uses constant propagation; this was shown to be less powerful than partial evaluation in Constraint-based Partial Evaluation of Rewriting-based Functional Logic Programs L. Lafave and J.P. Gallagher Department of Computer Science, University of Bristol, Bristol BS8 1UB, U.K. flafave, johng@cs.bris.ac.uk

More information

Interpretive Overhead and Optimal Specialisation. Or: Life without the Pending List (Workshop Version)

Interpretive Overhead and Optimal Specialisation. Or: Life without the Pending List (Workshop Version) Interpretive Overhead and Optimal Specialisation. Or: Life without the Pending List (Workshop Version) Lars Hartmann, Neil D. Jones, Jakob Grue Simonsen DIKU (Computer Science Dept., University of Copenhagen,

More information

Experiments on string matching in memory structures

Experiments on string matching in memory structures Experiments on string matching in memory structures Thierry Lecroq LIR (Laboratoire d'informatique de Rouen) and ABISS (Atelier de Biologie Informatique Statistique et Socio-Linguistique), Universite de

More information

String matching algorithms تقديم الطالب: سليمان ضاهر اشراف المدرس: علي جنيدي

String matching algorithms تقديم الطالب: سليمان ضاهر اشراف المدرس: علي جنيدي String matching algorithms تقديم الطالب: سليمان ضاهر اشراف المدرس: علي جنيدي للعام الدراسي: 2017/2016 The Introduction The introduction to information theory is quite simple. The invention of writing occurred

More information

BRICS. Partial Evaluation of the Euclidian Algorithm. (Extended Version)

BRICS. Partial Evaluation of the Euclidian Algorithm. (Extended Version) BRICS Basic Research in Computer Science BRICS RS-97-1 Danvy & Goldberg: Partial Evaluation of the Euclidian Algorithm Partial Evaluation of the Euclidian Algorithm (Extended Version) Olivier Danvy Mayer

More information

Lecture 7 February 26, 2010

Lecture 7 February 26, 2010 6.85: Advanced Data Structures Spring Prof. Andre Schulz Lecture 7 February 6, Scribe: Mark Chen Overview In this lecture, we consider the string matching problem - finding all places in a text where some

More information

BRICS. Fast Partial Evaluation of Pattern Matching in Strings. BRICS RS Ager et al.: Fast Partial Evaluation of Pattern Matching in Strings

BRICS. Fast Partial Evaluation of Pattern Matching in Strings. BRICS RS Ager et al.: Fast Partial Evaluation of Pattern Matching in Strings BRICS RS-04-40 Ager et al.: Fast Partial Evaluation of Pattern Matching in Strings BRICS Basic Research in Computer Science Fast Partial Evaluation of Pattern Matching in Strings Mads Sig Ager Olivier

More information

Self-applicable Partial Evaluation for Pure Lambda Calculus

Self-applicable Partial Evaluation for Pure Lambda Calculus Self-applicable Partial Evaluation for Pure Lambda Calculus Torben Æ. Mogensen DIKU, University of Copenhagen, Denmark Abstract Partial evaluation of an applied lambda calculus was done some years ago

More information

String Matching. Pedro Ribeiro 2016/2017 DCC/FCUP. Pedro Ribeiro (DCC/FCUP) String Matching 2016/ / 42

String Matching. Pedro Ribeiro 2016/2017 DCC/FCUP. Pedro Ribeiro (DCC/FCUP) String Matching 2016/ / 42 String Matching Pedro Ribeiro DCC/FCUP 2016/2017 Pedro Ribeiro (DCC/FCUP) String Matching 2016/2017 1 / 42 On this lecture The String Matching Problem Naive Algorithm Deterministic Finite Automata Knuth-Morris-Pratt

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

String Matching Algorithms

String Matching Algorithms String Matching Algorithms 1. Naïve String Matching The naïve approach simply test all the possible placement of Pattern P[1.. m] relative to text T[1.. n]. Specifically, we try shift s = 0, 1,..., n -

More information

Pragmatics of Type-Directed Partial Evaluation. Olivier Danvy. Computer Science Department. Aarhus University?

Pragmatics of Type-Directed Partial Evaluation. Olivier Danvy. Computer Science Department. Aarhus University? Pragmatics of Type-Directed Partial Evaluation Olivier Danvy Computer Science Department Aarhus University? http://www.brics.dk/~danvy Abstract. Type-directed partial evaluation stems from the residualization

More information

Problem Set 9 Solutions

Problem Set 9 Solutions Introduction to Algorithms December 8, 2004 Massachusetts Institute of Technology 6.046J/18.410J Professors Piotr Indyk and Charles E. Leiserson Handout 34 Problem Set 9 Solutions Reading: Chapters 32.1

More information

A string is a sequence of characters. In the field of computer science, we use strings more often as we use numbers.

A string is a sequence of characters. In the field of computer science, we use strings more often as we use numbers. STRING ALGORITHMS : Introduction A string is a sequence of characters. In the field of computer science, we use strings more often as we use numbers. There are many functions those can be applied on strings.

More information

Exact String Matching. The Knuth-Morris-Pratt Algorithm

Exact String Matching. The Knuth-Morris-Pratt Algorithm Exact String Matching The Knuth-Morris-Pratt Algorithm Outline for Today The Exact Matching Problem A simple algorithm Motivation for better algorithms The Knuth-Morris-Pratt algorithm The Exact Matching

More information

Andrei P. Nemytykh and Victoria A. Pinchuk. Program Systems Institute, Pereslavl-Zalesski, Yaroslavl Region, Russia,

Andrei P. Nemytykh and Victoria A. Pinchuk. Program Systems Institute, Pereslavl-Zalesski, Yaroslavl Region, Russia, Program Transformation with Metasystem Transitions: Experiments with a Supercompiler Andrei P. Nemytykh and Victoria A. Pinchuk Program Systems Institute, Pereslavl-Zalesski, Yaroslavl Region, Russia,

More information

A Transformation-Based Foundation for Semantics-Directed Code Generation

A Transformation-Based Foundation for Semantics-Directed Code Generation A Transformation-Based Foundation for Semantics-Directed Code Generation Arthur Nunes-Harwitt Rochester Institute of Technology, Rochester NY 14623, USA anh@cs.rit.edu Abstract. An interpreter is a concise

More information

Experiments with Implementations of two Theoretical Constructions

Experiments with Implementations of two Theoretical Constructions Experiments with Implementations of two Theoretical Constructions Torben Amtoft Hansen Thomas Nikolajsen Jesper Larsson Träff Neil D. Jones DIKU, Department of Computer Science, University of Copenhagen.

More information

BRICS. On Obtaining the Boyer-Moore String-Matching Algorithm by Partial Evaluation

BRICS. On Obtaining the Boyer-Moore String-Matching Algorithm by Partial Evaluation BRICS RS-05-29 Danvy & Rohde: On Obtaining the Boyer-Moore String-Matching Algorithm by Partial Evaluation BRICS Basic Research in Computer Science On Obtaining the Boyer-Moore String-Matching Algorithm

More information

A very fast string matching algorithm for small. alphabets and long patterns. (Extended abstract)

A very fast string matching algorithm for small. alphabets and long patterns. (Extended abstract) A very fast string matching algorithm for small alphabets and long patterns (Extended abstract) Christian Charras 1, Thierry Lecroq 1, and Joseph Daniel Pehoushek 2 1 LIR (Laboratoire d'informatique de

More information

The Essence of Compiling with Continuations

The Essence of Compiling with Continuations RETROSPECTIVE: The Essence of Compiling with Continuations Cormac Flanagan Amr Sabry Bruce F. Duba Matthias Felleisen Systems Research Center Compaq cormac.flanagan@compaq.com Dept. of Computer Science

More information

Boyer-Moore strategy to efficient approximate string matching

Boyer-Moore strategy to efficient approximate string matching Boyer-Moore strategy to efficient approximate string matching Nadia El Mabrouk, Maxime Crochemore To cite this version: Nadia El Mabrouk, Maxime Crochemore. Boyer-Moore strategy to efficient approximate

More information

Study of Selected Shifting based String Matching Algorithms

Study of Selected Shifting based String Matching Algorithms Study of Selected Shifting based String Matching Algorithms G.L. Prajapati, PhD Dept. of Comp. Engg. IET-Devi Ahilya University, Indore Mohd. Sharique Dept. of Comp. Engg. IET-Devi Ahilya University, Indore

More information

Improving CPS-Based Partial Evaluation: Writing Cogen by Hand

Improving CPS-Based Partial Evaluation: Writing Cogen by Hand Improving CPS-Based Partial Evaluation: Writing Cogen by Hand Anders Bondorf DIKU Department of Computer Science Universitetsparken 1 DK-2100 Copenhagen, Denmark anders@diku.dk Dirk Dussart Departement

More information

String Matching. Geetha Patil ID: Reference: Introduction to Algorithms, by Cormen, Leiserson and Rivest

String Matching. Geetha Patil ID: Reference: Introduction to Algorithms, by Cormen, Leiserson and Rivest String Matching Geetha Patil ID: 312410 Reference: Introduction to Algorithms, by Cormen, Leiserson and Rivest Introduction: This paper covers string matching problem and algorithms to solve this problem.

More information

Fast Substring Matching

Fast Substring Matching Fast Substring Matching Andreas Klein 1 2 3 4 5 6 7 8 9 10 Abstract The substring matching problem occurs in several applications. Two of the well-known solutions are the Knuth-Morris-Pratt algorithm (which

More information

Black-Box Program Specialization

Black-Box Program Specialization Published in Technical Report 17/99, Department of Software Engineering and Computer Science, University of Karlskrona/Ronneby: Proceedings of WCOP 99 Black-Box Program Specialization Ulrik Pagh Schultz

More information

SORTING. Practical applications in computing require things to be in order. To consider: Runtime. Memory Space. Stability. In-place algorithms???

SORTING. Practical applications in computing require things to be in order. To consider: Runtime. Memory Space. Stability. In-place algorithms??? SORTING + STRING COMP 321 McGill University These slides are mainly compiled from the following resources. - Professor Jaehyun Park slides CS 97SI - Top-coder tutorials. - Programming Challenges book.

More information

Towards Leakage Containment. Julia L. Lawall and Daniel P. Friedman. Indiana University. Abstract

Towards Leakage Containment. Julia L. Lawall and Daniel P. Friedman. Indiana University. Abstract Towards Leakage Containment Julia L. Lawall and Daniel P. Friedman Indiana University Computer Science Department Bloomington, IN 47405 Abstract Functional programs are organized into procedures, each

More information

residual residual program final result

residual residual program final result C-Mix: Making Easily Maintainable C-Programs run FAST The C-Mix Group, DIKU, University of Copenhagen Abstract C-Mix is a tool based on state-of-the-art technology that solves the dilemma of whether to

More information

From Macrogeneration to Syntactic Abstraction

From Macrogeneration to Syntactic Abstraction From Macrogeneration to Syntactic Abstraction R. Kent Dybvig (dyb@cs.indiana.edu) Indiana University Computer Science Department Lindley Hall 215, Bloomington, IN 47408, USA October 1999 Abstract. In his

More information

language (no restrictions due to self-application) the generator manipulates only syntax trees (no need to implement a self-interpreter) values in gen

language (no restrictions due to self-application) the generator manipulates only syntax trees (no need to implement a self-interpreter) values in gen Multi-Level Specialization (Extended Abstract) Robert Gluck 1 and Jesper Jrgensen 2 1 DIKU, Department of Computer Science, University of Copenhagen, Universitetsparken 1, DK-2100 Copenhagen, Denmark.

More information

Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi.

Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi. Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 18 Tries Today we are going to be talking about another data

More information

Fast Parallel String Prex-Matching. Dany Breslauer. April 6, Abstract. n log m -processor CRCW-PRAM algorithm for the

Fast Parallel String Prex-Matching. Dany Breslauer. April 6, Abstract. n log m -processor CRCW-PRAM algorithm for the Fast Parallel String Prex-Matching Dany Breslauer April 6, 1995 Abstract An O(log logm) time n log m -processor CRCW-PRAM algorithm for the string prex-matching problem over general alphabets is presented.

More information

CPSC 320 Sample Solution, Playing with Graphs!

CPSC 320 Sample Solution, Playing with Graphs! CPSC 320 Sample Solution, Playing with Graphs! September 23, 2017 Today we practice reasoning about graphs by playing with two new terms. These terms/concepts are useful in themselves but not tremendously

More information

CSCI S-Q Lecture #13 String Searching 8/3/98

CSCI S-Q Lecture #13 String Searching 8/3/98 CSCI S-Q Lecture #13 String Searching 8/3/98 Administrivia Final Exam - Wednesday 8/12, 6:15pm, SC102B Room for class next Monday Graduate Paper due Friday Tonight Precomputation Brute force string searching

More information

Konstantinos Sagonas and Michael Leuschel. ACM Computing Surveys, Vol. 30, No. 3es, September 1998

Konstantinos Sagonas and Michael Leuschel. ACM Computing Surveys, Vol. 30, No. 3es, September 1998 Extending partial deduction to tabled execution: some results and open issues Konstantinos Sagonas and Michael Leuschel ACM Computing Surveys, Vol. 30, No. 3es, September 1998 Article 16 Permission to

More information

SPECIALIZING VISUALIZATION ALGORITHMS

SPECIALIZING VISUALIZATION ALGORITHMS SPECIALIZING VISUALIZATION ALGORITHMS Stephan Diehl FR Informatik Universität des Saarlandes diehl@cs.uni-sb.de Abstract In this paper we look at the potential of program specialization techniques in the

More information

DAT V Programmeringssprog (4): Partial Evaluation, Compiling, and Compiler Generation. Neil Jones

DAT V Programmeringssprog (4): Partial Evaluation, Compiling, and Compiler Generation. Neil Jones DAT V Programmeringssprog (4): Partial Evaluation, Compiling, and Compiler Generation Neil Jones September 26, 2003 Contents 4 Partial Evaluation, Compiling, and Compiler Generation 2 4.1 Specialization.........................................

More information

Testing Isomorphism of Strongly Regular Graphs

Testing Isomorphism of Strongly Regular Graphs Spectral Graph Theory Lecture 9 Testing Isomorphism of Strongly Regular Graphs Daniel A. Spielman September 26, 2018 9.1 Introduction In the last lecture we saw how to test isomorphism of graphs in which

More information

Detecting Metamorphic Computer Viruses using Supercompilation

Detecting Metamorphic Computer Viruses using Supercompilation Detecting Metamorphic Computer Viruses using Supercompilation Alexei Lisitsa and Matt Webster In this paper we present a novel approach to detection of metamorphic computer viruses by proving program equivalence

More information

CS103 Handout 13 Fall 2012 May 4, 2012 Problem Set 5

CS103 Handout 13 Fall 2012 May 4, 2012 Problem Set 5 CS103 Handout 13 Fall 2012 May 4, 2012 Problem Set 5 This fifth problem set explores the regular languages, their properties, and their limits. This will be your first foray into computability theory,

More information

Compiling Monads. December 1991

Compiling Monads. December 1991 Compiling Monads Olivier Danvy, Jürgen Koslowski, and Karoline Malmkjær Department of Computing and Information Sciences Kansas State University (danvy, koslowj, karoline)@cis.ksu.edu December 1991 Abstract

More information

BRICS. On Obtaining Knuth, Morris, and Pratt s String Matcher by Partial Evaluation

BRICS. On Obtaining Knuth, Morris, and Pratt s String Matcher by Partial Evaluation BRICS Basic Research in Computer Science BRICS RS-02-32 Ager et al.: On Obtaining Knuth, Morris, and Pratt s String Matcher by Partial Evaluatio On Obtaining Knuth, Morris, and Pratt s String Matcher by

More information

Lecture 18 April 12, 2005

Lecture 18 April 12, 2005 6.897: Advanced Data Structures Spring 5 Prof. Erik Demaine Lecture 8 April, 5 Scribe: Igor Ganichev Overview In this lecture we are starting a sequence of lectures about string data structures. Today

More information

2 M. Sperber and P. Thiemann are traditionally implemented by recursive descent. The traditional model underlying LR parsing complicates understanding

2 M. Sperber and P. Thiemann are traditionally implemented by recursive descent. The traditional model underlying LR parsing complicates understanding Generation of LR Parsers by Partial Evaluation MICHAEL SPERBER Universitat Tubingen and PETER THIEMANN University of Nottingham Partial evaluation can turn a general parser into a parser generator. We

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

An Approach to Polyvariant Binding Time Analysis for a Stack-Based Language

An Approach to Polyvariant Binding Time Analysis for a Stack-Based Language Supported by Russian Foundation for Basic Research project No. 06-01-00574-a and No. 08-07-00280-a, and Russian Federal Agency of Science and Innovation project No. 2007-4-1.4-18-02-064. An Approach to

More information

An Approach to Polyvariant Binding Time Analysis for a Stack-Based Language

An Approach to Polyvariant Binding Time Analysis for a Stack-Based Language An Approach to Polyvariant Binding Time Analysis for a Stack-Based Language Yuri A. Klimov Keldysh Institute of Applied Mathematics, Russian Academy of Sciences RU-125047 Moscow, Russia, yuklimov@keldysh.ru

More information

An analysis of the Intelligent Predictive String Search Algorithm: A Probabilistic Approach

An analysis of the Intelligent Predictive String Search Algorithm: A Probabilistic Approach I.J. Information Technology and Computer Science, 2017, 2, 66-75 Published Online February 2017 in MECS (http://www.mecs-press.org/) DOI: 10.5815/ijitcs.2017.02.08 An analysis of the Intelligent Predictive

More information

4. References. q h-1. q h

4. References. q h-1. q h 4. References -1-2 Fig. 5 polygon on which the DSW algorithm fails. C 1 Bhattacharya B K, ElGindy H. new linear convex hull algorithm for simple polygons. IEEE Transactions on Information Theory. 1994,

More information

Improving the Static Analysis of Loops by Dynamic Partitioning Techniques

Improving the Static Analysis of Loops by Dynamic Partitioning Techniques Improving the Static Analysis of Loops by Dynamic Partitioning echniques Matthieu Martel CEA - Recherche echnologique LIS-DSI-SLA CEA F91191 Gif-Sur-Yvette Cedex, France Matthieu.Martel@cea.fr Abstract

More information

Erez Petrank. Department of Computer Science. Haifa, Israel. Abstract

Erez Petrank. Department of Computer Science. Haifa, Israel. Abstract The Best of Both Worlds: Guaranteeing Termination in Fast Randomized Byzantine Agreement Protocols Oded Goldreich Erez Petrank Department of Computer Science Technion Haifa, Israel. Abstract All known

More information

Algorithms and Data Structures

Algorithms and Data Structures Algorithms and Data Structures Charles A. Wuethrich Bauhaus-University Weimar - CogVis/MMC May 11, 2017 Algorithms and Data Structures String searching algorithm 1/29 String searching algorithm Introduction

More information

A Simplied NP-complete MAXSAT Problem. Abstract. It is shown that the MAX2SAT problem is NP-complete even if every variable

A Simplied NP-complete MAXSAT Problem. Abstract. It is shown that the MAX2SAT problem is NP-complete even if every variable A Simplied NP-complete MAXSAT Problem Venkatesh Raman 1, B. Ravikumar 2 and S. Srinivasa Rao 1 1 The Institute of Mathematical Sciences, C. I. T. Campus, Chennai 600 113. India 2 Department of Computer

More information

LL Parsing, LR Parsing, Complexity, and Automata

LL Parsing, LR Parsing, Complexity, and Automata LL Parsing, LR Parsing, Complexity, and Automata R. Gregory Taylor Department of Mathematics and Computer Science Manhattan College Riverdale, New York 10471-4098 USA Abstract It

More information

University of Utrecht. 1992; Fokker, 1995), the use of monads to structure functional programs (Wadler,

University of Utrecht. 1992; Fokker, 1995), the use of monads to structure functional programs (Wadler, J. Functional Programming 1 (1): 1{000, January 1993 c 1993 Cambridge University Press 1 F U N C T I O N A L P E A R L S Monadic Parsing in Haskell Graham Hutton University of Nottingham Erik Meijer University

More information

Inexact Pattern Matching Algorithms via Automata 1

Inexact Pattern Matching Algorithms via Automata 1 Inexact Pattern Matching Algorithms via Automata 1 1. Introduction Chung W. Ng BioChem 218 March 19, 2007 Pattern matching occurs in various applications, ranging from simple text searching in word processors

More information

Implementation of Hopcroft's Algorithm

Implementation of Hopcroft's Algorithm Implementation of Hopcroft's Algorithm Hang Zhou 19 December 2009 Abstract Minimization of a deterministic nite automaton(dfa) is a well-studied problem of formal language. An ecient algorithm for this

More information

CSC152 Algorithm and Complexity. Lecture 7: String Match

CSC152 Algorithm and Complexity. Lecture 7: String Match CSC152 Algorithm and Complexity Lecture 7: String Match Outline Brute Force Algorithm Knuth-Morris-Pratt Algorithm Rabin-Karp Algorithm Boyer-Moore algorithm String Matching Aims to Detecting the occurrence

More information

Expressions that talk about themselves. Maarten Fokkinga, University of Twente, dept. INF, Version of May 6, 1994

Expressions that talk about themselves. Maarten Fokkinga, University of Twente, dept. INF, Version of May 6, 1994 Expressions that talk about themselves Maarten Fokkinga, University of Twente, dept. INF, fokkinga@cs.utwente.nl Version of May 6, 1994 Introduction Self-reference occurs frequently in theoretical investigations

More information

Constructor Specialization. Torben. Mogensen. the residual programs. 2 Overview. further work.

Constructor Specialization. Torben. Mogensen.   the residual programs. 2 Overview. further work. Constructor Specialization Torben. Mogensen DIKU, University of Copenhagen, Denmark email: torbenm@diku.dk Abstract In the section on \challenging problems" in the proceedings from the rst international

More information

Formal Languages and Compilers Lecture VI: Lexical Analysis

Formal Languages and Compilers Lecture VI: Lexical Analysis Formal Languages and Compilers Lecture VI: Lexical Analysis Free University of Bozen-Bolzano Faculty of Computer Science POS Building, Room: 2.03 artale@inf.unibz.it http://www.inf.unibz.it/ artale/ Formal

More information

CS103 Handout 14 Winter February 8, 2013 Problem Set 5

CS103 Handout 14 Winter February 8, 2013 Problem Set 5 CS103 Handout 14 Winter 2012-2013 February 8, 2013 Problem Set 5 This fifth problem set explores the regular languages, their properties, and their limits. This will be your first foray into computability

More information

An Efficient Staging Algorithm for Binding-Time Analysis

An Efficient Staging Algorithm for Binding-Time Analysis An Efficient Staging Algorithm for Binding-Time Analysis Takuma Murakami 1, Zhenjiang Hu 1,2, Kazuhiko Kakehi 1, and Masato Takeichi 1 1 Department of Mathematical Informatics, Graduate School of Information

More information

LIF Marseille, CNRS & University Aix{Marseille address: URL:

LIF Marseille, CNRS & University Aix{Marseille  address: URL: 1D EFFECTIVELY CLOSED SUBSHIFTS AND 2D TILINGS BRUNO DURAND 1, ANDREI ROMASHCHENKO 2, AND ALEXANDER SHEN 2 1 LIF Marseille, CNRS & University Aix{Marseille E-mail address: Bruno.Durand@lif.univ-mrs.fr

More information

Lecture 5: Suffix Trees

Lecture 5: Suffix Trees Longest Common Substring Problem Lecture 5: Suffix Trees Given a text T = GGAGCTTAGAACT and a string P = ATTCGCTTAGCCTA, how do we find the longest common substring between them? Here the longest common

More information

Indexing and Searching

Indexing and Searching Indexing and Searching Introduction How to retrieval information? A simple alternative is to search the whole text sequentially Another option is to build data structures over the text (called indices)

More information

Derivation of an Abstract Machine for λ-calculus with Delimited Continuation Constructs

Derivation of an Abstract Machine for λ-calculus with Delimited Continuation Constructs Derivation of an Abstract Machine for λ-calculus with Delimited Continuation Constructs Arisa Kitani Kenich Asai Ochanomizu University 2-1-1 Otsuka, Bunkyo-ku, Tokyo 112-8610, Japan Abstract The goal of

More information

Logimix: A Self-Applicable Partial Evaluator for Prolog

Logimix: A Self-Applicable Partial Evaluator for Prolog Logimix: A Self-Applicable Partial Evaluator for Prolog Torben Æ. Mogensen DIKU, Department of Computer Science, University of Copenhagen Copenhagen, Denmark e-mail: torbenm@diku.dk Anders Bondorf DIKU,

More information

callee s frame... arg k caller s frame

callee s frame... arg k caller s frame An Ecient Implementation of Multiple Return Values in Scheme J. Michael Ashley R. Kent Dybvig Indiana University Computer Science Department Lindley Hall 215 Bloomington, Indiana 47405 fjashley,dybg@cs.indiana.edu

More information

String Matching Algorithms

String Matching Algorithms String Matching Algorithms Georgy Gimel farb (with basic contributions from M. J. Dinneen, Wikipedia, and web materials by Ch. Charras and Thierry Lecroq, Russ Cox, David Eppstein, etc.) COMPSCI 369 Computational

More information

Implementing Software Connectors through First-Class Methods

Implementing Software Connectors through First-Class Methods Implementing Software Connectors through First-Class Methods Cheoljoo Jeong and Sangduck Lee Computer & Software Technology Laboratory Electronics and Telecommunications Research Institute Taejon, 305-350,

More information

A stack eect (type signature) is a pair of input parameter types and output parameter types. We also consider the type clash as a stack eect. The set

A stack eect (type signature) is a pair of input parameter types and output parameter types. We also consider the type clash as a stack eect. The set Alternative Syntactic Methods for Dening Stack Based Languages Jaanus Poial Institute of Computer Science University of Tartu, Estonia e-mail: jaanus@cs.ut.ee Abstract. Traditional formal methods of syntax

More information

Lecture Notes on Top-Down Predictive LL Parsing

Lecture Notes on Top-Down Predictive LL Parsing Lecture Notes on Top-Down Predictive LL Parsing 15-411: Compiler Design Frank Pfenning Lecture 8 1 Introduction In this lecture we discuss a parsing algorithm that traverses the input string from l eft

More information

Eager Evaluation Isn t Eager Enough A Transformation Based Approach to Semantics-Directed Code Generation

Eager Evaluation Isn t Eager Enough A Transformation Based Approach to Semantics-Directed Code Generation Eager Evaluation Isn t Eager Enough A Transformation Based Approach to Semantics-Directed Code Generation Arthur Nunes-Harwitt Rochester Institute of Technology 102 Lomb Memorial Drive Rochester, New York

More information

International Journal of Digital Application & Contemporary research Website: (Volume 1, Issue 7, February 2013)

International Journal of Digital Application & Contemporary research Website:   (Volume 1, Issue 7, February 2013) Performance Analysis of GA and PSO over Economic Load Dispatch Problem Sakshi Rajpoot sakshirajpoot1988@gmail.com Dr. Sandeep Bhongade sandeepbhongade@rediffmail.com Abstract Economic Load dispatch problem

More information

Decidable Problems. We examine the problems for which there is an algorithm.

Decidable Problems. We examine the problems for which there is an algorithm. Decidable Problems We examine the problems for which there is an algorithm. Decidable Problems A problem asks a yes/no question about some input. The problem is decidable if there is a program that always

More information

String Matching in Scribblenauts Unlimited

String Matching in Scribblenauts Unlimited String Matching in Scribblenauts Unlimited Jordan Fernando / 13510069 Program Studi Teknik Informatika Sekolah Teknik Elektro dan Informatika Institut Teknologi Bandung, Jl. Ganesha 10 Bandung 40132, Indonesia

More information

The Lambda Calculus. notes by Don Blaheta. October 12, A little bondage is always a good thing. sk

The Lambda Calculus. notes by Don Blaheta. October 12, A little bondage is always a good thing. sk The Lambda Calculus notes by Don Blaheta October 2, 2000 A little bondage is always a good thing. sk We ve seen that Scheme is, as languages go, pretty small. There are just a few keywords, and most of

More information

Planarity Algorithms via PQ-Trees (Extended Abstract)

Planarity Algorithms via PQ-Trees (Extended Abstract) Electronic Notes in Discrete Mathematics 31 (2008) 143 149 www.elsevier.com/locate/endm Planarity Algorithms via PQ-Trees (Extended Abstract) Bernhard Haeupler 1 Department of Computer Science, Princeton

More information

Institut für Informatik D Augsburg

Institut für Informatik D Augsburg Universität Augsburg Safer Ways to Pointer Manipulation Bernhard Möller Report 2000-4 Mai 2000 Institut für Informatik D-86135 Augsburg Copyright c Bernhard Möller Institut für Informatik Universität Augsburg

More information

Multithreaded Sliding Window Approach to Improve Exact Pattern Matching Algorithms

Multithreaded Sliding Window Approach to Improve Exact Pattern Matching Algorithms Multithreaded Sliding Window Approach to Improve Exact Pattern Matching Algorithms Ala a Al-shdaifat Computer Information System Department The University of Jordan Amman, Jordan Bassam Hammo Computer

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

A Note on Fairness in I/O Automata. Judi Romijn and Frits Vaandrager CWI. Abstract

A Note on Fairness in I/O Automata. Judi Romijn and Frits Vaandrager CWI. Abstract A Note on Fairness in I/O Automata Judi Romijn and Frits Vaandrager CWI P.O. Box 94079, 1090 GB Amsterdam, The Netherlands judi@cwi.nl, fritsv@cwi.nl Abstract Notions of weak and strong fairness are studied

More information

A macro- generator for ALGOL

A macro- generator for ALGOL A macro- generator for ALGOL byh.leroy Compagnie Bull-General Electric Paris, France INTRODUCfION The concept of macro-facility is ambiguous, when applied to higher level languages. For some authorsl,2,

More information

Optimization of Boyer-Moore-Horspool-Sunday Algorithm

Optimization of Boyer-Moore-Horspool-Sunday Algorithm Optimization of Boyer-Moore-Horspool-Sunday Algorithm Rionaldi Chandraseta - 13515077 Program Studi Teknik Informatika Sekolah Teknik Elektro dan Informatika, Institut Teknologi Bandung Bandung, Indonesia

More information

ONE-STACK AUTOMATA AS ACCEPTORS OF CONTEXT-FREE LANGUAGES *

ONE-STACK AUTOMATA AS ACCEPTORS OF CONTEXT-FREE LANGUAGES * ONE-STACK AUTOMATA AS ACCEPTORS OF CONTEXT-FREE LANGUAGES * Pradip Peter Dey, Mohammad Amin, Bhaskar Raj Sinha and Alireza Farahani National University 3678 Aero Court San Diego, CA 92123 {pdey, mamin,

More information

PCPs and Succinct Arguments

PCPs and Succinct Arguments COSC 544 Probabilistic Proof Systems 10/19/17 Lecturer: Justin Thaler PCPs and Succinct Arguments 1 PCPs: Definitions and Relationship to MIPs In an MIP, if a prover is asked multiple questions by the

More information

A New String Matching Algorithm Based on Logical Indexing

A New String Matching Algorithm Based on Logical Indexing The 5th International Conference on Electrical Engineering and Informatics 2015 August 10-11, 2015, Bali, Indonesia A New String Matching Algorithm Based on Logical Indexing Daniar Heri Kurniawan Department

More information

17 dicembre Luca Bortolussi SUFFIX TREES. From exact to approximate string matching.

17 dicembre Luca Bortolussi SUFFIX TREES. From exact to approximate string matching. 17 dicembre 2003 Luca Bortolussi SUFFIX TREES From exact to approximate string matching. An introduction to string matching String matching is an important branch of algorithmica, and it has applications

More information

Algorithms and Data Structures Lesson 3

Algorithms and Data Structures Lesson 3 Algorithms and Data Structures Lesson 3 Michael Schwarzkopf https://www.uni weimar.de/de/medien/professuren/medieninformatik/grafische datenverarbeitung Bauhaus University Weimar May 30, 2018 Overview...of

More information

An Effective Upperbound on Treewidth Using Partial Fill-in of Separators

An Effective Upperbound on Treewidth Using Partial Fill-in of Separators An Effective Upperbound on Treewidth Using Partial Fill-in of Separators Boi Faltings Martin Charles Golumbic June 28, 2009 Abstract Partitioning a graph using graph separators, and particularly clique

More information