Software Foundations 06 Tactics

Software Foundations

Online Textbook

Michael Clarkson's Open Online Course (on Youtube) Michael Charkson's Course (on Bilibili)

Xiong Yingfei's Course Webpage (2023 Spring)

This note is used as a brief summary and supplementofr the textbook and courses.

Tactics

The apply tactic with symmetry and transitivity

apply

When encountering situations where the goal to be proved is exactly the same as some hypothesis in the context or some previously proved lemma, we can use apply tactic instead of the rewrite & reflexivity we previously used.

1
2
3
4
5
6
7
8
9
10
11
Theorem silly1 : forall (n m : nat),
n = m ->
n = m.
Proof.
intros n m eq.
(** n, m : nat
eq : n = m
______________________________________(1/1)
n = m
*)
apply eq. Qed.

Read More

Software Foundations 04 Lists

Software Foundations

Online Textbook

Michael Clarkson's Open Online Course (on Youtube) Michael Charkson's Course (on Bilibili)

Xiong Yingfei's Course Webpage (2023 Spring)

This note is used as a brief summary and supplementofr the textbook and courses.

Lists

Pairs

We define the pair of natural numbers. (Cartesian product)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Inductive natprod : Type :=
| pair (n1 n2 : nat).

Definition fst (p : natprod) : nat :=
match p with
| pair x y => x
end.

Definition snd (p : natprod) : nat :=
match p with
| pair x y => y
end.

Notation "( x , y )" := (pair x y).

Read More

Sipser Part One

Introduction to the Theory of Computation Michael Sipser

with MIT 18.404 Theory of Computation 2020 Fall PPT

Part One: Automata and Languages

Lecture 1

Automata, computability and complexity

Finite Automaton 1. a model of computer with limited capacity 2. state diagram of finite automaton

Read More

Software Foundations

Introduction

03 Sources of Knowledge

Type System

Compilers can automatically find errors.

Compliers use deductive resoning to determine whether that are type errors. And human designer use deductive reasoning to prove that the type system is sound. (Well-typed programs don't go wrong.)

Read More