@@ -613,9 +613,9 @@ Module Stack.
613613 end
614614 end .
615615
616- Axiom admit_access_for_now :
616+ (* Axiom admit_access_for_now :
617617 forall {A : Set} `{Link A} (Stack : Stack.t) (ref_core : Ref.Core.t A),
618- t Stack ref_core.
618+ t Stack ref_core. *)
619619
620620 Ltac infer :=
621621 cbn ||
@@ -624,8 +624,7 @@ Module Stack.
624624 apply (runner r)
625625 end ||
626626 assumption ||
627- apply Stack.CanAccess.Immediate ||
628- apply admit_access_for_now.
627+ apply Stack.CanAccess.Immediate .
629628 End CanAccess.
630629End Stack.
631630
@@ -813,12 +812,26 @@ Module Run.
813812 (e : LowM.t R Output')
814813 (k : Output.t R (Ref.t Pointer.Kind.Raw Output') -> LowM.t R Output)
815814 (H_e : {{ StackIn 🌲 e }})
816- (H_k : forall (ref_or_exception : Output.t R (Ref.t Pointer.Kind.Raw Output') ),
815+ (H_k : forall (value_or_exception : Output.t R Output'),
817816 let StackIn' :=
818- match ref_or_exception with
817+ match value_or_exception with
819818 | Output.Success _ => StackIn ++ [Output']
820819 | Output.Exception _ => StackIn
821820 end in
821+ let ref_or_exception : Output.t R (Ref.t Pointer.Kind.Raw Output') :=
822+ match value_or_exception with
823+ | Output.Success _ =>
824+ Output.Success {|
825+ Ref.core :=
826+ Ref.Core.Mutable
827+ (List.length StackIn)
828+ []
829+ φ
830+ Some
831+ (fun _ => Some)
832+ |}
833+ | Output.Exception exception => Output.Exception exception
834+ end in
822835 {{ StackIn' 🌲 k ref_or_exception }}
823836 ) :
824837 {{ StackIn 🌲 LowM.LetAlloc e k }}
@@ -883,29 +896,22 @@ Proof.
883896 }
884897 { (* LetAlloc *)
885898 refine (
886- let '(output', stack_in') := evaluate _ _ _ _ run stack_in in
899+ let '(value_or_exception, stack_in') := evaluate _ _ _ _ run stack_in in
900+ _
901+ ).
902+ refine (
903+ let result := H_k value_or_exception in
887904 _
888905 ).
889- destruct output' as [output' | exception].
906+ destruct value_or_exception as [value | exception].
890907 { refine (
891- let ref_core :=
892- Ref.Core.Mutable
893- (List.length StackIn)
894- []
895- φ
896- Some
897- (fun _ => Some) in
898- let ref : Ref.t Pointer.Kind.Raw Output' := {| Ref.core := ref_core |} in
899- _
900- ).
901- refine (
902908 let '(output, stack_out) := _ in
903909 (output, fst (Stack.dealloc (A := Output') stack_out))
904910 ).
905- unshelve eapply (evaluate _ _ _ _ (H_k (Output.Success ref)) _).
906- exact (Stack.alloc stack_in' output' ).
911+ unshelve eapply (evaluate _ _ _ _ result _).
912+ exact (Stack.alloc stack_in' value ).
907913 }
908- { exact (evaluate _ _ _ _ (H_k (Output.Exception exception)) stack_in'). }
914+ { exact (evaluate _ _ _ _ result stack_in'). }
909915 }
910916Defined .
911917
0 commit comments