Sie sind auf Seite 1von 14

FIRST SEMESTER 2019-20

COURSE HANDOUT

In addition to part-I (General Handout for all courses appended to the time table) this portion gives
further specific details regarding the course

Course No. : CS / IS F214


Course Title : Logic in Computer Science

Instructor-in-Charge: Rajesh Kumar (email: rajesh.k)


Instructors:
Rajesh Kumar
Jagat Seth

Tutorials:
Rajesh Kumar
Jagat Seth
Sadhana Jha

Course Website: Check Nalanda

1. Scope and Objective:

The objective of this course is to introduce the formal study of Logic for Computer Science
undergraduates. Within this context the course covers first order propositional and predicate
logics and briefly touches upon temporal logics. Natural Deduction as a proof system for
propositional and predicate logics is covered. Soundness and Correctness proofs are also covered
but only for propositional logic. It also covers some applications in modeling and reasoning about
programs - in particular, model checking based on LTL and program verification using Floyd-Hoare
logic. The relationship between formal logic and pragmatics of computing is highlighted via a few
specialized topics: the satisfiability problem in propositional logic and Horn-clause problem
solving.

2. Text Book:
T1: Michael Huth and Mark Ryan. Logic in Computer Science – Modelling and Reasoning
about Systems. Cambridge University Press. 2nd Edition. 2004.

Birla Institute of Technology & Science, Pilani Tel: +91 1596 245073
Pilani Campus, Vidya Vihar Fax: +91 1596 244183
Pilani 333031, Rajasthan, India Web: www.pilani.bits-pilani.ac.in
3. Course Plan:

3.a. Modules

Module Topics
#

I Introduction to Logics and Proofs. Overview of the interplay of Logic and Computing.

II Propositional Logic: Natural Deduction, Syntax and Semantics, Soundness and


Completeness, Satisfiability.

III Predicate Logic: Syntax and Semantics, Logic Programming, Natural Deduction

IV Temporal Logic: LTL and Model Checking

V Program Verification: Floyd-Hoare Logic – Pre-conditions, Post-conditions, and Loop


Invariants.

3. b. Lecture Schedule:

Lecture Module Topic Learning Outcome(s) Reading


#
#
[The student will be able to: ]

L1 I.a Why study Logic?  state a few reasons to study logics -


Liar paradox, Berry paradox, and proofs
Application of logic in CS
L2 I.b A broad and selective history of Logic  state typical issues and debates in -
and Proofs in the last century: Hilbert’s formalizing proofs (and
Program and the Formalization mathematical arguments in general)
problem.

L2 I.c Logic and Computing: Halting  state soundness and completeness -


problem, Proof by contradiction, requirements of proof systems and
Godel, Church, and Turing:  explain – at a high level – the
Computability – Systems for defining implications of Godel’s
computability; Church-Turing Thesis. incompleteness results

Birla Institute of Technology & Science, Pilani Tel: +91 1596 245073
Pilani Campus, Vidya Vihar Fax: +91 1596 244183
Pilani 333031, Rajasthan, India Web: www.pilani.bits-pilani.ac.in
L3 I.d Soundness and completeness  Informally define the notion of -
Godel’s Incompleteness Result and “computability”
its impact on the formalization of  state the equivalence of schemes /
mathematics, Proof systems mechanisms for computability
L4 1.e Time complexity, Complexity  define complexity class P -
classes, Is P=NP, Boolean and NP
satisfiability problem  state what it means to say
that P=NP or P=!NP
L5 I.g Informal introduction to logic,  To informally understand the -
Propositions, Connectives, different concepts in propositional
Ambiguous statements, Truth tables logic

L6 II.a Propositional Logic: Natural Deduction  state the notational conventions T1 Sec.
as a Proof System. used in Natural Deduction 1.2.1
L6 II. b Propositional Logic: Natural Deduction:  apply proof rules involving T1 Sec.
Conjunction Rules conjunction 1.2.1
L6 II.c Propositional Logic: Natural Deduction:  apply proof rules involving T1 Sec.
Implication Rules implication 1.2.1
L7 II.d Propositional Logic: Natural Deduction:  apply proof rules involving T1 Sec.
Disjunction Rules disjunction 1.2.1
L7 II.e Propositional Logic: Natural Deduction:  apply proof rules involving negation T1 Sec.
Negation Rules 1.2.1
L7 II.f Propositional Logic: Natural Deduction:  apply proof rules involving double T1 Sec.
Double Negation Rules negation 1.2.1
L7 II.g Propositional Logic: Natural Deduction:  apply modus tollens, LEM, and PbC in T1 Sec.
Derived Rules: Modus Tollens, Law of proofs 1.2.2
Excluded Middle (LEM), Proof by  derive modus tollens, LEM, and PbC
Contradictio (PbC). from basic proof rules
L8 II.h Syntax: Context Free Grammars (CFG):  define CFGs for simple constructs T1 Sec.
Notation and Examples 1.3
L8 II.i Context Free Grammars: Parse Trees:  illustrate and explain the internal T1 Sec.
Examples structure of context-free constructs 1.3
L9 II.j Propositional Logic: Syntax: Well-  state the formal syntax of T1 Sec.
formed-formulas and grammar. propositional logic as a CFG 1.3
L9 II.k Propositional Logic: Syntax: Different  write grammar rules to define the T1 Sec.

