+ let rec q_let_s sor n =
+ match sor with
+ [] -> q_let_u
+ | [s] -> M.LetVVar ("sort" ^ (string_of_int n), M.Const [s], q_let_u)
+ | s::tl -> M.LetVVar ("sort" ^ (string_of_int n), M.Const [s], q_let_s tl (n+1))
+ in
+
+(* let q_let_s = M.LetVVar ("sorts", M.Const sor, q_let_u) in *)
+
+ let rec q_let_ds sdep n =
+ match sdep with
+ []
+ | [None] -> q_let_s sor 1
+ | (None)::tl -> q_let_ds tl (n+1)
+ | [Some d] -> M.LetVVar ("sort_depth" ^ (string_of_int n), M.Const [(string_of_int d)], q_let_s sor 1)
+ | (Some d)::tl -> M.LetVVar ("sort_depth" ^ (string_of_int n), M.Const [(string_of_int d)], q_let_ds tl (n+1))
+ in
+
+(* let q_let_ds = M.LetVVar ("sort_depths", M.Const sdep, q_let_s) in *)
+
+ let rec q_let_dr rdep n =
+ match rdep with
+ []
+ | [None] -> q_let_ds sdep 1
+ | (None)::tl -> q_let_dr tl (n+1)
+ | [Some d] -> M.LetVVar ("rel_depth" ^ (string_of_int n), M.Const [(string_of_int d)], q_let_ds sdep 1)
+ | (Some d)::tl -> M.LetVVar ("rel_depth" ^ (string_of_int n), M.Const [(string_of_int d)], q_let_dr tl (n+1))
+ in
+