0% found this document useful (0 votes)
5 views

Dm2_Ch1d_Examples on Using Propositional and Predicate Logic

Uploaded by

Reading Steiner
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Dm2_Ch1d_Examples on Using Propositional and Predicate Logic

Uploaded by

Reading Steiner
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Examples on Using

Proposition and
Predicate Logic

Nguyen An Khuong,

Chapter 1d Huynh Tuong Nguyen

Examples on Using Proposition and


Predicate Logic
Contents
Discrete Mathematics II Natural Deduction in
Propositional Logic:
Electing Puzzle

Expressing
specifications by
Predicate Logic:
Protocol Requirements

(Materials drawn from Chapter 2 in:


“Michael Huth and Mark Ryan. Logic in Computer Science: Modelling and
Reasoning about Systems, 2nd Ed., Cambridge University Press, 2006.”)

Nguyen An Khuong, Huynh Tuong Nguyen


Faculty of Computer Science and Engineering
University of Technology, VNU-HCM
1d.1
Examples on Using
Contents Proposition and
Predicate Logic

Nguyen An Khuong,
Huynh Tuong Nguyen

1 Natural Deduction in Propositional Logic: Electing Puzzle Contents

Natural Deduction in
Propositional Logic:
Electing Puzzle

Expressing
specifications by
Predicate Logic:
2 Expressing specifications by Predicate Logic: Protocol Protocol Requirements
Requirements

1d.2
Examples on Using
Electing Puzzle Proposition and
Predicate Logic

Nguyen An Khuong,
Huynh Tuong Nguyen

Contents

Natural Deduction in
Propositional Logic:
Electing Puzzle

Expressing
specifications by
Predicate Logic:
Protocol Requirements

1d.3
Examples on Using
Electing Puzzle Proposition and
Predicate Logic

Nguyen An Khuong,
Huynh Tuong Nguyen

• Four men and four women are nominated for two positions.

Contents

Natural Deduction in
Propositional Logic:
Electing Puzzle

Expressing
specifications by
Predicate Logic:
Protocol Requirements

1d.3
Examples on Using
Electing Puzzle Proposition and
Predicate Logic

Nguyen An Khuong,
Huynh Tuong Nguyen

• Four men and four women are nominated for two positions.
• Exactly one man and one woman are elected.
Contents

Natural Deduction in
Propositional Logic:
Electing Puzzle

Expressing
specifications by
Predicate Logic:
Protocol Requirements

1d.3
Examples on Using
Electing Puzzle Proposition and
Predicate Logic

Nguyen An Khuong,
Huynh Tuong Nguyen

• Four men and four women are nominated for two positions.
• Exactly one man and one woman are elected.
Contents
• The men are A, B, C, D and the women are E, F, G, H. Natural Deduction in
Propositional Logic:
Electing Puzzle

Expressing
specifications by
Predicate Logic:
Protocol Requirements

1d.3
Examples on Using
Electing Puzzle Proposition and
Predicate Logic

Nguyen An Khuong,
Huynh Tuong Nguyen

• Four men and four women are nominated for two positions.
• Exactly one man and one woman are elected.
Contents
• The men are A, B, C, D and the women are E, F, G, H. Natural Deduction in
Propositional Logic:
Electing Puzzle

Expressing
specifications by
Predicate Logic:
Protocol Requirements

1d.3
Examples on Using
Electing Puzzle Proposition and
Predicate Logic

Nguyen An Khuong,
Huynh Tuong Nguyen

• Four men and four women are nominated for two positions.
• Exactly one man and one woman are elected.
Contents
• The men are A, B, C, D and the women are E, F, G, H. We Natural Deduction in
Propositional Logic:
know: Electing Puzzle

Expressing
specifications by
Predicate Logic:
Protocol Requirements

1d.3
Examples on Using
Electing Puzzle Proposition and
Predicate Logic

Nguyen An Khuong,
Huynh Tuong Nguyen

• Four men and four women are nominated for two positions.
• Exactly one man and one woman are elected.
Contents
• The men are A, B, C, D and the women are E, F, G, H. We Natural Deduction in
Propositional Logic:
know: Electing Puzzle

Expressing
specifications by
Predicate Logic:
Protocol Requirements

1d.3
Examples on Using
Electing Puzzle Proposition and
Predicate Logic

Nguyen An Khuong,
Huynh Tuong Nguyen

