src/FOL/ex/IffOracle.ML
author haftmann
Thu, 16 Jun 2005 10:30:26 +0200
changeset 16406 4f393b8f84b7
parent 16063 7dd4eb2c8055
permissions -rw-r--r--
isa-migrate ++

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

Example of how to use an oracle
*)

val IffOracle_thy = the_context ();
fun iff_oracle n =
  invoke_oracle IffOracle_thy "iff" (Theory.sign_of IffOracle_thy, IffOracleExn n);


iff_oracle 2;
iff_oracle 10;
#der(rep_thm it);

(*These oracle calls had better fail*)

(iff_oracle 5; raise ERROR)
  handle IffOracleExn _ => writeln"Failed, as expected";

(iff_oracle 0; raise ERROR)
  handle IffOracleExn _ => writeln"Failed, as expected";