diff -r 979ecb48e909 -r 113997e55e71 src/Tools/isac/BaseDefinitions/termC.sml --- a/src/Tools/isac/BaseDefinitions/termC.sml Mon Jun 29 15:43:35 2020 +0200 +++ b/src/Tools/isac/BaseDefinitions/termC.sml Mon Jun 29 16:01:01 2020 +0200 @@ -14,7 +14,7 @@ datatype lrd = D | L | R type path val string_of_path: path -> string - val at_location: path -> term -> term + val sub_at: path -> term -> term val go_up: path -> term -> term val contains_Var: term -> bool @@ -130,13 +130,13 @@ | ldr2str D = "D"; fun string_of_path k = (strs2str' o (map ldr2str)) k; (*go to a location in a term and fetch the resective sub-term*) -fun at_location [] t = t - | at_location (D :: p) (Abs(_, _, body)) = at_location p body - | at_location (L :: p) (t1 $ _) = at_location p t1 - | at_location (R :: p) (_ $ t2) = at_location p t2 - | at_location l t = raise TERM ("at_location: no " ^ string_of_path l ^ " for ", [t]); +fun sub_at [] t = t + | sub_at (D :: p) (Abs(_, _, body)) = sub_at p body + | sub_at (L :: p) (t1 $ _) = sub_at p t1 + | sub_at (R :: p) (_ $ t2) = sub_at p t2 + | sub_at l t = raise TERM ("sub_at: no " ^ string_of_path l ^ " for ", [t]); fun go_up l t = - if length l > 1 then at_location (drop_last l) t else raise ERROR ("go_up [] " ^ UnparseC.term t) + if length l > 1 then sub_at (drop_last l) t else raise ERROR ("go_up [] " ^ UnparseC.term t) fun isastr_of_int i = if i >= 0 then string_of_int i else "-" ^ string_of_int (abs i)