| 7145 |      1 | (*  Title:      HOL/Tools/svc_funcs.ML
 | 
|  |      2 |     ID:         $Id$
 | 
|  |      3 |     Author:     Lawrence C Paulson
 | 
|  |      4 |     Copyright   1999  University of Cambridge
 | 
|  |      5 | 
 | 
|  |      6 | Translation and abstraction functions for the interface to SVC
 | 
|  |      7 | 
 | 
|  |      8 | Based upon the work of Søren T. Heilmann
 | 
|  |      9 | 
 | 
| 7164 |     10 | Integers and naturals are translated as follows:
 | 
|  |     11 |   In a positive context, replace x<y by x+1<=y
 | 
|  |     12 |   In a negative context, replace x<=y by x<y+1
 | 
|  |     13 |   In a negative context, replace x=y by x<y+1 & y<x+1
 | 
|  |     14 | Biconditionals (if-and-only-iff) are expanded if they require such translations
 | 
|  |     15 |   in either operand.
 | 
| 7145 |     16 | 
 | 
| 7164 |     17 | For each variable of type nat, an assumption is added that it is non-negative.
 | 
|  |     18 | *)
 | 
| 7145 |     19 | 
 | 
|  |     20 | structure Svc =
 | 
|  |     21 | struct
 | 
|  |     22 |  val trace = ref false;
 | 
|  |     23 | 
 | 
|  |     24 |  datatype expr =
 | 
|  |     25 |      bracketed_expr of expr
 | 
|  |     26 |    | ref_def_expr of string * expr
 | 
|  |     27 |    | ref_expr of string
 | 
|  |     28 |    | typed_expr of Type * expr
 | 
|  |     29 |    | buildin_expr of string * expr list
 | 
|  |     30 |    | interp_expr of string * expr list
 | 
|  |     31 |    | uninterp_expr of string * expr list
 | 
|  |     32 |    | false_expr 
 | 
|  |     33 |    | true_expr
 | 
|  |     34 |    | distinct_expr of string
 | 
|  |     35 |    | int_expr of int
 | 
|  |     36 |    | rat_expr of int * int
 | 
|  |     37 |  and Type = 
 | 
|  |     38 |      simple_type of string
 | 
|  |     39 |    | array_type of Type * Type
 | 
|  |     40 |    | record_type of (expr * Type) list
 | 
|  |     41 |    | bitvec_type of int;
 | 
|  |     42 | 
 | 
|  |     43 |  open BasisLibrary
 | 
|  |     44 | 
 | 
|  |     45 |  fun toString t =
 | 
|  |     46 |      let fun signedInt i = 
 | 
|  |     47 | 	 if i < 0 then "-" ^ Int.toString (~i)
 | 
|  |     48 | 	 else Int.toString i
 | 
|  |     49 | 	 fun ut(simple_type s) = s ^ " "
 | 
|  |     50 | 	   | ut(array_type(t1, t2)) = "ARRAY " ^ (ut t1) ^ (ut t2)
 | 
|  |     51 | 	   | ut(record_type fl) = 
 | 
|  |     52 | 	     "RECORD" ^ 
 | 
|  |     53 | 	     (foldl (fn (a, (d, t)) => a ^ (ue d) ^ (ut t)) (" ", fl))
 | 
|  |     54 | 	   | ut(bitvec_type n) = "BITVEC " ^ (Int.toString n) ^ " "
 | 
|  |     55 | 	 and ue(bracketed_expr e) = "(" ^ (ue e) ^ ") "
 | 
|  |     56 | 	   | ue(ref_def_expr(r, e)) = "$" ^ r ^ ":" ^ (ue e)
 | 
|  |     57 | 	   | ue(ref_expr r) = "$" ^ r ^ " "
 | 
|  |     58 | 	   | ue(typed_expr(t, e)) = (ut t) ^ (ue e)
 | 
|  |     59 | 	   | ue(buildin_expr(s, l)) = 
 | 
|  |     60 | 	     "(" ^ s ^ (foldl (fn (a, b) => a ^ " " ^ (ue b)) ("", l)) ^ ") "
 | 
|  |     61 | 	   | ue(interp_expr(s, l)) = 
 | 
|  |     62 | 	     "{" ^ s ^ (foldl (fn (a, b) => a ^ " " ^ (ue b)) ("", l)) ^ "} "
 | 
