✆ ✆ ✙ ✣ ✚ ✢ ✆ ✆ ✆ 1 3 Notes�on�Isabelle/HOL�Notation Notes�on�Isabelle/HOL�Notation • In��Isabelle/HOL:� ; A n |] � � � � G Introduction�to�Isabelle/HOL [| A 1 ; A 2 ; …� can�be�read�as�“if� A 1 and� A 2 and�...�and� A n then� G ”� Note:��- P x (P� x )��stands�for�� P� ( x )� ( P ( x )) - P ( x ,� y ) can�be�expressed�as�� P� y or�� ( P� x� x )� y - recall�that�in�higher�order�logic:�functions,�sets�and� predicates�can�be�identified�with�each�other. • ∀ x .� P ,� ∃ x .� P are�quantified�sentences�(where� P may�or�may�not�contain� x ) Jacques�Fleuriot • If�and�only�if�is�expressed�using�“ = “ e.g.�� ( P ∧ Q )� =� ¬ ( ¬ P ∨ ¬ Q ) Automated�Reasoning Automated�Reasoning Introduction�to�Isabelle/HOL�����������������Lecture�8/9 Automated�Reasoning Introduction�to�Isabelle/HOL�����������������Lecture�8/9 2 4 Meta-logic�has Has�decision�procedures Reasoning�in�Isabelle Isabelle Reasoning�in�Isabelle Isabelle Universal�quantifier e.g.�linear�arithmetic Implication� • Forward and�backward proofs Conjunction�“;” Simplifier�does Isabelle rewriting • Natural�Deduction Isabelle/HOL Other� logic… - Introduction�Rules Has�its�own - Elimination�Rules connectives�and Quantifiers: e.g.Propositional, �✂✁☎✄✝✆ ✞✠✟☛✡ ☞☎✌✝✍ sets… e.g� FOL� etc. • Isabelle�tactics/methods Proof�tools: ✎✏✟✠✑✝✆ ☞☎✒ ✟☛✄✠✒ ✌☛✍ blast, auto, etc�… ✓✕✔✝✍ ✖✗✌☎✒ ✘✝✄ � e.g.�“rule”,�“drule”,�“auto”,�… ✖✠✘✝✄ ✁☎✄☎✖✗✒ ✘☛✄✜✛ • We�will�look�at�procedural proofs�i.e.�proofs�will�have�sequences�of� apply (method theorem_name )� Has�reasoning�methods� Hierarchy�of�theories�e.g. sets,�natural� (based�on�natural�deduction�for� numbers,�real�numbers,�security�protocols�… example) Automated�Reasoning Automated�Reasoning Introduction�to�Isabelle/HOL�����������������Lecture�8/9 Automated�Reasoning Introduction�to�Isabelle/HOL�����������������Lecture�8/9 1
✪ ✦ ✧ 7 5 Natural�Deduction�(Cont.) Natural�Deduction�(Cont.) The�Rules�of�the�Game The�Rules�of�the�Game Conjunction�Introduction�rule: • So�far,�we�have�seen�(automatic)�refutation�proofs�mainly premises • Isabelle�uses�mostly� natural� deduction � � ? P � � [|� ? P ;� ? Q |]� ? Q ( conjI ) Isabelle�syntax: • Natural�deduction�aims�to�capture�human�reasoning�patterns�when� doing�formal�logic� conclusion conjunction • Each�logical�connective�has�two�kinds�of�rules: ?Q :�schematic ? P,� variables can�be� • Introduction�Rules:�allow�connective��to�be�inferred “ fat� brackets ” group� premises substituted�for • Elimination�Rules:��allow�consequences��from�connective�to�be�deduced •In�general,�rules�will�involve�other�logical�symbols�e.g.�user�defined�ones In�procedural�style:�mainly reason�backwards Automated�Reasoning Introduction�to�Isabelle/HOL�����������������Lecture�8/9 Automated�Reasoning Introduction�to�Isabelle/HOL�����������������Lecture�8/9 6 8 Natural�Deduction Natural�Deduction A�Simple�Proof A�Simple�Proof Example:��Conjunction�Introduction enables�us�to�introduce�the� ✤ connective Given�that� P is�true�and�that� Q is�true�prove� P ✦✩★ Q ✦ P premises branch� is P Q Isabelle� name� closed conjI for� rule assumption assumption P Q Q P conjI conclusion assumption P ( Q ✦ P ) introduced� in� conclusion conjI P ✦ ( Q� ✦ P ) Forward�proof:� “If�we�have�P�and�we�have�Q�then�we�have�P� ∧ Q” Backward�proof:� “To�prove�P� ✥ Q,�prove�that�P�is�true�and�prove�that�Q�is�true” Assumptions:�� P� � � � Q Automated�Reasoning Introduction�to�Isabelle/HOL�����������������Lecture�8/9 Automated�Reasoning Introduction�to�Isabelle/HOL�����������������Lecture�8/9 2
✪ ✪ 9 11 Other�Introduction�Rules�(II) Other�Introduction�Rules�(II) A�Simple� A�Simple�Backward Backward Proof�in�Isabelle Proof�in�Isabelle [ P ] Given�that� P is�true�and�that� Q is�true�prove� P ✦✩★ Q ✦ P • • Isabelle� keyword name� given� to� resulting� theorem • P Q false disjI1 disjI2 notI lemma a_conj_theorem :�“[|� P ;� Q |]� � � P � � ✦ ( Q ✦ P )” P ∨ Q P ∨ Q ¬ P apply (rule� conjI ) apply assumption� Intuition:� ¬ P� = ( P → false ) apply (rule� conjI ) [ P ] [ Q ] • apply assumption • • • apply assumption • • Isabelle:�“[|�? P � � � ? Q ;� � ? Q � � � ? P |]� � � � � P = Q ” � Q P qed The�method/tactic�called�rule iffI applies�its�argument�(a�theorem)� P = Q Isabelle� commands backwards Automated�Reasoning Introduction�to�Isabelle/HOL�����������������Lecture�8/9 Automated�Reasoning Introduction�to�Isabelle/HOL�����������������Lecture�8/9 10 12 Other�Introduction�Rules�(I) Substitution Substitution Other�Introduction�Rules�(I) In�Isabelle�literature: P [ t / x ]� is�result�of�replacing� x by� t� in� P� Isabelle:��(? P � ✪ � [ P ] Common� ✫ Q ✫ P → ✫ Q ★ impI Note:�this�is�same�as� P ⋅ { t� / x } that�we�saw�before notation: • P � Q • • or�as impI only�positions designated�by� s� = t P [ s� / x ] P → Q variable substituted�by�this�rule Q ssubst P [ t� / x ] impI P → Q |] � ? P� ( ssubst ) Substitution�rule�in�Isabelle: [| ? t� =� ? s� ; ? P� ? s� ? t Note:�[ P ]:�assumption local�to�sub-proof = t � � � t� � Example:�prove�symmetry�of�equality�predicate�i.e. s� = s : Forward:�“If�on�the�the�assumption�that�P�is�true,�Q�can�be�shown�to����� hold,�then�we�can�conclude�P� → Q “ s� = t ( x� = s� ) [ s� / x ]� s� = t s� = s� Justification: Backward:�“ To�prove�P → Q ,�assume�P�is�true�and�prove�that�Q t� = s t� = s follows” More�rules�to�come�… Automated�Reasoning Introduction�to�Isabelle/HOL�����������������Lecture�8/9 Automated�Reasoning Introduction�to�Isabelle/HOL�����������������Lecture�8/9 3
Recommend
More recommend