perspective, logic programs do have a notion of control ow, and the in terms of the central control ow the program embodies.

Size: px
Start display at page:

Download "perspective, logic programs do have a notion of control ow, and the in terms of the central control ow the program embodies."

Transcription

1 Projections of Logic Programs Using Symbol Mappings Ashish Jain Department of Computer Engineering and Science Case Western Reserve University Cleveland, OH USA Abstract This work presents some formalization of our intuition that from an operational perspective, logic programs do have a notion of control ow, and the computational behavior of a \well-structured" logic program is best understood in terms of the central control ow the program embodies. Generalizing earlier work on program map theory, a concept of a projection of a logic program using a mapping for the literals appearing in the program clauses is introduced. If a well-structured program is considered an annotation of a basic control ow then projecting out the annotations will abstract the core structure. Projections are particularly useful for incremental program development methods. We demonstrate, using an incremental method for program construction from reusable components, that incremental addition of functionalities can be analyzed for a better design by manipulating the projection equations. We study the relationship between a program and its projections and characterize situations under which the functionality of a program can be orthogonally decomposed so that subsets of functionalities can be independently developed and understood. An example analysis for a better design using projections is presented. 1 Introduction What is a well-structured logic program? It is dicult to give a satisfactory answer to this question if only the declarative semantics are considered. From a declarative perspective, a logic program is a collection of formulae in rst-order logic representing knowledge about a problem with no inherent structure. However, when viewed operationally, logic programs do have a notion of control ow. Moreover, programmers nd it more intuitive to develop/explain programs using the operational behavior of the programs. For example, it is very common to hear sayings like \this program recurses down the following data-structure", \the search is made by a depth rst traversal of the graph", \the program computes the value bottom-up", etc. when the computational behavior of a program is explained.

2 We believe that a logic program should be termed well-structured if it has a well-dened and easy to understand control ow. It is our intuition that once the basic control ow of a logic program is identied, the functionality of the given program can be understood/explained in terms of the basic control ow. In this paper, we present \projections" of logic programs for abstracting out the basic control ow. Projections of logic programs are based on mappings for the literals which appear in the program clauses. Projections are particularly useful for incremental program development methods. Please note, we are not attempting to dene a mathematical structure concisely capturing the control ow of logic programs { a la the program dependence graphs for imperative programs, reduction graph for functional programs, etc. Rather, we take the meta-approach that the control ow of logic programs is best represented by logic programs. The key intuition behind this paper is that by projecting out certain \computational details" of a logic program, a simple program corresponding to the basic control ow of the given program can be abstracted out. Or stated from the perspective of a programming methodology, if we build \computational details" around a well-understood control ow then it is easy to explain the computational behavior of the nal program. To help esstablish context for the readers, here is some background into this research. A method for developing structured logic programs called \stepwise enhancement" has been presented in [9, 5, 7]. Stepwise enhancement incrementally builds a target program from simpler, well-understood, reusable programs by the application of standard programming techniques. A programming technique introduces additional functionality without altering the essential control ow of the program. A formalization of the intuitions behind stepwise enhancement is reported in [4]. The symbol mapping for dening a projection of a logic program is a generalization of the \program map" of [4]. The remainder of the paper is organized as follows: Section 2 formally de- nes a projection of a logic program. Section 3 establishes certain properties of these projections, and discusses how projections can help in decomposing the functionality of a program into orthogonal subsets. Section 4 presents an example of program analysis using projections. We present our conclusions in Section 5. 2 Projections of Logic Programs Projection of a logic program is dened relative to a mapping for the literals appearing in the program clauses. A projection of a logic program is obtained by mapping individual clauses. A mapping of a clause involves: a) deletion of certain literals appearing in the clause, and b) mapping of the remaining literals to literals with possibly lower arity. The mapping for the literals and the clauses is induced from a mapping for the predicate symbols. Predicate

