To save content items to your account,
please confirm that you agree to abide by our usage policies.
If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account.
Find out more about saving content to .
To save content items to your Kindle, first ensure no-reply@cambridge.org
is added to your Approved Personal Document E-mail List under your Personal Document Settings
on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part
of your Kindle email address below.
Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations.
‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi.
‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
This chapter presents an overview of the syntax and primary constructs of the Visual Basic.NET (VB.NET) language for programmers unfamiliar with VB.NET. This is not a tutorial chapter, however, so if you are new to programming you should study another text on VB.NET before continuing with this book. If, though, you are coming to VB.NET from some other language, such as C++ or Java or even Visual Basic 6, you should read through this chapter to familiarize yourself with the language.
NET PROGRAMS
There are two ways to build programs in VB.NET. One is to use the Visual Studio.NET Integrated Development Environment (IDE). The other is to use the command-line compiler packaged as part of the.NET Framework Software Development Kit (SDK). In this section we'll discuss developing programs with the command-line compiler, since this software is free and can run on any of the modern Windows operating sysems (Windows 98 and beyond).
VB.NET Program Types
With VB.NET, you can write many different kinds of programs. A VB.NET program that makes use of a graphical user interface (GUI) is a Windows application. A VB.NET program that uses the command-prompt console for input and output is called a Console application. You can also write Internet applications, Windows Services applications, and other types of applications.
A Windows application is by necessity written in an object-oriented manner. This chapter discusses the code generated by VS. NET when a Windows application is built. We'll examine both the code generated by VS. NET and the code created when a programmer builds an application. We will also examine how to use object-oriented principles in the code the programmer adds to the application.
As the noted computer scientist and education theorist Seymour Paper once stated, “You can't think about thinking without thinking about thinking about something.” Likewise, you can't examine building a Windows application without having a Windows application to build. To that end, the application we'll use to illustrate how object-oriented principles aid the creation of a Windows application is a basic calculator, similar to the one found in Windows. By picking a rather simple application that uses many widely employed Windows features (e.g., textboxes, buttons, and labels), we can focus on how taking an object-oriented approach makes the development easier and more efficient. We should also mention that this chapter is not designed to teach a novice how to create a Windows application; rather it teaches how to create a Windows application in an object-oriented way. We assume the reader already knows how to place controls on a form and already knows the basics of writing event-driven code.
We introduce the notion of a differentiation function of acontext-free grammar which gives the number of terminal words that can bederived in a certain number of steps. A grammar is called narrow (ork-narrow) iff its differentiation function is bounded by a constant(by k). We present the basic properties of differentiation functions,especially we relate them to structure function of context-free languagesand narrow grammars to slender languages. We discuss the decidability of the equivalence of grammars with respect to the differentiation function andstructure function and prove the decidability of the k-narrowness of context-free grammars. Furthermore, we introduce languages representing the graph of the differentiation and structure function and relate these languages to those of the Chomsky hierarchy.
We show that the class of groups whichhave monoid presentations by means of finite special[λ]-confluent string-rewriting systems strictly contains the class of plain groups(the groups which are free products of a finitely generated freegroup and finitely many finite groups),and that any groupwhich has an infinite cyclic central subgroupcan be presented by such a string-rewriting system if and only if it is thedirect product of an infinite cyclic group and a finite cyclic group.
Circular splicing has been very recently introducedto model a specific recombinant behaviourof circular DNA, continuing the investigation initiatedwith linear splicing. In this paper we restrict ourstudy to therelationship between regular circular languagesand languages generated by finite circular splicing systemsand provide some results towards a characterizationof the intersection between these two classes.We consider the class of languages X*, calledhere star languages, which are closed under conjugacyrelation and with X being a regular language.Usingautomata theory and combinatorial techniques on words, weshow that for a subclass of star languagesthe corresponding circular languagesare (Paun) circular splicing languages.For example, star languages belongto this subclass when X* is a free monoidor X is a finite set.We also prove thateach (Paun) circular splicing language Lover a one-letter alphabet has the formL = X+ ∪ Y, with X,Y finite sets satisfyingparticular hypotheses.Cyclic and weak cyclic languages,which will be introduced in this paper, show that thisresult does not hold when we increase the size ofalphabets, even if we restrict ourselves to regular languages.
We add a sufficient condition for validity of Propo-sition 4.10 in the paper Frougny et al. (2004).This condition is not a necessary one, it is nevertheless convenient, since anyway mostof the statements in the paper Frougny et al. (2004) use it.
We give a linear time algorithm which, given a simply connected figure of the plane divided into cells, whose boundary is crossed by some colored inputs and outputs, produces non-intersecting directed flow lines which match inputs and outputs according to the colors, in such a way that each edge of any cell is crossed by at most one line. The main tool is the notion of height function, previously introduced for tilings. It appears as an extension of the notion of potential of a flow in a planar graph.
Defeasible logic is a rule-based nonmonotonic logic, with both strict and defeasible rules, and a priority relation on rules. We show that inference in the propositional form of the logic can be performed in linear time. This contrasts markedly with most other propositional nonmonotonic logics, in which inference is intractable.
As an invited contributor to this Festschrift honoring Alain Colmerauer, I feel compelled to give not only an account of his main research contributions, but also of my perspective on the motivations behind them. I hope that this will provide the reader with a glimpse of how a focused, tenacious, rigorous, and inventive mind like Alain's picks research problems and proceeds to solve them. The history of Prolog, the language that remains one of Alain's major accomplishments, is well documented. His paper on the ‘Birth of Prolog,’ co-authored with Philippe Roussel (Colmerauer & Roussel, 1970), is a highly recommended account of the circumstances that led to the development of Prolog. Bob Kowalski (1988) presents his views of the early history of Prolog from the automatic theorem proving perspective. Finally, my own paper on the topic (Cohen, 1988) contains material complementing Alain's and Bob's narratives. Instead of recasting already-available historical material, I have opted to present here a more personal account of Alain's contributions, acknowledging in advance the individual bias inherent in such an accounting of long-past events.
We present a prescriptive type system with parametric polymorphism and subtyping for constraint logic programs. The aim of this type system is to detect programming errors statically. It introduces a type discipline for constraint logic programs and modules, while maintaining the capabilities of performing the usual coercions between constraint domains, and of typing meta-programming predicates, thanks to the exibility of subtyping. The property of subject reduction expresses the consistency of a prescriptive type system w.r.t. the execution model: if a program is ‘well-typed’, then all derivations starting from a ‘well-typed’ goal are again ‘well-typed’. That property is proved w.r.t. the abstract execution model of constraint programming which proceeds by accumulation of constraints only, and w.r.t. an enriched execution model with type constraints for substitutions. We describe our implementation of the system for type checking and type inference. We report our experimental results on type checking ISO-Prolog, the (constraint) libraries of Sicstus Prolog and other Prolog programs.
We study here a natural situation when constraint programming can be entirely reduced to rule-based programming. To this end we explain first how one can compute on constraint satisfaction problems using rules represented by simple first-order formulas. Then we consider constraint satisfaction problems that are based on predefined, explicitly given constraints. To solve them we first derive rules from these explicitly given constraints and limit the computation process to a repeated application of these rules, combined with labeling. We consider two types of rule here. The first type, that we call equality rules, leads to a new notion of local consistency, called rule consistency that turns out to be weaker than arc consistency for constraints of arbitrary arity (called hyper-arc consistency in Marriott & Stuckey (1998)). For Boolean constraints rule consistency coincides with the closure under the well-known propagation rules for Boolean constraints. The second type of rules, that we call membership rules, yields a rule-based characterization of arc consistency. To show feasibility of this rule-based approach to constraint programming, we show how both types of rules can be automatically generated, as CHR rules of Frühwirth (1995). This yields an implementation of this approach to programming by means of constraint logic programming. We illustrate the usefulness of this approach to constraint programming by discussing various examples, including Boolean constraints, two typical examples of many valued logics, constraints dealing with Waltz's language for describing polyhedral scenes, and Allen's qualitative approach to temporal logic.
We consider a simple extension of logic programming where variables may range over goals and goals may be arguments of predicates. In this language we can write logic programs which use goals as data. We give practical evidence that, by exploiting this capability when transforming programs, we can improve program efficiency. We propose a set of program transformation rules which extend the familiar unfolding and folding rules and allow us to manipulate clauses with goals which occur as arguments of predicates. In order to prove the correctness of these transformation rules, we formally define the operational semantics of our extended logic programming language. This semantics is a simple variant of LD-resolution. When suitable conditions are satisfied this semantics agrees with LD-resolution and, thus, the programs written in our extended language can be run by ordinary Prolog systems. Our transformation rules are shown to preserve the operational semantics and termination.
Context-sensitive rewriting is a computational restriction of term rewriting used to model non-strict (lazy) evaluation in functional programming. The goal of this paper is the study and development of techniques to analyze the termination behavior of context-sensitive rewrite systems. For that purpose, several methods have been proposed in the literature which transform context-sensitive rewrite systems into ordinary rewrite systems such that termination of the transformed ordinary system implies termination of the original context-sensitive system. In this way, the huge variety of existing techniques for termination analysis of ordinary rewriting can be used for context-sensitive rewriting, too. We analyze the existing transformation techniques for proving termination of context-sensitive rewriting and we suggest two new transformations. Our first method is simple, sound, and more powerful than the previously proposed transformations. However, it is not complete, i.e., there are terminating context-sensitive rewrite systems that are transformed into non-terminating term rewrite systems. The second method that we present in this paper is both sound and complete. All these observations also hold for rewriting modulo associativity and commutativity.
Abductive logic programming offers a formalism to declaratively express and solve problems in areas such as diagnosis, planning, belief revision and hypothetical reasoning. Tabled logic programming offers a computational mechanism that provides a level of declarativity superior to that of Prolog, and which has supported successful applications in fields such as parsing, program analysis, and model checking. In this paper we show how to use tabled logic programming to evaluate queries to abductive frameworks with integrity constraints when these frameworks contain both default and explicit negation. The result is the ability to compute abduction over well-founded semantics with explicit negation and answer sets. Our approach consists of a transformation and an evaluation method. The transformation adjoins to each objective literal $O$ in a program, an objective literal $\hbox{\it not}(O)$ along with rules that ensure that $\hbox{\it not}(O)$ will be true if and only if $O$ is false. We call the resulting program a dual program. The evaluation method, ABDUAL, then operates on the dual program. ABDUAL is sound and complete for evaluating queries to abductive frameworks whose entailment method is based on either the well-founded semantics with explicit negation, or on answer sets. Further, ABDUAL is asymptotically as efficient as any known method for either class of problems. In addition, when abduction is not desired, ABDUAL operating on a dual program provides a novel tabling method for evaluating queries to ground extended programs whose complexity and termination properties are similar to those of the best tabling methods for the well-founded semantics. A publicly available meta-interpreter has been developed for ABDUAL using the XSB system.
Twenty years ago Abelson and Sussman's Structure and Interpretation of Computer Programs radically changed the intellectual landscape of introductory computing courses. Instead of teaching some currently fashionable programming language, it employed Scheme and functional programming to teach important ideas. Introductory courses based on the book showed up around the world and made Scheme and functional programming popular. Unfortunately, these courses quickly disappeared again due to shortcomings of the book and the whimsies of Scheme. Worse, the experiment left people with a bad impression of Scheme and functional programming in general. In this pearl, we propose an alternative role for functional programming in the first-year curriculum. Specifically, we present a framework for discussing the first-year curriculum and, based on it, the design rationale for our book and course, dubbed How to Design Programs. The approach emphasizes the systematic design of programs. Experience shows that it works extremely well as a preparation for a course on object-oriented programming.