|  |     63 | 	   | ue(uninterp_expr(s, l)) = 
 | 
|  |     64 | 	     "(" ^ s ^ (foldl (fn (a, b) => a ^ " " ^ (ue b)) ("", l)) ^ ") "
 | 
|  |     65 | 	   | ue(false_expr) = "FALSE "
 | 
|  |     66 | 	   | ue(true_expr) = "TRUE "
 | 
|  |     67 | 	   | ue(distinct_expr s) = "@" ^ s ^ " "
 | 
|  |     68 | 	   | ue(int_expr i) = (signedInt i) ^ " "
 | 
|  |     69 | 	   | ue(rat_expr(i, j)) = (signedInt i) ^ "|" ^ (signedInt j) ^ " "
 | 
|  |     70 |      in
 | 
|  |     71 | 	 ue t
 | 
|  |     72 |      end;
 | 
|  |     73 | 
 | 
|  |     74 |  fun valid e = 
 | 
|  |     75 |   let val svc_home = getenv "SVC_HOME" 
 | 
|  |     76 |       val svc_machine = getenv "SVC_MACHINE"
 | 
|  |     77 |       val check_valid = if svc_home = ""
 | 
|  |     78 | 	                then error "Environment variable SVC_HOME not set"
 | 
|  |     79 | 			else if svc_machine = ""
 | 
|  |     80 | 	                then error "Environment variable SVC_MACHINE not set"
 | 
|  |     81 | 			else svc_home ^ "/" ^ svc_machine ^ "/bin/check_valid"
 | 
|  |     82 |       val svc_input = toString e
 | 
|  |     83 |       val _ = if !trace then writeln ("Calling SVC:\n" ^ svc_input) else ()
 | 
|  |     84 |       val svc_input_file  = File.tmp_path (Path.basic "SVM_in");
 | 
|  |     85 |       val svc_output_file = File.tmp_path (Path.basic "SVM_out");
 | 
|  |     86 |       val _ = (File.write svc_input_file svc_input;
 | 
|  |     87 | 	       execute (check_valid ^ " -dump-result " ^ 
 | 
| 7164 |     88 | 			File.sysify_path svc_output_file ^
 | 
|  |     89 | 			" " ^ File.sysify_path svc_input_file ^ 
 | 
| 7145 |     90 | 			"> /dev/null 2>&1"))
 | 
|  |     91 |       val svc_output = File.read svc_output_file
 | 
|  |     92 | 	               handle _ => error "SVC returned no output"
 | 
|  |     93 |       val _ = if !trace then writeln ("SVC Returns:\n" ^ svc_output) else ()
 | 
|  |     94 |   in
 | 
|  |     95 |       String.isPrefix "VALID" svc_output
 | 
|  |     96 |   end
 | 
|  |     97 | 
 | 
|  |     98 |  (*New exception constructor for passing arguments to the oracle*)
 | 
|  |     99 |  exception OracleExn of term;
 | 
|  |    100 | 
 | 
| 7164 |    101 |  fun apply c args =
 | 
|  |    102 |      let val (ts, bs) = ListPair.unzip args
 | 
|  |    103 |      in  (list_comb(c,ts), exists I bs)  end;
 | 
|  |    104 | 
 | 
|  |    105 |  fun is_intnat T = T = HOLogic.intT orelse T = HOLogic.natT;
 | 
|  |    106 |  
 | 
|  |    107 |  (*Determining whether the biconditionals must be unfoled: if there are
 | 
|  |    108 |    int or nat comparisons below*)
 | 
|  |    109 |  val iff_tag =
 | 
|  |    110 |    let fun tag t =
 | 
|  |    111 | 	 let val (c,ts) = strip_comb t
 | 
|  |    112 | 	 in  case c of
 | 
|  |    113 | 	     Const("op &", _)   => apply c (map tag ts)
 | 
|  |    114 | 	   | Const("op |", _)   => apply c (map tag ts)
 | 
|  |    115 | 	   | Const("op -->", _) => apply c (map tag ts)
 | 
|  |    116 | 	   | Const("Not", _)    => apply c (map tag ts)
 | 
|  |    117 | 	   | Const("True", _)   => (c, false)
 | 
|  |    118 | 	   | Const("False", _)  => (c, false)
 | 
|  |    119 | 	   | Const("op =", Type ("fun", [T,_])) => 
 | 