3 symbol mapping is dened in Denition 2.3. We assume some familiarity with basic terminology of logic programming. [1] is a good reference for review of the terminology. Denition 2.1 Let V, F, and P respectively denote the denumerable sets of variables, function symbols, and predicate symbols for rst-order logic. Let > be a special predicate of arity 0 in P which we assume will not be used in any program text. Denition 2.2 Let C P denote the set of clauses of a logic program P. Given a logic program P, let V P, F P, and P P denote the variables, function symbols, and predicate symbols which explicitly appear in C P. Remarks: 1. For readability, though programs may use the same variable name for variables appearing in dierent clauses, they should be considered distinct variables. 2. Given a program P, V P, F P, and P P are proper subsets of V, F, and P respectively. 3. For brevity, we write terms with function symbols of arity 0 as `f' instead of `f()' and atomic formulae with predicate symbols of arity 0 as `p' instead of `p()'. Denition 2.3 Given a logic program, a mapping h : P P! P is a predicate symbol mapping if 8p 2 P P, arity(p) arity(h(p)). Since a literal l 0 may get mapped to a literal of lower arity, some of the arguments of l 0 should be deleted when mapping l 0. Besides deletion, the arguments may be re-shued. Mathematically, this is achieved by associating a projection sequence (Denition 2.4) with each predicate p in P P. Denition 2.4 A projection sequence from m to n, m n, is given by S m;n = x 1, x 2, : : :, x n where each x i is distinct and each x i 2 f1; 2; : : :; mg. Given a projection sequence S p m;n for predicate p where m is the arity of p and n is the arity of h(p), when a literal with p as predicate is mapped, the i th argument of the literal, 1 i m and i 62 S p m;n, gets projected out. The induced mapping for the literals and the clauses is more formally dened by the following denition: Denition 2.5 Given a logic program P, a predicate symbol mapping h p : P P! P, and the associated projection sequences with each predicate in P P, the induced mapping h for the literals and clauses of P is dened as follows: 1. for an atomic literal p(t 1 ; t 2 ; : : :; t m ) in P, if x 1 ; x 2 ; : : :; x n is the projection sequence of p then h(p(t 1 ; t 2 ; : : :; t m )) = h(p)(t x1 ; t x2 ; : : :; t xn )

4 2. for a negative literal :A, h(:a) = :h(a). 3. for any clause l 0 l 1 ; l 2 ; : : :; l n where n 0, h(l 0 l 1 ; l 2 ; : : :; l n ) = h(l 0 ) h(l 1 ); h(l 2 ); : : :; h(l n ). Remarks: We collectively refer to the predicate symbol mapping and the projection sequences by the induced mapping. Projection of a program with respect to a given induced mapping is dened as follows: Denition 2.6 Given an Q induced mapping h for P, the projection of P with respect to h, denoted h(p ), is the program corresponding to the set of clauses fdel(h(c))jc 2 C P and if l is the head of C then h(l) 6= >g where del(h(c)) is the clause obtained by deleting every > and :> from h(c). The deletion of certain literals during the mapping of a clause is achieved by the operation del. Simply stated, if a predicate p gets mapped to > under a given predicate symbol map then every literal in a clause of the program with p as the predicate gets deleted from the mapping. It should be noted that projections of logic programs are more general than the program maps for logic programs given in [4]. In particular, Q h(p ) = Q does not imply that h is a program map from P to Q. For h to be a program map from P to Q, each predicate and function symbol in Q should have a unique inverse image under h in P. Here we have implicitly assumed a 1-1 mapping for the function symbols; thus, each function symbol in Q has a unique inverse in P. However, the same is not true for the predicate symbols. The predicate symbol mapping is strictly more general that the bijective mapping of the program maps. On the other hand, if h is a program map from P to Q then Q h(p ) = Q albeit with a slight re-interpretation of the mapping of the function symbols. Sine a program Q map includes a bijective mapping for the function symbols, the equation h (P ) = Q holds modulo consistent renaming of the function symbols. Generalizing 1-1 mapping of predicate symbols under the program maps to many-1 mapping under the projections has a tradeo. Projections are stronger, as will be discussed in the following section, as they allow a broader class of programming techniques or modication operations on the reusable program units. However, the generalized modication operations do not necessarily preserve the computations of the programs to which they are applied, a result true for the application of programming techniques of program maps ([4]). So while the broader class of operations aids in program development and maintenance, correctness proofs of nal programs cannot be leveraged as easily as under the program maps. One can take successive projections of a complicated program till (s)he has identied the program corresponding to the \core structure". We will

5 discuss this approach in greater details in the next two sections. As an example of how projection \strips" a program of some of its functionality to get to Q the core, consider programs and the mapping h given in Figures 3 and 4. h(p 1 ) = P 0. We conclude the section with the following denition which denes composition of successive projections. Denition 2.7 Given Q h 1 (P ) = Q and Q h 2 (Q) = S, the composition of h 1 and h 2, denoted, h 1 h 2, is dened as follows: 1. 8p, p 2 P P, if h 1 (p) 6= > then dene h p (p) = h 2 (h 1 (p)) else dene h p (p) = >. 2. 8p, p 2 P P, if h 1 (p) = > then dene the projection sequence for p to be else dene the projection sequence as x y1 ; x y2 ; : : :; x ym where x 1 ; x 2 ; : : :; x n is the projection sequence of p under the mapping h 1, and y 1 ; y 2 ; : : :; y m is the projection sequence of h 1 (p) under the mapping h 2. The predicate symbol mapping h p and the new projection sequences dened above are the basis for the induced mapping h 1 h 2. The following property of the successive projections follows from Denition 2.7. Property 1 Given Q h 1 (P ) = Q and Q h 2 (Q) = S then Q h 1 h 2 (P ) = S. 3 Incremental Construction and Program Projections As stated, the aim for projecting logic programs is to abstract the core control structure. If a program achieves certain functionality, abstractly denoted by ( x 1 ; x 2 ; : : :; x n ), and if we could identify syntactic constructs contributing to a particular subset of the functionality then we can delete those constructs to \strip" the program of that functionality. If we do it successively then we would be left with a core program with a simple and easy to understand control ow. Of course, if a program has no notion of a structure; that is, program is so written that none of the functionality can be viewed independently then we cannot do any better than explaining the program in its entirety. Assuming that the program has a structure, the question is, how useful are our projections in associating constructs with functionality? Obtaining a projection of a logic program involves identication of literals and argument positions which should be projected out. For arbitrary programs, the best we can do is use heuristics for projections. For example, if the mode of usage of a program is known then projecting non-ground arguments of the main predicate and removing goals which manipulate these

6 arguments may help. If the program was developed incrementally, adding a subset of functionality at a time, then the design can be analyzed in terms of the incremental projections. Such post-development analysis of the design in terms of incremental projection equations can lead to a natural decomposition of the nal program's functionality where subsets of functionality which do not depend on each other can be independently developed. In other words, incremental construction adds functionality in a \layered" manner, and using projections we can strip a layer, rearrange layers for a better design, or decompose the program into \orthogonal" layers. This is the main advantage of projections and will be the focus for the remainder of this section. The stepwise enhancement method proposed in [5, 9] develops programs incrementally. Program development using stepwise enhancement starts with a small, well-understood skeleton program and successively applies standard programming techniques to incrementally add functionality. Programming techniques modify programs in a well-dened manner. The theory of program maps given in [4] captures the incremental changes made to a program by techniques. That is, if (P ) = Q Q for some technique then there exists a program map h from P to Q, and h (P ) = Q modulo consistent function symbol renaming. Since projections are strictly more general than program maps they capture a broader class of modication operations. Solving a problem in essence solves a class of related problems. Very often, a solution is obtained by modifying the (known) solution of a related problem. For example, consider modication of a DCG to build the parse tree. The typical steps performed to modify a logic program to solve a related problem can be identied as: 1) renaming a predicate with a new predicate of possibly higher arity in which case additional arguments would be provided, 2) consistent rearrangement of the arguments, 3) introduction of new goals with new predicate symbols manipulating the newly added arguments, and 4) introduction of new clauses dening the predicates of the new goals added. Predicate symbol mappings and projection sequences can succinctly capture the modications done. Consider for example an incremental construction starting from an initial program P 0 implementing functionality ( x 0 ) and successively moving towards the nal program P n implementing functionality ( x 0 ; x 1 ; : : :; x n ) using generic modication operations as discussed above. A graph which we will call program development graph capturing the program development history, and incremental addition Q of functionality for such a design is given in Figure 1. In Figure 1, h i (P i ) = P i?1, 1 i n. Such a design, however, has an obvious aw with respect to future modi- cations. Due to the degenerate linear structure, if the program needs modication at a later date, due to a ripple eect a lot of changes may be needed in order to incorporate the desired modications. For stepwise enhancement, this shortcoming in linear design was pointed out by Lakhotia in [5]. He also suggested that for orthogonal functionalities, a program should be enhanced

7 P 0 h 1? P 1 h 2? : : :P n?1 h n? P n (x 0 ) h 1? (x 0 ; x 1 ) h 2? : : : (x 0 ; x 1 ; : : :; x n?1 ) hn? (x 0 ; x 1 ; : : :; x n ) Figure 1: Incremental construction using modication operations independently in parallel, and later automatically merged using a composition operation. However, the development still required clairvoyance from the user for decomposing the required functionality into orthogonal subsets. Using projection equations, one can elegantly decompose a design to avoid a linear degenerate structure. Given a linear structure of Figure 1, the key is deciding if the computational layer added from P k?1 to P k manipulates (syntactically) any variable or predicate symbol which was added for the rst time by program P j for some j < k. This can be syntactically checked using the criteria given by Denition 3.2. For the discussion to follow, h 0 is implicit. Assume 8p 2 P 0, h 0 (p) = >. Denition 3.1 Let h i;j denote the composition h i h i?1 : : : h j. h Denition 3.2 Given a linear structure 1 h P 0? n P 1 : : :? P n, the modications done going from P k?1 to P k are orthogonal to the context added for the rst time by P j, 0 j < k n, i: 1. None of the arguments which get projected out from the literals under the mapping h k contains variables added for the rst time by P j (V Pj n V Pj?1 is the set of variables added by P j for the rst time). Note that if a literal l gets deleted in the projection then it should be assumed that all the arguments of l get projected out. 2. P k should not enhance any literal added for the rst time by P j ; that is, 8p 2 P Pk, if h j (h k;j+1 (p)) = > then arity(p) = arity(h k;j+1 (p)). Note that h k;j+1 (p) 2 P Pj. The decomposition of the functionality proceeds as follows: Find maximal j such that the n th layer added is not orthogonal to the context added for the rst time by P j. This means that the n th modication can be done directly to P j. It also implies that (x 0 ; : : : ; x j ) h n 0? (x 0 ; : : : ; x j ; x n ) can be done independent of the development (x 0 ; : : : ; x j ) hj+1? (x 0 : : : x j ; x j+1 ) : : : hn?1? (x 0 ; : : : ; x j ; : : :; x n?1). The advantage of such a decomposition is that the program behavior (including correctness) of the nal program with respect to x n can now be done relative to P j instead of P n?1. A key thing to note

8 P n?1..= }... P j = P 0 P 1 P j } = P n 0 P n Figure 2: Program development graph after rst decomposition is that the modied projection h n 0 together with the program text code corresponding to the functionality (x 0 ; : : :; x j ; x n ) can be automatically obtained by a restructuring tool since all the information needed to strip a computational layer and adding it to another program is available. Such a maintenance tool is in the scope of future work. Let P n 0 denote the program corresponding to the functionality (x 0 ; : : : ; x j ; x n ). The modied program development graph is given in Figure 2. The decomposition process continues with the new design of Figure 2 by h recursively decomposing the program development subgraphs 1 P 0? P 1 : : : h j h j+1? P j and P j? Pj+1 : : : h n?1? P n?1. Another key aspect of such a restructuring is that merging can be done automatically. For example, in Figure 2, P n?1 can be automatically merged with P n 0. In case of stepwise enhancement, this operation is called composition and an algorithm for composition appears in [9]. However, since the projections here are more general than program maps, the composition operation of stepwise enhancement should be generalized. Since composition is not in the scope of this work, we beg the reader's indulgence as we present only an overview of the merge operation. The generalized composition algorithm is in the scope of future work. Given Q h 1 (P ) = Q h 2 (Q) = S, functionalities of P and Q can be merged automatically with respect to S. P and Q are merged with respect to S by merging all the corresponding clauses of P and Q with respect to S (two syntactic entities correspond if they have the same projection under their respective mappings) followed by, addition of all the non-corresponding clauses of P and Q. Two corresponding clauses c p and c q with respect to c s, are merged by merging all the corresponding literals of c p and c q, followed by, addition of all the non-corresponding literals of c p and c q. The merging of corresponding literals l p and l q with respect to l s is obtained by adding at the end of l s all the non-corresponding arguments of l p, followed by all the non-corresponding arguments of l q.

9 P 0 :: traverse(tree(andor,node,children)) traverse list(children). traverse list([ ]). traverse list([xjxs]) traverse(x), traverse list(xs). Figure 3: The basic control ow 4 Example We present an example program to demonstrate how decomposition works. The following problem was given as an exercise for a LISP programming course. Given a representation for AND-OR trees, compute all the nodes which are successful nodes, and nd the total number of nodes in a given AND-OR tree. Consider all AND leaf-nodes successful and all OR leaf-nodes failed. A preliminary look at the problem statement reects that any program implementing the required functionality has to do a complete traversal of the given AND-OR tree. We propose program P 0 given in Figure 3 as the starting point. We incrementally build the functionality. For the rst step, we modify program P 0 to compute labels for each node. A node is labeled `true' or `false' based on the conventions of an AND-OR tree. Program P 1 is given in Figure 4. The mapping h 1 which induces a projection from P 1 to P 0 is also given in the same gure. Using the control ow of P 1, one can collect the successful nodes based on the labels of the nodes. We modify P 1 to obtain a program P 2 which collects the successful nodes of the given tree. P 2 with the associated projection is given in Figure 5. Finally, the constructs for counting the number of nodes in the given AND-OR tree are added to P 2. Program P 3 and the associated projection is given in Figure 6. As expected, if P 3 is decomposed then one would notice that counting can be done independent of P 1 and P 2 since the maximum j for which modication done in going from P 2 to P 3 is orthogonal with respect to P j is 0. Further, P 2 is not orthogonal with respect to P 1 since P 2 adds the goal parent inclusion(label,,, ) which refers to a variable which was added for the rst time by P 1. Thus, we conclude that P 0 should be directly enhanced