Birla Institute of Technology & Science, Pilani Tel: +91 1596 245073
Pilani Campus, Vidya Vihar Fax: +91 1596 244183
Pilani 333031, Rajasthan, India Web: www.pilani.bits-pilani.ac.in
forms of grammar: Precedence and syntax of propositional logic with a 1.3
Order of evaluation: Rules to handle specific order of evaluation
precedence and over-ride precedence
L9 II.l Grammars, Parse Trees and Structural  illustrate the relation between T1 Sec.
Induction – Approach languages and inductive proofs 1.4.2
 explain structural induction as a
proof technique
L10 II.m Structural Induction - Examples  write proofs using structural T1 Sec.
induction 1.4.2
L11 II.p Propositional Logic: Semantics: Truth  interpret sentences in propositional T1 Sec.
Tables, Soundness and Completeness logic 1.4.1
 state the soundness and
completeness results w.r.t.
propositional logic
L11 II.q Propositional Logic: Semantics:  argue or verify the equivalence (or T1 Sec.
Equivalence and Normal Forms the lack of it) of given propositional 1.4.1
formulas
L11 II.q Propositional Logic : Soundness  state soundness arguments in T1 Sec.
general and soundness arguments 1.4.3
for logics in particular
L11 II.r Propositional Logic: Soundness Proof  argue that proofs in propositional T1 Sec.
logic are sound 1.4.3
L12 II.s Propositional Logic: Completeness  state completeness arguments in T1 Sec.
general and completeness 1.4.4
arguments for logics in particular
L12 II.t Propositional Logic: Completeness  state completeness arguments for T1 Sec.
Proof Overview propositional logic 1.4.4
L12 II.u Propositional Logic: Completeness  argue that propositional logic is T1 Sec.
Proof complete using structural induction 1.4.4

Birla Institute of Technology & Science, Pilani Tel: +91 1596 245073
Pilani Campus, Vidya Vihar Fax: +91 1596 244183
Pilani 333031, Rajasthan, India Web: www.pilani.bits-pilani.ac.in
L13 II.v Propositional Logic: Conjunctive  recognize propositional formulas T1 Sec.
Normal Form (CNF) and in CNF / DNF 1.5.2
Disjunctive Normal Form (DNF)  rewrite propositional formulas in
CNF / DNF
L13 II.w Propositional Logic: Validity  verify whether a propositional T1 Sec.
formula is valid or not 1.5.1

L13 II.x Propositional Logic: Validity of  verify validity of a formula in CNF T1 Sec.
specific forms, Algorithm(s) for  write a program to verify validity 1.5.1
validity of a formula in CNF

L14 II.y Propositional Logic: Validity and  verify whether a propositional T1 Sec.
Satisifiability formula is satisfiable or not 1.5.1
 state the relation between validity
and satisifiability of propositional
formulas
L14 II.z Propositional Logic: Horn Clauses  distinguish Horn formulas from T1 Sec.
and Horn Formulas general formulas in propositional 1.5.3
logic
 identify when a propositional
formula can be rewritten in Horn
form
L14 II.aa Propositional Logic: Satisifiability  verify whether a Horn formula is T1 Sec.
of Horn Formulas satisfiable or not 1.5.3

L14 II.ab Propositional Logic: Algorithm for  write a program to verify validity T1 Sec.
Satisfiability of Horn Formulas of a Horn formula 1.5.3

L15 III.a Expressiveness of Propositional  illustrate statements and T1 Sec.


Logic – Limitations: Need for arguments that cannot be 2.1
predicates expressed in propositional logic
 explain why predicates are more