|  |    120 | 		 if T = HOLogic.boolT then
 | 
|  |    121 | 		     (*biconditional: with int/nat comparisons below?*)
 | 
|  |    122 | 		     let val [t1,t2] = ts
 | 
|  |    123 | 			 val (u1,b1) = tag t1
 | 
|  |    124 | 			 and (u2,b2) = tag t2
 | 
|  |    125 | 			 val cname = if b1 orelse b2 then "unfold" else "keep"
 | 
|  |    126 | 		     in 
 | 
|  |    127 | 			(Const ("SVC_Oracle.iff_" ^ cname, dummyT) $ u1 $ u2,
 | 
|  |    128 | 			 b1 orelse b2)
 | 
|  |    129 | 		     end
 | 
|  |    130 | 		 else (*numeric equality*)          (t, is_intnat T)
 | 
|  |    131 | 	   | Const("op <", Type ("fun", [T,_]))  => (t, is_intnat T)
 | 
|  |    132 | 	   | Const("op <=", Type ("fun", [T,_])) => (t, is_intnat T)
 | 
|  |    133 | 	   | _ => (t, false)
 | 
|  |    134 | 	 end
 | 
|  |    135 |    in #1 o tag end;
 | 
|  |    136 | 
 | 
|  |    137 | 
 | 
|  |    138 |  (*Map expression e to 0<=a --> e, where "a" is the name of a nat variable*)
 | 
|  |    139 |  fun add_nat_var (a, e) = 
 | 
|  |    140 |      buildin_expr("=>", [buildin_expr("<=", [int_expr 0, 
 | 
|  |    141 | 					     uninterp_expr (a, [])]),
 | 
|  |    142 | 			 e]);
 | 
|  |    143 | 
 | 
| 7145 |    144 |  (*Translate an Isabelle formula into an SVC expression
 | 
|  |    145 |    pos ["positive"]: true if an assumption, false if a goal*)
 | 
|  |    146 |  fun expr_of pos t =
 | 
|  |    147 |   let
 | 
| 7164 |    148 |     val params = rev (rename_wrt_term t (Term.strip_all_vars t))
 | 
|  |    149 |     and body   = Term.strip_all_body t
 | 
|  |    150 |     val nat_vars = ref ([] : string list)
 | 
|  |    151 |     (*translation of a variable: record all natural numbers*)
 | 
|  |    152 |     fun trans_var (a,T) =
 | 
|  |    153 | 	(if T = HOLogic.natT then nat_vars := (a ins_string (!nat_vars))
 | 
|  |    154 | 	                     else ();
 | 
|  |    155 |          uninterp_expr (a, []))
 | 
|  |    156 |     fun var (Free(a,T))      = trans_var ("F_" ^ a, T)
 | 
|  |    157 |       | var (Var((a, 0), T)) = trans_var (a, T)
 | 
|  |    158 |       | var (Bound i)        = 
 | 
|  |    159 |           let val (a,T) = List.nth (params, i)
 | 
|  |    160 | 	  in  trans_var ("B_" ^ a, T)  end
 | 
|  |    161 |       | var (t $ Bound _)    = var t    (*removing a parameter from a Var*)
 | 
|  |    162 |       | var t = raise OracleExn t;
 | 
|  |    163 |     (*translation of a literal*)
 | 
|  |    164 |     fun lit (Const("Numeral.number_of", _) $ w) = NumeralSyntax.dest_bin w
 | 
|  |    165 |       | lit (Const("0", _)) = 0
 | 
|  |    166 |       | lit (Const("RealDef.0r", _)) = 0
 | 
|  |    167 |       | lit (Const("RealDef.1r", _)) = 1
 | 
|  |    168 |     (*translation of a literal expression [no variables]*)
 | 
|  |    169 |     fun litExp (Const("op +", T) $ x $ y) = (litExp x) + (litExp y)
 | 
|  |    170 |       | litExp (Const("op -", T) $ x $ y) = (litExp x) - (litExp y)
 | 
|  |    171 |       | litExp (Const("op *", T) $ x $ y) = (litExp x) * (litExp y)
 | 
|  |    172 |       | litExp (Const("uminus", _) $ x)   = ~(litExp x)
 | 
|  |    173 |       | litExp t = lit t 
 | 
