equal
deleted
inserted
replaced
152 val term_tvars: term -> (indexname * sort) list |
152 val term_tvars: term -> (indexname * sort) list |
153 val add_term_tycons: term * string list -> string list |
153 val add_term_tycons: term * string list -> string list |
154 val add_term_vars: term * term list -> term list |
154 val add_term_vars: term * term list -> term list |
155 val term_vars: term -> term list |
155 val term_vars: term -> term list |
156 val exists_Const: (string * typ -> bool) -> term -> bool |
156 val exists_Const: (string * typ -> bool) -> term -> bool |
|
157 val exists_subterm: (term -> bool) -> term -> bool |
157 val compress_type: typ -> typ |
158 val compress_type: typ -> typ |
158 val compress_term: term -> term |
159 val compress_term: term -> term |
159 end; |
160 end; |
160 |
161 |
161 signature TERM = |
162 signature TERM = |
727 | ex (t $ u ) = ex t orelse ex u |
728 | ex (t $ u ) = ex t orelse ex u |
728 | ex (Abs (_, _, t)) = ex t |
729 | ex (Abs (_, _, t)) = ex t |
729 | ex _ = false |
730 | ex _ = false |
730 in ex t end; |
731 in ex t end; |
731 |
732 |
|
733 fun exists_subterm P = |
|
734 let fun ex t = P t orelse |
|
735 (case t of |
|
736 u $ v => ex u orelse ex v |
|
737 | Abs(_, _, u) => ex u |
|
738 | _ => false) |
|
739 in ex end; |
|
740 |
732 (*map classes, tycons*) |
741 (*map classes, tycons*) |
733 fun map_typ f g (Type (c, Ts)) = Type (g c, map (map_typ f g) Ts) |
742 fun map_typ f g (Type (c, Ts)) = Type (g c, map (map_typ f g) Ts) |
734 | map_typ f _ (TFree (x, S)) = TFree (x, map f S) |
743 | map_typ f _ (TFree (x, S)) = TFree (x, map f S) |
735 | map_typ f _ (TVar (xi, S)) = TVar (xi, map f S); |
744 | map_typ f _ (TVar (xi, S)) = TVar (xi, map f S); |
736 |
745 |