expressive than propositions
L16 III.b Expressiveness of Propositional  illustrate statements that cannot T1 Sec.
Logic – Limitations: Need for be expressed in propositional logic 2.1
variables and quantification  explain how variables and
quantification add expressive
power

Birla Institute of Technology & Science, Pilani Tel: +91 1596 245073
Pilani Campus, Vidya Vihar Fax: +91 1596 244183
Pilani 333031, Rajasthan, India Web: www.pilani.bits-pilani.ac.in
L16 III.c Introduction to Predicate Logic:  distinguish between predicates T1 Sec.
Predicates vs. Functions and and functions 2.1
Need for Function Terms  explain when function terms are
more expressive than predicates
L16 III.d Predicate Logic: Features  write formulas in predicate logic T1 Sec.
2.2

L17 III.e Predicate Logic: Theorem  explain how proofs in predicate -


Proving: Proof Steps; Automating logic can be approached.
the proof steps.  state issues in automating proofs
steps
L18 III.f Horn Clause Programming:  identify Horn Clauses -
Theorem Proving and Logic  explain the relation between
Programming, Programming with Theorem Proving and Logic
Horn Clauses Programming
 state how Horn Clauses can be
used for programming
L18 III.g Logic Programming and Prolog  perform unification of terms -
Programming: Proof Steps and
Term Unification.

L19 III.h Logic Programming and Prolog  apply search to execute a Prolog -
Programming: Proof Search, program and
Backtracking  explain the use of backtracking in
search
L19 III.i Prolog Programming: Simple  write programs that use search -
Examples and backtracking in Prolog

L20 III.j Prolog Programming: Inductive /  write programs using recursion in -


Recursive definitions Prolog

L20 III.k Prolog Programming: Problem  write reasonably large programs -


Solving in Prolog to solve complex problems using
Prolog
L21 III.l Predicate Logic: Syntax:  write grammar rules for defining T1 Sec.
Grammar terms 2.2.1
 write grammar rules for defining to
formulas in Predicate Logic 2.2.2
 use the grammar rules to parse
formulas in Predicate Logic

Birla Institute of Technology & Science, Pilani Tel: +91 1596 245073
Pilani Campus, Vidya Vihar Fax: +91 1596 244183
Pilani 333031, Rajasthan, India Web: www.pilani.bits-pilani.ac.in
L21 III.m Predicate Logic: Syntax: Free and  identify and distinguish between T1 Sec.
Bound Variables free and bound variables in 2.2.3
Predicate Logic formulas
L21 III.n Predicate Logic: Proofs and Proof  explain / illustrate the need for a T1 Sec.
Rules: Introduction: Need for a substitution operation in applying 2.2
Substitution Operation proof rules of Predicate Logic

L21 III.o Predicate Logic: Substitution:  apply substitution Predicate Logic T1 Sec.
Definition and Examples formulas 2.2.4

L22 III.p Predicate Logic: Proof Rules:  explain the need for rules for T1
Equality equality 2.3.1
 use the rules for equality
L22 III.q Predicate Logic: Natural  apply rules for universal T1 Sec.
Deduction: Rules for Universal quantification in proofs of 2.3.1
Quantification predicate logic formulas

L22 III.r Predicate Logic: Natural  apply rules for existential T1 Sec.
Deduction: Rules for Existential quantification in proofs of 2.3.1
Quantification predicate logic formulas

L23 III.s Predicate Logic: Natural  illustrate and explain the structure T1 Sec.
Deduction: Proofs of natural deduction proofs of 2.3.1
predicate logic formulas

L23 III.t Predicate Logic: Syntactic  deduce equivalences of formulas T1 Sec.


Equivalence in predicate logic 2.3.2

L24 III.u Predicate Logic: Semantics and  describe the semantics of T1 Sec.
Models predicate logic formulas 2.4
 describe what models are
L25 III.v Predicate Logic: Semantics:  Define models for different T1 Sec.
Defining Models – Examples. (example) theories 2.4.1

L26 III.w Predicate Logic: Semantics:  describe the role of models in T1 Sec.
Model Checking proofs 2.4.1

L26 III.x Predicate Logic: Semantics:  illustrate and explain semantic T1 Sec.

Birla Institute of Technology & Science, Pilani Tel: +91 1596 245073
Pilani Campus, Vidya Vihar Fax: +91 1596 244183
Pilani 333031, Rajasthan, India Web: www.pilani.bits-pilani.ac.in
Semantic Entailment entailment in predicate logic 2.4.2

L26 III.y Predicate Logic: Semantics:  state and explain validity and T1 Sec.
Validity and Satisifiability satisfiability in Predicate Logic 2.4.3
 explain and illustrate issues in