|  |    174 | 		handle Match => raise OracleExn t
 | 
|  |    175 |     (*translation of a real/rational expression*)
 | 
|  |    176 |     fun suc t = interp_expr("+", [int_expr 1, t])
 | 
|  |    177 |     fun tm (Const("Suc", T) $ x) = suc (tm x)
 | 
|  |    178 |       | tm (Const("op +", T) $ x $ y) = interp_expr("+", [tm x, tm y])
 | 
|  |    179 |       | tm (Const("op -", _) $ x $ y) = 
 | 
|  |    180 | 	  interp_expr("+", [tm x, interp_expr("*", [int_expr ~1, tm y])])
 | 
|  |    181 |       | tm (Const("op *", _) $ x $ y) = interp_expr("*", [tm x, tm y])
 | 
|  |    182 |       | tm (Const("op /", _) $ x $ y) = 
 | 
|  |    183 | 	  interp_expr("*", [tm x, rat_expr(1, litExp y)])
 | 
|  |    184 |       | tm (Const("uminus", _) $ x) = interp_expr("*", [int_expr ~1, tm x])
 | 
|  |    185 |       | tm t = int_expr (lit t) 
 | 
|  |    186 | 	       handle Match => var t
 | 
|  |    187 |     (*translation of a formula*)
 | 
|  |    188 |     and fm pos (Const("op &", _) $ p $ q) =  
 | 
|  |    189 | 	    buildin_expr("AND", [fm pos p, fm pos q])
 | 
|  |    190 |       | fm pos (Const("op |", _) $ p $ q) =  
 | 
|  |    191 | 	    buildin_expr("OR", [fm pos p, fm pos q])
 | 
|  |    192 |       | fm pos (Const("op -->", _) $ p $ q) =  
 | 
|  |    193 | 	    buildin_expr("=>", [fm (not pos) p, fm pos q])
 | 
|  |    194 |       | fm pos (Const("Not", _) $ p) =  
 | 
|  |    195 | 	    buildin_expr("NOT", [fm (not pos) p])
 | 
|  |    196 |       | fm pos (Const("True", _)) = true_expr
 | 
|  |    197 |       | fm pos (Const("False", _)) = false_expr
 | 
|  |    198 |       | fm pos (Const("SVC_Oracle.iff_keep", _) $ p $ q) = 
 | 
