src/Tools/isac/Interpret/solve-step.sml
author Walther Neuper <walther.neuper@jku.at>
Mon, 04 May 2020 09:25:51 +0200
changeset 59932 87336f3b021f
parent 59931 cc5b51681c4b
child 59933 92214be419b2
permissions -rw-r--r--
separate Solve_Step.add, rearrange code, prep. Specify_Step
walther@59920
     1
(* Title:  Specify/solve-step.sml
walther@59920
     2
   Author: Walther Neuper
walther@59920
     3
   (c) due to copyright terms
walther@59920
     4
walther@59920
     5
Code for the solve-phase in analogy to structure Specify_Step for the specify-phase.
walther@59920
     6
*)
walther@59920
     7
walther@59920
     8
signature SOLVE_STEP =
walther@59920
     9
sig
walther@59921
    10
  val check: Tactic.input -> Calc.T -> Applicable.T
walther@59931
    11
  val add: Tactic.T -> Istate_Def.T * Proof.context -> Calc.T -> Generate.test_out
walther@59932
    12
  val add_general: Tactic.T -> Istate_Def.T * Proof.context -> Calc.T -> Generate.test_out
walther@59932
    13
  val s_add_general: State_Steps.T ->
walther@59932
    14
    Ctree.ctree * Pos.pos' list * Pos.pos' -> Ctree.ctree * Pos.pos' list * Pos.pos'
walther@59932
    15
walther@59921
    16
(* ---- for tests only: shifted from below to remove the Warning "unused" at fun.def. --------- *)
walther@59921
    17
  (*NONE*)                                                     
walther@59921
    18
(*/-------------------------------------------------------- ! aktivate for Test_Isac BEGIN ---\* )
walther@59921
    19
  (*NONE*)                                                     
walther@59921
    20
