src/HOL/Tools/ATP/reduce_axiomsN.ML
author mengj
Sat Feb 11 14:23:35 2006 +0100 (2006-02-11)
changeset 19009 bb29bf9d3a72
parent 18791 9b4ae9fa67a4
child 19035 678ef6658a0e
permissions -rw-r--r--
Added another filter strategy.
mengj@18791
     1
structure ReduceAxiomsN =
mengj@18791
     2
(* Author: Jia Meng, Cambridge University Computer Laboratory
mengj@18791
     3
   
mengj@18791
     4
   Two filtering strategies *)
mengj@18791
     5
mengj@18791
     6
struct
mengj@18791
     7
mengj@18791
     8
val pass_mark = ref 0.5;
mengj@18791
     9
val strategy = ref 1;
mengj@18791
    10
mengj@18791
    11
fun pol_to_int true = 1
mengj@18791
    12
  | pol_to_int false = ~1;
mengj@18791
    13
mengj@18791
    14
fun part refs [] (s1,s2) = (s1,s2)
mengj@18791
    15
  | part refs (s::ss) (s1,s2) = if (s mem refs) then (part refs ss (s::s1,s2)) else (part refs ss (s1,s::s2));
mengj@18791
    16
mengj@18791
    17
mengj@18791
    18
fun pol_mem _ [] = false
mengj@18791
    19
  | pol_mem (pol,const) ((p,c)::pcs) = if ((pol = not p) andalso (const = c)) then true else pol_mem (pol,const) pcs;
mengj@18791
    20
mengj@18791
    21
mengj@18791
    22
fun part_w_pol refs [] (s1,s2) = (s1,s2)
mengj@18791
    23
  | part_w_pol refs (s::ss) (s1,s2) = if (pol_mem s refs) then (part_w_pol refs ss (s::s1,s2)) else (part_w_pol refs ss (s1,s::s2));
mengj@18791
    24
mengj@18791
    25
mengj@18791
    26
fun add_term_consts_rm ncs (Const(c, _)) cs = if (c mem ncs) then cs else (c ins_string cs)
mengj@18791
    27
  | add_term_consts_rm ncs (t $ u) cs =
mengj@18791
    28
      add_term_consts_rm ncs t (add_term_consts_rm ncs u cs)
mengj@18791
    29
  | add_term_consts_rm ncs (Abs(_,_,t)) cs = add_term_consts_rm ncs t cs
mengj@18791
    30
  | add_term_consts_rm ncs _ cs = cs;
mengj@18791
    31
mengj@18791
    32
fun term_consts_rm ncs t = add_term_consts_rm ncs t [];
mengj@18791
    33
mengj@18791
    34
fun consts_of_term term = term_consts_rm ["Trueprop","==>","all","Ex","op &", "op |", "Not", "All", "op -->", "op =", "==", "True", "False"] term;
mengj@18791
    35
mengj@18791
    36
mengj@18791
    37
fun add_term_pconsts_rm ncs (Const(c,_)) pol cs = if (c mem ncs) then cs else ((pol,c) ins cs)
mengj@18791
    38
  | add_term_pconsts_rm ncs (Const("Not",_)$P) pol cs = add_term_pconsts_rm ncs P (not pol) cs
mengj@18791
    39
  | add_term_pconsts_rm ncs (P$Q) pol cs = 
mengj@18791
    40
    add_term_pconsts_rm ncs P pol (add_term_pconsts_rm ncs Q pol cs)
mengj@18791
    41
  | add_term_pconsts_rm ncs (Abs(_,_,t)) pol cs = add_term_pconsts_rm ncs t pol cs
mengj@18791
    42
  | add_term_pconsts_rm ncs _ _ cs = cs;
mengj@18791
    43
mengj@18791
    44
mengj@18791
    45
fun term_pconsts_rm ncs t = add_term_pconsts_rm ncs t true [];
mengj@18791
    46
mengj@18791
    47
mengj@18791
    48
fun pconsts_of_term term = term_pconsts_rm ["Trueprop","==>","all","Ex","op &", "op |", "Not", "All", "op -->", "op =", "==", "True", "False"] term;
mengj@18791
    49
mengj@18791
    50
fun consts_in_goal goal = consts_of_term goal;
mengj@18791
    51
fun get_goal_consts cs = foldl (op union_string) [] (map consts_in_goal cs);
mengj@18791
    52