• Four men and four women are nominated for two positions.
• Exactly one man and one woman are elected.
Contents
• The men are A, B, C, D and the women are E, F, G, H. We Natural Deduction in
Propositional Logic:
know: Electing Puzzle

• if neither A nor E won, then G won Expressing


specifications by
Predicate Logic:
Protocol Requirements

1d.3
Examples on Using
Electing Puzzle Proposition and
Predicate Logic

Nguyen An Khuong,
Huynh Tuong Nguyen

• Four men and four women are nominated for two positions.
• Exactly one man and one woman are elected.
Contents
• The men are A, B, C, D and the women are E, F, G, H. We Natural Deduction in
Propositional Logic:
know: Electing Puzzle

• if neither A nor E won, then G won Expressing


specifications by
• if neither A nor F won, then B won Predicate Logic:
Protocol Requirements

1d.3
Examples on Using
Electing Puzzle Proposition and
Predicate Logic

Nguyen An Khuong,
Huynh Tuong Nguyen

• Four men and four women are nominated for two positions.
• Exactly one man and one woman are elected.
Contents
• The men are A, B, C, D and the women are E, F, G, H. We Natural Deduction in
Propositional Logic:
know: Electing Puzzle

• if neither A nor E won, then G won Expressing


specifications by
• if neither A nor F won, then B won Predicate Logic:
Protocol Requirements
• if neither B nor G won, then C won

1d.3
Examples on Using
Electing Puzzle Proposition and
Predicate Logic

Nguyen An Khuong,
Huynh Tuong Nguyen

• Four men and four women are nominated for two positions.
• Exactly one man and one woman are elected.
Contents
• The men are A, B, C, D and the women are E, F, G, H. We Natural Deduction in
Propositional Logic:
know: Electing Puzzle

• if neither A nor E won, then G won Expressing


specifications by
• if neither A nor F won, then B won Predicate Logic:
Protocol Requirements
• if neither B nor G won, then C won
• if neither C nor F won, then E won.

1d.3
Examples on Using
Electing Puzzle Proposition and
Predicate Logic

Nguyen An Khuong,
Huynh Tuong Nguyen

• Four men and four women are nominated for two positions.
• Exactly one man and one woman are elected.
Contents
• The men are A, B, C, D and the women are E, F, G, H. We Natural Deduction in
Propositional Logic:
know: Electing Puzzle

• if neither A nor E won, then G won Expressing


specifications by
• if neither A nor F won, then B won Predicate Logic:
Protocol Requirements
• if neither B nor G won, then C won
• if neither C nor F won, then E won.

1d.3
Examples on Using
Electing Puzzle Proposition and
Predicate Logic

Nguyen An Khuong,
Huynh Tuong Nguyen

• Four men and four women are nominated for two positions.
• Exactly one man and one woman are elected.
Contents
• The men are A, B, C, D and the women are E, F, G, H. We Natural Deduction in
Propositional Logic:
know: Electing Puzzle

• if neither A nor E won, then G won Expressing


specifications by
• if neither A nor F won, then B won Predicate Logic:
Protocol Requirements
• if neither B nor G won, then C won
• if neither C nor F won, then E won.

• Who were the two people elected?

1d.3
Examples on Using
Huth and Ryan [2], Exercises 2.1.5: Protocol Requirements Proposition and
Predicate Logic
• The following sentences are taken from the RFC3157 Nguyen An Khuong,
Internet Task-force Document ‘Securely Available Huynh Tuong Nguyen

Credentials – Requirements.’

Contents

Natural Deduction in
Propositional Logic:
Electing Puzzle

Expressing
specifications by
Predicate Logic:
Protocol Requirements

1d.4
Examples on Using
Huth and Ryan [2], Exercises 2.1.5: Protocol Requirements Proposition and
Predicate Logic
• The following sentences are taken from the RFC3157 Nguyen An Khuong,
Internet Task-force Document ‘Securely Available Huynh Tuong Nguyen

Credentials – Requirements.’
• Specify it in predicate logic, defining predicate symbols as
appropriate:

Contents

Natural Deduction in
Propositional Logic:
Electing Puzzle

Expressing
specifications by
Predicate Logic:
Protocol Requirements

1d.4
Examples on Using
Huth and Ryan [2], Exercises 2.1.5: Protocol Requirements Proposition and
Predicate Logic
• The following sentences are taken from the RFC3157 Nguyen An Khuong,
Internet Task-force Document ‘Securely Available Huynh Tuong Nguyen