10 P 1 :: label(tree(andor,node,children),label) initial label(andor,initlabel), label list(children,andor,initlabel,label). label list([ ],AndOr,Label,Label). label list([xjxs],andor,labelin,labelout) label(x,label), and or(andor,label,labelin,labeltemp), label list(xs,andor,labeltemp,labelout). initial label(or,false). and or(and,true,true,true). and or(and,false,true,false). and or(or,true,true,true). and or(or,false,true,true). initial label(and,true). and or(and,true,false,false). and or(and,false,false,false). and or(or,true,false,true). and or(or,false,false,false). h p (label) = traverse, h p (label list) = tarverse list, h p (initial label) = >, h p (and or) = > label list initial label and or 2;1 = 1, S4;1 = 1, and S2;0 = S4;0 =. S label Figure 4: The rst incremental modication and the associated projection to get the functionality of counting the number of nodes in the AND-OR tree. P 0 should be independently enhanced to P 1, and P 1 should then be enhanced to P 2. Both the segments of the enhancement should then be composed. The program development graph for our example is given in Figure 7. Note that program P 0 3 corresponds to the addition of Q syntactic entities which would get projected out during the projection h 3 h 2 (P 3 ) directly to P 0. A restructuring tool can automatically generate P 0 3 as all the required restructuring information is present. 5 Conclusions We presented projections for logic programs for abstracting the core structure of well-structured logic programs. We outlined a method for incremental construction of logic programs using generic modication operations which added functionality in a layered manner. The modications operations are strictly more general than programming techniques of stepwise enhancement ([5, 9, 7]). Incremental construction for software development has been advocated by others as well ([10, 3, 2]). However, in order to reduce the \ripple

11 P 2 :: nodes(tree(andor,node,children),label,nodes) initial label(andor,initlabel), nodes list(children,andor,initlabel,label,[ ],ChildNodes), parent inclusion(label,node,childnodes,nodes). nodes list([ ],AndOr,Label,Label,Nodes,Nodes). nodes list([xjxs],andor,labelin,labelout,nodesin,nodesout) nodes(x,label,nodes), append(nodes,nodesin,nodestemp), and or(andor,label,labelin,labeltemp), nodes list(xs,andor,labeltemp,labelout,nodestemp,nodesout). initial label(or,false). and or(and,true,true,true). and or(and,false,true,false). and or(or,true,true,true). and or(or,false,true,true). initial label(and,true). and or(and,true,false,false). and or(and,false,false,false). and or(or,true,false,true). and or(or,false,false,false). parent inclusion(true,node,nodes,[nodejnodes]). parent inclusion(false,node,nodes,nodes). h p (nodes) = label, h p (nodes list) = label list, h p (initial label) = initial label, h p (and or) = and or, h p (parent inclusion) = h p (append) = > S nodes nodes list initial label 3;2 = 1; 2, S6;4 = 1; 2; 3; 4, S2;2 = 1; 2, and or parent inclusion S3;3 = 1; 2; 3, and S4;0 = S append 3;0 =. Figure 5: The second incremental modication and the associated projection eect" in a linear development structure, we used projections for identifying independent enhancements (orthogonal layers) of logic programs. We believe, orthogonally decomposing a program helps in a better understanding of the programming process and is a suitable basis for writing well-structured programs. Also, there is substantial scope for automating the software development using a high-level editing tool similar to the ones proposed in [6] and [8]. As pointed out earlier, besides development, almost every aspect of the restructuring can be automated. We propose to develop an integrated environment, both for development and restructuring, in the near future.

12 P 3 :: count nodes(tree(andor,node,children),label,nodes,count) initial label(andor,initlabel), count nodes list(children,andor,initlabel,label,[ ],ChildNodes,1,Count), parent inclusion(label,node,childnodes,nodes). count nodes list([ ],AndOr,Label,Label,Nodes,Nodes,Count,Count). count nodes list([xjxs],andor,labelin,labelout,nodesin,nodesout, CountIn,CountOut) count nodes(x,label,nodes,count), append(nodes,nodesin,nodestemp), plus(countin,count,counttemp), and or(andor,label,labelin,labeltemp), count nodes list(xs,andor,labeltemp,labelout,nodestemp,nodesout, CountTemp,CountOut). initial label(or,false). and or(and,true,true,true). and or(and,false,true,false). and or(or,true,true,true). and or(or,false,true,true). initial label(and,true). and or(and,true,false,false). and or(and,false,false,false). and or(or,true,false,true). and or(or,false,false,false). parent inclusion(true,node,nodes,[nodejnodes]). parent inclusion(false,node,nodes,nodes). h p (count nodes) = nodes, h p (count nodes list) = nodes list, h p (initial label) = initial label, h p (and or) = and or, h p (parent inclusion) = parent inclusion, h p (append) = append, h p (plus) = > count nodes S count nodes list initial label 2;2 = 3;3 = 4;3 = 1; 2; 3, S8;6 = 1; 2; 3; 4; 5; 6, S and or parent inclusion 1; 2, S3;3 = 1; 2; 3, S4;4 = 1; 2; 3; 4, S append 1; 2; 3, and S plus 3;0 =. Figure 6: The nal program and the associated projection