mengj@18791
    53
mengj@18791
    54
fun pconsts_in_goal goal = pconsts_of_term goal;
mengj@18791
    55
fun get_goal_pconsts cs = foldl (op union) [] (map pconsts_in_goal cs);
mengj@18791
    56
mengj@18791
    57
mengj@18791
    58
(*************************************************************************)
mengj@18791
    59
(*            the first relevance filtering strategy                     *)
mengj@18791
    60
(*************************************************************************)
mengj@18791
    61
mengj@18791
    62
fun find_clause_weight_s_1 (refconsts : string list) consts wa = 
mengj@18791
    63
    let val (rel,irrel) = part refconsts consts ([],[])
mengj@18791
    64
    in
mengj@18791
    65
	((real (length rel))/(real (length consts))) * wa
mengj@18791
    66
    end;
mengj@18791
    67
mengj@18791
    68
fun find_clause_weight_m_1 [] (_,w) = w 
mengj@18791
    69
  | find_clause_weight_m_1 ((_,(refconsts,wa))::y) (consts,w) =
mengj@18791
    70
    let val w' = find_clause_weight_s_1 refconsts consts wa
mengj@18791
    71
    in
mengj@18791
    72
	if (w < w') then find_clause_weight_m_1 y (consts,w')
mengj@18791
    73
	else find_clause_weight_m_1 y (consts,w)
mengj@18791
    74
    end;
mengj@18791
    75
mengj@18791
    76
mengj@18791
    77
fun relevant_clauses_ax_g_1 _ []  _ (ax,r) = (ax,r)
mengj@18791
    78
  | relevant_clauses_ax_g_1 gconsts  ((clsthm,(consts,_))::y) P (ax,r) =
mengj@18791
    79
    let val weight = find_clause_weight_s_1 gconsts consts 1.0
mengj@18791
    80
    in
mengj@18791
    81
	if  P <= weight then relevant_clauses_ax_g_1 gconsts y P ((clsthm,(consts,weight))::ax,r)
mengj@18791
    82
	else relevant_clauses_ax_g_1 gconsts y P (ax,(clsthm,(consts,weight))::r)
mengj@18791
    83
    end;
mengj@18791
    84
mengj@18791
    85
mengj@18791
    86
fun relevant_clauses_ax_1 rel_axs  [] P (addc,tmpc) keep = 
mengj@18791
    87
    (case addc of [] => rel_axs @ keep
mengj@18791
    88
		| _ => case tmpc of [] => addc @ rel_axs @ keep
mengj@18791
    89
				  | _ => relevant_clauses_ax_1 addc tmpc P ([],[]) (rel_axs @ keep))
mengj@18791
    90
  | relevant_clauses_ax_1 rel_axs ((clsthm,(consts,weight))::e_axs) P (addc,tmpc) keep = 
mengj@18791
    91
    let val weight' = find_clause_weight_m_1 rel_axs (consts,weight) 
mengj@18791
    92
	val e_ax' = (clsthm,(consts, weight'))
mengj@18791
    93
    in
mengj@18791
    94
	
mengj@18791
    95
	if P <= weight' then relevant_clauses_ax_1 rel_axs e_axs P ((clsthm,(consts,weight'))::addc,tmpc) keep
