src/FOL/ex/declIffOracle.ML
author paulson
Thu, 21 Mar 1996 13:02:26 +0100
changeset 1601 0ef6ea27ab15
parent 1537 3f51f0945a3e
child 1847 58ab3b74a344
permissions -rw-r--r--
Changes required by removal of the theory argument of Theorem
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1537
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
     1
(*  Title:      FOL/ex/declIffOracle
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
     2
    ID:         $Id$
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
     4
    Copyright   1996  University of Cambridge
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
     5
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
     6
Example of how to declare an oracle
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
     7
*)
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
     8
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
     9
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
    10
(*New exception constructor for passing arguments to the oracle*)
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
    11
exception IffOracleExn of int;
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
    12
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
    13
(*Internal syntactic declarations*)
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
    14
val oT = Type("o",[]);
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
    15
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
    16
val iff = Const("op <->", [oT,oT]--->oT);
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
    17
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
    18
fun mk_iff 0 = Const("True", oT)
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
    19
  | mk_iff n = iff $ Free("P", oT) $ mk_iff (n-1);
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
    20
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
    21
val Trueprop = Const("Trueprop",oT-->propT);
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
    22
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
    23
(*Oracle makes tautologies of the form "P <-> P <-> P <-> P <-> True"*)
3f51f0945a3e Example of declaring oracles
paulson
parents:
diff changeset
    24
fun mk_iff_oracle (sign, IffOracleExn n) = Trueprop $ mk_iff (2*n);