This document defines various relationships between programs (P, P'), specifications (R, R'), and program correctness. It establishes that:
1) P refines P' (P' is more correct than P) if the competence domain of P is included in the competence domain of P' with respect to any specification R.
2) If P' is more correct than P with respect to a specification R, then P' is more reliable than P.
3) P is equally correct to P' with respect to a specification R if P refines P' and P' refines P (they have the same competence domain).
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
21 views2 pages
(R P) L RL: Description R Refine R'
This document defines various relationships between programs (P, P'), specifications (R, R'), and program correctness. It establishes that:
1) P refines P' (P' is more correct than P) if the competence domain of P is included in the competence domain of P' with respect to any specification R.
2) If P' is more correct than P with respect to a specification R, then P' is more reliable than P.
3) P is equally correct to P' with respect to a specification R if P refines P' and P' refines P (they have the same competence domain).
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
definition Description
R ⊒ R′ => RL ∩ R′L ∩ (R ∪ R′) = R′ R refine R’
R ⊒ R′ if and only if R ⊆ R′ If R and R′ have the same domain, so R refine R’ if and only if R is included in R’ R′ ⊆ R if and only if R′ ⊆ R if R and R′ are deterministic and R’ is included in R so R’ refines R (P ∩ R)L ⊇ (P′ ∩ R) L p is more-correct than p’ with respect to R (P′⊒ RP) (P ∩ R)L ⊃ (P′ ∩ R) L p is strictly more-correct than p’ with respect to R (P’ ⊐ R P) (R ∩ P)L = RL Program g is correct with respect to R If program p is correct with respect to R, then it is more-correct than any program p’ with respect to R. If program p is correct with respect to R, and program p’ is not, then p is strictly-more-correct than p’ with respect to R If and only if P refines P′, program p is more-correct than program p’ with respect to any specification R. dom(R ∩ P) = dom(R) ∩dom(P) p is partially correct with respect to R dom(R ∩ P) = dom(R) P is correct with respect to R dom(R ∩ P) ⊆ dom(R ∩P’) p’ is more-correct than p with respect to R dom(R ∩ P) ⊂ dom(R ∩P’) P’ is strictly more-correct than p with respect to R set ∑ is dom (R P)∩ testing a program for relative correctness has implications for test data generation Ω(s, s’) ≡ (ω (s, P(s)) => ω (s, s’)) oracle that must be used to test p’ for relative correctness over p with respect to R (R∩R′)L = RL∩R′L the consistency condition (R ∩ P)L ⊆ (R ∩ P′)L ∧ (R ∩ P)L ∩ Ŕ ∩ P′ ⊆ P Relative correctness for non-deterministic program (P′ ⊒ RP) P′ ⊒ R ⇔ (∀P : P′ ⊒ R P) p is correct with respect to R if and only if p is more-correct with respect to R than any candidate program on S ❑ ❑ If program p′ is more-correct than p with respect P′⊒ R P ⇒ ∫ θ( s) ds ≥ ∫ θ(s )ds dom(R ∩ P ' ) dom(R ∩ P) to specification R then p′ is more reliable than p P′ ⊒ P ⇔ (∀R : P′⊒ R P) p′refines p if and only if p′ is more-correct than p with respect to any specification R on S depth(p) = 1 + depth(p′) fault depth P ≡R P′ if and only if P ⊒ R P′ and P′ ⊒R P relations P and P′ are said to be equally correct with respect to specification R (having the same competence domain) P′ ⊒R P ⇔ ρ R(P′) ⊒ ρ R (P) P′ is more correct than P with respect to R if and only if ρ R (P′) refines ρ R (P) (P′ ⊒ P P) can be written as: Proof of Necessity PL ⊆ (P ∩ P′)L ∧ PL ∩ Ṕ ∩ P′ ⊆ P P′ ⊒R ⊓ Q P => P′ ⊒Q P ∧ P′ ⊒ R P Definition of relative correctness If P′ is more-correct than P with respect to R and with respect to Q, then it is more-correct than P with respect to (R ⊓ Q). P′ ⊒Q ⊔R P If P′ is more-correct than P with respect to R and with respect to Q, then it is more-correct than P with respect to (R⊔Q).