equal
deleted
inserted
replaced
711 |
711 |
712 (* inference rules *) |
712 (* inference rules *) |
713 |
713 |
714 val promise_ord: (serial * thm future) ord = fn ((i, _), (j, _)) => int_ord (j, i); |
714 val promise_ord: (serial * thm future) ord = fn ((i, _), (j, _)) => int_ord (j, i); |
715 |
715 |
|
716 fun bad_proofs i = |
|
717 error ("Illegal level of detail for proof objects: " ^ string_of_int i); |
|
718 |
716 fun deriv_rule2 f |
719 fun deriv_rule2 f |
717 (Deriv {promises = ps1, body = PBody {oracles = oracles1, thms = thms1, proof = prf1}}) |
720 (Deriv {promises = ps1, body = PBody {oracles = oracles1, thms = thms1, proof = prf1}}) |
718 (Deriv {promises = ps2, body = PBody {oracles = oracles2, thms = thms2, proof = prf2}}) = |
721 (Deriv {promises = ps2, body = PBody {oracles = oracles2, thms = thms2, proof = prf2}}) = |
719 let |
722 let |
720 val ps = Ord_List.union promise_ord ps1 ps2; |
723 val ps = Ord_List.union promise_ord ps1 ps2; |
723 val prf = |
726 val prf = |
724 (case ! Proofterm.proofs of |
727 (case ! Proofterm.proofs of |
725 2 => f prf1 prf2 |
728 2 => f prf1 prf2 |
726 | 1 => MinProof |
729 | 1 => MinProof |
727 | 0 => MinProof |
730 | 0 => MinProof |
728 | i => error ("Illegal level of detail for proof objects: " ^ string_of_int i)); |
731 | i => bad_proofs i); |
729 in make_deriv ps oracles thms prf end; |
732 in make_deriv ps oracles thms prf end; |
730 |
733 |
731 fun deriv_rule1 f = deriv_rule2 (K f) empty_deriv; |
734 fun deriv_rule1 f = deriv_rule2 (K f) empty_deriv; |
732 |
735 |
733 fun deriv_rule0 make_prf = |
736 fun deriv_rule0 make_prf = |
1042 let val Cterm {cert = cert2, t = prop, T, maxidx, sorts} = oracle_fn arg in |
1045 let val Cterm {cert = cert2, t = prop, T, maxidx, sorts} = oracle_fn arg in |
1043 if T <> propT then |
1046 if T <> propT then |
1044 raise THM ("Oracle's result must have type prop: " ^ name, 0, []) |
1047 raise THM ("Oracle's result must have type prop: " ^ name, 0, []) |
1045 else |
1048 else |
1046 let |
1049 let |
1047 val oracle = Proofterm.make_oracle name prop; |
1050 val (oracle, prf) = |
1048 val prf = if ! Proofterm.proofs = 2 then Proofterm.oracle_proof name prop else MinProof; |
1051 (case ! Proofterm.proofs of |
|
1052 2 => ((name, SOME prop), Proofterm.oracle_proof name prop) |
|
1053 | 1 => ((name, SOME prop), MinProof) |
|
1054 | 0 => ((name, NONE), MinProof) |
|
1055 | i => bad_proofs i); |
1049 in |
1056 in |
1050 Thm (make_deriv [] [oracle] [] prf, |
1057 Thm (make_deriv [] [oracle] [] prf, |
1051 {cert = Context.join_certificate (Context.Certificate thy', cert2), |
1058 {cert = Context.join_certificate (Context.Certificate thy', cert2), |
1052 tags = [], |
1059 tags = [], |
1053 maxidx = maxidx, |
1060 maxidx = maxidx, |