mengj@18791
    96
	else relevant_clauses_ax_1 rel_axs e_axs P (addc,(clsthm,(consts,weight'))::tmpc) keep 
mengj@18791
    97
    end;
mengj@18791
    98
mengj@18791
    99
mengj@18791
   100
fun initialize [] ax_weights = ax_weights
mengj@18791
   101
  | initialize ((cls,thm)::clss_thms) ax_weights =
mengj@18791
   102
    let val tm = prop_of thm
mengj@18791
   103
	val consts = consts_of_term tm
mengj@18791
   104
    in
mengj@18791
   105
	initialize clss_thms (((cls,thm),(consts,0.0))::ax_weights)
mengj@18791
   106
    end;
mengj@18791
   107
mengj@18791
   108
fun relevance_filter1_aux axioms goals = 
mengj@18791
   109
    let val pass = !pass_mark
mengj@18791
   110
	val axioms_weights = initialize axioms []
mengj@18791
   111
	val goals_consts = get_goal_consts goals
mengj@18791
   112
	val (rel_clauses,nrel_clauses) = relevant_clauses_ax_g_1 goals_consts axioms_weights pass ([],[]) 
mengj@18791
   113
    in
mengj@18791
   114
	relevant_clauses_ax_1 rel_clauses nrel_clauses pass ([],[]) []
mengj@18791
   115
    end;
mengj@18791
   116
mengj@18791
   117
fun relevance_filter1 axioms goals = map fst (relevance_filter1_aux axioms goals);
mengj@18791
   118
mengj@18791
   119
mengj@18791
   120
mengj@18791
   121
mengj@18791
   122
(*************************************************************************)
mengj@18791
   123
(*            the second relevance filtering strategy                    *)
mengj@18791
   124
(*************************************************************************)
mengj@18791
   125
mengj@18791
   126
fun find_clause_weight_s_2 (refpconsts : (bool * string) list) pconsts wa = 
mengj@18791
   127
    let val (rel,irrel) = part_w_pol refpconsts pconsts ([],[])
mengj@18791
   128
    in
mengj@18791
   129
	((real (length rel))/(real (length pconsts))) * wa
mengj@18791
   130
    end;
mengj@18791
   131
mengj@18791
   132
fun find_clause_weight_m_2 [] (_,w) = w 
mengj@18791
   133
  | find_clause_weight_m_2 ((_,(refpconsts,wa))::y) (pconsts,w) =
mengj@18791
   134
    let val w' = find_clause_weight_s_2 refpconsts pconsts wa
mengj@18791
   135
    in
mengj@18791
   136
	if (w < w') then find_clause_weight_m_2 y (pconsts,w')
mengj@18791
   137
	else find_clause_weight_m_2 y (pconsts,w)
mengj@18791
   138
    end;
mengj@18791
   139
mengj@18791
   140
mengj@18791
   141
fun relevant_clauses_ax_g_2 _ []  _ (ax,r) = (ax,r)
mengj@18791
   142
  | relevant_clauses_ax_g_2 gpconsts  ((clsthm,(pconsts,_))::y) P (ax,r) =
mengj@18791
   143
    let val weight = find_clause_weight_s_2 gpconsts pconsts 1.0
mengj@18791
   144
    in
mengj@18791
   145
	if  P <= weight then relevant_clauses_ax_g_2 gpconsts y P ((clsthm,(pconsts,weight))::ax,r)
mengj@18791
   146
	else relevant_clauses_ax_g_2 gpconsts y P (ax,(clsthm,(pconsts,weight))::r)
mengj@18791
   147
    end;
mengj@18791
   148
mengj@18791
   149
mengj@18791
   150
fun relevant_clauses_ax_2 rel_axs  [] P (addc,tmpc) keep = 
mengj@18791
   151
    (case addc of [] => rel_axs @ keep
mengj@18791
   152
		| _ => case tmpc of [] => addc @ rel_axs @ keep
mengj@18791
   153
				  | _ => relevant_clauses_ax_2 addc tmpc P ([],[]) (rel_axs @ keep))
mengj@18791
   154
  | relevant_clauses_ax_2 rel_axs ((clsthm,(pconsts,weight))::e_axs) P (addc,tmpc) keep = 
mengj@18791
   155
    let val weight' = find_clause_weight_m_2 rel_axs (pconsts,weight) 
mengj@18791
   156
	val e_ax' = (clsthm,(pconsts, weight'))
mengj@18791
   157
    in
mengj@18791
   158
	
mengj@18791
   159
	if P <= weight' then relevant_clauses_ax_2 rel_axs e_axs P ((clsthm,(pconsts,weight'))::addc,tmpc) keep
