| author | paulson | 
| Thu, 26 Sep 1996 16:12:25 +0200 | |
| changeset 2035 | e329b36d9136 | 
| 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: 
1537diff
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: 
1537diff
changeset | 13 | (*These oracle calls had better fail*) | 
| 
58ab3b74a344
Modified to reject certain inputs -- illustrates error handling
 paulson parents: 
1537diff
changeset | 14 | |
| 
58ab3b74a344
Modified to reject certain inputs -- illustrates error handling
 paulson parents: 
1537diff
changeset | 15 | (invoke_oracle (IffOracle.thy, sign_of IffOracle.thy, IffOracleExn 5); | 
| 
58ab3b74a344
Modified to reject certain inputs -- illustrates error handling
 paulson parents: 
1537diff
changeset | 16 | raise ERROR) handle IffOracleExn _ => writeln"Failed, as expected"; | 
| 
58ab3b74a344
Modified to reject certain inputs -- illustrates error handling
 paulson parents: 
1537diff
changeset | 17 | |
| 
58ab3b74a344
Modified to reject certain inputs -- illustrates error handling
 paulson parents: 
1537diff
changeset | 18 | (invoke_oracle (IffOracle.thy, sign_of IffOracle.thy, IffOracleExn 0); | 
| 
58ab3b74a344
Modified to reject certain inputs -- illustrates error handling
 paulson parents: 
1537diff
changeset | 19 | raise ERROR) handle IffOracleExn _ => writeln"Failed, as expected"; |