src/Tools/isac/calcelems.sml
changeset 55373 4f3f530f3cf6
parent 55372 32b7d689e299
child 55380 7be2ad0e4acb
     1.1 --- a/src/Tools/isac/calcelems.sml	Fri Jan 31 17:50:50 2014 +0100
     1.2 +++ b/src/Tools/isac/calcelems.sml	Sat Feb 01 16:44:45 2014 +0100
     1.3 @@ -894,6 +894,22 @@
     1.4  type mets = (met ptyp) list;
     1.5  val mets = Unsynchronized.ref ([e_Mets]:mets);
     1.6  
     1.7 +fun coll_metguhs mets =
     1.8 +    let fun node coll (Ptyp (_,[n],ns)) =
     1.9 +	    [(#guh : met -> guh) n]
    1.10 +	and nodes coll [] = coll
    1.11 +	  | nodes coll (n::ns) = (node coll n) @ (nodes coll ns);
    1.12 +    in nodes [] mets end;
    1.13 +
    1.14 +(* val (guh, mets) = ("met_test", !mets);
    1.15 +   *)
    1.16 +fun check_metguh_unique (guh:guh) (mets: (met ptyp) list) =
    1.17 +    if member op = (coll_metguhs mets) guh
    1.18 +    then error ("check_guh_unique failed with '"^guh^"';\n"^
    1.19 +		      "use 'sort_metguhs()' for a list of guhs;\n"^
    1.20 +		      "consider setting 'check_guhs_unique := false'")
    1.21 +    else ();
    1.22 +
    1.23  
    1.24  (*
    1.25  end (*struct*)