Hol_reln : term quotation -> (thm * thm * thm)
<input-format> ::= <clause> /\ <input-format> | <clause> <clause> ::= (!x1 .. xn. <hypothesis> ==> <conclusion>) | (!x1 .. xn. <conclusion>) <conclusion> ::= <con> sv1 sv2 .... <hypothesis> ::= any term <con> ::= a new relation constant
The Hol_reln function may be used to define multiple relations. These may or may not be mutually recursive. The clauses for each relation need not be contiguous.
The function returns three theorems. Each is also saved in the current theory segment. The first is a conjunction of implications that will be the same as the input term quotation. This theorem is saved under the name <stem>_rules, where <stem> is the name of the first relation defined by the function. The second is the induction principle for the relations, saved under the name <stem>_ind. The third is the cases theorem for the relations, saved under the name <stem>_cases. The cases theorem is of the form
(!a0 .. an. R1 a0 .. an = <R1's first rule possibility> \/ <R1's second rule possibility> \/ ...) /\ (!a0 .. am. R2 a0 .. am = <R2's first rule possibility> \/ <R2's second rule possibility> \/ ...) /\ ...
If the name of the new constants are such that they will produce invalid SML identifiers when bound in a theory file, using export_theory will fail, and suggest the use of set_MLname to fix the problem.
- Hol_reln`EVEN 0 /\ (!n. ODD n ==> EVEN (n + 1)) /\ (!n. EVEN n ==> ODD (n + 1))`; > val it = (|- EVEN 0 /\ (!n. ODD n ==> EVEN (n + 1)) /\ !n. EVEN n ==> ODD (n + 1), |- !EVEN' ODD'. EVEN' 0 /\ (!n. ODD' n ==> EVEN' (n + 1)) /\ (!n. EVEN' n ==> ODD' (n + 1)) ==> (!a0. EVEN a0 ==> EVEN' a0) /\ !a1. ODD a1 ==> ODD' a1, |- (!a0. EVEN a0 = (a0 = 0) \/ ?n. (a0 = n + 1) /\ ODD n) /\ !a1. ODD a1 = ?n. (a1 = n + 1) /\ EVEN n) : thm * thm * thm
- Hol_reln `(!x. RTC R x x) /\ (!x z. (?y. R x y /\ RTC R y z) ==> RTC R x z)`; <<HOL message: inventing new type variable names: 'a>> > val it = (|- !R. (!x. RTC R x x) /\ !x z. (?y. R x y /\ RTC R y z) ==> RTC R x z, |- !R RTC'. (!x. RTC' x x) /\ (!x z. (?y. R x y /\ RTC' y z) ==> RTC' x z) ==> !a0 a1. RTC R a0 a1 ==> RTC' a0 a1, |- !R a0 a1. RTC R a0 a1 = (a1 = a0) \/ ?y. R a0 y /\ RTC R y a1) : thm * thm * thm