152 val could_unify: term * term -> bool |
152 val could_unify: term * term -> bool |
153 val strip_abs_eta: int -> term -> (string * typ) list * term |
153 val strip_abs_eta: int -> term -> (string * typ) list * term |
154 val match_bvars: (term * term) * (string * string) list -> (string * string) list |
154 val match_bvars: (term * term) * (string * string) list -> (string * string) list |
155 val map_abs_vars: (string -> string) -> term -> term |
155 val map_abs_vars: (string -> string) -> term -> term |
156 val rename_abs: term -> term -> term -> term option |
156 val rename_abs: term -> term -> term -> term option |
|
157 val is_open: term -> bool |
|
158 val is_dependent: term -> bool |
157 val lambda_name: string * term -> term -> term |
159 val lambda_name: string * term -> term -> term |
158 val close_schematic_term: term -> term |
160 val close_schematic_term: term -> term |
159 val maxidx_typ: typ -> int -> int |
161 val maxidx_typ: typ -> int -> int |
160 val maxidx_typs: typ list -> int -> int |
162 val maxidx_typs: typ list -> int -> int |
161 val maxidx_term: term -> int -> int |
163 val maxidx_term: term -> int -> int |
648 fun loose_bvar1(Bound i,k) = i = k |
650 fun loose_bvar1(Bound i,k) = i = k |
649 | loose_bvar1(f$t, k) = loose_bvar1(f,k) orelse loose_bvar1(t,k) |
651 | loose_bvar1(f$t, k) = loose_bvar1(f,k) orelse loose_bvar1(t,k) |
650 | loose_bvar1(Abs(_,_,t),k) = loose_bvar1(t,k+1) |
652 | loose_bvar1(Abs(_,_,t),k) = loose_bvar1(t,k+1) |
651 | loose_bvar1 _ = false; |
653 | loose_bvar1 _ = false; |
652 |
654 |
|
655 fun is_open t = loose_bvar (t, 0); |
|
656 fun is_dependent t = loose_bvar1 (t, 0); |
|
657 |
653 (*Substitute arguments for loose bound variables. |
658 (*Substitute arguments for loose bound variables. |
654 Beta-reduction of arg(n-1)...arg0 into t replacing (Bound i) with (argi). |
659 Beta-reduction of arg(n-1)...arg0 into t replacing (Bound i) with (argi). |
655 Note that for ((%x y. c) a b), the bound vars in c are x=1 and y=0 |
660 Note that for ((%x y. c) a b), the bound vars in c are x=1 and y=0 |
656 and the appropriate call is subst_bounds([b,a], c) . |
661 and the appropriate call is subst_bounds([b,a], c) . |
657 Loose bound variables >=n are reduced by "n" to |
662 Loose bound variables >=n are reduced by "n" to |