equal
deleted
inserted
replaced
27 Term.betapply(P, Bound 0)); |
27 Term.betapply(P, Bound 0)); |
28 |
28 |
29 fun mk_Collect (a, D, t) = @{const Collect} $ D $ absfree (a, iT, t); |
29 fun mk_Collect (a, D, t) = @{const Collect} $ D $ absfree (a, iT, t); |
30 |
30 |
31 (*simple error-checking in the premises of an inductive definition*) |
31 (*simple error-checking in the premises of an inductive definition*) |
32 fun chk_prem rec_hd (Const (@{const_name "op &"}, _) $ _ $ _) = |
32 fun chk_prem rec_hd (Const (@{const_name conj}, _) $ _ $ _) = |
33 error"Premises may not be conjuctive" |
33 error"Premises may not be conjuctive" |
34 | chk_prem rec_hd (Const (@{const_name mem}, _) $ t $ X) = |
34 | chk_prem rec_hd (Const (@{const_name mem}, _) $ t $ X) = |
35 (Logic.occs(rec_hd,t) andalso error "Recursion term on left of member symbol"; ()) |
35 (Logic.occs(rec_hd,t) andalso error "Recursion term on left of member symbol"; ()) |
36 | chk_prem rec_hd t = |
36 | chk_prem rec_hd t = |
37 (Logic.occs(rec_hd,t) andalso error "Recursion term in side formula"; ()); |
37 (Logic.occs(rec_hd,t) andalso error "Recursion term in side formula"; ()); |
94 (*Make a datatype's domain: form the union of its set parameters*) |
94 (*Make a datatype's domain: form the union of its set parameters*) |
95 fun union_params (rec_tm, cs) = |
95 fun union_params (rec_tm, cs) = |
96 let val (_,args) = strip_comb rec_tm |
96 let val (_,args) = strip_comb rec_tm |
97 fun is_ind arg = (type_of arg = iT) |
97 fun is_ind arg = (type_of arg = iT) |
98 in case filter is_ind (args @ cs) of |
98 in case filter is_ind (args @ cs) of |
99 [] => @{const 0} |
99 [] => @{const zero} |
100 | u_args => Balanced_Tree.make mk_Un u_args |
100 | u_args => Balanced_Tree.make mk_Un u_args |
101 end; |
101 end; |
102 |
102 |
103 |
103 |
104 (*Includes rules for succ and Pair since they are common constructions*) |
104 (*Includes rules for succ and Pair since they are common constructions*) |