Changeset 982


Ignore:
Timestamp:
Jun 16, 2011, 2:39:53 PM (8 years ago)
Author:
boender
Message:
  • this should work (see previous commit)
Location:
src/ASM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/ASM/Assembly.ma

    r938 r982  
    44include "ASM/Fetch.ma".
    55include "ASM/Status.ma".
     6include "ASM/FoldStuff.ma".
    67
    78definition assembly_preinstruction ≝
  • src/ASM/AssemblyProof.ma

    r979 r982  
    11include "ASM/Assembly.ma".
    22include "ASM/Interpret.ma".
    3 
    4 (* RUSSEL **)
    5 
    6 include "basics/jmeq.ma".
    7 
    8 notation > "hvbox(a break ≃ b)"
    9   non associative with precedence 45
    10 for @{ 'jmeq ? $a ? $b }.
    11 
    12 notation < "hvbox(term 46 a break maction (≃) (≃\sub(t,u)) term 46 b)"
    13   non associative with precedence 45
    14 for @{ 'jmeq $t $a $u $b }.
    15 
    16 interpretation "john major's equality" 'jmeq t x u y = (jmeq t x u y).
    17 
    18 lemma eq_to_jmeq:
    19   ∀A: Type[0].
    20   ∀x, y: A.
    21     x = y → x ≃ y.
    22   //
    23 qed.
    24 
    25 definition inject : ∀A.∀P:A → Prop.∀a.∀p:P a.Σx:A.P x ≝ λA,P,a,p. dp … a p.
    26 definition eject : ∀A.∀P: A → Prop.(Σx:A.P x) → A ≝ λA,P,c.match c with [ dp w p ⇒ w].
    27 
    28 coercion inject nocomposites: ∀A.∀P:A → Prop.∀a.∀p:P a.Σx:A.P x ≝ inject on a:? to Σx:?.?.
    29 coercion eject nocomposites: ∀A.∀P:A → Prop.∀c:Σx:A.P x.A ≝ eject on _c:Σx:?.? to ?.
    30 
    31 axiom VOID: Type[0].
    32 axiom assert_false: VOID.
    33 definition bigbang: ∀A:Type[0].False → VOID → A.
    34  #A #abs cases abs
    35 qed.
    36 
    37 coercion bigbang nocomposites: ∀A:Type[0].False → ∀v:VOID.A ≝ bigbang on _v:VOID to ?.
    38 
    39 lemma sig2: ∀A.∀P:A → Prop. ∀p:Σx:A.P x. P (eject … p).
    40  #A #P #p cases p #w #q @q
    41 qed.
    42 
    43 lemma jmeq_to_eq: ∀A:Type[0]. ∀x,y:A. x≃y → x=y.
    44  #A #x #y #JMEQ @(jmeq_elim ? x … JMEQ) %
    45 qed.
    46 
    47 coercion jmeq_to_eq: ∀A:Type[0]. ∀x,y:A. ∀p:x≃y.x=y ≝ jmeq_to_eq on _p:?≃? to ?=?.
    48 
    49 (* END RUSSELL **)
    503
    514
     
    162115  ]
    163116qed.
    164 
    165 let rec foldl_strong_internal
    166   (A: Type[0]) (P: list A → Type[0]) (l: list A)
    167   (H: ∀prefix. ∀hd. ∀tl. l = prefix @ [hd] @ tl → P prefix → P (prefix @ [hd]))
    168   (prefix: list A) (suffix: list A) (acc: P prefix) on suffix:
    169     l = prefix @ suffix → P(prefix @ suffix) ≝
    170   match suffix return λl'. l = prefix @ l' → P (prefix @ l') with
    171   [ nil ⇒ λprf. ?
    172   | cons hd tl ⇒ λprf. ?
    173   ].
    174   [ > (append_nil ?)
    175     @ acc
    176   | applyS (foldl_strong_internal A P l H (prefix @ [hd]) tl ? ?)
    177     [ @ (H prefix hd tl prf acc)
    178     | applyS prf
    179     ]
    180   ]
    181 qed.
    182 
    183 definition foldl_strong ≝
    184   λA: Type[0].
    185   λP: list A → Type[0].
    186   λl: list A.
    187   λH: ∀prefix. ∀hd. ∀tl. l = prefix @ [hd] @ tl → P prefix → P (prefix @ [hd]).
    188   λacc: P [ ].
    189     foldl_strong_internal A P l H [ ] l acc (refl …).
    190117
    191118definition bit_elim: ∀P: bool → bool. bool ≝
     
    890817qed.
    891818
    892 lemma pair_destruct: ∀A,B,a1,a2,b1,b2. pair A B a1 a2 = 〈b1,b2〉 → a1=b1 ∧ a2=b2.
    893  #A #B #a1 #a2 #b1 #b2 #EQ destruct /2/
    894 qed.
    895 
    896819axiom eq_bv_to_eq: ∀n.∀v1,v2: BitVector n. eq_bv … v1 v2 = true → v1=v2.
    897820
     
    965888        Some ? (λx.lookup ?? x sigma_map (zero …)) ].
    966889
    967 axiom policy_ok: ∀p. sigma_safe p ≠ None ….
    968 
     890(* stuff about policy *)
     891
     892lemma policy_ok: ∀p. sigma_safe p ≠ None ….
     893 #instr_list whd in match (sigma_safe ?) whd in match (sigma0 ?)
     894 
    969895definition sigma: pseudo_assembly_program → Word → Word ≝
    970896 λp.
Note: See TracChangeset for help on using the changeset viewer.