|  |    199 | 	     (*polarity doesn't matter*)
 | 
|  |    200 | 	    buildin_expr("=", [fm pos p, fm pos q]) 
 | 
|  |    201 |       | fm pos (Const("SVC_Oracle.iff_unfold", _) $ p $ q) = 
 | 
|  |    202 | 	    buildin_expr("AND",   (*unfolding uses both polarities*)
 | 
|  |    203 | 			 [buildin_expr("=>", [fm (not pos) p, fm pos q]),
 | 
|  |    204 | 			  buildin_expr("=>", [fm (not pos) q, fm pos p])])
 | 
|  |    205 |       | fm pos (t as Const("op =", Type ("fun", [T,_])) $ x $ y) = 
 | 
|  |    206 | 	    let val tx = tm x and ty = tm y
 | 
|  |    207 | 		in if pos orelse T = HOLogic.realT then
 | 
|  |    208 | 		       buildin_expr("=", [tx, ty])
 | 
|  |    209 | 		   else if is_intnat T then
 | 
|  |    210 | 		       buildin_expr("AND", 
 | 
|  |    211 | 				    [buildin_expr("<", [tx, suc ty]), 
 | 
|  |    212 | 				     buildin_expr("<", [ty, suc tx])])
 | 
|  |    213 | 		   else raise OracleExn t
 | 
|  |    214 | 	    end
 | 
|  |    215 | 	(*inequalities: possible types are nat, int, real*)
 | 
|  |    216 |       | fm pos (t as Const("op <",  Type ("fun", [T,_])) $ x $ y) = 
 | 
|  |    217 | 	    if not pos orelse T = HOLogic.realT then
 | 
|  |    218 | 		buildin_expr("<", [tm x, tm y])
 | 
|  |    219 | 	    else if is_intnat T then
 | 
|  |    220 | 		buildin_expr("<=", [suc (tm x), tm y])
 | 
|  |    221 | 	    else raise OracleExn t
 | 
|  |    222 |       | fm pos (t as Const("op <=",  Type ("fun", [T,_])) $ x $ y) = 
 | 
|  |    223 | 	    if pos orelse T = HOLogic.realT then
 | 
|  |    224 | 		buildin_expr("<=", [tm x, tm y])
 | 
|  |    225 | 	    else if is_intnat T then
 | 
|  |    226 | 		buildin_expr("<", [tm x, suc (tm y)])
 | 
|  |    227 | 	    else raise OracleExn t
 | 
|  |    228 |       | fm pos t = var t;
 | 
|  |    229 |       (*entry point, and translation of a meta-formula*)
 | 
|  |    230 |       fun mt pos ((c as Const("Trueprop", _)) $ p) = fm pos (iff_tag p)
 | 
|  |    231 | 	| mt pos ((c as Const("==>", _)) $ p $ q) = 
 | 
|  |    232 | 	    buildin_expr("=>", [mt (not pos) p, mt pos q])
 | 
|  |    233 | 	| mt pos t = fm pos (iff_tag t)  (*it might be a formula*)
 | 
|  |    234 | 
 | 
|  |    235 |       val body_e = mt pos body  (*evaluate now to assign into !nat_vars*)
 | 
| 7145 |    236 |   in 
 | 
| 7164 |    237 |      foldr add_nat_var (!nat_vars, body_e) 
 | 
| 7145 |    238 |   end;
 | 
|  |    239 | 
 | 
|  |    240 | 
 | 
|  |    241 |  (*Generalize an Isabelle formula, replacing by Vars
 | 
| 7164 |    242 |    all subterms not intelligible to SVC.  
 | 
|  |    243 |    Do not present "raw" terms to expr_of; the translation could be unsound!*)
 | 
| 7145 |    244 |  fun abstract t =
 | 
|  |    245 |   let
 | 
| 7164 |    246 |     val params = Term.strip_all_vars t
 | 
|  |    247 |     and body   = Term.strip_all_body t
 | 
|  |    248 |     val Us = map #2 params
 | 
|  |    249 |     val nPar = length params
 | 
|  |    250 |     val vname = ref "V_a"
 | 
|  |    251 |     val pairs = ref ([] : (term*term) list)
 | 
|  |    252 |     fun insert t = 
 | 
|  |    253 | 	let val T = fastype_of t
 | 
|  |    254 | 	    val v = Unify.combound (Var ((!vname,0), Us--->T),
 | 
|  |    255 | 				    0, nPar)
 | 
|  |    256 | 	in  vname := bump_string (!vname); 
 | 
|  |    257 | 	    pairs := (t, v) :: !pairs;
 | 
|  |    258 | 	    v
 | 
|  |    259 | 	end;
 | 
|  |    260 |     fun replace t = 
 | 
|  |    261 | 	case t of
 | 
|  |    262 | 	    Free _  => t  (*but not existing Vars, lest the names clash*)
 | 
|  |    263 | 	  | Bound _ => t
 | 
|  |    264 | 	  | _ => (case gen_assoc (op aconv) (!pairs, t) of
 | 
|  |    265 | 		      Some v => v
 | 
|  |    266 | 		    | None   => insert t)
 | 
|  |    267 |     (*abstraction of a real/rational expression*)
 | 
|  |    268 |     fun rat ((c as Const("op +", _)) $ x $ y) = c $ (rat x) $ (rat y)
 | 
|  |    269 |       | rat ((c as Const("op -", _)) $ x $ y) = c $ (rat x) $ (rat y)
 | 
|  |    270 |       | rat ((c as Const("op /", _)) $ x $ y) = c $ (rat x) $ (rat y)
 | 
|  |    271 |       | rat ((c as Const("op *", _)) $ x $ y) = c $ (rat x) $ (rat y)
 | 
|  |    272 |       | rat ((c as Const("uminus", _)) $ x) = c $ (rat x)
 | 
|  |    273 |       | rat ((c as Const("RealDef.0r", _))) = c
 | 
|  |    274 |       | rat ((c as Const("RealDef.1r", _))) = c 
 | 
|  |    275 |       | rat (t as Const("Numeral.number_of", _) $ w) = t
 | 
|  |    276 |       | rat t = replace t
 | 
|  |    277 |     (*abstraction of an integer expression: no div, mod*)
 | 
|  |    278 |     fun int ((c as Const("op +", _)) $ x $ y) = c $ (int x) $ (int y)
 | 
|  |    279 |       | int ((c as Const("op -", _)) $ x $ y) = c $ (int x) $ (int y)
 | 
|  |    280 |       | int ((c as Const("op *", _)) $ x $ y) = c $ (int x) $ (int y)
 | 
|  |    281 |       | int ((c as Const("uminus", _)) $ x) = c $ (int x)
 | 
|  |    282 |       | int (t as Const("Numeral.number_of", _) $ w) = t
 | 
|  |    283 |       | int t = replace t
 | 
|  |    284 |     (*abstraction of a natural number expression: no minus*)
 | 
|  |    285 |     fun nat ((c as Const("op +", _)) $ x $ y) = c $ (nat x) $ (nat y)
 | 
|  |    286 |       | nat ((c as Const("op *", _)) $ x $ y) = c $ (nat x) $ (nat y)
 | 
|  |    287 |       | nat ((c as Const("Suc", _)) $ x) = c $ (nat x)
 | 
|  |    288 |       | nat (t as Const("0", _)) = t
 | 
|  |    289 |       | nat (t as Const("Numeral.number_of", _) $ w) = t
 | 
|  |    290 |       | nat t = replace t
 | 
|  |    291 |     (*abstraction of a relation: =, <, <=*)
 | 
|  |    292 |     fun rel (T, c $ x $ y) =
 | 
|  |    293 | 	    if T = HOLogic.realT then c $ (rat x) $ (rat y)
 | 
|  |    294 | 	    else if T = HOLogic.intT then c $ (int x) $ (int y)
 | 
|  |    295 | 	    else if T = HOLogic.natT then c $ (nat x) $ (nat y)
 | 
|  |    296 | 	    else if T = HOLogic.boolT then c $ (fm x) $ (fm y)
 | 
|  |    297 | 	    else replace (c $ x $ y)   (*non-numeric comparison*)
 | 
|  |    298 |     (*abstraction of a formula*)
 | 
|  |    299 |     and fm ((c as Const("op &", _)) $ p $ q) = c $ (fm p) $ (fm q)
 | 
|  |    300 |       | fm ((c as Const("op |", _)) $ p $ q) = c $ (fm p) $ (fm q)
 | 
|  |    301 |       | fm ((c as Const("op -->", _)) $ p $ q) = c $ (fm p) $ (fm q)
 | 
|  |    302 |       | fm ((c as Const("Not", _)) $ p) = c $ (fm p)
 | 
|  |    303 |       | fm ((c as Const("True", _))) = c
 | 
|  |    304 |       | fm ((c as Const("False", _))) = c
 | 
|  |    305 |       | fm (t as Const("op =", Type ("fun", [T,_])) $ x $ y) = rel (T, t)
 | 
|  |    306 |       | fm (t as Const("op <", Type ("fun", [T,_])) $ x $ y) = rel (T, t)
 | 
|  |    307 |       | fm (t as Const("op <=", Type ("fun", [T,_])) $ x $ y) = rel (T, t)
 | 
|  |    308 |       | fm t = replace t
 | 
|  |    309 |     (*entry point, and abstraction of a meta-formula*)
 | 
|  |    310 |     fun mt ((c as Const("Trueprop", _)) $ p) = c $ (fm p)
 | 
|  |    311 |       | mt ((c as Const("==>", _)) $ p $ q)  = c $ (mt p) $ (mt q)
 | 
|  |    312 |       | mt t = fm t  (*it might be a formula*)
 | 
| 7145 |    313 |   in (list_all (params, mt body), !pairs) end;
 | 
|  |    314 | 
 | 
| 7164 |    315 |  (*The oracle proves not the original formula but the abstracted version*)
 | 
|  |    316 |  fun oracle (sign, OracleExn P) = 
 | 
|  |    317 |    let val (absP, _) = abstract P
 | 
|  |    318 |        val dummy = if !trace then writeln ("Subgoal abstracted to\n" ^
 | 
|  |    319 | 					   Sign.string_of_term sign absP)
 | 
|  |    320 |                    else ()
 | 
|  |    321 |    in
 | 
|  |    322 |        if valid (expr_of false absP) then absP
 | 
|  |    323 |        else raise OracleExn P
 | 
|  |    324 |    end;
 | 
| 7145 |    325 | 
 | 
|  |    326 | end;
 |