PARTIAL EVALUATION OF PATTERN-MATCHING IN CONSTRAINT LOGIC PROGRAMMING-LANGUAGES

被引:0
作者
SMITH, DA [1 ]
机构
[1] BRANDEIS UNIV,MICHTOM SCH COMP SCI,WALTHAM,MA 02254
来源
SIGPLAN NOTICES | 1991年 / 26卷 / 09期
关键词
D O I
暂无
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
A standard example in the literature on partial evaluation is the derivation of an efficient pattern matcher by partial evaluation of a (more or less) naive matcher. The effect can be summarized by the claim that partial evaluation 'automatically' performs the optimization central to the Knuth-Morris-Pratt (KMP) string matching algorithm. In this paper we generalize the previous results by showing that the idea behind the KMP optimization extends to pattern matching in domains other than linear strings. In particular, we give examples that demonstrate how the same idea is applicable to the derivation of efficient pattern matchers for finite trees (Prolog terms with variables), for Boolean algebra, and for finite sets. For this purpose we utilize the constraint logic programming languages CLP(FT), CLP(Bool), and CLP(Finite Domain). Our analysis of how partial evaluation is able to perform these derivations leads us to introduce the notion of the failure continuation, which we utilize in the derivation of a program for matching against a set of pattern strings.
引用
收藏
页码:62 / 71
页数:10
相关论文
共 22 条
[1]  
AHO A, 1980, FORMAL LANGUAGE THEO
[2]  
Aho A. V., 1974, DESIGN ANAL COMPUTER
[3]  
[Anonymous], 14TH P ACM S PRINC P
[4]  
BJORNER D, 1988, PARTIAL EVALUATION M
[5]  
CONSEL C, 1989, INFORMATION PROCESSI, V30
[6]  
DANVY O, 1991, IN PRESS INFORMATION
[7]  
FUJITA H, 5TH LOG PROGR P INT, V2, P924
[8]  
FUJITA H, 1987, ICOT TM0367 TECHN ME
[9]  
HEINTZE N, 1987, P ICLP87 MELBOURNE
[10]  
HICKEY, 1991, ACM IFIP S PARTIAL E