13 P 1 + } P 2 } P 0 P 3 + P 0 3 Figure 7: The program development graph of P 3 Acknowledgments I would like to acknowledge Leon Sterling and Marc Kirschenbaum for providing me with valuable insights into this work. I would also like to thank the reviewers for their constructive comments. This research was supported by NSF Grant No. CCR References [1] Krzysztof R. Apt. Introduction to logic programming. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science{Vol. B, chapter 10, pages 495{571. The MIT Press/Elsevier, [2] R.G. Dromey. Systematic program development. IEEE Transactions on Software Engineering, 14(1):12{29, January [3] M.S. Feather. Constructing specications by combining parallel elaborations. IEEE Transactions on Software Engineering, 15(2):198{208, February [4] Marc Kirschenbaum, Leon Sterling, and Ashish Jain. Relating logic program via program maps. Annals of Mathematics and Articial Intelligence, 8(III-IV):229{246, [5] Arun Lakhotia. A Workbench for Developing Logic Programs By Stepwise Enhancement. PhD thesis, Case Western Reserver University, Department of Computer Engineering and Science, [6] C. Rich and R.C. Waters. The Programmer's Apprentice. Addison- Wesley, 1990.

14 [7] Leon Sterling and Marc Kirschenbaum. Applying techniques to skeletons. In J.M.J. Jacquet, editor, Constructing Logic Programs, chapter 6, pages 127{140. John Wiley, [8] Leon Sterling and Chok Sitt Sen. A tool to support stepwise enhancement in prolog. In ILPS '93 Post Conference Workshop on Methodologies for Composing Logic Programs, Vancouver, October [9] Leon Sterling and Ehud Shapiro. The Art of Prolog. The MIT Press, 2 nd edition, [10] N. Wirth. Program development using stepwise enhancement. Communications of the ACM, 14(4):221{227, 1971.

Refinement Strategies for Inductive Learning Of Simple Prolog Programs

Refinement Strategies for Inductive Learning Of Simple Prolog Programs Refinement Strategies for Inductive Learning Of Simple Prolog Programs Marc Kirschenbaum Mathematics & Computer Science Dept. John Carroll Univesity Cleveland, Ohio 44118 U.S.A. Leon S. Sterling Computer

More information

Gen := 0. Create Initial Random Population. Termination Criterion Satisfied? Yes. Evaluate fitness of each individual in population.

Gen := 0. Create Initial Random Population. Termination Criterion Satisfied? Yes. Evaluate fitness of each individual in population. An Experimental Comparison of Genetic Programming and Inductive Logic Programming on Learning Recursive List Functions Lappoon R. Tang Mary Elaine Cali Raymond J. Mooney Department of Computer Sciences

More information

Algebraic Properties of CSP Model Operators? Y.C. Law and J.H.M. Lee. The Chinese University of Hong Kong.

Algebraic Properties of CSP Model Operators? Y.C. Law and J.H.M. Lee. The Chinese University of Hong Kong. Algebraic Properties of CSP Model Operators? Y.C. Law and J.H.M. Lee Department of Computer Science and Engineering The Chinese University of Hong Kong Shatin, N.T., Hong Kong SAR, China fyclaw,jleeg@cse.cuhk.edu.hk

More information

This paper concerns our research on developing a theory and methodology appropriate

This paper concerns our research on developing a theory and methodology appropriate Applying Techniques to Skeletons L. S. Sterling and M. Kirschenbaum This paper concerns our research on developing a theory and methodology appropriate for systematically building complicated Prolog programs.

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

A taxonomy of race. D. P. Helmbold, C. E. McDowell. September 28, University of California, Santa Cruz. Santa Cruz, CA

A taxonomy of race. D. P. Helmbold, C. E. McDowell. September 28, University of California, Santa Cruz. Santa Cruz, CA A taxonomy of race conditions. D. P. Helmbold, C. E. McDowell UCSC-CRL-94-34 September 28, 1994 Board of Studies in Computer and Information Sciences University of California, Santa Cruz Santa Cruz, CA

More information

where is a constant, 0 < <. In other words, the ratio between the shortest and longest paths from a node to a leaf is at least. An BB-tree allows ecie

where is a constant, 0 < <. In other words, the ratio between the shortest and longest paths from a node to a leaf is at least. An BB-tree allows ecie Maintaining -balanced Trees by Partial Rebuilding Arne Andersson Department of Computer Science Lund University Box 8 S-22 00 Lund Sweden Abstract The balance criterion dening the class of -balanced trees

More information

Part I Logic programming paradigm

Part I Logic programming paradigm Part I Logic programming paradigm 1 Logic programming and pure Prolog 1.1 Introduction 3 1.2 Syntax 4 1.3 The meaning of a program 7 1.4 Computing with equations 9 1.5 Prolog: the first steps 15 1.6 Two

More information

Server 1 Server 2 CPU. mem I/O. allocate rec n read elem. n*47.0. n*20.0. select. n*1.0. write elem. n*26.5 send. n*

Server 1 Server 2 CPU. mem I/O. allocate rec n read elem. n*47.0. n*20.0. select. n*1.0. write elem. n*26.5 send. n* Information Needs in Performance Analysis of Telecommunication Software a Case Study Vesa Hirvisalo Esko Nuutila Helsinki University of Technology Laboratory of Information Processing Science Otakaari

More information

SAT solver of Howe & King as a logic program

SAT solver of Howe & King as a logic program SAT solver of Howe & King as a logic program W lodzimierz Drabent June 6, 2011 Howe and King [HK11b, HK11a] presented a SAT solver which is an elegant and concise Prolog program of 22 lines. It is not

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

The Compositional C++ Language. Denition. Abstract. This document gives a concise denition of the syntax and semantics

The Compositional C++ Language. Denition. Abstract. This document gives a concise denition of the syntax and semantics The Compositional C++ Language Denition Peter Carlin Mani Chandy Carl Kesselman March 12, 1993 Revision 0.95 3/12/93, Comments welcome. Abstract This document gives a concise denition of the syntax and

More information

Chordal graphs and the characteristic polynomial

Chordal graphs and the characteristic polynomial Discrete Mathematics 262 (2003) 211 219 www.elsevier.com/locate/disc Chordal graphs and the characteristic polynomial Elizabeth W. McMahon ;1, Beth A. Shimkus 2, Jessica A. Wolfson 3 Department of Mathematics,

More information

6.001 Notes: Section 8.1

6.001 Notes: Section 8.1 6.001 Notes: Section 8.1 Slide 8.1.1 In this lecture we are going to introduce a new data type, specifically to deal with symbols. This may sound a bit odd, but if you step back, you may realize that everything

More information

Software Component Relationships. Stephen H. Edwards. Department of Computer Science. Virginia Polytechnic Institute and State University

Software Component Relationships. Stephen H. Edwards. Department of Computer Science. Virginia Polytechnic Institute and State University Software Component Relationships Stephen H. Edwards Department of Computer Science Virginia Polytechnic Institute and State University 660 McBryde Hall Blacksburg, VA 24061-0106 Tel: (540)-231-7537 Email:

More information

to automatically generate parallel code for many applications that periodically update shared data structures using commuting operations and/or manipu

to automatically generate parallel code for many applications that periodically update shared data structures using commuting operations and/or manipu Semantic Foundations of Commutativity Analysis Martin C. Rinard y and Pedro C. Diniz z Department of Computer Science University of California, Santa Barbara Santa Barbara, CA 93106 fmartin,pedrog@cs.ucsb.edu

More information

and therefore the system throughput in a distributed database system [, 1]. Vertical fragmentation further enhances the performance of database transa

and therefore the system throughput in a distributed database system [, 1]. Vertical fragmentation further enhances the performance of database transa Vertical Fragmentation and Allocation in Distributed Deductive Database Systems Seung-Jin Lim Yiu-Kai Ng Department of Computer Science Brigham Young University Provo, Utah 80, U.S.A. Email: fsjlim,ngg@cs.byu.edu

More information

the application rule M : x:a: B N : A M N : (x:a: B) N and the reduction rule (x: A: B) N! Bfx := Ng. Their algorithm is not fully satisfactory in the

the application rule M : x:a: B N : A M N : (x:a: B) N and the reduction rule (x: A: B) N! Bfx := Ng. Their algorithm is not fully satisfactory in the The Semi-Full Closure of Pure Type Systems? Gilles Barthe Institutionen for Datavetenskap, Chalmers Tekniska Hogskola, Goteborg, Sweden Departamento de Informatica, Universidade do Minho, Braga, Portugal

More information

2 Data Reduction Techniques The granularity of reducible information is one of the main criteria for classifying the reduction techniques. While the t

2 Data Reduction Techniques The granularity of reducible information is one of the main criteria for classifying the reduction techniques. While the t Data Reduction - an Adaptation Technique for Mobile Environments A. Heuer, A. Lubinski Computer Science Dept., University of Rostock, Germany Keywords. Reduction. Mobile Database Systems, Data Abstract.

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

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

Reuse Contracts As Component Interface. Descriptions. Koen De Hondt, Carine Lucas, and Patrick Steyaert. Programming Technology Lab

Reuse Contracts As Component Interface. Descriptions. Koen De Hondt, Carine Lucas, and Patrick Steyaert. Programming Technology Lab Reuse Contracts As Component Interface Descriptions Koen De Hondt, Carine Lucas, and Patrick Steyaert Programming Technology Lab Computer Science Department Vrije Universiteit Brussel Pleinlaan 2, B-1050

More information

A Small Interpreted Language

A Small Interpreted Language A Small Interpreted Language What would you need to build a small computing language based on mathematical principles? The language should be simple, Turing equivalent (i.e.: it can compute anything that

More information

Operational Semantics

Operational Semantics 15-819K: Logic Programming Lecture 4 Operational Semantics Frank Pfenning September 7, 2006 In this lecture we begin in the quest to formally capture the operational semantics in order to prove properties

More information

A Boolean Expression. Reachability Analysis or Bisimulation. Equation Solver. Boolean. equations.

A Boolean Expression. Reachability Analysis or Bisimulation. Equation Solver. Boolean. equations. A Framework for Embedded Real-time System Design? Jin-Young Choi 1, Hee-Hwan Kwak 2, and Insup Lee 2 1 Department of Computer Science and Engineering, Korea Univerity choi@formal.korea.ac.kr 2 Department

More information

Treewidth and graph minors

Treewidth and graph minors Treewidth and graph minors Lectures 9 and 10, December 29, 2011, January 5, 2012 We shall touch upon the theory of Graph Minors by Robertson and Seymour. This theory gives a very general condition under

More information

Finding a winning strategy in variations of Kayles

Finding a winning strategy in variations of Kayles Finding a winning strategy in variations of Kayles Simon Prins ICA-3582809 Utrecht University, The Netherlands July 15, 2015 Abstract Kayles is a two player game played on a graph. The game can be dened

More information

size, runs an existing induction algorithm on the rst subset to obtain a rst set of rules, and then processes each of the remaining data subsets at a

size, runs an existing induction algorithm on the rst subset to obtain a rst set of rules, and then processes each of the remaining data subsets at a Multi-Layer Incremental Induction Xindong Wu and William H.W. Lo School of Computer Science and Software Ebgineering Monash University 900 Dandenong Road Melbourne, VIC 3145, Australia Email: xindong@computer.org

More information

Lecture 9 - Matrix Multiplication Equivalences and Spectral Graph Theory 1

Lecture 9 - Matrix Multiplication Equivalences and Spectral Graph Theory 1 CME 305: Discrete Mathematics and Algorithms Instructor: Professor Aaron Sidford (sidford@stanfordedu) February 6, 2018 Lecture 9 - Matrix Multiplication Equivalences and Spectral Graph Theory 1 In the

More information

CMPUT 325 : Lambda Calculus Basics. Lambda Calculus. Dr. B. Price and Dr. R. Greiner. 13th October 2004

CMPUT 325 : Lambda Calculus Basics. Lambda Calculus. Dr. B. Price and Dr. R. Greiner. 13th October 2004 CMPUT 325 : Lambda Calculus Basics Dr. B. Price and Dr. R. Greiner 13th October 2004 Dr. B. Price and Dr. R. Greiner CMPUT 325 : Lambda Calculus Basics 1 Lambda Calculus Lambda calculus serves as a formal

More information

Some Applications of Graph Bandwidth to Constraint Satisfaction Problems

Some Applications of Graph Bandwidth to Constraint Satisfaction Problems Some Applications of Graph Bandwidth to Constraint Satisfaction Problems Ramin Zabih Computer Science Department Stanford University Stanford, California 94305 Abstract Bandwidth is a fundamental concept

More information

Baby Steps Toward an Implementation of Axiomatic Language

Baby Steps Toward an Implementation of Axiomatic Language Baby Steps Toward an Implementation of Axiomatic Language Extended Abstract Walter W. Wilson Lockheed Martin, P.O. Box 748, Fort Worth TX 76101, USA wwwilson@acm.org Abstract. This paper describes an initial

More information

Semantics via Syntax. f (4) = if define f (x) =2 x + 55.

Semantics via Syntax. f (4) = if define f (x) =2 x + 55. 1 Semantics via Syntax The specification of a programming language starts with its syntax. As every programmer knows, the syntax of a language comes in the shape of a variant of a BNF (Backus-Naur Form)

More information

ALGORITHMIC DECIDABILITY OF COMPUTER PROGRAM-FUNCTIONS LANGUAGE PROPERTIES. Nikolay Kosovskiy

ALGORITHMIC DECIDABILITY OF COMPUTER PROGRAM-FUNCTIONS LANGUAGE PROPERTIES. Nikolay Kosovskiy International Journal Information Theories and Applications, Vol. 20, Number 2, 2013 131 ALGORITHMIC DECIDABILITY OF COMPUTER PROGRAM-FUNCTIONS LANGUAGE PROPERTIES Nikolay Kosovskiy Abstract: A mathematical

More information

Lecture 3: Recursion; Structural Induction

Lecture 3: Recursion; Structural Induction 15-150 Lecture 3: Recursion; Structural Induction Lecture by Dan Licata January 24, 2012 Today, we are going to talk about one of the most important ideas in functional programming, structural recursion

More information

Propositional Logic. Part I

Propositional Logic. Part I Part I Propositional Logic 1 Classical Logic and the Material Conditional 1.1 Introduction 1.1.1 The first purpose of this chapter is to review classical propositional logic, including semantic tableaux.

More information

SOFTWARE ENGINEERING DESIGN I

SOFTWARE ENGINEERING DESIGN I 2 SOFTWARE ENGINEERING DESIGN I 3. Schemas and Theories The aim of this course is to learn how to write formal specifications of computer systems, using classical logic. The key descriptional technique

More information

User-defined Functions. Conditional Expressions in Scheme

User-defined Functions. Conditional Expressions in Scheme User-defined Functions The list (lambda (args (body s to a function with (args as its argument list and (body as the function body. No quotes are needed for (args or (body. (lambda (x (+ x 1 s to the increment

More information

Semantics. A. Demers Jan This material is primarily from Ch. 2 of the text. We present an imperative

Semantics. A. Demers Jan This material is primarily from Ch. 2 of the text. We present an imperative CS411 Notes 1: IMP and Large Step Operational Semantics A. Demers 23-25 Jan 2001 This material is primarily from Ch. 2 of the text. We present an imperative language called IMP; wegive a formal definition

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

Simulative Evaluation of Internet Protocol Functions

Simulative Evaluation of Internet Protocol Functions Simulative Evaluation of Internet Protocol Functions Introduction Course Objectives & Introduction Performance Evaluation & Simulation A Manual Simulation Example Resources http://www.tu-ilmenau.de/fakia/simpro.html

More information

Semantics of programming languages

Semantics of programming languages Semantics of programming languages Informatics 2A: Lecture 27 John Longley School of Informatics University of Edinburgh jrl@inf.ed.ac.uk 21 November, 2011 1 / 19 1 2 3 4 2 / 19 Semantics for programming

More information

System-Level Specication of Instruction Sets. Department of Electrical and Computer Engineering. Department of Computer Science

System-Level Specication of Instruction Sets. Department of Electrical and Computer Engineering. Department of Computer Science System-Level Specication of Instruction Sets Todd A. Cook Paul D. Franzon Ed A. Harcourt y Thomas K. Miller III Department of Electrical and Computer Engineering y Department of Computer Science North

More information

Bijective Term Encodings

Bijective Term Encodings Bijective Term Encodings Paul Tarau Department of Computer Science and Engineering Univ of North Texas CICLOPS 2011 Paul Tarau (University of North Texas) Bijective Term Encodings CICLOPS 2011 1 / 27 Motivation

More information

A Formal Approach to Program Modification. Lindsay Groves

A Formal Approach to Program Modification. Lindsay Groves A Formal Approach to Program Modication Lindsay Groves School of Mathematical and Computing Sciences Victoria University of Wellington, New Zealand lindsay@mcs.vuw.ac.nz Abstract This paper presents a

More information

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution Foundations of AI 9. Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution Wolfram Burgard, Andreas Karwath, Bernhard Nebel, and Martin Riedmiller 09/1 Contents Motivation

More information

proc {Produce State Out} local State2 Out2 in State2 = State + 1 Out = State Out2 {Produce State2 Out2}

proc {Produce State Out} local State2 Out2 in State2 = State + 1 Out = State Out2 {Produce State2 Out2} Laziness and Declarative Concurrency Raphael Collet Universite Catholique de Louvain, B-1348 Louvain-la-Neuve, Belgium raph@info.ucl.ac.be May 7, 2004 Abstract Concurrency and distribution in a programming

More information

Optimum Alphabetic Binary Trees T. C. Hu and J. D. Morgenthaler Department of Computer Science and Engineering, School of Engineering, University of C

Optimum Alphabetic Binary Trees T. C. Hu and J. D. Morgenthaler Department of Computer Science and Engineering, School of Engineering, University of C Optimum Alphabetic Binary Trees T. C. Hu and J. D. Morgenthaler Department of Computer Science and Engineering, School of Engineering, University of California, San Diego CA 92093{0114, USA Abstract. We

More information

Localization in Graphs. Richardson, TX Azriel Rosenfeld. Center for Automation Research. College Park, MD

Localization in Graphs. Richardson, TX Azriel Rosenfeld. Center for Automation Research. College Park, MD CAR-TR-728 CS-TR-3326 UMIACS-TR-94-92 Samir Khuller Department of Computer Science Institute for Advanced Computer Studies University of Maryland College Park, MD 20742-3255 Localization in Graphs Azriel

More information

Imperative Functional Programming

Imperative Functional Programming Imperative Functional Programming Uday S. Reddy Department of Computer Science The University of Illinois at Urbana-Champaign Urbana, Illinois 61801 reddy@cs.uiuc.edu Our intuitive idea of a function is

More information

A Pearl on SAT Solving in Prolog (extended abstract)

A Pearl on SAT Solving in Prolog (extended abstract) A Pearl on SAT Solving in Prolog (extended abstract) Jacob M. Howe and Andy King 1 Introduction The Boolean satisfiability problem, SAT, is of continuing interest because a variety of problems are naturally

More information

Discrete Optimization. Lecture Notes 2

Discrete Optimization. Lecture Notes 2 Discrete Optimization. Lecture Notes 2 Disjunctive Constraints Defining variables and formulating linear constraints can be straightforward or more sophisticated, depending on the problem structure. The

More information

1 INTRODUCTION 2 Represent a multiset as an association list, where the rst argument of a pair is an item and the second argument is the multiplicity

1 INTRODUCTION 2 Represent a multiset as an association list, where the rst argument of a pair is an item and the second argument is the multiplicity Programming with Multisets J.W. Lloyd Department of Computer Science University of Bristol Bristol BS8 1UB, UK Abstract This paper proposes a novel way of introducing multisets into declarative programming

More information

KeyNote: Trust Management for Public-Key. 180 Park Avenue. Florham Park, NJ USA.

KeyNote: Trust Management for Public-Key. 180 Park Avenue. Florham Park, NJ USA. KeyNote: Trust Management for Public-Key Infrastructures Matt Blaze 1 Joan Feigenbaum 1 Angelos D. Keromytis 2 1 AT&T Labs { Research 180 Park Avenue Florham Park, NJ 07932 USA fmab,jfg@research.att.com

More information

arxiv: v1 [cs.pl] 1 May 2017

arxiv: v1 [cs.pl] 1 May 2017 arxiv:1705.00556v1 [cs.pl] 1 May 2017 Mapping Objects to Persistent Predicates. José E. Zalacain Llanes Abstract The Logic Programming through Prolog has been widely used for supply persistence in many

More information

Permissions to Specify the Composite Design Pattern

Permissions to Specify the Composite Design Pattern Permissions to Specify the Composite Design Pattern Kevin Bierhoff Jonathan Aldrich Institute for Software Research, Carnegie Mellon University 5000 Forbes Avenue, Pittsburgh, PA 15213, USA {kevin.bierhoff,jonathan.aldrich

More information

Reverse Engineering with a CASE Tool. Bret Johnson. Research advisors: Spencer Rugaber and Rich LeBlanc. October 6, Abstract

Reverse Engineering with a CASE Tool. Bret Johnson. Research advisors: Spencer Rugaber and Rich LeBlanc. October 6, Abstract Reverse Engineering with a CASE Tool Bret Johnson Research advisors: Spencer Rugaber and Rich LeBlanc October 6, 994 Abstract We examine using a CASE tool, Interactive Development Environment's Software

More information

A Mixed Fragmentation Methodology For. Initial Distributed Database Design. Shamkant B. Navathe. Georgia Institute of Technology.

A Mixed Fragmentation Methodology For. Initial Distributed Database Design. Shamkant B. Navathe. Georgia Institute of Technology. A Mixed Fragmentation Methodology For Initial Distributed Database Design Shamkant B. Navathe Georgia Institute of Technology Kamalakar Karlapalem Hong Kong University of Science and Technology Minyoung

More information

Martin P. Robillard and Gail C. Murphy. University of British Columbia. November, 1999

Martin P. Robillard and Gail C. Murphy. University of British Columbia. November, 1999 Migrating a Static Analysis Tool to AspectJ TM Martin P. Robillard and Gail C. Murphy Department of Computer Science University of British Columbia 201-2366 Main Mall Vancouver BC Canada V6T 1Z4 fmrobilla,murphyg@cs.ubc.ca

More information

Disjoint Support Decompositions

Disjoint Support Decompositions Chapter 4 Disjoint Support Decompositions We introduce now a new property of logic functions which will be useful to further improve the quality of parameterizations in symbolic simulation. In informal

More information

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine. 1. true / false By a compiler we mean a program that translates to code that will run natively on some machine. 2. true / false ML can be compiled. 3. true / false FORTRAN can reasonably be considered

More information

Abstract. Programs written in languages of the Oberon family usually. contain runtime tests on the dynamic type of variables.

Abstract. Programs written in languages of the Oberon family usually. contain runtime tests on the dynamic type of variables. Type Test Elimination using Typeow Analysis Diane Corney and John Gough Queensland University of Technology, Brisbane, Australia Abstract. Programs written in languages of the Oberon family usually contain

More information

2 Texts and Text Styles The texts considered for generation in the current stage of the AGILE project are simplied versions of routine passages occurr

2 Texts and Text Styles The texts considered for generation in the current stage of the AGILE project are simplied versions of routine passages occurr Text Structuring in a Multilingual System for Generation of Instructions Ivana Kruij-Korbayova and Geert-Jan M. Kruij Institute of Formal and Applied Linguistics ( UFAL) Faculty of Mathematics and Physics,

More information

such internal data dependencies can be formally specied. A possible approach to specify

such internal data dependencies can be formally specied. A possible approach to specify Chapter 6 Specication and generation of valid data unit instantiations In this chapter, we discuss the problem of generating valid data unit instantiations. As valid data unit instantiations must adhere

More information

Core Membership Computation for Succinct Representations of Coalitional Games

Core Membership Computation for Succinct Representations of Coalitional Games Core Membership Computation for Succinct Representations of Coalitional Games Xi Alice Gao May 11, 2009 Abstract In this paper, I compare and contrast two formal results on the computational complexity

More information

Higher-Order Conditional Term Rewriting. In this paper, we extend the notions of rst-order conditional rewrite systems

Higher-Order Conditional Term Rewriting. In this paper, we extend the notions of rst-order conditional rewrite systems Higher-Order Conditional Term Rewriting in the L Logic Programming Language Preliminary Results Amy Felty AT&T Bell Laboratories 600 Mountain Avenue Murray Hill, NJ 07974 Abstract In this paper, we extend

More information

Semantics of programming languages

Semantics of programming languages Semantics of programming languages Informatics 2A: Lecture 28 Mary Cryan School of Informatics University of Edinburgh mcryan@inf.ed.ac.uk 21 November 2018 1 / 18 Two parallel pipelines A large proportion

More information

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1 CME 305: Discrete Mathematics and Algorithms Instructor: Professor Aaron Sidford (sidford@stanford.edu) January 11, 2018 Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1 In this lecture

More information

PROPER TECHNIQUE OF SOFTWARE INSPECTION USING GUARDED COMMAND LANGUAGE

PROPER TECHNIQUE OF SOFTWARE INSPECTION USING GUARDED COMMAND LANGUAGE International Journal of Computer Science and Communication Vol. 2, No. 1, January-June 2011, pp. 153-157 PROPER TECHNIQUE OF SOFTWARE INSPECTION USING GUARDED COMMAND LANGUAGE Neeraj Kumar Singhania University,

More information

2 Related Work Often, animation is dealt with in an ad-hoc manner, such as keeping track of line-numbers. Below, we discuss some generic approaches. T

2 Related Work Often, animation is dealt with in an ad-hoc manner, such as keeping track of line-numbers. Below, we discuss some generic approaches. T Animators for Generated Programming Environments Frank Tip? CWI, P.O. Box 4079, 1009 AB Amsterdam, The Netherlands tip@cwi.nl Abstract. Animation of execution is a necessary feature of source-level debuggers.

More information

Maximal Monochromatic Geodesics in an Antipodal Coloring of Hypercube

Maximal Monochromatic Geodesics in an Antipodal Coloring of Hypercube Maximal Monochromatic Geodesics in an Antipodal Coloring of Hypercube Kavish Gandhi April 4, 2015 Abstract A geodesic in the hypercube is the shortest possible path between two vertices. Leader and Long

More information

For our sample application we have realized a wrapper WWWSEARCH which is able to retrieve HTML-pages from a web server and extract pieces of informati

For our sample application we have realized a wrapper WWWSEARCH which is able to retrieve HTML-pages from a web server and extract pieces of informati Meta Web Search with KOMET Jacques Calmet and Peter Kullmann Institut fur Algorithmen und Kognitive Systeme (IAKS) Fakultat fur Informatik, Universitat Karlsruhe Am Fasanengarten 5, D-76131 Karlsruhe,

More information

APPLICATION OF THE FUZZY MIN-MAX NEURAL NETWORK CLASSIFIER TO PROBLEMS WITH CONTINUOUS AND DISCRETE ATTRIBUTES

APPLICATION OF THE FUZZY MIN-MAX NEURAL NETWORK CLASSIFIER TO PROBLEMS WITH CONTINUOUS AND DISCRETE ATTRIBUTES APPLICATION OF THE FUZZY MIN-MAX NEURAL NETWORK CLASSIFIER TO PROBLEMS WITH CONTINUOUS AND DISCRETE ATTRIBUTES A. Likas, K. Blekas and A. Stafylopatis National Technical University of Athens Department

More information

In Our Last Exciting Episode

In Our Last Exciting Episode In Our Last Exciting Episode #1 Lessons From Model Checking To find bugs, we need specifications What are some good specifications? To convert a program into a model, we need predicates/invariants and

More information

M.Ward. Centre for Software Maintenance. University of Durham. July 16, Abstract

M.Ward. Centre for Software Maintenance. University of Durham. July 16, Abstract Transforming a Program into a Specication M.Ward Centre for Software Maintenance School of Engineering and Applied Science University of Durham July 16, 1993 Abstract There has been much research in recent

More information

Enhancing Datalog with Epistemic Operators to Reason About Systems Knowledge in

Enhancing Datalog with Epistemic Operators to Reason About Systems Knowledge in Enhancing Datalog with Epistemic Operators to Enhancing ReasonDatalog About Knowledge with Epistemic in Distributed Operators to Reason About Systems Knowledge in Distributed (Extended abstract) Systems

More information

CS 242. Fundamentals. Reading: See last slide

CS 242. Fundamentals. Reading: See last slide CS 242 Fundamentals Reading: See last slide Syntax and Semantics of Programs Syntax The symbols used to write a program Semantics The actions that occur when a program is executed Programming language

More information

Single-pass Static Semantic Check for Efficient Translation in YAPL

Single-pass Static Semantic Check for Efficient Translation in YAPL Single-pass Static Semantic Check for Efficient Translation in YAPL Zafiris Karaiskos, Panajotis Katsaros and Constantine Lazos Department of Informatics, Aristotle University Thessaloniki, 54124, Greece

More information

Lecture Notes on Binary Decision Diagrams

Lecture Notes on Binary Decision Diagrams Lecture Notes on Binary Decision Diagrams 15-122: Principles of Imperative Computation William Lovas Notes by Frank Pfenning Lecture 25 April 21, 2011 1 Introduction In this lecture we revisit the important

More information

An Annotated Language

An Annotated Language Hoare Logic An Annotated Language State and Semantics Expressions are interpreted as functions from states to the corresponding domain of interpretation Operators have the obvious interpretation Free of

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

Automating Big Refactorings for Componentization and the Move to SOA

Automating Big Refactorings for Componentization and the Move to SOA Automating Big Refactorings for Componentization and the Move to SOA IBM Programming Languages and Development Environments Seminar 2008 Aharon Abadi, Ran Ettinger and Yishai Feldman Software Asset Management

More information

11/6/17. Functional programming. FP Foundations, Scheme (2) LISP Data Types. LISP Data Types. LISP Data Types. Scheme. LISP: John McCarthy 1958 MIT

11/6/17. Functional programming. FP Foundations, Scheme (2) LISP Data Types. LISP Data Types. LISP Data Types. Scheme. LISP: John McCarthy 1958 MIT Functional programming FP Foundations, Scheme (2 In Text: Chapter 15 LISP: John McCarthy 1958 MIT List Processing => Symbolic Manipulation First functional programming language Every version after the

More information

.Math 0450 Honors intro to analysis Spring, 2009 Notes #4 corrected (as of Monday evening, 1/12) some changes on page 6, as in .

.Math 0450 Honors intro to analysis Spring, 2009 Notes #4 corrected (as of Monday evening, 1/12) some changes on page 6, as in  . 0.1 More on innity.math 0450 Honors intro to analysis Spring, 2009 Notes #4 corrected (as of Monday evening, 1/12) some changes on page 6, as in email. 0.1.1 If you haven't read 1.3, do so now! In notes#1

More information

Swinburne Research Bank

Swinburne Research Bank Swinburne Research Bank http://researchbank.swinburne.edu.au Sterling, S., & Yalçinalp, U. (1996). Logic programming and software engineering: implications for software design. Originally published in

More information

Path Expression Processing. in Korean Natural Language Query Interface. for Object-Oriented Databases. Jinseok Chae and Sukho Lee

Path Expression Processing. in Korean Natural Language Query Interface. for Object-Oriented Databases. Jinseok Chae and Sukho Lee Path Expression Processing in Korean Natural Language Query Interface for Object-Oriented Databases Jinseok Chae and Sukho Lee Department of Computer Engineering, Seoul National University, San 56-1, Shinrim-Dong,

More information

Software Paradigms (Lesson 6) Logic Programming

Software Paradigms (Lesson 6) Logic Programming Software Paradigms (Lesson 6) Logic Programming Table of Contents 1 Introduction... 2 2 Facts... 3 3 Predicates (Structured Terms)... 4 3.1 General Structures... 4 3.2 Predicates (Syntax)... 4 3.3 Simple

More information

16 Greedy Algorithms

16 Greedy Algorithms 16 Greedy Algorithms Optimization algorithms typically go through a sequence of steps, with a set of choices at each For many optimization problems, using dynamic programming to determine the best choices

More information

axiomatic semantics involving logical rules for deriving relations between preconditions and postconditions.

axiomatic semantics involving logical rules for deriving relations between preconditions and postconditions. CS 6110 S18 Lecture 18 Denotational Semantics 1 What is Denotational Semantics? So far we have looked at operational semantics involving rules for state transitions, definitional semantics involving translations

More information

Chapter 3. Semantics. Topics. Introduction. Introduction. Introduction. Introduction

Chapter 3. Semantics. Topics. Introduction. Introduction. Introduction. Introduction Topics Chapter 3 Semantics Introduction Static Semantics Attribute Grammars Dynamic Semantics Operational Semantics Axiomatic Semantics Denotational Semantics 2 Introduction Introduction Language implementors

More information

Contents. Chapter 1 SPECIFYING SYNTAX 1

Contents. Chapter 1 SPECIFYING SYNTAX 1 Contents Chapter 1 SPECIFYING SYNTAX 1 1.1 GRAMMARS AND BNF 2 Context-Free Grammars 4 Context-Sensitive Grammars 8 Exercises 8 1.2 THE PROGRAMMING LANGUAGE WREN 10 Ambiguity 12 Context Constraints in Wren

More information

Document Image Restoration Using Binary Morphological Filters. Jisheng Liang, Robert M. Haralick. Seattle, Washington Ihsin T.

Document Image Restoration Using Binary Morphological Filters. Jisheng Liang, Robert M. Haralick. Seattle, Washington Ihsin T. Document Image Restoration Using Binary Morphological Filters Jisheng Liang, Robert M. Haralick University of Washington, Department of Electrical Engineering Seattle, Washington 98195 Ihsin T. Phillips

More information

Vertex Magic Total Labelings of Complete Graphs

Vertex Magic Total Labelings of Complete Graphs AKCE J. Graphs. Combin., 6, No. 1 (2009), pp. 143-154 Vertex Magic Total Labelings of Complete Graphs H. K. Krishnappa, Kishore Kothapalli and V. Ch. Venkaiah Center for Security, Theory, and Algorithmic

More information

The Global Standard for Mobility (GSM) (see, e.g., [6], [4], [5]) yields a

The Global Standard for Mobility (GSM) (see, e.g., [6], [4], [5]) yields a Preprint 0 (2000)?{? 1 Approximation of a direction of N d in bounded coordinates Jean-Christophe Novelli a Gilles Schaeer b Florent Hivert a a Universite Paris 7 { LIAFA 2, place Jussieu - 75251 Paris

More information

A Parallel Intermediate Representation based on. Lambda Expressions. Timothy A. Budd. Oregon State University. Corvallis, Oregon.

A Parallel Intermediate Representation based on. Lambda Expressions. Timothy A. Budd. Oregon State University. Corvallis, Oregon. A Parallel Intermediate Representation based on Lambda Expressions Timothy A. Budd Department of Computer Science Oregon State University Corvallis, Oregon 97331 budd@cs.orst.edu September 20, 1994 Abstract

More information

Reinforcement Control via Heuristic Dynamic Programming. K. Wendy Tang and Govardhan Srikant. and

Reinforcement Control via Heuristic Dynamic Programming. K. Wendy Tang and Govardhan Srikant. and Reinforcement Control via Heuristic Dynamic Programming K. Wendy Tang and Govardhan Srikant wtang@ee.sunysb.edu and gsrikant@ee.sunysb.edu Department of Electrical Engineering SUNY at Stony Brook, Stony

More information

6.001 Notes: Section 4.1

6.001 Notes: Section 4.1 6.001 Notes: Section 4.1 Slide 4.1.1 In this lecture, we are going to take a careful look at the kinds of procedures we can build. We will first go back to look very carefully at the substitution model,

More information

Automatic flow analysis using symbolic execution and path enumeration

Automatic flow analysis using symbolic execution and path enumeration Automatic flow analysis using symbolic execution path enumeration D. Kebbal Institut de Recherche en Informatique de Toulouse 8 route de Narbonne - F-62 Toulouse Cedex 9 France Djemai.Kebbal@iut-tarbes.fr

More information

specified or may be difficult to handle, we often have a tabulated data

specified or may be difficult to handle, we often have a tabulated data Interpolation Introduction In many practical situations, for a function which either may not be explicitly specified or may be difficult to handle, we often have a tabulated data where and for In such

More information

Towards a formal model of object-oriented hyperslices

Towards a formal model of object-oriented hyperslices Towards a formal model of object-oriented hyperslices Torsten Nelson, Donald Cowan, Paulo Alencar Computer Systems Group, University of Waterloo {torsten,dcowan,alencar}@csg.uwaterloo.ca Abstract This

More information