verifying satisfiability and validity
of formulas in Predicate Logic
L26 III.z Predicate Logic: Soundness and  state and explain claims regarding -
Completeness Soundness and Completeness of
Predicate Logic

L27 III.aa Predicate Logic: Validity of  state the requirements for -


Formulas; Computing Validity; computing (i.e. verifying) validity
Definition of Computability of a formula in Predicate Logic
 identify issues and the complexity
in verifying validity in Predicate
Logic
L27 III.ab Undecidability and the Halting  state and explain the notion of -
Problem undecidability
 state and explain the Halting
problem.
 Provide a diagonalization proof of
the Halting problem
L28 III.ac Predicate Logic: Validity is  provide an explanation for why T1 Sec.
Undecidable: Proof approach Validity in Predicate Logic is 2.5
using Reduction undecidable using the idea of a
reduction to a known undecidable
problem

L28 III.ad Predicate Logic: Validity is  provide an proof argument for T1 Sec.
Undecidable: Proof sketch using why Validity in Predicate Logic is 2.5
Diagonalization undecidable using diagonalization

L29 III.ae State Machines and Graphs  write state machines for simple T1 Sec.
problems / computations 2.7.1
 define a graph and illustrate
 state the relation between a state
machine and a graph
L29 III.af Predicate Logic: Expressiveness:  provide examples of statements T1 Sec.
that cannot be expressed in First

Birla Institute of Technology & Science, Pilani Tel: +91 1596 245073
Pilani Campus, Vidya Vihar Fax: +91 1596 244183
Pilani 333031, Rajasthan, India Web: www.pilani.bits-pilani.ac.in
Inexpressible Properties: Order Predicate Logic 2.6
Example and Proof.  provide an intuitive argument as
to why such statements are
inexpressible in First Order
Predicate Logic
 provide a rigorous argument as to
why reachability in graphs is
inexpressible in First Order
Predicate Logic
L30 V.c Truth and Time.  provide examples where “time” T1 Sec.
needs to be specified explicitly in 3.1

L31 V.d Modeling Time – Approaches and  provide examples where different T1 Sec.
Examples notions of “time” are explicitly 3.1
used in logical formulas

L31 V.e Linear-time Temporal Logic (LTL)  describe LTL T1 Sec.


- Introduction 3.2

L32 V.f LTL: Syntax: Formulas and Parse  provide examples of formulas in T1 Sec.
Trees LTL 3.2.1
 illustrate internal structure of
formulas in LTL
L32 V.g LTL: Semantics: Transitions  interpret LTL formulas T1 Sec.
3.2.2

L32 V.h LTL: Semantics: Paths  interpret LTL formulas T1 Sec.


3.2.2

L32 V.i LTL: Specifications: Examples  write LTL specifications for T1 Sec.
complex scenarios 3.2.3

L33 V.j Model Checking: Case Study:  define the problem of model T1 Sec.
Problem Statement checking for a particular case 3.3.4 &
3.3.5

Birla Institute of Technology & Science, Pilani Tel: +91 1596 245073
Pilani Campus, Vidya Vihar Fax: +91 1596 244183
Pilani 333031, Rajasthan, India Web: www.pilani.bits-pilani.ac.in
L33 IV.k Model Checking: Case Study:  explain intricacies and issues in T1 Sec.
Modeling approach and Issues model checking 3.3.4 &
3.3.5

L34 IV.b Program Verification: Floyd-  write pre-conditions and post- T1 Sec.
Hoare Logic: Assignment conditions for assignment 4.2.2 &
Statements and Sequencing statements 4.3.1
 compose pre-conditions and post-
conditions over sequential
statements
L35 IV.c Program Verification: Floyd-  compose pre-conditions and post- T1 Sec.
Hoare Logic: Conditional conditions over conditional 4.2.2 &
Statements statements 4.3.1

L36 IV.d Program Verification: Floyd-  identify and distinguish between T1 Sec.
Hoare Logic: Program Variables Program Variables and Logical 4.3.1
and Logical Variables Variables in verification using
Floyd-Hoare Logic
 illustrate the need for Logical
Variables with examples
L37 IV.e Program Verification: Verification  apply rules of Floyd-Hoare to T1 Sec.
of Straight-Line programs - verify properties of straight line 4.3.1

Birla Institute of Technology & Science, Pilani Tel: +91 1596 245073
Pilani Campus, Vidya Vihar Fax: +91 1596 244183
Pilani 333031, Rajasthan, India Web: www.pilani.bits-pilani.ac.in
Examples programs

