中国科学技术大学:《程序分析与程序验证》课程教学资源(PPT课件讲稿)第7章 程序验证 ProgramVerification Necula 04 Decision-Procedure Based Theorem Provers Tactic-Based Theorem Proving Inferring Loop Invariants

Decision-Procedure Based Theorem Provers Tactic-Based Theorem Proving Inferring Loop Invariants CS294-8 Lecture 12 Prof.Necula CS 294-8 Lecture 12 1
Prof. Necula CS 294-8 Lecture 12 1 Decision-Procedure Based Theorem Provers Tactic-Based Theorem Proving Inferring Loop Invariants CS 294-8 Lecture 12

Review Source language VCGen FOL Theories Goal-directed Sat.proc Sat.proc proving 1 n Prof.Necula CS 294-8 Lecture 12 2
Prof. Necula CS 294-8 Lecture 12 2 Review Source language VCGen FOL Theories Sat. proc 1 Sat. proc n Goal-directed proving … ?

Combining Satisfiability Procedures Consider a set of literals F Containing symbols from two theories Ti and Ta We split F into two sets of literals Fi containing only literals in theory Ti F2 containing only literals in theory T2 We name all subexpressions: pi(f2(E))is split into f2(E)=n^pi(n) We have:unsat (F1A F2)iff unsat(F) unsat(F)v unsat(F2)=unsat(F) But the converse is not true So we cannot compute unsat(F)with a trivial combination of the sat.procedures for Ti and Ta Prof.Necula CS 294-8 Lecture 12 3
Prof. Necula CS 294-8 Lecture 12 3 Combining Satisfiability Procedures • Consider a set of literals F – Containing symbols from two theories T1 and T2 • We split F into two sets of literals – F1 containing only literals in theory T1 – F2 containing only literals in theory T2 – We name all subexpressions: p1 (f2 (E)) is split into f2 (E) = n p1 (n) • We have: unsat (F1 F2 ) iff unsat(F) – unsat(F1 ) unsat(F2 ) unsat(F) – But the converse is not true • So we cannot compute unsat(F) with a trivial combination of the sat. procedures for T1 and T2

Combining Satisfiability Procedures.Example Consider equality and arithmetic ffx)-fy)≠fz) x≤y y+Z≤X 0≤Z y≤x X- f(x)=f(y) 0=Z fx)-fy)=z false← f(f(x)-f(y))=f(z) Prof.Necula CS 294-8 Lecture 12 4
Prof. Necula CS 294-8 Lecture 12 4 Combining Satisfiability Procedures. Example • Consider equality and arithmetic f(f(x) - f(y)) f(z) x y y + z x 0 z false f(x) = f(y) y x x = y 0 = z f(x) - f(y) = z f(f(x) - f(y)) = f(z)

Combining Satisfiability Procedures Combining satisfiability procedures is non trivial And that is to be expected: Equality was solved by Ackerman in 1924,arithmetic by Fourier even before,but E+A only in 1979 yet in any single verification problem we will have literals from several theories: Equality,arithmetic,lists,... When and how can we combine separate satisfiability procedures? Prof.Necula CS 294-8 Lecture 12 5
Prof. Necula CS 294-8 Lecture 12 5 Combining Satisfiability Procedures • Combining satisfiability procedures is non trivial • And that is to be expected: – Equality was solved by Ackerman in 1924, arithmetic by Fourier even before, but E + A only in 1979 ! • Yet in any single verification problem we will have literals from several theories: – Equality, arithmetic, lists, … • When and how can we combine separate satisfiability procedures?

