Home > Store

Logic and Language Models for Computer Science

Register your product to gain access to bonus material or receive a coupon.

Logic and Language Models for Computer Science

Book

  • Sorry, this book is no longer in print.
Not for Sale

About

Features

  • Two-part presentation—Integrates logic and formal language.
    • Enables students to focus on propositional and predicate logic and formal models of language—both with applications.

  • Computer science applications of theory—Includes compilers; databases; verification; and artificial intelligence.
    • Engages students in abstract conceptual material that will actually help them as computer scientists.

  • Entire chapters devoted to the use of logic in proofs and in program correctness.
    • Helps students understand the usefulness of theory.

  • Detailed treatment of Lex and Prolog.
    • Introduces students to important programming languages based on the two major topics of this book—thereby emphasizing their value.

  • Over 150 worked-out examples—Many are application oriented.
    • Helps students understand the usefulness and applicability of theory and mathematical reasoning to their chosen field of study.

  • More than 200 manageable exercises—Answer book available to instructors (upon request).
  • Diagrammatic approach to automata.
    • Aids student comprehension of abstract theories.

  • Proofs: Why and How.
    • Instills appreciation of rigorous argumentation and helps students achieve it.

  • Chapter introductions.
    • Alerts students to key concepts and motivates them to achieve their learning goals.

Description

  • Copyright 2002
  • Edition: 1st
  • Book
  • ISBN-10: 0-13-065487-6
  • ISBN-13: 978-0-13-065487-8

This book invites the reader to explore abstractions that are crucial to computer science. The authors bring a sense of excitement to logics, formal languages and automata—motivating topics by linking them to computing and to computational applications, sometime with whole chapters. They achieve exceptional clarity through a plethora of examples and figures, yet without-losing sight of, and indeed celebrating, the precision that is the hallmark of this subject matter.

Features of the book include:
  • application of logic to program verification
  • programming in the logic language, Prolog
  • discussion of "why" and "how" to prove things
  • relationships between English and programming languages
  • diagrams-first approach to automata
  • lex as a tool and an extension of formal language
  • pushdown automata as parsing strategies
  • Turing machines as models of computation

Sample Content

Table of Contents



1. Mathematical Preliminaries.

Operators and Their Algebraic Properties. Sets. Strings. Relations and Functions. Growth Rates of Functions. Graphs and Trees. Computing with Mathematical Objects.

I. LOGIC FOR COMPUTER SCIENCE.

2. Propositional Logic.

Propositions. States, Operators, and Truth Tables. Proofs of Equivalence with Truth Tables. Laws of Propositional Logic. Two Important Operators.

3. Proving Things: Why and How.

Reasons for Wanting to Prove Things. Rules of Inference. Proof by Rules. Assumptions. Proof Examples. Types of Theorems and Proof Strategies.

4. Predicate Logic.

Predicates and Functions. Predicates, English, and Sets. Quantifiers. Multiple Quantifiers. Logic for Data Structures.

5. Proving with Predicates.

Inference Rules with Predicates. Proof Strategies with Predicates. Applying logic to Mathematics. Mathematical Induction. Limits of Logic.

6. Program Verification.

The Idea of Verification. Definitions. Inference Rules. Loop Invariants. The Debate About formal Verification.

7. Logic Programming.

The Essence of Prolog and Its Relation to Logic. Getting Started Using Prolog. Database Operations in Prolog. The General Form and a Limitation of Prolog. How Prolog Works. Structures. Lists and Recursion. Built-in Predicates and Operators.

II. LANGUAGE MODELS FOR COMPUTER SCIENCE.

8. Language Models.

Programming Languages and Computer Science. Ambiguity and language Design. Formal Languages. Operations on Languages. Two levels and Two Language Classes. The Questions of Formal Language Theory.

9. Finite Automata and Their Languages.

Automata: The General Idea. Diagrams and Recognition. Formal Notation for Finite Automata. Finite Automata in Prolog. Nondeterminism: The General Idea. Nondeterministic Finite Automata. Removing Nondeterminism. A-Transistions. Pattern Matching. Regular Languages.

10. Regular Expressions.

Regular Sets. Regular Expressions and What They Represent. All Regular sets Are FA Languages. All FA languages Are Represented by Res.

11. Lex: A Tool for Building Lexical Scanners.

Overview. Lex Operators and What They Do. The Structure and processing of Lex Programs. Lex Examples with C. States. Using Lex in Unix. Flex and C++.

12. Context-Free Grammars.

Limitations of Regular Languages. Introduction to Context-Free Grammars. RE Operators in CFGs. Structure, Meaning, and Ambiguity. Backus Normal form and Syntax Diagrams. Theory Matters.

13. Pushdown Automata and Parsing.

Visualizing PDAs. Standard Notation for PDAs. NPDAs for CFG Parsing Strategies. Deterministic Pushdown Automata and Parsing. Bottom-Up Parsing. Pushdown Automata in Prolog. Notes on Memory.

14. Turing Machines.

Beyond Context-Free Languages. A Limitation on Deterministic Pushdown Automata. Unrestricted Grammars. The Turing Machine Model. Infinite Sets. Universal Turing Machines. Limits on Turing Machines. Undecidability. Church-Turing Thesis. Computational Complexity.

Index.

Preface

