Logic and Language Models for Computer Science
eBook - ePub

Logic and Language Models for Computer Science

Dana Richards, Henry Hamburger;;;

Share book
  1. 468 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Logic and Language Models for Computer Science

Dana Richards, Henry Hamburger;;;

Book details
Book preview
Table of contents
Citations

About This Book

-->

This text presents the formal concepts underlying Computer Science.

It starts with a wide introduction to Logic with an emphasis on reasoning and proof, with chapters on Program Verification and Prolog.

The treatment of computability with Automata and Formal Languages stands out in several ways:

-->

  • it emphasizes the algorithmic nature of the proofs and the reliance on simulations;
  • it stresses the centrality of nondeterminism in generative models and the relationship to deterministic recognition models

-->

The style is appropriate for both undergraduate and graduate classes.

--> Contents:

    • Mathematical Preliminaries
  • Logic for Computer Science:
    • Propositional Logic
    • Proofs by Deduction
    • Predicate Logic
    • Proving with Predicates
    • Program Verification
  • Language Models for Computer Science:
    • Language and Models
    • Generative Models of Regular Languages
    • Finite Automata and Regular Languages
    • Context-Free Grammars
    • Pushdown Automata and Parsing
    • Turing Machines
  • Appendices:
    • Logic Programming
    • The awk Language
    • Answers to Selected Problems

-->
--> Readership: Students and professionals interested in theoretical computation and language models for computer science. -->
Keywords:Theory of Computation;Logic Automata Theory;Formal LanguagesReview: Key Features:

  • The emphasis is on Logic. Logic is described in the context of reasoning (not circuits) with a concentration on proof techniques. The discussion entails a chapter on Program Verification and a chapter on Prolog programming
  • There is a forthright treatment of non-determinism. Non-determinism is fundamental to generative techniques, like grammatical models and recursively defined constructs such as regular expressions, and are integral to machine models of context-free languages
  • The treatment of constructive proofs (in particular, simulation-based proofs of computability) are cast in explicit algorithmic notation, which is familiar to the Computer Science student

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Logic and Language Models for Computer Science an online PDF/ePUB?
Yes, you can access Logic and Language Models for Computer Science by Dana Richards, Henry Hamburger;;; in PDF and/or ePUB format, as well as other popular books in Computer Science & Natural Language Processing. We have over one million books available in our catalogue for you to explore.

Information

Publisher
WSPC
Year
2017
ISBN
9789813229228
Edition
3

Chapter 1

Mathematical Preliminaries

This text is concerned with formal models that are important to the field of computer science. Because the models are formal, we will make substantial use of mathematical ideas. In many ways the topics in this book — logic, languages and automata — are a natural extension of a Discrete Mathematics course, which is generally required for Computer Science majors. This text steers clear of excessive mathematical notation, focusing instead on fundamental ideas and their application. However it is impossible to appreciate the power that comes from the rigorous methods and models in this book without a background in Discrete Mathematics. This chapter is a brief overview of the needed mathematical background and may be useful for self-evaluation, review and reference.

1.1Sets and Sequences

A set is a unordered collection of distinct elements. The elements are typically thought of as objects such as integers, people, books, or classrooms, and are written within braces, like this: {Friday, Saturday, Sunday}. When working with sets, it can be important to specify U, the universe of elements (e.g., the set of days of the week) from which the elements of particular sets are drawn. Note that the universe itself is a set: the set of all elements of a given type.
Sometimes the universe is only implicitly specified, when the reader can easily figure out what it is. The elements are said to be in the set and are called its members.
Sets can be presented in two forms. The extensional form enumerates the elements of the set, while the intensional form specifies the properties of the elements. For example:
images
are extensional and intensional forms of the same set. The second of these is read “those x such that x is an integer and … ” Note that the universe, the set of integers, is implicit in the first example and only informally specified in the second. The empty set is a set with no element and is denoted
images
.
Because the elements of a set are distinct, you should write sets with no repetition. For example, suppose a student database includes countries of origin and that it shows the participants in a seminar as being from China, France, China, Egypt and France. Then the set of countries represented in this class is {China, France, Egypt}. There is no concept of ordering within a set; there is no “first” element, etc. For example, the sets {4, 2, 3} and {2, 3, 4} are the same set.
If ordering is important then one speaks of a sequence of elements. In the extensional form of a sequence the elements appear in order, within parentheses, not braces. For example, the sequence (4, 2, 3) is different from (2, 3, 4). Further, sequences need not have distinct elements, so the sequence (2, 3, 3, 4) is different from (2, 3, 4). A sequence of length 2 is called an ordered pair. A sequence of length 3, 4 or 5 is called a triple, quadruple or quintuple respectively; in the general case of length n, the word is n-tuple. Sequences are often implemented as one-dimensional arrays or as linked lists. This leads to an intensional form for sequences, where we use subscripts, so that the extensional notation, like (x1, x2, x3), can replaced with a direct definition of xi, for each i.
The cross-product of S1 and S2, denoted S1 × S2, is the set of ordered pairs of elements in which the first is in S1 and the second is in S2.
Formally,
images
For example, {a, b} × {c, d, e} = {(a, c), (a, d), (a, e), (b, c), (b, d), (b, e)}. Just as the elements of S1 × S2 are ordered pairs, the elements of S1 × S2 × S3 are triples, and so on.
Set operators are discussed later, but we start with two basic ideas, the notions of membership and comparison. The notation x
images
S means that x is an element of the set S, while x
images
S means that x is not in S. When S = {11, 12, 13, 14}, 12
images
S and 16
images
S. We say that S1 is a subset of S2, written S1
images
S2, if each element of S1 is also an element of S2. For example, {12, 14}
images
{11, 12, 13, 14}. Note that S
images
S. Now consider subset T, that is not equal to S, because it is missing one or more elements of S. While it is correct to write T
images
S we may choose to write T
images
S, which states that T is a proper subset of S. The empty set is a subset of any set, so we can write
images
images
S, for any set S.

1.2Relations and Functions

A binary relation is a set of ordered pairs. More formally, a relation R from the set S1 to the set S2 is a subset of the cross-product of those sets, R
images
S1 × S2. For example, if E is a set of employees and P is a set of projects, we can specify a relation R between...

Table of contents