From ad942553b7b56ad4a0cc50647fdc81672935aca7 Mon Sep 17 00:00:00 2001 From: Zoltan Somogyi Date: Wed, 4 Feb 2026 04:16:37 +1100 Subject: [PATCH] Fix too-long lines. --- compiler/hlds_class.m | 17 +++++++++-------- compiler/inst_match.m | 34 +++++++++++++++++++++++++--------- compiler/make.program_target.m | 5 +++-- compiler/rat.m | 5 +++-- 4 files changed, 40 insertions(+), 21 deletions(-) diff --git a/compiler/hlds_class.m b/compiler/hlds_class.m index bad8dd09b..4d3af0034 100644 --- a/compiler/hlds_class.m +++ b/compiler/hlds_class.m @@ -1,7 +1,7 @@ %---------------------------------------------------------------------------% % vim: ft=mercury ts=4 sw=4 et %---------------------------------------------------------------------------% -% Copyright (C) 2018-2019, 2022-2025 The Mercury team. +% Copyright (C) 2018-2019, 2022-2026 The Mercury team. % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %---------------------------------------------------------------------------% @@ -661,7 +661,8 @@ update_redundant_constraints_2(ClassTable, TVarSet, Constraint, !Redundant) :- % variables that appear in the head of the declaration.) tvarset_merge_renaming(TVarSet, ClassTVarSet, _, Renaming), - apply_renaming_to_constraints(Renaming, ClassAncestors, RenamedAncestors), + apply_renaming_to_constraints(Renaming, + ClassAncestors, RenamedAncestors), apply_renaming_to_tvars(Renaming, ClassParams, RenamedParams), map.from_corresponding_lists(RenamedParams, ArgTypes, Subst), apply_subst_to_constraints(Subst, RenamedAncestors, Ancestors), @@ -686,7 +687,7 @@ add_redundant_constraint(Constraint, !Redundant) :- lookup_hlds_constraint_list(ConstraintMap, ConstraintType, GoalId, Count, Constraints) :- ( if - search_hlds_constraint_list_2(ConstraintMap, ConstraintType, GoalId, + search_hlds_constraint_list_loop(ConstraintMap, ConstraintType, GoalId, Count, [], ConstraintsPrime) then Constraints = ConstraintsPrime @@ -696,14 +697,14 @@ lookup_hlds_constraint_list(ConstraintMap, ConstraintType, GoalId, Count, search_hlds_constraint_list(ConstraintMap, ConstraintType, GoalId, Count, Constraints) :- - search_hlds_constraint_list_2(ConstraintMap, ConstraintType, GoalId, + search_hlds_constraint_list_loop(ConstraintMap, ConstraintType, GoalId, Count, [], Constraints). -:- pred search_hlds_constraint_list_2(constraint_map::in, constraint_type::in, - goal_id::in, int::in, +:- pred search_hlds_constraint_list_loop(constraint_map::in, + constraint_type::in, goal_id::in, int::in, list(prog_constraint)::in, list(prog_constraint)::out) is semidet. -search_hlds_constraint_list_2(ConstraintMap, ConstraintType, GoalId, Count, +search_hlds_constraint_list_loop(ConstraintMap, ConstraintType, GoalId, Count, !Constraints) :- ( if Count = 0 then true @@ -711,7 +712,7 @@ search_hlds_constraint_list_2(ConstraintMap, ConstraintType, GoalId, Count, ConstraintId = constraint_id(ConstraintType, GoalId, Count), map.search(ConstraintMap, ConstraintId, Constraint), !:Constraints = [Constraint | !.Constraints], - search_hlds_constraint_list_2(ConstraintMap, ConstraintType, + search_hlds_constraint_list_loop(ConstraintMap, ConstraintType, GoalId, Count - 1, !Constraints) ). diff --git a/compiler/inst_match.m b/compiler/inst_match.m index a9fb6af3e..64cb86b2b 100644 --- a/compiler/inst_match.m +++ b/compiler/inst_match.m @@ -2,7 +2,7 @@ % vim: ft=mercury ts=4 sw=4 et %---------------------------------------------------------------------------% % Copyright (C) 1995-1998, 2000-2012 The University of Melbourne. -% Copyright (C) 2014-2018, 2021, 2023-2025 The Mercury team. +% Copyright (C) 2014-2018, 2021, 2023-2026 The Mercury team. % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %---------------------------------------------------------------------------% @@ -607,8 +607,10 @@ inst_matches_final_gmb(ModuleInfo, GroundMatchesBound, Type, InstA, InstB) :- :- pred inst_matches_final_mt(calculate_sub, mer_type, mer_inst, mer_inst, inst_match_info, inst_match_info). -:- mode inst_matches_final_mt(in, in, in, in, in(imi_ns), out(imi_ns)) is semidet. -:- mode inst_matches_final_mt(in, in, in, in, in(imi_ivs), out(imi_ivs)) is semidet. +:- mode inst_matches_final_mt(in, in, in, in, + in(imi_ns), out(imi_ns)) is semidet. +:- mode inst_matches_final_mt(in, in, in, in, + in(imi_ivs), out(imi_ivs)) is semidet. inst_matches_final_mt(CalcSub, Type, InstA, InstB, !Info) :- ( if InstA = InstB then @@ -1289,8 +1291,10 @@ pred_inst_matches_ground(ModuleInfo, Type, PredInst) :- :- pred pred_inst_matches_ground_1(calculate_sub, mer_type, pred_inst_info, inst_match_info, inst_match_info). -:- mode pred_inst_matches_ground_1(in, in, in, in(imi_ns), out(imi_ns)) is semidet. -:- mode pred_inst_matches_ground_1(in, in, in, in(imi_ivs), out(imi_ivs)) is semidet. +:- mode pred_inst_matches_ground_1(in, in, in, + in(imi_ns), out(imi_ns)) is semidet. +:- mode pred_inst_matches_ground_1(in, in, in, + in(imi_ivs), out(imi_ivs)) is semidet. pred_inst_matches_ground_1(CalcSub, Type, PredInst, !Info) :- % NOTE CalcSub is set to cs_none by pred_inst_matches_ground above, @@ -1321,8 +1325,10 @@ pred_inst_matches(ModuleInfo, Type, PredInstA, PredInstB) :- % :- pred pred_inst_matches_1(calculate_sub, mer_type, pred_inst_info, pred_inst_info, inst_match_info, inst_match_info). -:- mode pred_inst_matches_1(in, in, in, in, in(imi_ns), out(imi_ns)) is semidet. -:- mode pred_inst_matches_1(in, in, in, in, in(imi_ivs), out(imi_ivs)) is semidet. +:- mode pred_inst_matches_1(in, in, in, in, + in(imi_ns), out(imi_ns)) is semidet. +:- mode pred_inst_matches_1(in, in, in, in, + in(imi_ivs), out(imi_ivs)) is semidet. pred_inst_matches_1(CalcSub, Type, PredInstA, PredInstB, !Info) :- % In the float_regs.m pass a variable may take on pred insts which differ @@ -1592,6 +1598,14 @@ do_handle_inst_var_subs(CalcSubDir, Type, InstA, InstB, Result, !Info) :- % % NOTE: our *caller* *may* end up unifying SubInstA with InstB, % but it has no access to _InstVarsA, since we throw it away here. + % + % In a post to m-rev on 2024 Jul 5, wangp replied to the above + % comment with: + % + % All I can tell you is that code follows the get_subst_inst + % function in David Overton's thesis (page 78, figure 4.2). + % The InstA = constrained_inst_vars(_, _) branch is the + % second case of get_subst_inst, which ignores Ω. swap_insts_back(CalcSubDir, SubInstA, InstB, Inst1, Inst2), Result = ivsr_recurse(Inst1, Inst2) ; @@ -1654,7 +1668,8 @@ update_inst_var_sub(InstVars, InstA, Type, !Info) :- :- pred update_inst_var_sub_vars(mer_inst, mer_type, list(inst_var), inst_match_info, inst_match_info). -:- mode update_inst_var_sub_vars(in, in, in, in(imi_ivs), out(imi_ivs)) is semidet. +:- mode update_inst_var_sub_vars(in, in, in, + in(imi_ivs), out(imi_ivs)) is semidet. update_inst_var_sub_vars(_, _, [], !Info). update_inst_var_sub_vars(InstA, Type, [InstVar | InstVars], !Info) :- @@ -1663,7 +1678,8 @@ update_inst_var_sub_vars(InstA, Type, [InstVar | InstVars], !Info) :- :- pred update_inst_var_sub_2(mer_inst, mer_type, inst_var, inst_match_info, inst_match_info). -:- mode update_inst_var_sub_2(in, in, in, in(imi_ivs), out(imi_ivs)) is semidet. +:- mode update_inst_var_sub_2(in, in, in, + in(imi_ivs), out(imi_ivs)) is semidet. update_inst_var_sub_2(InstA, Type, InstVar, !Info) :- !.Info ^ imi_maybe_state = inst_var_sub_state(InstVarSub0), diff --git a/compiler/make.program_target.m b/compiler/make.program_target.m index 8b1c66cf7..c486e9055 100644 --- a/compiler/make.program_target.m +++ b/compiler/make.program_target.m @@ -2,7 +2,7 @@ % vim: ft=mercury ts=4 sw=4 et %---------------------------------------------------------------------------% % Copyright (C) 2002-2012 The University of Melbourne. -% Copyright (C) 2013-2017, 2019-2025 The Mercury team. +% Copyright (C) 2013-2017, 2019-2026 The Mercury team. % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %---------------------------------------------------------------------------% @@ -1062,7 +1062,8 @@ make_misc_target_builder(ProgressStream, Globals, MainModuleName, TargetType, ; ModuleTargetType = module_target_xml_doc ), build_int_opt_files(ProgressStream, Globals, - build_all_ints_opts, AllModuleNames, Succeeded1, !Info, !IO) + build_all_ints_opts, AllModuleNames, Succeeded1, + !Info, !IO) ), ( if Succeeded1 = did_not_succeed, diff --git a/compiler/rat.m b/compiler/rat.m index cf8ec5169..12d99a7f4 100644 --- a/compiler/rat.m +++ b/compiler/rat.m @@ -1,8 +1,9 @@ %-----------------------------------------------------------------------------% % vim: ft=mercury ts=4 sw=4 et %-----------------------------------------------------------------------------% -% Copyright (C) 1997-1998, 2003, 2005-2006, 2010-2011 The University of Melbourne. -% Copyright (C) 2014, 2016, 2019-2021, 2023 The Mercury team. +% Copyright (C) 1997-1998, 2003, 2005-2006, The University of Melbourne. +% Copyright (C) 2010-2011 The University of Melbourne. +% Copyright (C) 2014, 2016, 2019-2021, 2023, 2026 The Mercury team. % This file may only be copied under the terms of the GNU Library General % Public License - see the file COPYING.LIB in the Mercury distribution. %-----------------------------------------------------------------------------%