src/FOL/ex/IffOracle.ML
author paulson
Thu, 11 Jul 1996 15:02:42 +0200
changeset 1847 58ab3b74a344
parent 1537 3f51f0945a3e
child 3817 f20f193d42b4
permissions -rw-r--r--
Modified to reject certain inputs -- illustrates error handling

(*  Title:      FOL/ex/IffOracle
    ID:         $Id$
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
    Copyright   1996  University of Cambridge

Example of how to use an oracle
*)

invoke_oracle (IffOracle.thy, sign_of IffOracle.thy, IffOracleExn 2);
invoke_oracle (IffOracle.thy, sign_of IffOracle.thy, IffOracleExn 10);
#der(rep_thm it);

(*These oracle calls had better fail*)

(invoke_oracle (IffOracle.thy, sign_of IffOracle.thy, IffOracleExn 5); 
 raise ERROR) handle IffOracleExn _ => writeln"Failed, as expected";  

(invoke_oracle (IffOracle.thy, sign_of IffOracle.thy, IffOracleExn 0); 
 raise ERROR) handle IffOracleExn _ => writeln"Failed, as expected";