author | paulson |
Tue, 16 Jul 1996 15:49:46 +0200 | |
changeset 1868 | 836950047d85 |
parent 1847 | 58ab3b74a344 |
child 3817 | f20f193d42b4 |
permissions | -rw-r--r-- |
1537 | 1 |
(* Title: FOL/ex/IffOracle |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1996 University of Cambridge |
|
5 |
||
6 |
Example of how to use an oracle |
|
7 |
*) |
|
8 |
||
1847
58ab3b74a344
Modified to reject certain inputs -- illustrates error handling
paulson
parents:
1537
diff
changeset
|
9 |
invoke_oracle (IffOracle.thy, sign_of IffOracle.thy, IffOracleExn 2); |
1537 | 10 |
invoke_oracle (IffOracle.thy, sign_of IffOracle.thy, IffOracleExn 10); |
11 |
#der(rep_thm it); |
|
12 |
||
1847
58ab3b74a344
Modified to reject certain inputs -- illustrates error handling
paulson
parents:
1537
diff
changeset
|
13 |
(*These oracle calls had better fail*) |
58ab3b74a344
Modified to reject certain inputs -- illustrates error handling
paulson
parents:
1537
diff
changeset
|
14 |
|
58ab3b74a344
Modified to reject certain inputs -- illustrates error handling
paulson
parents:
1537
diff
changeset
|
15 |
(invoke_oracle (IffOracle.thy, sign_of IffOracle.thy, IffOracleExn 5); |
58ab3b74a344
Modified to reject certain inputs -- illustrates error handling
paulson
parents:
1537
diff
changeset
|
16 |
raise ERROR) handle IffOracleExn _ => writeln"Failed, as expected"; |
58ab3b74a344
Modified to reject certain inputs -- illustrates error handling
paulson
parents:
1537
diff
changeset
|
17 |
|
58ab3b74a344
Modified to reject certain inputs -- illustrates error handling
paulson
parents:
1537
diff
changeset
|
18 |
(invoke_oracle (IffOracle.thy, sign_of IffOracle.thy, IffOracleExn 0); |
58ab3b74a344
Modified to reject certain inputs -- illustrates error handling
paulson
parents:
1537
diff
changeset
|
19 |
raise ERROR) handle IffOracleExn _ => writeln"Failed, as expected"; |