Nelson-Oppen Method (1) 1. Represent all conjuncts in the same DAG f(f(x)-f(y)≠f(z)∧Y≥×∧×≥Y+z∧z≥0 X Z 0 Prof.Necula CS 294-8 Lecture 12 6
Prof. Necula CS 294-8 Lecture 12 6 Nelson-Oppen Method (1) 1. Represent all conjuncts in the same DAG f(f(x) - f(y)) f(z) y x x y + z z 0 f - f f y x z 0 + f

Nelson-Oppen Method (2) 2.Run each sat.procedure Require it to report all contradictions (as usual) Also require it to report all equalities between nodes f Z、 Prof.Necula CS 294-8 Lecture 12 7
Prof. Necula CS 294-8 Lecture 12 7 Nelson-Oppen Method (2) 2. Run each sat. procedure • Require it to report all contradictions (as usual) • Also require it to report all equalities between nodes f - f f y x z 0 + f

Nelson-Oppen Method (3) 3.Broadcast all discovered equalities and re-run sat. procedures Until no more equalities are discovered or a contradiction arises f x Contradiction Z、 Prof.Necula CS 294-8 Lecture 12 8
Prof. Necula CS 294-8 Lecture 12 8 Nelson-Oppen Method (3) 3. Broadcast all discovered equalities and re-run sat. procedures • Until no more equalities are discovered or a contradiction arises f - f f y x z 0 + f x Contradiction

What Theories Can be Combined? Only theories without common interpreted symbols But Ok if one theory takes the symbol uninterpreted Only certain theories can be combined Consider (Z,+,and Equality -Consider:1≤×≤2Λa=1Ab=2∧f(X)≠f(a)Af(X)≠f(b) No equalities and no contradictions are discovered yet,unsatisfiable A theory is non-convex when a set of literals entails a dis junction of equalities without entailing any single equality Prof.Necula CS 294-8 Lecture 12 9
Prof. Necula CS 294-8 Lecture 12 9 What Theories Can be Combined? • Only theories without common interpreted symbols – But Ok if one theory takes the symbol uninterpreted • Only certain theories can be combined – Consider (Z, +, ·) and Equality – Consider: 1 x 2 a = 1 b = 2 f(x) f(a) f(x) f(b) – No equalities and no contradictions are discovered – Yet, unsatisfiable • A theory is non-convex when a set of literals entails a disjunction of equalities without entailing any single equality

Handling Non-Convex Theories Many theories are non-convex Consider the theory of memory and pointers It is not-convex: trueA=A'v sel(upd(M,A,V),A')=sel(M,A) (neither of the dis juncts is entailed individually) For such theories it can be the case that No contradiction is discovered No single equality is discovered - But a disjunction of equalities is discovered We need to propagate disjunction of equalities.. Prof.Necula CS 294-8 Lecture 12 10
Prof. Necula CS 294-8 Lecture 12 10 Handling Non-Convex Theories • Many theories are non-convex • Consider the theory of memory and pointers – It is not-convex: true A = A’ sel(upd(M, A, V), A’) = sel(M, A’) (neither of the disjuncts is entailed individually) • For such theories it can be the case that – No contradiction is discovered – No single equality is discovered – But a disjunction of equalities is discovered • We need to propagate disjunction of equalities …
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 中国科学技术大学:《程序分析与程序验证》课程教学资源(PPT课件讲稿)第7章 程序验证 ProgramVerification Necula 03 Theorem Proving for FOL Satisfiability Procedures.ppt
- 中国科学技术大学:《程序分析与程序验证》课程教学资源(PPT课件讲稿)第7章 程序验证 ProgramVerification Necula 02 Finish Verification Condition Generation Simple Prover for FOL.ppt
- 中国科学技术大学:《程序分析与程序验证》课程教学资源(PPT课件讲稿)第7章 程序验证 ProgramVerification Necula 01 Theorem Proving.ppt
- 中国科学技术大学:《程序分析与程序验证》课程教学资源(PPT课件讲稿)第7章 程序验证 Program verification.ppt
- 中国科学技术大学:《程序分析与程序验证》课程教学资源(PPT课件讲稿)第6章 模型检测.ppt
- 中国科学技术大学:《程序分析与程序验证》课程教学资源(PPT课件讲稿)第5章 类型和效果系统(补充).ppt
- 中国科学技术大学:《程序分析与程序验证》课程教学资源(课件讲稿)第5章 类型和效果系统(Nielson等)Principles of Program Analysis - Type and Effect Systems.pdf
- 中国科学技术大学:《程序分析与程序验证》课程教学资源(PPT课件讲稿)第4章 抽象解释(补充).ppt
- 中国科学技术大学:《程序分析与程序验证》课程教学资源(课件讲稿)第4章 抽象解释(Nielson等)Principles of Program Analysis - Abstract Interpretation.pdf
- 中国科学技术大学:《程序分析与程序验证》课程教学资源(PPT课件讲稿)第3章 基于约束的分析(补充).ppt
- 中国科学技术大学:《程序分析与程序验证》课程教学资源(课件讲稿)第3章 基于约束的分析(Nielson等)Principles of Program Analysis - Control Flow Analysis.pdf
- 中国科学技术大学:《程序分析与程序验证》课程教学资源(PPT课件讲稿)第2章 数据流分析(补充).ppt
- 中国科学技术大学:《程序分析与程序验证》课程教学资源(课件讲稿)第2章 数据流分析(Nielson等)Principles of Program Analysis - Data Flow Analysis.pdf
- 中国科学技术大学:《程序分析与程序验证》课程教学资源(PPT课件讲稿)第1章 引言(主讲:陈意云).ppt
- 中国科学技术大学:《编译原理与技术》课程教学资源(PPT课件讲稿)第9章 独立于机器的优化.ppt
- 中国科学技术大学:《编译原理与技术》课程教学资源(PPT课件讲稿)第8章 代码生成.ppt
- 中国科学技术大学:《编译原理与技术》课程教学资源(PPT课件讲稿)第7章 中间代码生成.ppt
- 中国科学技术大学:《编译原理与技术》课程教学资源(PPT课件讲稿)第13章 函数式语言的编译.ppt
- 中国科学技术大学:《编译原理与技术》课程教学资源(PPT课件讲稿)第12章 面向对象语言的编译.ppt
- 中国科学技术大学:《编译原理与技术》课程教学资源(PPT课件讲稿)第11章 编译系统和运行系统.ppt
- 中国科学技术大学:《程序设计语言理论》课程教学资源(参考教材)第1章 引言.pdf
- 中国科学技术大学:《程序设计语言理论》课程教学资源(参考教材)第2章 泛代数和代数数据类型.pdf
- 中国科学技术大学:《程序设计语言理论》课程教学资源(参考教材)第6章 递归类型.pdf
- 中国科学技术大学:《程序设计语言理论》课程教学资源(PPT课件讲稿)第1章 引言(主讲:陈意云).ppt
- 中国科学技术大学:《程序设计语言理论》课程教学资源(PPT课件讲稿)第2章 泛代数和代数数据类型.ppt
- 中国科学技术大学:《程序设计语言理论》课程教学资源(PPT课件讲稿)第3章 简单类型化λ演算.ppt
- 中国科学技术大学:《程序设计语言理论》课程教学资源(PPT课件讲稿)第4章 类型化λ演算的模型.ppt
- 中国科学技术大学:《程序设计语言理论》课程教学资源(PPT课件讲稿)第5章 命令式程序的语义.ppt
- 中国科学技术大学:《程序设计语言理论》课程教学资源(PPT课件讲稿)第6章 递归类型.ppt
- 中国科学技术大学:《程序设计语言理论》课程教学资源(PPT课件讲稿)第7章 多态性.ppt
- 中国科学技术大学:《程序设计语言理论》课程教学资源(PPT课件讲稿)第8章 依赖类型.ppt
- 中国科学技术大学:《程序设计语言理论》课程教学资源(PPT课件讲稿)第9章 类型推断.ppt
- 中国科学技术大学:《程序设计语言理论》课程教学资源(PPT课件讲稿)第10章 子定型.ppt
- 华中科技大学:《大学计算机基础》课程教学资源(课件讲稿)第五章 程序设计的其它方法与技术.pdf
- 复旦大学:《C语言程序设计》课程教学资源(课件讲稿)指针.ppt
- 复旦大学:《C语言程序设计》课程教学资源(课件讲稿)第1章 程序设计和C语言.pdf
- 北京中医药大学:《计算机基础》课程教学资源(教学大纲,Ⅰ,主讲:黄友良).doc
- 北京中医药大学:《计算机基础》课程教学资源(电子教材)第一章 数据库基础知识.doc
- 北京中医药大学:《计算机基础》课程教学资源(电子教材)第二章 数据库和表.doc
- 北京中医药大学:《计算机基础》课程教学资源(电子教材)第五章 关系数据库标准语言——SQL.doc