Hoare Logic (Sequential and Conditionals)

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/8

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 5:21 PM on 4/3/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

9 Terms

1
New cards

Inference Rule Structure

  • A₁, A₂, …, Aₙ / C: Valid antecedents lead to valid consequence C.

  • Axiom: Inference rule without antecedents.

  • Used in proof trees: root = statement to prove, leaves = axioms.

2
New cards

Hoare Logic Proof Procedure

  • Start with statement as root.
  • Choose rule to break it down into sub-goals.
  • Apply rules backward until all leaves are closed.
3
New cards

Rule of Composition

  • {P} S {R}, {R} T {Q} => {P} S; T {Q}.
  • Requires intermediate assertion R linking S's postcondition to T's precondition.
  • Generalized for multiple statements.
4
New cards

Composition Precondition Calculation

  • Compute intermediate assertions by backward substitution.
  • Work backwards from postcondition, applying substitutions for each assignment.
5
New cards

Rule of Conditional

  • {P ∧ G} S {Q}, {P ∧ ¬G} T {Q} => {P} if G {S} {T} {Q}.
  • G branches: True -> S executes; False -> T executes.
6
New cards

Conditional Proof Example

  • Prove: {x ≠ 0} if (x < 0) {x := -x} {x := x} {x > 0}.
  • Cases: x
7
New cards

Backward Reasoning Approach

  • Proofs built backward: start from postcondition, work toward precondition.
  • Substitute backward for assignments.
  • Split cases for conditionals.
8
New cards

Proof Tree Construction

  • Root: statement to prove.
  • Decompose into sub-goals with chosen rules.
  • Valid when all branches are proven.
9
New cards

Intermediate Assertion Role

  • R must be strong enough to follow from S's execution.
  • Weak enough to imply T's precondition.
  • Found by back-calculating from final postcondition.

Explore top notes

note
IB Chemistry 3.1 Periodic Table
Updated 1266d ago
0.0(0)
note
Aula APS Redes Territorializacao
Updated 501d ago
0.0(0)
note
EMSF110 - Trauma Exam
Updated 997d ago
0.0(0)
note
US History Chap. 11
Updated 926d ago
0.0(0)
note
AFPF casus 5
Updated 443d ago
0.0(0)
note
World History 2 Midterm
Updated 217d ago
0.0(0)
note
IB Chemistry 3.1 Periodic Table
Updated 1266d ago
0.0(0)
note
Aula APS Redes Territorializacao
Updated 501d ago
0.0(0)
note
EMSF110 - Trauma Exam
Updated 997d ago
0.0(0)
note
US History Chap. 11
Updated 926d ago
0.0(0)
note
AFPF casus 5
Updated 443d ago
0.0(0)
note
World History 2 Midterm
Updated 217d ago
0.0(0)

Explore top flashcards

flashcards
History Unit 5 Test
70
Updated 1127d ago
0.0(0)
flashcards
Los 99 nombres de Allah
100
Updated 215d ago
0.0(0)
flashcards
Antidiabetic Drugs
52
Updated 1219d ago
0.0(0)
flashcards
ИМА
553
Updated 442d ago
0.0(0)
flashcards
NL woordenschat blok 1 en 2
49
Updated 1231d ago
0.0(0)
flashcards
Hinduism
20
Updated 1103d ago
0.0(0)
flashcards
History Unit 5 Test
70
Updated 1127d ago
0.0(0)
flashcards
Los 99 nombres de Allah
100
Updated 215d ago
0.0(0)
flashcards
Antidiabetic Drugs
52
Updated 1219d ago
0.0(0)
flashcards
ИМА
553
Updated 442d ago
0.0(0)
flashcards
NL woordenschat blok 1 en 2
49
Updated 1231d ago
0.0(0)
flashcards
Hinduism
20
Updated 1103d ago
0.0(0)