mengj@18791
   160
	else relevant_clauses_ax_2 rel_axs e_axs P (addc,(clsthm,(pconsts,weight'))::tmpc) keep 
mengj@18791
   161
    end;
mengj@18791
   162
mengj@18791
   163
mengj@18791
   164
fun initialize_w_pol [] ax_weights = ax_weights
mengj@18791
   165
  | initialize_w_pol ((cls,thm)::clss_thms) ax_weights =
mengj@18791
   166
    let val tm = prop_of thm
mengj@18791
   167
	val consts = pconsts_of_term tm
mengj@18791
   168
    in
mengj@18791
   169
	initialize_w_pol clss_thms (((cls,thm),(consts,0.0))::ax_weights)
mengj@18791
   170
    end;
mengj@18791
   171
mengj@18791
   172
mengj@18791
   173
fun relevance_filter2_aux axioms goals = 
mengj@18791
   174
    let val pass = !pass_mark
mengj@18791
   175
	val axioms_weights = initialize_w_pol axioms []
mengj@18791
   176
	val goals_consts = get_goal_pconsts goals
mengj@18791
   177
	val (rel_clauses,nrel_clauses) = relevant_clauses_ax_g_2 goals_consts axioms_weights pass ([],[]) 
mengj@18791
   178
    in
mengj@18791
   179
	relevant_clauses_ax_2 rel_clauses nrel_clauses pass ([],[]) []
mengj@18791
   180
    end;
mengj@18791
   181
mengj@18791
   182
fun relevance_filter2 axioms goals = map fst (relevance_filter2_aux axioms goals);
mengj@18791
   183
mengj@19009
   184
(******************************************************************)
mengj@19009
   185
(*       the third relevance filtering strategy                   *)
mengj@19009
   186
(******************************************************************)
mengj@18791
   187
mengj@19009
   188
(*** unit clauses ***)
mengj@19009
   189
datatype clause_type = Unit_neq | Unit_geq | Other
mengj@19009
   190
mengj@19009
   191
val add_unit = ref true;
mengj@19009
   192
mengj@19009
   193
mengj@19009
   194
fun literals_of_term args (Const ("Trueprop",_) $ P) = literals_of_term args P
mengj@19009
   195
  | literals_of_term args (Const ("op |",_) $ P $ Q) = 
mengj@19009
   196
    literals_of_term (literals_of_term args P) Q
mengj@19009
   197
  | literals_of_term args P = (P::args);
mengj@19009
   198
mengj@19009
   199
mengj@19009
   200
fun is_ground t = if (term_vars t = []) then (term_frees t = []) else false;
mengj@19009
   201
mengj@19009
   202
mengj@19009
   203
fun eq_clause_type (P,Q) = 
mengj@19009
   204
    if ((is_ground P) orelse (is_ground Q)) then Unit_geq else Other;
mengj@19009
   205
mengj@19009
   206
fun unit_clause_type (Const ("op =",_) $ P $ Q) = eq_clause_type (P,Q)
mengj@19009
   207
  | unit_clause_type _ = Unit_neq;
mengj@19009
   208
mengj@19009
   209
fun clause_type tm = 
mengj@19009
   210
    let val lits = literals_of_term [] tm
mengj@19009
   211
	val nlits = length lits
mengj@19009
   212
    in 
mengj@19009
   213
	if (nlits > 1) then Other
mengj@19009
   214
	else unit_clause_type (hd lits)
mengj@19009
   215
    end;
mengj@19009
   216
mengj@19009
   217
(*** constants with types ***)
mengj@19009
   218
mengj@19009
   219
datatype const_typ =  CTVar | CType of string * const_typ list
mengj@19009
   220
mengj@19009
   221
fun uni_type (CType (con1,args1)) (CType (con2,args2)) = (con1 = con2) andalso (uni_types args1 args2)
mengj@19009
   222
  | uni_type (CType (_,_)) CTVar = true
mengj@19009
   223
  | uni_type CTVar CTVar = true
mengj@19009
   224
  | uni_type CTVar _ = false
mengj@19009
   225
mengj@19009
   226
and 
mengj@19009
   227
     uni_types [] [] = true
mengj@19009
   228
      | uni_types (a1::as1) (a2::as2) = (uni_type a1 a2) andalso (uni_types as1 as2);
mengj@19009
   229
mengj@19009
   230
mengj@19009
   231
mengj@19009
   232
fun uni_constants (c1,ctp1) (c2,ctp2) = (c1 = c2) andalso (uni_types ctp1 ctp2);
mengj@19009
   233
mengj@19009
   234
fun uni_mem _ [] = false
mengj@19009
   235
  | uni_mem (c,c_typ) ((c1,c_typ1)::ctyps) = (uni_constants (c,c_typ) (c1,c_typ1)) orelse (uni_mem (c,c_typ) ctyps);
mengj@19009
   236
mengj@19009
   237
mengj@19009
   238
mengj@19009
   239
fun const_typ_of (Type (c,typs)) = CType (c,map const_typ_of typs) 
mengj@19009
   240
  | const_typ_of (TFree(_,_)) = CTVar
mengj@19009
   241
  | const_typ_of (TVar(_,_)) = CTVar
mengj@19009
   242
mengj@19009
   243
mengj@19009
   244
fun const_w_typ thy (c,tp) = 
mengj@19009
   245
    let val tvars = Sign.const_typargs thy (c,tp)
mengj@19009
   246
    in
mengj@19009
   247
	(c,map const_typ_of tvars)
mengj@19009
   248
    end;
mengj@19009
   249
mengj@19009
   250
fun add_term_consts_typs_rm thy ncs (Const(c, tp)) cs = if (c mem ncs) then cs else (const_w_typ thy (c,tp) ins cs)
mengj@19009
   251
  | add_term_consts_typs_rm thy ncs (t $ u) cs =
mengj@19009
   252
      add_term_consts_typs_rm thy ncs  t (add_term_consts_typs_rm thy ncs u cs)
mengj@19009
   253
  | add_term_consts_typs_rm thy ncs (Abs(_,_,t)) cs = add_term_consts_typs_rm thy ncs t cs
mengj@19009
   254
  | add_term_consts_typs_rm thy ncs _ cs = cs;
mengj@19009
   255
mengj@19009
   256
fun term_consts_typs_rm thy ncs t = add_term_consts_typs_rm thy ncs t [];
mengj@19009
   257
mengj@19009
   258
fun consts_typs_of_term thy term = term_consts_typs_rm thy ["Trueprop","==>","all","Ex","op &", "op |", "Not", "All", "op -->", "op =", "==", "True", "False"] term;
mengj@19009
   259
mengj@19009
   260
mengj@19009
   261
fun consts_typs_in_goal thy goal = consts_typs_of_term thy goal;
mengj@19009
   262
mengj@19009
   263
fun get_goal_consts_typs thy cs = foldl (op union) [] (map (consts_typs_in_goal thy) cs)
mengj@19009
   264
mengj@19009
   265
mengj@19009
   266
(******** filter clauses ********)
mengj@19009
   267
mengj@19009
   268
fun part3 gctyps [] (s1,s2) = (s1,s2)
mengj@19009
   269
  | part3 gctyps (s::ss) (s1,s2) = if (uni_mem s gctyps) then part3 gctyps ss (s::s1,s2) else part3 gctyps ss (s1,s::s2);
mengj@19009
   270
mengj@19009
   271
mengj@19009
   272
fun find_clause_weight_s_3 gctyps consts_typs wa =
mengj@19009
   273
    let val (rel,irrel) = part3 gctyps consts_typs ([],[])
mengj@19009
   274
    in
mengj@19009
   275
	((real (length rel))/(real (length consts_typs))) * wa
mengj@19009
   276
    end;
mengj@19009
   277
mengj@19009
   278
mengj@19009
   279
fun find_clause_weight_m_3 [] (_,w) = w
mengj@19009
   280
  | find_clause_weight_m_3 ((_,(_,(refconsts_typs,wa)))::y) (consts_typs,w) =
mengj@19009
   281
    let val w' = find_clause_weight_s_3 refconsts_typs consts_typs wa
mengj@19009
   282
    in
mengj@19009
   283
	if (w < w') then find_clause_weight_m_3 y (consts_typs,w')
mengj@19009
   284
	else find_clause_weight_m_3 y (consts_typs,w)
mengj@19009
   285
    end;
mengj@19009
   286
mengj@19009
   287
mengj@19009
   288
fun relevant_clauses_ax_g_3 _ [] _ (ax,r) = (ax,r)
mengj@19009
   289
  | relevant_clauses_ax_g_3 gctyps ((cls_typ,(clsthm,(consts_typs,_)))::y) P (ax,r) =
mengj@19009
   290
    let val weight = find_clause_weight_s_3 gctyps consts_typs 1.0
mengj@19009
   291
    in
mengj@19009
   292
	if P <= weight then relevant_clauses_ax_g_3 gctyps y P ((cls_typ,(clsthm,(consts_typs,weight)))::ax,r)
mengj@19009
   293
	else relevant_clauses_ax_g_3 gctyps y P (ax,(cls_typ,(clsthm,(consts_typs,weight)))::r)
mengj@19009
   294
    end;
mengj@19009
   295
mengj@19009
   296
fun relevant_clauses_ax_3 rel_axs [] P (addc,tmpc) keep =
mengj@19009
   297
    (case addc of [] => (rel_axs @ keep,tmpc)
mengj@19009
   298
		| _ => case tmpc of [] => (addc @ rel_axs @ keep,[])
mengj@19009
   299
				  | _ => relevant_clauses_ax_3 addc tmpc P ([],[]) (rel_axs @ keep))
mengj@19009
   300
  | relevant_clauses_ax_3 rel_axs ((cls_typ,(clsthm,(consts_typs,weight)))::e_axs) P (addc,tmpc) keep =
mengj@19009
   301
    let val weight' = find_clause_weight_m_3 rel_axs (consts_typs,weight)
mengj@19009
   302
	val e_ax' = (cls_typ,(clsthm,(consts_typs,weight')))
