Lecture-1 MCA
Lecture-1 MCA
2
Application of FoLT
• Concepts and notations from FoL are useful in
studying and describing objects and problems
in branches of computer science, such as
– computer algorithms
– programming languages
– cryptography
– automated theorem proving
– software development.
– AI
3
Unit-1: Foundations of Logic or
Mathematical Logic : Overview
Mathematical Logic is a tool for working with elaborate
compound statements. It includes:
• A formal language for expressing them.
• A concise notation for writing them.
• A methodology for objectively reasoning about their
truth or falsity.
• It is the foundation for expressing formal proofs in all
branches of mathematics.
Unit-1: Foundations of Logic: Overview
• Propositional logic:
– Basic definitions.
– Equivalence rules & derivations.
• Predicate logic
– Predicates.
– Quantified predicate expressions.
– Equivalences & derivations.
Topic #1 – Propositional Logic
Propositional Logic
Propositional Logic is the logic of compound
statements built from simpler statements
using so-called Boolean connectives.
Some applications in computer science: George Boole
(1815-1864)
• Design of digital electronic circuits.
• Expressing conditions in programs.
• Queries to databases & search engines.
Chrysippus of Soli
(ca. 281 B.C. – 205 B.C.)
Topic #1 – Propositional Logic
Definition of a Proposition
Examples of Propositions
• “It is raining.” (In a given situation.)
• “Beijing is the capital of China.” • “1 + 2 = 3”
• “Who’s there?”
• (interrogative, question)
• “La la la la la.”
• (meaningless interjection)
• “Just do it!”
• (imperative, command)
• “Yeah, I sorta dunno, whatever...”
• (vague)
• “1 + 2”
• (expression with a non-true/false value)
Topic #1.0 – Propositional Logic: Operators
Operators / Connectives
A Simple Exercise
Let p=“It rained last night”,
q=“The sprinklers came on last night,”
r=“The lawn was wet this morning.”
Translate each of the following into English:
¬p =
r ¬p = “It didn’t rain last night.”
“The lawn was wet this morning, and
it didn’t rain last night.”
¬rpq=
“Either the lawn wasn’t wet this morning, or it
rained last night, or the sprinklers came on last
night.”
Topic #1.0 – Propositional Logic: Operators
Examples of Implications
p q q p p q q p
F F T T T T
F T F T T T
T F T F F F
T T F F T T
Topic #1.0 – Propositional Logic: Operators
The inverse is “If it is not raining, then the home team does not win.”