So you are a computer science (CS) major and you are sitting down to see what this book is about. It has been assigned, the course is required, you have no choice. Still you chose your institution, your major. Maybe your instructor made a good choice. Let's hope so.

Okay, you are not a computer science major, perhaps not even a student, but you have picked up this book. Maybe the title intrigued you. Will you be able to read it, to learn from it? We think so. We will try to interest you too.

Or you are teaching a course that might use this book, maybe in discrete math, maybe including logics or formal language or both. If you want your CS students to see the applicability of mathematical reasoning to their own field or your math students to see the usefulness of their field outside itself, it is your students whom we have in mind.

If you are a CS major, you have already noticed that this course is different from the others you have taken so far. It is not an introduction to computing, programming, problem solving, or data structures. No, this book is about something called models—models of language and knowledge. It is also about formal methods.

You know something about models if you have built or seen a model airplane. In Kitty Hawk, North Carolina, you can see the wind tunnel that the Wright brothers built to test the lift capabilities of various wing shapes. A model can help us simplify and think more clearly about a complex problem (powered flight) by selecting a part (the wing) and focusing on some aspect of it (its aerodynamics). The other, temporarily ignored parts and aspects must ultimately be addressed, of course, if the original problem is to be solved.

The models in this book are simplifications too, but not of material objects like airplanes. For computer scientists, the objects of study lie mainly in the world of symbols. In this book, it is computer software, and especially the programming languages in which that software is written, from which we draw our models and to which we apply them.

A model, then, is a collection of precisely stated interacting ideas that focus on a particular aspect or part of our subject matter. A good model can simplify a topic to its essence, stripping away the details so that we can understand the topic better and reason precisely about it. The model keeps only those parts and processes that are of interest.

We reason both formally and informally. Informal methods draw on analogies to your knowledge of other things in the world in general and your common sense, typically expressed in a human language like English and perhaps a diagram. Formal methods use abstract symbols—like the famous "x" of high school algebra—and clearly stated rules about how to manipulate them. A formal method based on a simple but precise model of a situation can enable us to prove that we have got things right at least as reflected in the model.

If this concern with precision and proof makes you think this is a theory book, you are partly right. If you think that means it is not of practical value, we ask you to think again. It is often said that experience is the best teacher. However, learning from experience means transferring ideas across situations by seeing the essential similarities in nonidentical situations. This abstracted essence, by which we learn from history or from our mistakes, is an informal model. Formalizing the model and reasoning carefully about it—that is, theory—is the scientist's and engineer's path to knowledge and action in the real world.

So what do we theorize about? We have chosen to focus on language, the crucial link between hardware and software. Programming languages permit software to be written and language processors—compilers, interpreters and assemblers—permit hardware to run that software. Sometimes a model proves to be so interesting and widely applicable that it becomes an object of study in its own right. That is the case with the logic and language models in this book.

Two key aspects of language are structure and meaning. We study models of each. The structure of language has to do with the arrangement of symbols into permitted sequences—called sentences in human language and statements in programming languages. This topic is usually called formal models of language. It underlies key aspects of compilers, the study of what computers can do efficiently and the processing of human language for translation and easy interaction between people and computers.

Symbol arrangements are of interest not only in their own right, but also because they express ideas about meaning and computation. Expressing meaning can be done in various ways, including logic. Of the many logics, the simplest is propositional logic. It finds application-in the tiny hardware components called logic gates, in the conditions for branching and loops in high-level programming languages and in mathematical rules of proof that can be applied via software throughout engineering and science. Predicate logic builds on propositional logic to permit knowledge representation in database systems, artificial intelligence, and work on program correctness in software engineering.

Computer science students may notice that several phrases in the prior paragraphs are the names of upper division courses in computer science. To further emphasize the practical value of the two major topics of this book, we introduce an important programming language based on each. Lex, based on formal language, is a tool for building a lexical scanner—a key component of a compiler. Prolog, a programming language whose core is based on predicate logic, supports rapid prototyping of intelligent systems.

Formalisms for language and logic have ancient roots: India for language and Greece for logic. Each field has enjoyed renewed attention in more recent times, starting in the nineteenth century for logic and early in the twentieth century for language. These latter thrusts are more formal yet still independent of computing. The venerable histories of logic and linguistics suggest the inherent fascination that each has held for human minds. Building on that motivation, this book stresses the relationship of each to computer science. The two fields are also related to each other in various ways that emerge in this text. Watch for these important links among logic, formal language, and computing.

  • Complementarity: Logic and formal language share the job of modeling, with logic providing models of meaning and formal language paying attention to form.
  • Recursion: In logic, formal language and elsewhere, recursive definitions provide a finite means to specify expressions of unlimited size.
  • Proofs: Logic supports proofs of results throughout formal language, mathematics, and computer science, notably in the area of program verification.
  • Correspondences: Language categories defined by grammar types are in direct correspondence to the recognition capabilities of types of automata (models of computing).
  • Compiling: Design strategies for some (pushdown) automata reflect language processing techniques for compilers. Concepts of formal languages and automata directly support compiler tools.
  • Computation: Another class of automata (Turing machines) provides an apparently correct characterization of the limits of computing.
  • Programming: Logic-based languages such as Prolog support the declarative style of programming. Prolog in turn is used to implement some automata and database concepts.

H. HAMBURGER
D. RICHARDS

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020