mengj@19009
   303
    in
mengj@19009
   304
	if P <= weight' then relevant_clauses_ax_3 rel_axs e_axs P (e_ax'::addc,tmpc) keep
mengj@19009
   305
	else relevant_clauses_ax_3 rel_axs e_axs P (addc,e_ax'::tmpc) keep
mengj@19009
   306
    end;
mengj@19009
   307
mengj@19009
   308
fun initialize3 thy [] ax_weights = ax_weights
mengj@19009
   309
  | initialize3 thy ((cls,thm)::clss_thms) ax_weights =
mengj@19009
   310
    let val tm = prop_of thm
mengj@19009
   311
	val cls_type = clause_type tm
mengj@19009
   312
	val consts = consts_typs_of_term thy tm
mengj@19009
   313
    in
mengj@19009
   314
	initialize3 thy clss_thms ((cls_type,((cls,thm),(consts,0.0)))::ax_weights)
mengj@19009
   315
    end;
mengj@19009
   316
mengj@19009
   317
fun add_unit_clauses ax [] = ax
mengj@19009
   318
  | add_unit_clauses ax ((cls_typ,consts_weight)::cs) =
mengj@19009
   319
    case cls_typ of Unit_neq => add_unit_clauses ((cls_typ,consts_weight)::ax) cs
mengj@19009
   320
		  | Unit_geq => add_unit_clauses ((cls_typ,consts_weight)::ax) cs
mengj@19009
   321
		  | Other => add_unit_clauses ax cs;
mengj@19009
   322
mengj@19009
   323
fun relevance_filter3_aux thy axioms goals = 
mengj@19009
   324
    let val pass = !pass_mark
mengj@19009
   325
	val axioms_weights = initialize3 thy axioms []
mengj@19009
   326
	val goals_consts_typs = get_goal_consts_typs thy goals
mengj@19009
   327
	val (rel_clauses,nrel_clauses) = relevant_clauses_ax_g_3 goals_consts_typs axioms_weights pass ([],[]) 
mengj@19009
   328
	val (ax,r) = relevant_clauses_ax_3 rel_clauses nrel_clauses pass ([],[]) []
mengj@19009
   329
    in
mengj@19009
   330
	if (!add_unit) then add_unit_clauses ax r else ax
mengj@19009
   331
    end;
mengj@19009
   332
mengj@19009
   333
fun relevance_filter3 thy axioms goals = map fst (map snd (relevance_filter3_aux thy axioms goals));
mengj@19009
   334
    
mengj@18791
   335
mengj@18791
   336
mengj@18791
   337
(******************************************************************)
mengj@18791
   338
(* Generic functions for relevance filtering                      *)
mengj@18791
   339
(******************************************************************)
mengj@18791
   340
mengj@18791
   341
exception RELEVANCE_FILTER of string;
mengj@18791
   342
mengj@19009
   343
fun relevance_filter thy axioms goals = 
mengj@18791
   344
    let val cls = (case (!strategy) of 1 => relevance_filter1 axioms goals
mengj@18791
   345
				     | 2 => relevance_filter2 axioms goals
mengj@19009
   346
				     | 3 => relevance_filter3 thy axioms goals
mengj@18791
   347
				     | _ => raise RELEVANCE_FILTER("strategy doesn't exists"))
mengj@18791
   348
    in
mengj@18791
   349
	cls
mengj@18791
   350
    end;
mengj@18791
   351
mengj@18791
   352
mengj@18791
   353
end;