test/Tools/isac/Specify/sub-problem.sml
author wneuper <Walther.Neuper@jku.at>
Mon, 20 Nov 2023 10:49:54 +0100
changeset 60765 5e91c279af3a
parent 60752 77958bc6ed7d
permissions -rw-r--r--
followup 2: un-comment / investigate tests, part.review TODO.md
Walther@60610
     1
(* Title:  "Interpret/sub-problem.sml"
Walther@60610
     2
   Author: Walther Neuper
Walther@60610
     3
   (c) due to copyright terms
Walther@60610
     4
*)
Walther@60610
     5
Walther@60610
     6
"-----------------------------------------------------------------------------------------------";
Walther@60610
     7
"table of contents -----------------------------------------------------------------------------";
Walther@60610
     8
"-----------------------------------------------------------------------------------------------";
Walther@60610
     9
"----------- TODO: make steps around Subproblem more helpful: me' ------------------------------";
Walther@60610
    10
"----------- TODO: make steps around Subproblem more helpful: Step.do_next ---------------------";
Walther@60610
    11
"----------- fun common_sub_thy for Sub_Problem ------------------------------------------------";
Walther@60610
    12
"-----------------------------------------------------------------------------------------------";
Walther@60610
    13
"-----------------------------------------------------------------------------------------------";
Walther@60610
    14
"-----------------------------------------------------------------------------------------------";
Walther@60610
    15
Walther@60765
    16
open Tactic
Walther@60765
    17
open Pos
Walther@60765
    18
open Test_Code;
Walther@60610
    19
Walther@60610
    20
"----------- TODO: make steps around Subproblem more helpful: me' ------------------------------";
Walther@60610
    21
"----------- TODO: make steps around Subproblem more helpful: me' ------------------------------";
Walther@60610
    22
"----------- TODO: make steps around Subproblem more helpful: me' ------------------------------";
Walther@60610
    23
(* compare biegelinie-4.sml *)
Walther@60610
    24
val (tac as Model_Problem (*["Biegelinien"]*), (pt, p as ([], Pbl))) =
Walther@60610
    25
Test_Code.init_calc' @{context} [(["Traegerlaenge L", "Streckenlast q_0", "Biegelinie y",
Walther@60736
    26
	    "Randbedingungen [y 0 = (0::real), y L = 0, M_b 0 = 0, M_b L = 0]",
Walther@60736
    27
(*
Walther@60736
    28
  Now follow items for ALL SubProblems,
Walther@60736
    29
  since ROOT MethodC must provide values for "actuals" of ALL SubProblems.
Walther@60736
    30
  See Biegelinie.thy subsection \<open>Survey on Methods\<close>.
Walther@60736
    31
*)
Walther@60736
    32
(*
Walther@60736
    33
  Items for MethodC "IntegrierenUndKonstanteBestimmen2"
Walther@60736
    34
*)
Walther@60736
    35
	    "FunktionsVariable x",
Walther@60736
    36
    (*"Biegelinie y",          ..already input for Problem above*)
Walther@60736
    37
      "AbleitungBiegelinie dy",
Walther@60736
    38
      "Biegemoment M_b",
Walther@60736
    39
      "Querkraft Q",
Walther@60736
    40
(*
Walther@60736
    41
  Item for Problem "LINEAR/system", which by [''no_met''] involves refinement
Walther@60736
    42
*)
Walther@60736
    43
      "GleichungsVariablen [c, c_2, c_3, c_4]"
Walther@60736
    44
],
Walther@60610
    45
("Biegelinie", ["Biegelinien"], ["IntegrierenUndKonstanteBestimmen2"]))]
Walther@60610
    46
Walther@60765
    47
val (tac as Model_Problem (*["vonBelastungZu", "Biegelinien"]*), (pt, p as ([1], Pbl))) =
Walther@60765
    48
  (tac, (pt, p)) |> me' |> me' |> me' |> me' |> me' |> me' |> me' |> me' |> me' |> me'
Walther@60765
    49
  |> me' |> me' |> me' |> me' |> me' |> me' |> me' |> me' |> me' |> me'
Walther@60765
    50
;
Walther@60610
    51
Walther@60610
    52
"----------- TODO: make steps around Subproblem more helpful: Step.do_next ---------------------";
Walther@60610
    53
"----------- TODO: make steps around Subproblem more helpful: Step.do_next ---------------------";
Walther@60610
    54
"----------- TODO: make steps around Subproblem more helpful: Step.do_next ---------------------";
Walther@60610
    55
Walther@60610
    56
val fmz = ["Traegerlaenge L", "Streckenlast q_0", "Biegelinie y",
Walther@60736
    57
	    "Randbedingungen [y 0 = (0::real), y L = 0, M_b 0 = 0, M_b L = 0]",
Walther@60736
    58
	    "FunktionsVariable x",
Walther@60736
    59
    (*"Biegelinie y",          ..already input for Problem above*)
Walther@60736
    60
      "AbleitungBiegelinie dy",
Walther@60736
    61
      "Biegemoment M_b",
Walther@60736
    62
      "Querkraft Q",
Walther@60736
    63
      "GleichungsVariablen [c, c_2, c_3, c_4]"
Walther@60736
    64
];
Walther@60610
    65
val refs =
Walther@60610
    66
  ("Biegelinie", ["Biegelinien"], ["IntegrierenUndKonstanteBestimmen2"]);
Walther@60736
    67
Walther@60610
    68
(*[], Pbl*)val (p,_,f,nxt,_,pt) = Test_Code.init_calc @{context} [(fmz, refs)];
Walther@60765
    69