Credentials – Requirements.’
• Specify it in predicate logic, defining predicate symbols as
appropriate:

Contents

Natural Deduction in
Propositional Logic:
Electing Puzzle

Expressing
specifications by
Predicate Logic:
Protocol Requirements

1d.4
Examples on Using
Huth and Ryan [2], Exercises 2.1.5: Protocol Requirements Proposition and
Predicate Logic
• The following sentences are taken from the RFC3157 Nguyen An Khuong,
Internet Task-force Document ‘Securely Available Huynh Tuong Nguyen

Credentials – Requirements.’
• Specify it in predicate logic, defining predicate symbols as
appropriate:
a. An attacker can persuade a server that a successful login has
occurred, even if it hasn’t. Contents

Natural Deduction in
Propositional Logic:
Electing Puzzle

Expressing
specifications by
Predicate Logic:
Protocol Requirements

1d.4
Examples on Using
Huth and Ryan [2], Exercises 2.1.5: Protocol Requirements Proposition and
Predicate Logic
• The following sentences are taken from the RFC3157 Nguyen An Khuong,
Internet Task-force Document ‘Securely Available Huynh Tuong Nguyen

Credentials – Requirements.’
• Specify it in predicate logic, defining predicate symbols as
appropriate:
a. An attacker can persuade a server that a successful login has
occurred, even if it hasn’t. Contents
b. An attacker can overwrite someone else’s credentials on the Natural Deduction in
server. Propositional Logic:
Electing Puzzle

Expressing
specifications by
Predicate Logic:
Protocol Requirements

1d.4
Examples on Using
Huth and Ryan [2], Exercises 2.1.5: Protocol Requirements Proposition and
Predicate Logic
• The following sentences are taken from the RFC3157 Nguyen An Khuong,
Internet Task-force Document ‘Securely Available Huynh Tuong Nguyen

Credentials – Requirements.’
• Specify it in predicate logic, defining predicate symbols as
appropriate:
a. An attacker can persuade a server that a successful login has
occurred, even if it hasn’t. Contents
b. An attacker can overwrite someone else’s credentials on the Natural Deduction in
server. Propositional Logic:
Electing Puzzle
c. All users enter passwords instead of names.
Expressing
specifications by
Predicate Logic:
Protocol Requirements

1d.4
Examples on Using
Huth and Ryan [2], Exercises 2.1.5: Protocol Requirements Proposition and
Predicate Logic
• The following sentences are taken from the RFC3157 Nguyen An Khuong,
Internet Task-force Document ‘Securely Available Huynh Tuong Nguyen

Credentials – Requirements.’
• Specify it in predicate logic, defining predicate symbols as
appropriate:
a. An attacker can persuade a server that a successful login has
occurred, even if it hasn’t. Contents
b. An attacker can overwrite someone else’s credentials on the Natural Deduction in
server. Propositional Logic:
Electing Puzzle
c. All users enter passwords instead of names.
Expressing
d. Credential transfer both to and from a device MUST be specifications by
Predicate Logic:
supported. Protocol Requirements

1d.4
Examples on Using
Huth and Ryan [2], Exercises 2.1.5: Protocol Requirements Proposition and
Predicate Logic
• The following sentences are taken from the RFC3157 Nguyen An Khuong,
Internet Task-force Document ‘Securely Available Huynh Tuong Nguyen

Credentials – Requirements.’
• Specify it in predicate logic, defining predicate symbols as
appropriate:
a. An attacker can persuade a server that a successful login has
occurred, even if it hasn’t. Contents
b. An attacker can overwrite someone else’s credentials on the Natural Deduction in
server. Propositional Logic:
Electing Puzzle
c. All users enter passwords instead of names.
Expressing
d. Credential transfer both to and from a device MUST be specifications by
Predicate Logic:
supported. Protocol Requirements

e. Credentials MUST NOT be forced by the protocol to be


present in cleartext at any device other than the end user’s.

1d.4
Examples on Using
Huth and Ryan [2], Exercises 2.1.5: Protocol Requirements Proposition and
Predicate Logic
• The following sentences are taken from the RFC3157 Nguyen An Khuong,
Internet Task-force Document ‘Securely Available Huynh Tuong Nguyen

Credentials – Requirements.’
• Specify it in predicate logic, defining predicate symbols as
appropriate:
a. An attacker can persuade a server that a successful login has
occurred, even if it hasn’t. Contents
b. An attacker can overwrite someone else’s credentials on the Natural Deduction in
server. Propositional Logic:
Electing Puzzle
c. All users enter passwords instead of names.
Expressing
d. Credential transfer both to and from a device MUST be specifications by
Predicate Logic:
supported. Protocol Requirements

