@@ -616,10 +616,10 @@ fun write_to_file prog_def = let
616
616
val _ = print ("Program pretty printed to " ^ filename ^ "\n")
617
617
in () end
618
618
619
- val _ = intermediate_prog_prefix := "rigidBody_unopt_ ";
619
+ val _ = intermediate_prog_prefix := "test03_unopt_ ";
620
620
val backend_config_def = arm7_backend_config_def
621
621
val cbv_to_bytes = cbv_to_bytes_arm7
622
- val name = "rigidBodyUnoptProg "
622
+ val name = "test03UnoptProg "
623
623
val prog_def = (Parse.Term ‘
624
624
APPEND ^(reader_def |> concl |> rhs)
625
625
(APPEND ^(intToFP_def |> concl |> rhs)
@@ -638,7 +638,7 @@ val data_prog_def = definition(mk_abbrev_name data_prog_name)
638
638
Overload monad_unitbind[local] = ``data_monad$bind``
639
639
Overload return[local] = ``data_monad$return``
640
640
val _ = monadsyntax.temp_add_monadsyntax()
641
- val _ = install_naming_overloads "scratch ";
641
+ val _ = install_naming_overloads "test01_sum3ProgComp ";
642
642
643
643
val _ = write_to_file data_prog_def;
644
644
**)
@@ -835,15 +835,17 @@ val _ = write_to_file data_prog_def;
835
835
val theAST_float_returns_def =
836
836
Define ‘
837
837
theAST_float_returns ^args w ⇔
838
- ∃ fpOpts st2 fp.
838
+ ( ∃ fpOpts st2 fp.
839
839
let theOpts = FLAT (MAP (λ x. case x of |Apply (_, rws) => rws |_ => []) (HD theAST_plan)) in
840
- evaluate (empty_state with fp_state :=
840
+ ( evaluate (empty_state with fp_state :=
841
841
empty_state.fp_state with
842
842
<| rws := theOpts ; opts := fpOpts; canOpt := FPScope NoOpt |>)
843
843
(theAST_env with v :=
844
844
extend_env_with_vars (REVERSE ^fvars) (REVERSE ^argList) (theAST_env).v)
845
- [^body] = (st2, Rval [FP_WordTree fp]) ∧ compress_word fp = w’
846
- val _ = computeLib.add_funs [list_result_rw, list_result_cond_rw]
845
+ [^body] = (st2, Rval [FP_WordTree fp])) ∧ (compress_word fp = w))’
846
+ val body_doubleExpPlan = store_thm (" body_doubleExpPlan" ,
847
+ Parse.Term ‘isDoubleExpPlan ^body no_fp_opt_conf (HD theAST_plan)’,
848
+ EVAL_TAC);
847
849
val freeVars_list_body = store_thm (" freeVars_list_body" ,
848
850
Parse.Term ‘
849
851
∀ (st1:unit semanticPrimitives$state) st2.
@@ -853,26 +855,9 @@ val _ = write_to_file data_prog_def;
853
855
no_fp_opt_conf
854
856
(HD theAST_plan)
855
857
^body’,
856
- rpt strip_tac
857
- \\ gs[theAST_plan_result, freeVars_plan_bound_def, freeVars_arithExp_bound_def, EVERYi_def]
858
- \\ rpt conj_tac
859
- (* Non-let goals automatically solved *)
860
- \\ rpt (
861
- gs[freeVars_fp_bound_def, extend_env_with_vars_def, EVERYi_def]
862
- \\ qmatch_goalsub_abbrev_tac ‘freeVars_arithExp_bound st1 st2 theAST_env_new _ _ rewrittenExp’
863
- \\ qpat_x_assum ‘Abbrev(rewrittenExp = _)’ (assume_tac o EVAL_RULE)
864
- \\ unabbrev_all_tac \\ gs[freeVars_arithExp_bound_def]
865
- \\ rpt strip_tac \\ gs[freeVars_fp_bound_def, EVERYi_def]
866
- \\ rpt (qpat_x_assum `evaluate _ _ _ = _` (fn th => mp_tac (EVAL_RULE th)) )
867
- \\ rpt strip_tac \\ rveq
868
- \\ gs[freeVars_fp_bound_def, extend_env_with_vars_def])
869
- \\ rpt strip_tac \\ gs[freeVars_arithExp_bound_def, freeVars_fp_bound_def, EVERYi_def]
870
- \\ rpt (qpat_x_assum `_ = (_, Rval _)` (fn th => mp_tac (EVAL_RULE th)) )
871
- \\ rpt strip_tac \\ rveq
872
- \\ gs[freeVars_fp_bound_def, namespaceTheory.nsOptBind_def, NULL, listTheory.REV_DEF,
873
- semanticPrimitivesTheory.fp_translate_def,
874
- ml_progTheory.nsLookup_nsBind_compute,extend_env_with_vars_def, list_result_cond_rw]
875
- \\ rveq \\ gs[])
858
+ irule isDoubleExpPlan_freeVars_plan_bound_def \\ conj_tac
859
+ \\ gs[body_doubleExpPlan, freeVars_fp_bound_def, extend_env_with_vars_def]
860
+ \\ rpt strip_tac \\ gs[])
876
861
val freeVars_real_list_body = store_thm (" freeVars_real_list_body" ,
877
862
Parse.Term ‘
878
863
∀ (st1:unit semanticPrimitives$state) st2.
@@ -881,28 +866,9 @@ val _ = write_to_file data_prog_def;
881
866
toRspace (extend_env_with_vars (REVERSE ^fvars) (REVERSE ^argList) (theAST_env).v))
882
867
no_fp_opt_conf (HD theAST_plan)
883
868
^body’,
884
- rpt strip_tac
885
- \\ gs[theAST_plan_result, freeVars_realPlan_bound_def,
886
- freeVars_realExp_bound_def, EVERYi_def, toRspace_def, extend_env_with_vars_def]
887
- \\ rpt conj_tac
888
- (* Non-let goals automatically solved *)
889
- \\ rpt (gs[freeVars_real_bound_def, extend_env_with_vars_def, EVERYi_def,
890
- nsMap_nsBind]
891
- \\ qmatch_goalsub_abbrev_tac ‘freeVars_realExp_bound _ _ theAST_env_new _ _ rewrittenExp’
892
- \\ qpat_x_assum ‘Abbrev(rewrittenExp = _)’ (assume_tac o EVAL_RULE)
893
- \\ unabbrev_all_tac \\ gs[freeVars_realExp_bound_def]
894
- \\ rpt strip_tac \\ gs[freeVars_real_bound_def, EVERYi_def]
895
- \\ rpt (qpat_x_assum `evaluate _ _ _ = _` (fn th => mp_tac (EVAL_RULE th)) )
896
- \\ rpt (COND_CASES_TAC \\ gs[semanticPrimitivesTheory.do_app_def])
897
- \\ rpt strip_tac \\ rveq
898
- \\ gs[freeVars_realExp_bound_def, freeVars_real_bound_def, extend_env_with_vars_def])
899
- \\ rpt strip_tac \\ gs[freeVars_real_bound_def, EVERYi_def]
900
- \\ rpt (qpat_x_assum `evaluate _ _ _ = _` (fn th => mp_tac (EVAL_RULE th)) )
901
- \\ rpt (COND_CASES_TAC \\ gs[semanticPrimitivesTheory.do_app_def])
902
- \\ rpt strip_tac \\ rveq
903
- \\ rpt strip_tac \\ gs[freeVars_real_bound_def,
904
- ml_progTheory.nsLookup_nsBind_compute, namespaceTheory.nsOptBind_def,
905
- toRspace_def, nsMap_nsBind])
869
+ irule isDoubleExpPlan_freeVars_realPlan_bound_def \\ conj_tac
870
+ \\ gs[body_doubleExpPlan, freeVars_real_bound_def, extend_env_with_vars_def, toRspace_def]
871
+ \\ rpt strip_tac \\ gs[nsMap_nsBind])
906
872
val theAST_opt_backward_sim = store_thm (" theAST_opt_backward_sim" ,
907
873
Parse.Term ‘theAST_opt_float_option_noopt ^args = SOME w ⇒
908
874
theAST_float_returns ^args (compress_word w)’,
0 commit comments