(*[], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Model_Problem = tac
Walther@60765
    70
(*[], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Add_Given "Traegerlaenge L" = tac
Walther@60765
    71
(*[], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Add_Given "Streckenlast q_0" = tac
Walther@60736
    72
(*[], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Add_Find "Biegelinie y" = tac
Walther@60752
    73
(*[], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Add_Relation "Randbedingungen [y 0 = 0]" = tac
Walther@60765
    74
(*[], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Add_Relation "Randbedingungen [y 0 = 0, y L = 0]" = tac
Walther@60765
    75
(*[], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Add_Relation "Randbedingungen [y 0 = 0, y L = 0, M_b 0 = 0]" = tac
Walther@60765
    76
(*[], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Add_Relation "Randbedingungen [y L = 0, y 0 = 0, M_b 0 = 0, M_b L = 0]" = tac
Walther@60736
    77
(*[], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Specify_Theory "Biegelinie" = tac
Walther@60736
    78
(*[], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Specify_Problem ["Biegelinien"] = tac
Walther@60736
    79
(*[], Met*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Specify_Method ["IntegrierenUndKonstanteBestimmen2"] = tac
Walther@60736
    80
(*[], Met*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Add_Given "FunktionsVariable x" = tac
Walther@60736
    81
(*[], Met*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Add_Given "AbleitungBiegelinie dy" = tac
Walther@60736
    82
(*[], Met*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Add_Given "Biegemoment M_b" = tac
Walther@60736
    83
(*[], Met*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Add_Given "Querkraft Q" = tac
Walther@60765
    84
(*[], Met*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Add_Given "GleichungsVariablen [c]" = tac
Walther@60765
    85
(*[], Met*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Add_Given "GleichungsVariablen [c, c_2]" = tac
Walther@60765
    86
(*[], Met*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Add_Given "GleichungsVariablen [c, c_2, c_3]" = tac
Walther@60765
    87
(*[], Met*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val  Add_Given "GleichungsVariablen [c_2, c, c_3, c_4]" = tac
Walther@60765
    88
Walther@60765
    89
val Add_Given "GleichungsVariablen [c_2, c, c_3, c_4]" = tac
Walther@60736
    90
(*[1], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Apply_Method ["IntegrierenUndKonstanteBestimmen2"] = tac
Walther@60610
    91
            (*INVISIBLE: \<rightarrow>SubProblem (''Biegelinie'', [''vonBelastungZu'', ''Biegelinien''])*)
Walther@60736
    92
(*[1], Pbl*)val (_, ([(tac, _, _)], _, (pt, p))) = Step.do_next p ((pt, e_pos'), []); val Model_Problem = tac
Walther@60736
    93
;
Walther@60610
    94
Walther@60610
    95
"----------- fun common_sub_thy for Sub_Problem ------------------------------------------------";
Walther@60610
    96
"----------- fun common_sub_thy for Sub_Problem ------------------------------------------------";
Walther@60610
    97
"----------- fun common_sub_thy for Sub_Problem ------------------------------------------------";
Walther@60610
    98
val (thy1, thy2) = (@{theory Partial_Fractions}, @{theory Inverse_Z_Transform});
Walther@60610
    99
if Context.theory_name (Sub_Problem.common_sub_thy (thy1, thy2)) = "Inverse_Z_Transform"
Walther@60610
   100
then () else error "common_sub_thy 1";
Walther@60610
   101
Walther@60610
   102
val (thy1, thy2) = (@{theory Inverse_Z_Transform}, @{theory Partial_Fractions});
Walther@60610
   103
if Context.theory_name (Sub_Problem.common_sub_thy (thy1, thy2)) = "Inverse_Z_Transform"
Walther@60610
   104
then () else error "common_sub_thy 2";
Walther@60610
   105
Walther@60610
   106
val (thy1, thy2) = (@{theory Partial_Fractions}, @{theory PolyEq});
Walther@60628
   107
if Context.theory_name (Sub_Problem.common_sub_thy (thy1, thy2)) =
Walther@60628
   108
     Context.theory_name (Know_Store.get_ref_last_thy ())
Walther@60628
   109
(*   Context.theory_name @{theory} ... would make the test dependent from where the test is run,
Walther@60628
   110
                                       e.g. Test_Some.thy or Test_Isac.thy                     *)
Walther@60610
   111
then () else error "common_sub_thy 3";
Walther@60610
   112
Walther@60610
   113
val (thy1, thy2) = (@{theory Partial_Fractions}, @{theory Isac_Knowledge});
Walther@60610
   114
if Context.theory_name (Sub_Problem.common_sub_thy (thy1, thy2)) = "Isac_Knowledge"
Walther@60610
   115
then () else error "common_sub_thy 4";
Walther@60610
   116
Walther@60610
   117
val (thy1, thy2) = (@{theory PolyEq}, @{theory Partial_Fractions});
Walther@60628
   118
if Context.theory_name (Sub_Problem.common_sub_thy (thy1, thy2)) =
Walther@60628
   119
     Context.theory_name (Know_Store.get_ref_last_thy ())
Walther@60628
   120
(*   Context.theory_name @{theory} ... would make the test dependent from where the test is run,
Walther@60628
   121
                                       e.g. Test_Some.thy or Test_Isac.thy                     *)
Walther@60610
   122
then () else error "common_sub_thy 5";
Walther@60610
   123
Walther@60610
   124
val (thy1, thy2) = (@{theory Isac_Knowledge}, @{theory Partial_Fractions});
Walther@60610
   125
if Context.theory_name (Sub_Problem.common_sub_thy (thy1, thy2)) = "Isac_Knowledge"
Walther@60610
   126
then () else error "common_sub_thy 6";