( *\--- ! aktivate for Test_Isac END ----------------------------------------------------------/*)
walther@59920
    21
end
walther@59920
    22
walther@59920
    23
(**)
walther@59920
    24
structure Solve_Step(** ): SOLVE_STEP( **) =
walther@59920
    25
struct
walther@59920
    26
(**)
walther@59920
    27
walther@59922
    28
(*
walther@59922
    29
  check tactics (input by the user, mostly) for applicability
walther@59922
    30
  and determine as much of the result of the tactic as possible initially.
walther@59922
    31
*)
walther@59932
    32
fun check (Tactic.Apply_Method mI) (pt, (p, _)) =
walther@59932
    33
      let
walther@59932
    34
        val (dI, pI, probl, ctxt) = case Ctree.get_obj I pt p of
walther@59932
    35
          Ctree.PblObj {origin = (_, (dI, pI, _), _), probl, ctxt, ...} => (dI, pI, probl, ctxt)
walther@59932
    36
        | _ => raise ERROR "Specify_Step.check Apply_Method: uncovered case Ctree.get_obj"
walther@59932
    37
        val {where_, ...} = Specify.get_pbt pI
walther@59932
    38
        val pres = map (Model.mk_env probl |> subst_atomic) where_
walther@59932
    39
        val ctxt = if ContextC.is_empty ctxt (*vvvvvvvvvvvvvv DO THAT EARLIER?!?*)
walther@59932
    40
          then ThyC.get_theory dI |> Proof_Context.init_global |> ContextC.insert_assumptions pres
walther@59932
    41
          else ctxt
walther@59932
    42
      in
walther@59932
    43
        Applicable.Yes (Tactic.Apply_Method' (mI, NONE, Istate_Def.empty (*filled later*), ctxt))
walther@59932
    44
      end
walther@59932
    45
  | check (Tactic.Calculate op_) (cs as (pt, (p, _))) =
walther@59923
    46
      let 
walther@59928
    47
        val (msg, thy', isa_fn) = ApplicableOLD.from_pblobj_or_detail_calc op_ p pt;
walther@59928
    48
        val f = Calc.current_formula cs;
walther@59923
    49
      in
walther@59923
    50
        if msg = "OK"
walther@59923
    51
        then
walther@59923
    52
    	    case Rewrite.calculate_ (ThyC.get_theory thy') isa_fn f of
walther@59923
    53
    	      SOME (f', (id, thm))
walther@59923
    54
    	        => Applicable.Yes (Tactic.Calculate' (thy', op_, f, (f', (id, thm))))
walther@59929
    55
    	    | NONE => Applicable.No ("'calculate " ^ op_ ^ "' not applicable") 
walther@59923
    56
        else Applicable.No msg                                              
walther@59923
    57
      end
walther@59928
    58
  | check (Tactic.Check_Postcond pI) (_, _) = (*TODO: only applicable, if evaluating to True*)
walther@59928
    59
      Applicable.Yes (Tactic.Check_Postcond' (pI, TermC.empty))
walther@59928
    60
  | check (Tactic.Check_elementwise pred) cs =
walther@59923
    61
      let 
walther@59928
    62
        val f = Calc.current_formula cs;
walther@59923
    63
      in
walther@59928
    64
        Applicable.Yes (Tactic.Check_elementwise' (f, pred, (f, [])))
walther@59923
    65
      end
walther@59923
    66
  | check Tactic.Empty_Tac _ = Applicable.No "Empty_Tac is not applicable"
walther@59929
    67
  | check (Tactic.Free_Solve) _ = Applicable.Yes (Tactic.Free_Solve')
walther@59929
    68
  | check Tactic.Or_to_List cs =
walther@59928
    69
       let 
walther@59929
    70
        val f = Calc.current_formula cs;
walther@59929
    71
        val ls = Prog_Expr.or2list f;
walther@59929
    72
      in
walther@59929
    73
        Applicable.Yes (Tactic.Or_to_List' (f, ls))
walther@59923
    74
      end
walther@59929
    75
  | check (Tactic.Rewrite thm) (cs as (pt, (p, _))) = 
walther@59923
    76
      let
walther@59929
    77
        val (msg, thy', ro, rls', _) = ApplicableOLD.from_pblobj_or_detail_thm thm p pt;
walther@59923
    78
        val thy = ThyC.get_theory thy';
walther@59928
    79
        val f = Calc.current_formula cs;
walther@59923
    80
      in
walther@59923
    81
        if msg = "OK" 
walther@59923
    82
        then
walther@59929
    83
          case Rewrite.rewrite_ thy (Rewrite_Ord.assoc_rew_ord ro) rls' false (snd thm) f of
walther@59929
    84
            SOME (f',asm) => Applicable.Yes (Tactic.Rewrite' (thy', ro, rls', false, thm, f, (f', asm)))
walther@59929
    85
          | NONE => Applicable.No ((thm |> fst |> quote) ^ " not applicable") 
walther@59923
    86
        else Applicable.No msg
walther@59923
    87
      end
walther@59929
    88
  | check (Tactic.Rewrite_Inst (subs, thm)) (cs as (pt, (p, _))) = 
walther@59921
    89
      let 
walther@59921
    90
        val pp = Ctree.par_pblobj pt p;
walther@59921
    91
        val thy' = Ctree.get_obj Ctree.g_domID pt pp;
walther@59921
    92
        val thy = ThyC.get_theory thy';
walther@59921
    93
        val {rew_ord' = ro', erls = erls, ...} = Specify.get_met (Ctree.get_obj Ctree.g_metID pt pp);
walther@59928
    94
        val f = Calc.current_formula cs;
walther@59929
    95
        val subst = Subst.T_from_input thy subs; (*TODO: input requires parse _: _ -> _ option*)
walther@59921
    96
      in 
walther@59929
    97
        case Rewrite.rewrite_inst_ thy (Rewrite_Ord.assoc_rew_ord ro') erls false subst (snd thm) f of
walther@59929
    98
          SOME (f', asm) =>
walther@59929
    99
            Applicable.Yes (Tactic.Rewrite_Inst' (thy', ro', erls, false, subst, thm, f, (f', asm)))
walther@59929
   100
        | NONE => Applicable.No (fst thm ^ " not applicable")
walther@59921
   101
      end
walther@59928
   102
  | check (Tactic.Rewrite_Set rls) (cs as (pt, (p, _))) =
walther@59921
   103
      let 
walther@59923
   104
        val pp = Ctree.par_pblobj pt p; 
walther@59921
   105
        val thy' = Ctree.get_obj Ctree.g_domID pt pp;
walther@59928
   106
        val f = Calc.current_formula cs;
walther@59923
   107
      in
walther@59923
   108
        case Rewrite.rewrite_set_ (ThyC.get_theory thy') false (assoc_rls rls) f of
walther@59921
   109
          SOME (f', asm)
walther@59923
   110
            => Applicable.Yes (Tactic.Rewrite_Set' (thy', false, assoc_rls rls, f, (f', asm)))
walther@59923
   111
          | NONE => Applicable.No (rls ^ " not applicable")
walther@59921
   112
      end
walther@59929
   113
  | check (Tactic.Rewrite_Set_Inst (subs, rls)) (cs as (pt, (p, _))) =
walther@59921
   114
      let 
walther@59921
   115
        val pp = Ctree.par_pblobj pt p;
walther@59921
   116
        val thy' = Ctree.get_obj Ctree.g_domID pt pp;
walther@59921
   117
        val thy = ThyC.get_theory thy';
walther@59928
   118
        val f = Calc.current_formula cs;
walther@59929
   119
    	  val subst = Subst.T_from_input thy subs; (*TODO: input requires parse _: _ -> _ option*)
walther@59921
   120
      in 
walther@59928
   121
        case Rewrite.rewrite_set_inst_ thy false subst (assoc_rls rls) f of
walther@59928
   122
          SOME (f', asm)
walther@59921
   123
            => Applicable.Yes (Tactic.Rewrite_Set_Inst' (thy', false, subst, assoc_rls rls, f, (f', asm)))
walther@59921
   124
        | NONE => Applicable.No (rls ^ " not applicable")
walther@59921
   125
      end
walther@59928
   126
  | check (Tactic.Subproblem (domID, pblID)) (_, _) = 
walther@59928
   127
      Applicable.Yes (Tactic.Subproblem' ((domID, pblID, Method.id_empty), [], 
walther@59928
   128
			  TermC.empty, [], ContextC.empty, Auto_Prog.subpbl domID pblID))
walther@59929
   129
   | check (Tactic.Substitute sube) (cs as (pt, (p, _))) =
walther@59928
   130
      let
walther@59928
   131
        val pp = Ctree.par_pblobj pt p
walther@59928
   132
        val thy = ThyC.get_theory (Ctree.get_obj Ctree.g_domID pt pp)
walther@59928
   133
        val f = Calc.current_formula cs;
walther@59928
   134
		    val {rew_ord', erls, ...} = Specify.get_met (Ctree.get_obj Ctree.g_metID pt pp)
walther@59929
   135
		    val subte = Subst.input_to_terms sube (*TODO: input requires parse _: _ -> _ option*)
walther@59928
   136
		    val subst = Subst.T_from_string_eqs thy sube
walther@59928
   137
		    val ro = Rewrite_Ord.assoc_rew_ord rew_ord'
walther@59928
   138
		  in
walther@59928
   139
		    if foldl and_ (true, map TermC.contains_Var subte)
walther@59928
   140
		    then (*1*)
walther@59928
   141
		      let val f' = subst_atomic subst f
walther@59928
   142
		      in if f = f'
walther@59928
   143
		        then Applicable.No (Subst.string_eqs_to_string sube ^ " not applicable")
walther@59928
   144
		        else Applicable.Yes (Tactic.Substitute' (ro, erls, subte, f, f'))
walther@59928
   145
		      end
walther@59928
   146
		    else (*2*)
walther@59928
   147
		      case Rewrite.rewrite_terms_ thy ro erls subte f of
walther@59928
   148
		        SOME (f', _) =>  Applicable.Yes (Tactic.Substitute' (ro, erls, subte, f, f'))
walther@59928
   149
		      | NONE => Applicable.No (Subst.string_eqs_to_string sube ^ " not applicable")
walther@59928
   150
		  end
walther@59928
   151
  | check (Tactic.Tac id) (cs as (pt, (p, _))) =
walther@59929
   152
      let 
walther@59929
   153
        val pp = Ctree.par_pblobj pt p; 
walther@59929
   154
        val thy' = Ctree.get_obj Ctree.g_domID pt pp;
walther@59929
   155
        val thy = ThyC.get_theory thy';
walther@59929
   156
        val f = Calc.current_formula cs;
walther@59929
   157
      in case id of
walther@59929
   158
        "subproblem_equation_dummy" =>
walther@59929
   159
    	  if TermC.is_expliceq f
walther@59929
   160
    	  then Applicable.Yes (Tactic.Tac_ (thy, UnparseC.term f, id, "subproblem_equation_dummy (" ^ UnparseC.term f ^ ")"))
walther@59929
   161
    	  else Applicable.No "applicable only to equations made explicit"
walther@59929
   162
      | "solve_equation_dummy" =>
walther@59929
   163
    	  let val (id', f') = ApplicableOLD.split_dummy (UnparseC.term f);
walther@59929
   164
    	  in
walther@59929
   165
    	    if id' <> "subproblem_equation_dummy"
walther@59929
   166
    	    then Applicable.No "no subproblem"
walther@59929
   167
    	    else if (ThyC.to_ctxt thy, f') |-> TermC.parseNEW |> the |> TermC.is_expliceq
walther@59929
   168
    		    then Applicable.Yes (Tactic.Tac_ (thy, UnparseC.term f, id, "[" ^ f' ^ "]"))
walther@59929
   169
    		    else error ("Solve_Step.check: f= " ^ f')
walther@59929
   170
        end
walther@59929
   171
      | _ => Applicable.Yes (Tactic.Tac_ (thy, UnparseC.term f, id, UnparseC.term f))
walther@59921
   172
      end
walther@59923
   173
  | check (Tactic.Take str) _ = Applicable.Yes (Tactic.Take' (TermC.str2term str)) (* always applicable ?*)
walther@59929
   174
  | check (Tactic.Begin_Trans) cs =
walther@59929
   175
      Applicable.Yes (Tactic.Begin_Trans' (Calc.current_formula cs))
walther@59923
   176
  | check (Tactic.End_Trans) (pt, (p, p_)) = (*TODO: check parent branches*)
walther@59923
   177
    if p_ = Pos.Res 
walther@59923
   178
	  then Applicable.Yes (Tactic.End_Trans' (Ctree.get_obj Ctree.g_result pt p))
walther@59923
   179
    else Applicable.No "'End_Trans' is not applicable at the beginning of a transitive sequence"
walther@59921
   180
  | check Tactic.End_Proof' _ = Applicable.Yes Tactic.End_Proof''
walther@59921
   181
  | check m _ = raise ERROR ("Solve_Step.check called for " ^ Tactic.input_to_string m);
walther@59920
   182
walther@59932
   183
fun add (Tactic.Apply_Method' (_, topt, is, _)) (_, ctxt) (pt, pos as (p, _)) = 
walther@59932
   184
    (case topt of 
walther@59932
   185
      SOME t => 
walther@59932
   186
        let val (pt, c) = Ctree.cappend_form pt p (is, ctxt) t
walther@59932
   187
        in (pos, c, Generate.EmptyMout, pt) end
walther@59932
   188
    | NONE => (pos, [], Generate.EmptyMout, pt))
walther@59932
   189
  | add (Tactic.Take' t) l (pt, (p, _)) = (* val (Take' t) = m; *)
walther@59931
   190
    let
walther@59931
   191
      val p =
walther@59931
   192
        let val (ps, p') = split_last p (* no connex to prev.ppobj *)
walther@59931
   193
	      in if p' = 0 then ps @ [1] else p end
walther@59931
   194
      val (pt, c) = Ctree.cappend_form pt p l t
walther@59931
   195
    in
walther@59931
   196
      ((p, Pos.Frm), c, Generate.FormKF (UnparseC.term t), pt)
walther@59931
   197
    end
walther@59931
   198
  | add (Tactic.Begin_Trans' t) l (pt, (p, Pos.Frm)) =
walther@59931
   199
    let
walther@59931
   200
      val (pt, c) = Ctree.cappend_form pt p l t
walther@59931
   201
      val pt = Ctree.update_branch pt p Ctree.TransitiveB (*040312*)
walther@59931
   202
      (* replace the old PrfOjb ~~~~~ *)
walther@59931
   203
      val p = (Pos.lev_on o Pos.lev_dn (* starts with [...,0] *)) p
walther@59931
   204
      val (pt, c') = Ctree.cappend_form pt p l t (*FIXME.0402 same istate ???*)
walther@59931
   205
    in
walther@59931
   206
      ((p, Pos.Frm), c @ c', Generate.FormKF (UnparseC.term t), pt)
walther@59931
   207
    end
walther@59931
   208
  | add (Tactic.Begin_Trans' t) l (pt, (p, Pos.Res)) = 
walther@59931
   209
    (*append after existing PrfObj    vvvvvvvvvvvvv*)
walther@59931
   210
    add (Tactic.Begin_Trans' t) l (pt, (Pos.lev_on p, Pos.Frm))
walther@59931
   211
  | add (Tactic.End_Trans' tasm) l (pt, (p, _)) =
walther@59931
   212
    let
walther@59931
   213
      val p' = Pos.lev_up p
walther@59931
   214
      val (pt, c) = Ctree.append_result pt p' l tasm Ctree.Complete
walther@59931
   215
    in
walther@59931
   216
      ((p', Pos.Res), c, Generate.FormKF "DUMMY" (*term2str t ..ERROR (t) has not been declared*), pt)
walther@59931
   217
    end
walther@59931
   218
  | add (Tactic.Rewrite_Inst' (_, _, _, _, subs', thm', f, (f', asm))) (is, ctxt) (pt, (p, _)) =
walther@59931
   219
    let
walther@59931
   220
      val (pt, c) = Ctree.cappend_atomic pt p (is, ctxt) f
walther@59931
   221
        (Tactic.Rewrite_Inst (Subst.T_to_input subs', thm')) (f',asm) Ctree.Complete;
walther@59931
   222
      val pt = Ctree.update_branch pt p Ctree.TransitiveB
walther@59931
   223
    in
walther@59931
   224
      ((p, Pos.Res), c, Generate.FormKF (UnparseC.term f'), pt)
walther@59931
   225
    end
walther@59931
   226
 | add (Tactic.Rewrite' (_, _, _, _, thm', f, (f', asm))) (is, ctxt) (pt, (p, _)) =
walther@59931
   227
   let
walther@59931
   228
     val (pt, c) = Ctree.cappend_atomic pt p (is, ctxt) f (Tactic.Rewrite thm') (f', asm) Ctree.Complete
walther@59931
   229
     val pt = Ctree.update_branch pt p Ctree.TransitiveB
walther@59931
   230
   in
walther@59931
   231
    ((p, Pos.Res), c, Generate.FormKF (UnparseC.term f'), pt)
walther@59931
   232
   end
walther@59931
   233
  | add (Tactic.Rewrite_Set_Inst' (_, _, subs', rls', f, (f', asm))) (is, ctxt) (pt, (p, _)) =
walther@59931
   234
    let
walther@59931
   235
      val (pt, c) = Ctree.cappend_atomic pt p (is, ctxt) f 
walther@59931
   236
        (Tactic.Rewrite_Set_Inst (Subst.T_to_input subs', Rule_Set.id rls')) (f', asm) Ctree.Complete
walther@59931
   237
      val pt = Ctree.update_branch pt p Ctree.TransitiveB
walther@59931
   238
    in
walther@59931
   239
      ((p, Pos.Res), c, Generate.FormKF (UnparseC.term f'), pt)
walther@59931
   240
    end
walther@59931
   241
  | add (Tactic.Rewrite_Set' (_, _, rls', f, (f', asm))) (is, ctxt) (pt, (p, _)) =
walther@59931
   242
    let
walther@59931
   243
      val (pt, c) = Ctree.cappend_atomic pt p (is, ctxt) f 
walther@59931
   244
        (Tactic.Rewrite_Set (Rule_Set.id rls')) (f', asm) Ctree.Complete
walther@59931
   245
      val pt = Ctree.update_branch pt p Ctree.TransitiveB
walther@59931
   246
    in
walther@59931
   247
      ((p, Pos.Res), c, Generate.FormKF (UnparseC.term f'), pt)
walther@59931
   248
    end
walther@59931
   249
  | add (Tactic.Check_Postcond' (_, scval)) l (pt, (p, _)) =
walther@59931
   250
      let
walther@59931
   251
        val (pt, c) = Ctree.append_result pt p l (scval, []) Ctree.Complete
walther@59931
   252
      in
walther@59931
   253
        ((p, Pos.Res), c, Generate.FormKF (UnparseC.term scval), pt)
walther@59931
   254
      end
walther@59931
   255
  | add (Tactic.Calculate' (_, op_, f, (f', _))) l (pt, (p, _)) =
walther@59931
   256
      let
walther@59931
   257
        val (pt,c) = Ctree.cappend_atomic pt p l f (Tactic.Calculate op_) (f', []) Ctree.Complete
walther@59931
   258
      in
walther@59931
   259
        ((p, Pos.Res), c, Generate.FormKF (UnparseC.term f'), pt)
walther@59931
   260
      end
walther@59931
   261
  | add (Tactic.Check_elementwise' (consts, pred, (f', asm))) l (pt, (p, _)) =
walther@59931
   262
      let
walther@59931
   263
        val (pt,c) = Ctree.cappend_atomic pt p l consts (Tactic.Check_elementwise pred) (f', asm) Ctree.Complete
walther@59931
   264
      in
walther@59931
   265
        ((p, Pos.Res), c, Generate.FormKF (UnparseC.term f'), pt)
walther@59931
   266
      end
walther@59931
   267
  | add (Tactic.Or_to_List' (ors, list)) l (pt, (p, _)) =
walther@59931
   268
      let
walther@59931
   269
        val (pt,c) = Ctree.cappend_atomic pt p l ors Tactic.Or_to_List (list, []) Ctree.Complete
walther@59931
   270
      in
walther@59931
   271
        ((p, Pos.Res), c, Generate.FormKF (UnparseC.term list), pt)
walther@59931
   272
      end
walther@59931
   273
  | add (Tactic.Substitute' (_, _, subte, t, t')) l (pt, (p, _)) =
walther@59931
   274
      let
walther@59931
   275
        val (pt,c) =
walther@59931
   276
          Ctree.cappend_atomic pt p l t (Tactic.Substitute (Subst.eqs_to_input subte)) (t',[]) Ctree.Complete
walther@59931
   277
        in ((p, Pos.Res), c, Generate.FormKF (UnparseC.term t'), pt) 
walther@59931
   278
        end
walther@59931
   279
  | add (Tactic.Tac_ (_, f, id, f')) l (pt, (p, _)) =
walther@59931
   280
      let
walther@59931
   281
        val (pt, c) = Ctree.cappend_atomic pt p l (TermC.str2term f) (Tactic.Tac id) (TermC.str2term f', []) Ctree.Complete
walther@59931
   282
      in
walther@59931
   283
        ((p,Pos.Res), c, Generate.FormKF f', pt)
walther@59931
   284
      end
walther@59931
   285
  | add (Tactic.Subproblem' ((domID, pblID, metID), oris, hdl, fmz_, ctxt_specify, f))
walther@59931
   286
      (l as (_, ctxt)) (pt, (p, _)) =
walther@59932
   287
      let
walther@59932
   288
  	    val (pt, c) = Ctree.cappend_problem pt p l (fmz_, (domID, pblID, metID))
walther@59932
   289
  	      (oris, (domID, pblID, metID), hdl, ctxt_specify)
walther@59932
   290
  	    val f = Syntax.string_of_term (ThyC.to_ctxt (Proof_Context.theory_of ctxt)) f
walther@59932
   291
      in
walther@59932
   292
        ((p, Pos.Pbl), c, Generate.FormKF f, pt)
walther@59932
   293
      end
walther@59932
   294
  | add m' _ (_, pos) =
walther@59932
   295
      raise ERROR ("Solve_Step.add: not impl.for " ^ Tactic.string_of m' ^ " at " ^ Pos.pos'2str pos)
walther@59932
   296
walther@59932
   297
(* LI switches between solve-phase and specify-phase *)
walther@59932
   298
fun add_general tac ic cs =
walther@59932
   299
  if Tactic.for_specify' tac
walther@59932
   300
  then Generate.generate1 tac ic cs
walther@59932
   301
  else add tac ic cs
walther@59932
   302
walther@59932
   303
(* tacis are in reverse order from do_next/specify_: last = fst to insert *)
walther@59932
   304
fun s_add_general [] ptp = ptp
walther@59932
   305
  | s_add_general tacis (pt, c, _) = 
walther@59931
   306
    let
walther@59932
   307
      val (tacis', (_, tac_, (p, is))) = split_last tacis
walther@59932
   308
	    val (p',c',_,pt') = add_general tac_ is (pt, p)
walther@59931
   309
    in
walther@59932
   310
      s_add_general tacis' (pt', c@c', p')
walther@59931
   311
    end
walther@59932
   312
walther@59931
   313
walther@59920
   314
(**)end(**);