Docsity

CS 245: Logic and Computation - First-Order Logic Course, Slides of Logic

Partial preview of the text

Download CS 245: Logic and Computation - First-Order Logic Course and more Slides Logic in PDF only on Docsity!

CS 245: Logic and Computation

Alice Gao

Fall 2017

Based on slides by Jonathan Buss, Lila Kari and Anna Lubiw with thanks to B. Bonakdarpour, D. Maftuleac, C. Roberts, R. Trefler, and P. Van Beek

Please come and sit in the front. I won’t pick on you.

We will begin when the music stops.

1/

Let’s begin!

2/

Meet your peers

In the next 2 minutes, introduce yourself to someone you don’t know.

What you can talk about: courses, co-op, summer activities, dorms, extracurricular activities...

For the first few lectures, I encourage you to sit in a different section of the classroom every lecture and get to know the people around you.

Let’s get acquainted 4/

I’d like to learn your names

Ask/answer questions in lecture and come to office hours so that I could learn your names!

When I ask your name, please let me know how you prefer to be called.

Let’s get acquainted 5/

What CS 245 is about...

First-order logic (predicate logic)

  • a formal and precise language that we can use to model and to reason about real world scenarios.
  • fundamental to many disciplines and has many applications in Computer Science.

and its applications:

  • (^) (Program verification) Prove whether a piece of code meets its formal specification.
  • (Limitations of computers) Prove that some problems cannot be solved using computer algorithms.

The content of this course 7/

A roadmap of this course

Four units: (1) Propositional Logic, (2) Predicate logic, (3) Program verification, (4) Undecidability.

Essential questions:

  • (Modeling) How do we use first-order logic to model real world phenomenon?
  • (Syntax) How do we formulate well-formed formulas in this language?
  • (^) (Semantics) How do we interpret the formulas written in this language?
  • (^) (Reasoning) How do we perform reasoning and inference using this language?
  • (^) (Program verification) How do we make sure that a piece of code does what it’s supposed to do?
  • (^) (Undecidability) Are there problems that cannot be solved by computer algorithms?

The schedule of lectures is on the course website. The content of this course 8/

Is this course only about logic?

Not quite! We also want you to develop these skills:

  • (^) Thinking and communicating precisely and clearly
  • Problem solving
  • (^) Creative thinking
  • Critical thinking
  • (^) ...

The content of this course 10/

Where do I find things?

Main components: lectures, tutorials, assignments, midterm, final exam.

  • Piazza: discussions.
  • (^) Learn: tutorial notes, assignment solutions, exam solutions, and marks.
  • (^) Web page: everything else including policies, assignments, office hours. https://www.student.cs.uwaterloo.ca/ cs245/

Logistics of the course 11/

How should I study and collaborate?

  • (^) Focus on the learning goals.
  • Read with questions in mind. After reading, summarize. After studying, test yourself. (Study strategies)
  • Spend time struggling before looking at the solutions/asking for help. (Dealing with failures)
  • Academic integrity

Logistics of the course 13/

Learning goals

By the end of the lecture, you should be able to

  • Give a high-level description of logic.
  • (^) Give examples of applications of logic in computer science.
  • Define propositions.
  • (^) Classify English sentences into propositions and non-propositions.
  • Give multiple translations of English sentences with ambiguity.
  • (^) Translate English sentences with no ambiguity into compound propositions.

Logistics of the course 14/

What is logic?

Logic is the science of reasoning

  • Etymology: Logykos (Greek) - pertaining to reasoning
  • (^) Logic = The science of reasoning, proof, thinking, or inference
  • Logic = The systematic study of the form of arguments

Logic: what and why What is logic? 16/

Why study logic?

  • (^) Logic is fun! Think about logical puzzles.
  • Logic improves one’s ability to think analytically and to communicate precisely.
  • (^) Logic has many applications in Computer Science.

“I expect that digital computing machines will eventually stimulate a considerable interest in symbolic logic.... The language in which one communicates with these machines... forms a sort of symbolic logic.” (Alan Turing, 1947)

Logic: what and why Why study logic in computer science? 17/

Applications of logic to computer science

  • Logic programming
  • (^) PROLOG (PROgramming with LOGic) has roots in first-order logic.
  • Theorem proving, expert systems, and natural language processing
  • (^) On February 14-16, 2011, IBM Watson won the Jeopardy Man vs.

Machine Challenge by defeating two former grand champions, Ken Jennings and Brad Rutter. Watson relied on natural language processing technology to analyze the vast amount of unstructured text (encyclopedias, dictionaries, news articles, etc.). Prolog was the ideal language for this due to its simplicity and expressiveness.

Logic: what and why Why study logic in computer science? 19/

Applications of logic to computer science

  • (^) Expert systems (knowledge base + inference engine)
  • Medical diagnosis systems: The user describes their symptoms to the computer as they would to a doctor and the computer returns a medical diagnosis.
  • (^) MYCIN: acceptable therapy in about 69% of cases, which was better than the performance of infectious disease experts who were judged using the same criteria.
  • (^) MISTRAL: an expert system for the monitoring of dam safety

Logic: what and why Why study logic in computer science? 20/