src/Provers/simp.ML
changeset 611 11098f505bfe
parent 231 cb6a24451544
child 1512 ce37c64244c0
equal deleted inserted replaced
610:ede55dd46f9d 611:11098f505bfe
   615      None => []  |  Some(refl) => [mk_cong sg (f,aTs,rT) refl]
   615      None => []  |  Some(refl) => [mk_cong sg (f,aTs,rT) refl]
   616 end;
   616 end;
   617 
   617 
   618 fun mk_cong_thy thy f =
   618 fun mk_cong_thy thy f =
   619 let val sg = sign_of thy;
   619 let val sg = sign_of thy;
   620     val T = case Sign.Symtab.lookup(#const_tab(Sign.rep_sg sg),f) of
   620     val T = case Sign.const_type sg f of
   621 		None => error(f^" not declared") | Some(T) => T;
   621 		None => error(f^" not declared") | Some(T) => T;
   622     val T' = incr_tvar 9 T;
   622     val T' = incr_tvar 9 T;
   623 in mk_cong_type sg (Const(f,T'),T') end;
   623 in mk_cong_type sg (Const(f,T'),T') end;
   624 
   624 
   625 fun mk_congs thy = filter_out is_fact o flat o map (mk_cong_thy thy);
   625 fun mk_congs thy = filter_out is_fact o flat o map (mk_cong_thy thy);
   627 fun mk_typed_congs thy =
   627 fun mk_typed_congs thy =
   628 let val sg = sign_of thy;
   628 let val sg = sign_of thy;
   629     val S0 = Type.defaultS(#tsig(Sign.rep_sg sg))
   629     val S0 = Type.defaultS(#tsig(Sign.rep_sg sg))
   630     fun readfT(f,s) =
   630     fun readfT(f,s) =
   631 	let val T = incr_tvar 9 (Sign.read_typ(sg,K(Some(S0))) s);
   631 	let val T = incr_tvar 9 (Sign.read_typ(sg,K(Some(S0))) s);
   632 	    val t = case Sign.Symtab.lookup(#const_tab(Sign.rep_sg sg),f) of
   632 	    val t = case Sign.const_type sg f of
   633 		      Some(_) => Const(f,T) | None => Free(f,T)
   633 		      Some(_) => Const(f,T) | None => Free(f,T)
   634 	in (t,T) end
   634 	in (t,T) end
   635 in flat o map (mk_cong_type sg o readfT) end;
   635 in flat o map (mk_cong_type sg o readfT) end;
   636 
   636 
   637 (* This code is fishy, esp the "let val T' = ..." 
   637 (* This code is fishy, esp the "let val T' = ..."