L38 IV.f Program Verification: Partial  distinguish between partial T1 Sec.


Correctness and Total correctness arguments and total 4.3.1
Correctness correctness arguments

L39 IV.g Program Verification: Floyd-  illustrate and explain what loop T1 Sec.
Hoare Logic: Loop Invariants invariants are 4.2.2 &
4.3.1

L39 IV.h Program Verification: Floyd-  write loop invariants given simple T1 Sec.
Hoare Logic: Verifying loops 4.2.2 &
correctness of Loops: Partial  provide correctness arguments 4.3.1
Correctness using Invariants - using loop invariants
Examples

L40 IV.i Program Verification: Floyd-  provide partial correctness proofs T1 Sec.
Hoare Logic: Proof Rules and for small programs 4.3.1 &
Verification Examples 4.3.2

L40 IV.j Program Verification: Total  provide termination arguments -


Correctness: Termination for loops
Arguments

L41 IV.k Program Verification: Case Study  apply Floyd-Hoare logic to verify -
properties of reasonably large
programs

L41 IV.l Program Verification: Limitations  describe issues and limitations in -


proving correctness of programs

L41 V.a Software Modeling: State  illustrate and explain specification T1 Sec.
Machines using state machines 2.7.1

L42 V.b Software Modeling: Model  describe model checking T1 Sec.


Checking 2.7.1

Birla Institute of Technology & Science, Pilani Tel: +91 1596 245073
Pilani Campus, Vidya Vihar Fax: +91 1596 244183
Pilani 333031, Rajasthan, India Web: www.pilani.bits-pilani.ac.in
Evaluation
4. a. Evaluation Scheme:
Component Weight Date Remarks

Quizzes (4) 4x15M=60M In Tutorial / Lecture Sessions 1 session notice


(Open Book)
Assignments (2) 40M 2 to 3 weeks one in Sep. and Take Home
(tentative one in Nov. (Teams of 2)
split 10+30)
Mid-Term Test (90 43M <TEST_1> (scheduled centrally)
minutes) (Open Book)
Comprehensive Exam 57M <TEST_2> (scheduled centrally)
(120 minutes) (Open Book)
TOTAL 200M - -

4. b. Make-up Policy:
- No Make-up will be available for Assignments under any condition.
- Late submission of assignment will incur a penalty of 25% up to 24 hours and a penalty of 50% up to
48 hours from the deadline.
- There will be one make-up (for all four quizzes put together) i.e. a student can take a make-up for at
most one quiz out of the four quizzes. The make-up quiz will be conducted after all the regular
quizzes are done and the coverage for that will be announced later.
- Prior Permission of the Instructor-in-Charge is usually required to get a make-up for the mid-term
test.
- Prior Permission of (Associate) Dean, Instruction is usually required to get a make-up for the
comprehensive exam.
- A make-up shall be granted only in genuine cases where - in the Instructor’s / Dean’s judgment - the
student would be physically unable to appear for the test/exam. Instructor’s / Dean’s decision in this
matter would be final.
4.c. Fairness Policy:
- Student teams are expected to work on their own on assignments.
- All students are expected to contribute equally within a team. The instructor’s assessment
regarding the contributions of team members would be final.
- Any use of unfair means in quizzes, assignment, or test/exam will be reported to the Unfair
means committee and will be subject to the severest penalty possible:
o Unfair means would include copying from other students or from the Web or from
other sources of information including electronic devices.
-

Birla Institute of Technology & Science, Pilani Tel: +91 1596 245073
Pilani Campus, Vidya Vihar Fax: +91 1596 244183
Pilani 333031, Rajasthan, India Web: www.pilani.bits-pilani.ac.in
5. Chamber Consultation Hour: Thursday: 14:00 – 15:00, 6120C

5. Notices: All notices concerning this course will be displayed on the course website only. If there is a need
email would be used on short notice (12 hours) – only BITS Pilani mail would be used.

Instructor –In-

Charge CS F214

Birla Institute of Technology & Science, Pilani Tel: +91 1596 245073
Pilani Campus, Vidya Vihar Fax: +91 1596 244183
Pilani 333031, Rajasthan, India Web: www.pilani.bits-pilani.ac.in
Birla Institute of Technology & Science, Pilani Tel: +91 1596 245073
Pilani Campus, Vidya Vihar Fax: +91 1596 244183
Pilani 333031, Rajasthan, India Web: www.pilani.bits-pilani.ac.in

Das könnte Ihnen auch gefallen