equal
deleted
inserted
replaced
|
1 |
1 |
2 |
2 Goal "A -->A"; |
3 Goal "A -->A"; |
3 by Auto_tac; |
4 by Auto_tac; |
4 qed "foo"; |
5 qed "foo"; |
5 |
6 |
192 |
193 |
193 |
194 |
194 fun prover s = prove_goal HOL.thy s (fn _ => [blast_tac HOL_cs 1]); |
195 fun prover s = prove_goal HOL.thy s (fn _ => [blast_tac HOL_cs 1]); |
195 |
196 |
196 |
197 |
197 |
198 exception powerError; |
|
199 |
|
200 fun power (x, n) = if x = 0 andalso n = 0 |
|
201 then raise powerError |
|
202 else if n = 0 |
|
203 then 1 |
|
204 else x * power (x, n-1); |
|
205 |
|
206 |
|
207 fun get_tens n = power(10, (n-1)) |
|
208 |
|
209 |
|
210 fun digits_to_int [] posn n = n |
|
211 | digits_to_int (x::xs) posn n = let |
|
212 val digit_val = ((ord x) - 48)*(get_tens posn) |
|
213 in |
|
214 digits_to_int xs (posn -1 )(n + digit_val) |
|
215 end; |
|
216 |
|
217 fun int_of_string str = let |
|
218 val digits = explode str |
|
219 val posn = length digits |
|
220 in |
|
221 digits_to_int digits posn 0 |
|
222 end |
198 |
223 |
199 |
224 |
200 exception ASSERTION of string; |
225 exception ASSERTION of string; |