Skip to main content
Top

1998 | Book

Exploring Computer Science with Scheme

Author: Oliver Grillmeyer

Publisher: Springer New York

Book Series : Undergraduate Texts in Computer Science

insite
SEARCH

About this book

The aim of this textbook is to present the central and basic concepts, techniques, and tools of computer science. The emphasis is on presenting a problem-solving approach and on providing a survey of all of the most important topics covered in computer science degree programmes. Scheme is used throughout as the programming language and the author stresses a functional programming approach which concentrates on the creation of simple functions that are composed to obtain the desired programming goal. Such simple functions are easily tested individually. This greatly helps in producing programs that work right first time. Throughout, the author presents techniques to aid in the writing of programs and makes liberal use of boxes which present "Mistakes to Avoid." Many programming examples are discussed in detail which illustrate general approaches to programming. These include: * abstracting a problem; * creating pseudo code as an intermediate solution; * top-down and bottom-up design; * building procedural and data abstractions; * writing progams in modules which are easily testable. Numerous exercises help the readers test their understanding of the material and develop some ideas in greater depth. As a result this text will make an ideal first course for all students coming to computer science for the first time.

Table of Contents

Frontmatter
Chapter 1. Introduction to Computer Science
Abstract
A computer can be defined as a machine capable of performing a set of well-defined functions. Modern computers are electronic devices. However, the first computing devices were mechanical in nature! If s the particular set of functions that the computer performs that separates it from microwave ovens or stereos, which are also electronic devices that perform well-defined functions.
Oliver Grillmeyer
Chapter 2. Problem Solving and Problem Abstraction
Abstract
People spend a great deal of time solving problems, often without consciously thinking about them. For example, when you go grocery shopping, you may encounter and solve a number of problems without paying attention to them. You might be looking for cream of asparagus soup. You have techniques that you use to find this particular flavor of soup. You probably don’t look for it among the frozen pizzas. You may ask someone where it can be found to narrow your search. You might ask, “Where is the cream of asparagus soup?” and be told, “The soups are on aisle four,” in which case you would go there and search among the soups. You probably wouldn’t respond with, “That’s fine, but I want to know where the cream of asparagus soup is!”
Oliver Grillmeyer
Chapter 3. Programming the Computer
Abstract
At this point we begin to use a real programming language to perform tasks and solve problems. The programming language used is Scheme, which is a dialect of LISP. Lisp is an acronym for LISt Processing. We will define what a list is and how Scheme goes about processing lists in Chapter 4.
Oliver Grillmeyer
Chapter 4. Lists: The Basic Data Structure
Abstract
Information stored within a computer system is called data. The types of data we have seen are numbers and symbols. Collectively, these are called atoms.
Oliver Grillmeyer
Chapter 5. Conditionals
Abstract
In addition to operations performed upon numbers, symbols, and lists, Scheme has control operations. Recall from Chapter 1 that control operations are an important element that separates computers from simpler computational devices. Control operations allow decisions to be made. Different actions are taken based on the given conditions. Lef s look at how Scheme handles control.
Oliver Grillmeyer
Chapter 6. Repetition Through Recursion
Abstract
There are times when a sequence of actions should be repeated. We may want to apply a function to all the elements of a list. We may want to add the first twenty numbers in a list. We may want to return the first symbol in a list. To carry out such actions the technique of recursion can be used. It is essential to master recursion, as it is commonly used in Scheme programming. There are different types of recursion that we will explore individually. The important thing is not to just memorize the general form for each type of recursion illustrated, but to get a thorough understanding of the process of writing recursive functions. Recursion is a skill that you improve on with practice. Use the examples to guide you, then practice, practice, practice.
Oliver Grillmeyer
Chapter 7. Data Structures
Abstract
We have looked at Scheme’s most common data structure, the list. We have seen how ordered lists and hierarchies can be represented. The focus in this chapter is on using data structures like these and other more abstract data structures in programs.
Oliver Grillmeyer
Chapter 8. Functionals
Abstract
In Scheme, functions can be passed as arguments to other functions, in the same fashion that data values like lists and atoms are passed. This enables different actions to be carried out depending on the function passed. Functions that take functions as arguments are called junctionals. Another term for these functions is applicative operators.
Oliver Grillmeyer
Chapter 9. Input and Output
Abstract
Information going from the user to the computer is called input, and information from the computer to the user is output. We have used the default form of input/output (often abbreviated as I/O) in Scheme. Input is a product of the interpreter reading in our requests at the > prompt. Output is the results of evaluating our input Scheme expressions that the interpreter prints out.
Oliver Grillmeyer
Chapter 10. Repetition Through Iteration
Abstract
Iteration is a type of repetition that, like recursion, involves repeating a task a certain number of times, or for every element in a list, or more generally until some condition is met. Iterative functions provide a means of carrying out these commonly performed tasks without having to explicitly create recursive functions. In general, any linear recursive function (a function with a single recursive call in each of its recursive cases) can be written using an iterative function. Most of the examples in this chapter are iterative versions of the functions written using recursion in Chapter 6. You should compare the iterative solutions to their recursive counterparts and decide which seems more natural to you.
Oliver Grillmeyer
Chapter 11. Advanced Uses of Functions
Abstract
There are three legal ways to specify parameters in a function definition. We have used the simplest method in which each parameter is given a unique name that matches directly with an argument when the function is called. These functions must be called with a fixed number of arguments. We can create functions that take a variable number of arguments. This is done by specifying one parameter after the function name and a period (making a function heading that looks like a dotted list). When the function is called, the arguments will be in a list that is bound to the single parameter.
Oliver Grillmeyer
Chapter 12. Database Management Systems
Abstract
A database is a collection of information, such as facts about countries, statistics on demographics, a store’s inventory, and phone lists. A database system allows one to access, insert, delete, and modify information stored within a computer system. The term computer system is used as opposed to computer because external memory may be needed. Database systems often require large amounts of memory that greatly exceed the storage capacities of the computer’s main memory. The database management system (DBMS) performs operations on the information stored within a database. The DBMS is a program that contains a query language that allows database updates and retrievals. A DBMS can be viewed as a layer or abstraction built upon the computer system.
Oliver Grillmeyer
Chapter 13. Compilers and Interpreters
Abstract
A compiler is a program that translates statements in one language into equivalent statements in another language. Typically, compilers translate programs written in a high-level language into programs that perform that same task in machine language. These machine-language programs can then be run on the computer. A cross-compiler produces machine language that is to be run on a different machine than the one on which the compiler runs. This is helpful when the computer for which the machine language is being produced is not readily available (e.g., a developmental machine).
Oliver Grillmeyer
Chapter 14. Operating Systems
Abstract
The operating system serves a number of functions in a computer system. It acts as an abstraction level between the hardware and the software to facilitate access to programs existing in the computer system. The operation system provides a simpler means of dealing with the resources that programs must use such as memory, printers, and input and output (I/O) devices (terminals, keyboards, and mouse). The operating system handles the information stored within the computer system; this information is typically maintained as a file system. The operating system takes care of the computer system memory, handling its distribution to programs running on the computer, and protection such that one program cannot corrupt another program. The operating system manages the programs running on the computer system to best utilize the resources of the computer; this is called process management. Each of these areas is discussed in more depth below. However, to better understand the workings of an operating system, it is important to understand the different pieces composing a computer system.
Oliver Grillmeyer
Chapter 15. Artificial Intelligence
Abstract
Artificial intelligence is perhaps the most talked about field within computer science. This is not due to the number of researchers or proponents within the field, or to number of accomplishments. Artificial intelligence, or AI as it is usually referred to, is so popular because it is the most controversial field within computer science. AI is threatening to some people and exciting to others. Some say it is an idea that is a few years away from becoming reality, while others say it will never be a possibility. Some say ifs hip; others, hype. How can one field elicit such disparate beliefs? The answer lies in what AI attempts to do.
Oliver Grillmeyer
Chapter 16. Soft Computing: Fuzzy Logic, Neural Networks, and Genetic Algorithms
Abstract
Soft computing is a relatively new field within computer science. It is a conglomeration of fuzzy logic, neural networks, and probabilistic reasoning. Probabilistic reasoning is further divided into belief networks, genetic algorithms, and chaos theory. What all of these subfields share is an adherence to nonexact computation. Up until now, we have been using formal Boolean logic, which says that something is either true or false, yes or no, black or white. There are no shades of gray with this type of logic.
Oliver Grillmeyer
Backmatter
Metadata
Title
Exploring Computer Science with Scheme
Author
Oliver Grillmeyer
Copyright Year
1998
Publisher
Springer New York
Electronic ISBN
978-1-4757-2937-5
Print ISBN
978-1-4419-2855-9
DOI
https://doi.org/10.1007/978-1-4757-2937-5