e. Credentials MUST NOT be forced by the protocol to be


present in cleartext at any device other than the end user’s.
f. The protocol MUST support a range of cryptographic
algorithms, including symmetric and asymmetric algorithms,
hash algorithms, and MAC algorithms.

1d.4
Examples on Using
Huth and Ryan [2], Exercises 2.1.5: Protocol Requirements Proposition and
Predicate Logic
• The following sentences are taken from the RFC3157 Nguyen An Khuong,
Internet Task-force Document ‘Securely Available Huynh Tuong Nguyen

Credentials – Requirements.’
• Specify it in predicate logic, defining predicate symbols as
appropriate:
a. An attacker can persuade a server that a successful login has
occurred, even if it hasn’t. Contents
b. An attacker can overwrite someone else’s credentials on the Natural Deduction in
server. Propositional Logic:
Electing Puzzle
c. All users enter passwords instead of names.
Expressing
d. Credential transfer both to and from a device MUST be specifications by
Predicate Logic:
supported. Protocol Requirements

e. Credentials MUST NOT be forced by the protocol to be


present in cleartext at any device other than the end user’s.
f. The protocol MUST support a range of cryptographic
algorithms, including symmetric and asymmetric algorithms,
hash algorithms, and MAC algorithms.
g. Credentials MUST only be downloadable following user
authentication or else only downloadable in a format that
requires completion of user authentication for deciphering.

1d.4
Examples on Using
Huth and Ryan [2], Exercises 2.1.5: Protocol Requirements Proposition and
Predicate Logic
• The following sentences are taken from the RFC3157 Nguyen An Khuong,
Internet Task-force Document ‘Securely Available Huynh Tuong Nguyen

Credentials – Requirements.’
• Specify it in predicate logic, defining predicate symbols as
appropriate:
a. An attacker can persuade a server that a successful login has
occurred, even if it hasn’t. Contents
b. An attacker can overwrite someone else’s credentials on the Natural Deduction in
server. Propositional Logic:
Electing Puzzle
c. All users enter passwords instead of names.
Expressing
d. Credential transfer both to and from a device MUST be specifications by
Predicate Logic:
supported. Protocol Requirements

e. Credentials MUST NOT be forced by the protocol to be


present in cleartext at any device other than the end user’s.
f. The protocol MUST support a range of cryptographic
algorithms, including symmetric and asymmetric algorithms,
hash algorithms, and MAC algorithms.
g. Credentials MUST only be downloadable following user
authentication or else only downloadable in a format that
requires completion of user authentication for deciphering.
h. Different end user devices MAY be used to download, upload,
or manage the same set of credentials. 1d.4
Examples on Using
Huth and Ryan [2], Exercises 2.1.5: Solutions Proposition and
Predicate Logic

Nguyen An Khuong,
Huynh Tuong Nguyen

Contents

Natural Deduction in
Propositional Logic:
Electing Puzzle

Expressing
specifications by
Predicate Logic:
Protocol Requirements

1d.5
Examples on Using
Huth and Ryan [2], Exercises 2.1.5: Solutions Proposition and
Predicate Logic

Nguyen An Khuong,
Huynh Tuong Nguyen

a. An attacker can persuade a server that a successful login has Contents

occurred, even if it hasn’t: Natural Deduction in


Propositional Logic:
φ := ∃a∃s((¬loggedIn(a, s)) −→ (canP ersuade(a, s))). Electing Puzzle

Expressing
specifications by
Predicate Logic:
Protocol Requirements

1d.5
Examples on Using
Huth and Ryan [2], Exercises 2.1.5: Solutions Proposition and
Predicate Logic

Nguyen An Khuong,
Huynh Tuong Nguyen

a. An attacker can persuade a server that a successful login has Contents

occurred, even if it hasn’t: Natural Deduction in


Propositional Logic:
φ := ∃a∃s((¬loggedIn(a, s)) −→ (canP ersuade(a, s))). Electing Puzzle

Expressing
b. An attacker can overwrite someone else’s credentials on the specifications by
Predicate Logic:
server: φ := ∃u∃c∃s∃d((¬ownsCredentials(u, c)) −→ Protocol Requirements

canW rite(u, c, s, d)).

1d.5

You might also like