src/Tools/isac/MathEngBasic/ctree.sml
author Walther Neuper <walther.neuper@jku.at>
Tue, 21 Apr 2020 15:42:50 +0200
changeset 59898 68883c046963
parent 59886 106e7d8723ca
child 59903 5037ca1b112b
permissions -rw-r--r--
replace Celem. with new struct.s in BaseDefinitions/

Note: the remaining code in calcelems.sml shall be destributed to respective struct.s
     1 (* Title: the calctree
     2    Author: Walther Neuper 161228
     3    (c) due to copyright terms
     4 *)
     5 
     6 signature CTREE =
     7 sig
     8   include BASIC_CALC_TREE
     9   include CALC_TREE_NAVIGATION
    10   include CALC_TREE_ACCESS
    11 
    12   val get_pblID : state -> Spec.pblID option
    13 end
    14 
    15 structure Ctree : CTREE =
    16 struct
    17   open CTbasic
    18   open CTnavi
    19   open CTaccess
    20 
    21 fun get_pblID (pt, (p, _)) =
    22   let val p' = par_pblobj pt p
    23   	val (_, pI, _) = get_obj g_spec pt p'
    24   	val (_, (_, oI, _), _) = get_obj g_origin pt p'
    25   in
    26     if pI <> Spec.e_pblID
    27     then SOME pI
    28     else
    29       if oI <> Spec.e_pblID then SOME oI else NONE end;
    30 
    31 
    32 end;
    33 (*/-------------------------------------------------------- ! aktivate for Test_Isac BEGIN ---\* )
    34   open Ctree;
    35   open Pos
    36 ( *\--- ! aktivate for Test_Isac END ----------------------------------------------------------/*)
    37 
    38 (* policy for "open" structures:
    39 --------------------------------
    40 The above "open Ctree" creates an unclear situation with structures, in particular in test/.
    41 This is work in progress, but urges to make policy explicit:
    42 
    43 (1) All structures are closed with a signature; this prepares for re-arrangement of structures.
    44 (2) Some structures are pervasive (e.g. Ctree) such, that an "open" ensures readability locally.
    45 (3) test/ is preceeded by "open" for all structures, in order to ease copy&paste from scr/ to test/
    46 
    47 ad (1) Presently this point is under construction.
    48 ad (2) Such local "open" are kept to a minimum (with the goal to reach Isabelle's state).
    49 ad (3) See https://intra.ist.tugraz.at/hg/isa/file/2ba35efb07b7/test/Tools/isac/Test_Isac.thy#l70
    50 *)