[m-rev.] for review: fix a bug reportd by Peter Hawkins
Zoltan Somogyi
zs at csse.unimelb.edu.au
Tue Jul 11 17:57:28 AEST 2006
The diff is big, but only the changes to det_analysis.m, hlds_pred.m
and the test case need to be reviewed; the rest is merely the renaming
of some function symbols.
Zoltan.
Fix a bug reported by Peter Hawkins. The bug was that an predicate without
a declared determinism but whose inferred determinism was invalid for its
tabling declaration led to a compiler abort.
compiler/det_analysis.m:
Fix the main cause of the bug, which was that the check for the
compatibility of evaluation method and determinism was performed
only for predicates with declared determinisms, not those without.
Centralize the printing of determinism error messages, and sort
the messages first.
compiler/hlds_pred.m:
Fix the other half of the bug: the predicate that checked the
compatibility of evaluation method and determinism was too liberal
with minimal model predicates, letting through determinisms that the
tabling transformation cannot (yet) support.
compiler/det_report.m:
Fix the formatting of the error message.
compiler/prog_data.m:
Rename the function symbols of the type "determinism", to avoid
conflicts with language keywords.
compiler/*.m:
Conform to the change to prog_data.m.
tests/invalid/hawkins_mm_fail_reset.{m,err_exp}:
New test case for the bug being fixed.
tests/invalid/Mmakefile:
Enable the new test case.
tests/invalid/loopcheck.err_exp:
Expect the new format of the improved error message.
cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/accumulator.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/accumulator.m,v
retrieving revision 1.58
diff -u -r1.58 accumulator.m
--- compiler/accumulator.m 14 Jun 2006 07:42:53 -0000 1.58
+++ compiler/accumulator.m 7 Jul 2006 06:10:00 -0000
@@ -1668,7 +1668,7 @@
Expr = unify(Out, var(Acc), UniMode, assign(Out,Acc), Context),
set.list_to_set([Out,Acc], NonLocalVars),
instmap_delta_from_assoc_list([Out - ground(shared, none)], InstMapDelta),
- goal_info_init(NonLocalVars, InstMapDelta, det, purity_pure, Info),
+ goal_info_init(NonLocalVars, InstMapDelta, detism_det, purity_pure, Info),
Goal = Expr - Info.
%-----------------------------------------------------------------------------%
Index: compiler/add_clause.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/add_clause.m,v
retrieving revision 1.24
diff -u -r1.24 add_clause.m
--- compiler/add_clause.m 20 Apr 2006 05:36:48 -0000 1.24
+++ compiler/add_clause.m 7 Jul 2006 05:21:03 -0000
@@ -733,7 +733,7 @@
->
% Initialize some fields to junk.
Modes = [],
- Det = erroneous,
+ Det = detism_erroneous,
GenericCall = higher_order(PredVar, Purity, predicate, Arity),
Call = generic_call(GenericCall, RealHeadVars, Modes, Det),
Index: compiler/add_heap_ops.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/add_heap_ops.m,v
retrieving revision 1.27
diff -u -r1.27 add_heap_ops.m
--- compiler/add_heap_ops.m 29 Mar 2006 08:06:34 -0000 1.27
+++ compiler/add_heap_ops.m 7 Jul 2006 05:22:39 -0000
@@ -165,7 +165,8 @@
% make sure that it can't fail. So we use a call to
% `private_builtin.unused' (which will call error/1) rather than
% `fail' for the "then" part.
- generate_call("unused", det, [], [], [], ModuleInfo, Context, ThenGoal)
+ generate_call("unused", detism_det, [], [], [], ModuleInfo, Context,
+ ThenGoal)
;
ThenGoal = Fail
),
@@ -217,8 +218,9 @@
% appropriate "Sorry, not implemented" error message.
ModuleInfo = !.Info ^ module_info,
goal_info_get_context(GoalInfo, Context),
- generate_call("reclaim_heap_nondet_pragma_foreign_code", erroneous,
- [], [], [], ModuleInfo, Context, SorryNotImplementedCode),
+ generate_call("reclaim_heap_nondet_pragma_foreign_code",
+ detism_erroneous, [], [], [], ModuleInfo, Context,
+ SorryNotImplementedCode),
Goal = SorryNotImplementedCode
;
Goal = PragmaForeign - GoalInfo
@@ -300,7 +302,7 @@
heap_ops_info::in, heap_ops_info::out) is det.
gen_mark_hp(SavedHeapPointerVar, Context, MarkHeapPointerGoal, !Info) :-
- generate_call("mark_hp", det, [SavedHeapPointerVar], [impure_goal],
+ generate_call("mark_hp", detism_det, [SavedHeapPointerVar], [impure_goal],
[SavedHeapPointerVar - ground_inst], !.Info ^ module_info, Context,
MarkHeapPointerGoal).
@@ -308,8 +310,9 @@
heap_ops_info::in, heap_ops_info::out) is det.
gen_restore_hp(SavedHeapPointerVar, Context, RestoreHeapPointerGoal, !Info) :-
- generate_call("restore_hp", det, [SavedHeapPointerVar], [impure_goal],
- [], !.Info ^ module_info, Context, RestoreHeapPointerGoal).
+ generate_call("restore_hp", detism_det, [SavedHeapPointerVar],
+ [impure_goal], [], !.Info ^ module_info, Context,
+ RestoreHeapPointerGoal).
:- func ground_inst = mer_inst.
Index: compiler/add_pragma.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/add_pragma.m,v
retrieving revision 1.37
diff -u -r1.37 add_pragma.m
--- compiler/add_pragma.m 10 Jul 2006 04:40:48 -0000 1.37
+++ compiler/add_pragma.m 11 Jul 2006 05:16:24 -0000
@@ -366,7 +366,7 @@
% determinism analysis.
(
MaybeDet = yes(Det),
- ( Det = nondet ; Det = multidet )
+ ( Det = detism_non ; Det = detism_multi )
->
Pieces = [words("Error: "),
fixed("`:- pragma export' declaration"),
@@ -1975,7 +1975,7 @@
Condition = true,
StatsPredDecl = pred_or_func(VarSet0, InstVarSet, ExistQVars,
predicate, StatsPredSymName, ArgDecls, WithType, WithInst,
- yes(det), Condition, purity_pure, Constraints),
+ yes(detism_det), Condition, purity_pure, Constraints),
ItemStatus0 = item_status(!.Status, may_be_unqualified),
add_item_decl_pass_1(StatsPredDecl, Context, ItemStatus0, _,
!ModuleInfo, _, !IO),
@@ -2029,7 +2029,7 @@
Condition = true,
ResetPredDecl = pred_or_func(VarSet0, InstVarSet, ExistQVars,
predicate, ResetPredSymName, ArgDecls, WithType, WithInst,
- yes(det), Condition, purity_pure, Constraints),
+ yes(detism_det), Condition, purity_pure, Constraints),
ItemStatus0 = item_status(!.Status, may_be_unqualified),
add_item_decl_pass_1(ResetPredDecl, Context, ItemStatus0, _,
!ModuleInfo, _, !IO),
Index: compiler/add_solver.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/add_solver.m,v
retrieving revision 1.13
diff -u -r1.13 add_solver.m
--- compiler/add_solver.m 8 Jun 2006 08:19:09 -0000 1.13
+++ compiler/add_solver.m 7 Jul 2006 05:23:28 -0000
@@ -105,7 +105,7 @@
[type_and_mode(SolverType, in_mode ),
type_and_mode(RepnType, OutGroundMode)],
module_add_pred_or_func(TVarSet, InstVarSet, ExistQTVars, function,
- ToGroundRepnSymName, ToGroundRepnArgTypes, yes(det),
+ ToGroundRepnSymName, ToGroundRepnArgTypes, yes(detism_det),
purity_impure, constraints([], []), NoMarkers, Context, !.Status, _,
!ModuleInfo, !IO),
@@ -118,7 +118,7 @@
[type_and_mode(SolverType, in_any_mode ),
type_and_mode(RepnType, OutAnyMode)],
module_add_pred_or_func(TVarSet, InstVarSet, ExistQTVars, function,
- ToAnyRepnSymName, ToAnyRepnArgTypes, yes(det),
+ ToAnyRepnSymName, ToAnyRepnArgTypes, yes(detism_det),
purity_impure, constraints([], []), NoMarkers, Context, !.Status, _,
!ModuleInfo, !IO),
@@ -131,7 +131,7 @@
[type_and_mode(RepnType, InGroundMode ),
type_and_mode(SolverType, out_mode )],
module_add_pred_or_func(TVarSet, InstVarSet, ExistQTVars, function,
- FromGroundRepnSymName, FromGroundRepnArgTypes, yes(det),
+ FromGroundRepnSymName, FromGroundRepnArgTypes, yes(detism_det),
purity_impure, constraints([], []), NoMarkers, Context, !.Status, _,
!ModuleInfo, !IO),
@@ -144,7 +144,7 @@
[type_and_mode(RepnType, InAnyMode ),
type_and_mode(SolverType, out_any_mode)],
module_add_pred_or_func(TVarSet, InstVarSet, ExistQTVars, function,
- FromAnyRepnSymName, FromAnyRepnArgTypes, yes(det),
+ FromAnyRepnSymName, FromAnyRepnArgTypes, yes(detism_det),
purity_impure, constraints([], []), NoMarkers, Context, !.Status, _,
!ModuleInfo, !IO).
Index: compiler/add_trail_ops.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/add_trail_ops.m,v
retrieving revision 1.37
diff -u -r1.37 add_trail_ops.m
--- compiler/add_trail_ops.m 8 Jun 2006 08:19:09 -0000 1.37
+++ compiler/add_trail_ops.m 7 Jul 2006 05:24:57 -0000
@@ -195,7 +195,7 @@
% `fail' for the "then" part.
mercury_private_builtin_module(PrivateBuiltin),
generate_simple_call(PrivateBuiltin, "unused", predicate, only_mode,
- det, [], [], [], ModuleInfo, Context, ThenGoal)
+ detism_det, [], [], [], ModuleInfo, Context, ThenGoal)
;
ThenGoal = Fail
),
@@ -312,8 +312,9 @@
% "Sorry, not implemented" error message.
ModuleInfo = !.Info^ module_info,
goal_info_get_context(GoalInfo, Context),
- trail_generate_call("trailed_nondet_pragma_foreign_code", erroneous,
- [], [], [], ModuleInfo, Context, SorryNotImplementedCode),
+ trail_generate_call("trailed_nondet_pragma_foreign_code",
+ detism_erroneous, [], [], [], ModuleInfo, Context,
+ SorryNotImplementedCode),
Goal = SorryNotImplementedCode
;
Goal = PragmaForeign - GoalInfo
@@ -431,9 +432,9 @@
GenerateInline = Info ^ inline_ops,
(
GenerateInline = no,
- trail_generate_call("store_ticket", det, [TicketVar], [impure_goal],
- [TicketVar - trail_ground_inst], Info ^ module_info, Context,
- SaveTicketGoal)
+ trail_generate_call("store_ticket", detism_det, [TicketVar],
+ [impure_goal], [TicketVar - trail_ground_inst],
+ Info ^ module_info, Context, SaveTicketGoal)
;
GenerateInline = yes,
Args = [foreign_arg(TicketVar, yes("Ticket" - out_mode),
@@ -451,7 +452,7 @@
GenerateInline = Info ^ inline_ops,
(
GenerateInline = no,
- trail_generate_call("reset_ticket_undo", det, [TicketVar],
+ trail_generate_call("reset_ticket_undo", detism_det, [TicketVar],
[impure_goal], [], Info ^ module_info, Context, ResetTicketGoal)
;
GenerateInline = yes,
@@ -470,7 +471,7 @@
GenerateInline = Info ^ inline_ops,
(
GenerateInline = no,
- trail_generate_call("reset_ticket_solve", det, [TicketVar],
+ trail_generate_call("reset_ticket_solve", detism_det, [TicketVar],
[impure_goal], [], Info ^ module_info, Context, ResetTicketGoal)
;
GenerateInline = yes,
@@ -489,7 +490,7 @@
GenerateInline = Info ^ inline_ops,
(
GenerateInline = no,
- trail_generate_call("reset_ticket_commit", det, [TicketVar],
+ trail_generate_call("reset_ticket_commit", detism_det, [TicketVar],
[impure_goal], [], Info ^ module_info, Context, ResetTicketGoal)
;
GenerateInline = yes,
@@ -508,7 +509,7 @@
GenerateInline = Info ^ inline_ops,
(
GenerateInline = no,
- trail_generate_call("prune_ticket", det, [], [impure_goal],
+ trail_generate_call("prune_ticket", detism_det, [], [impure_goal],
[], Info ^ module_info, Context, PruneTicketGoal)
;
GenerateInline = yes,
@@ -526,8 +527,8 @@
GenerateInline = Info ^ inline_ops,
(
GenerateInline = no,
- trail_generate_call("discard_ticket", det, [], [impure_goal], [],
- Info ^ module_info, Context, DiscardTicketGoal)
+ trail_generate_call("discard_ticket", detism_det, [], [impure_goal],
+ [], Info ^ module_info, Context, DiscardTicketGoal)
;
GenerateInline = yes,
Args = [],
@@ -545,10 +546,9 @@
GenerateInline = Info ^ inline_ops,
(
GenerateInline = no,
- trail_generate_call("mark_ticket_stack", det,
- [SavedTicketCounterVar],
- [impure_goal], [], Info ^ module_info, Context,
- MarkTicketStackGoal)
+ trail_generate_call("mark_ticket_stack", detism_det,
+ [SavedTicketCounterVar], [impure_goal], [], Info ^ module_info,
+ Context, MarkTicketStackGoal)
;
GenerateInline = yes,
Args = [foreign_arg(SavedTicketCounterVar,
@@ -568,9 +568,9 @@
GenerateInline = Info ^ inline_ops,
(
GenerateInline = no,
- trail_generate_call("prune_tickets_to", det, [SavedTicketCounterVar],
- [impure_goal], [], Info ^ module_info, Context,
- PruneTicketsToGoal)
+ trail_generate_call("prune_tickets_to", detism_det,
+ [SavedTicketCounterVar], [impure_goal], [], Info ^ module_info,
+ Context, PruneTicketsToGoal)
;
GenerateInline = yes,
Args = [foreign_arg(SavedTicketCounterVar,
@@ -644,7 +644,7 @@
trail_generate_foreign_proc(PredName, Features, InstMap,
ModuleInfo, Context, Args, ForeignCode, ForeignProcGoal) :-
mercury_private_builtin_module(PrivateBuiltinModule),
- Detism = det,
+ Detism = detism_det,
some [!ForeignProcAttrs] (
% XXX handle other target languages here.
!:ForeignProcAttrs = default_attributes(lang_c),
Index: compiler/bytecode.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/bytecode.m,v
retrieving revision 1.65
diff -u -r1.65 bytecode.m
--- compiler/bytecode.m 29 Mar 2006 08:06:36 -0000 1.65
+++ compiler/bytecode.m 7 Jul 2006 05:09:24 -0000
@@ -1000,25 +1000,25 @@
:- pred determinism_code(determinism::in, int::out) is det.
-determinism_code(det, 0).
-determinism_code(semidet, 1).
-determinism_code(multidet, 2).
-determinism_code(nondet, 3).
-determinism_code(cc_multidet, 4).
-determinism_code(cc_nondet, 5).
-determinism_code(erroneous, 6).
-determinism_code(failure, 7).
+determinism_code(detism_det, 0).
+determinism_code(detism_semi, 1).
+determinism_code(detism_multi, 2).
+determinism_code(detism_non, 3).
+determinism_code(detism_cc_multi, 4).
+determinism_code(detism_cc_non, 5).
+determinism_code(detism_erroneous, 6).
+determinism_code(detism_failure, 7).
:- pred determinism_debug(determinism::in, string::out) is det.
-determinism_debug(det, "det").
-determinism_debug(semidet, "semidet").
-determinism_debug(multidet, "multidet").
-determinism_debug(nondet, "nondet").
-determinism_debug(cc_multidet, "cc_multidet").
-determinism_debug(cc_nondet, "cc_nondet").
-determinism_debug(erroneous, "erroneous").
-determinism_debug(failure, "failure").
+determinism_debug(detism_det, "det").
+determinism_debug(detism_semi, "semidet").
+determinism_debug(detism_multi, "multidet").
+determinism_debug(detism_non, "nondet").
+determinism_debug(detism_cc_multi, "cc_multidet").
+determinism_debug(detism_cc_non, "cc_nondet").
+determinism_debug(detism_erroneous, "erroneous").
+determinism_debug(detism_failure, "failure").
:- pred binop_code(binary_op::in, int::out) is det.
Index: compiler/call_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/call_gen.m,v
retrieving revision 1.175
diff -u -r1.175 call_gen.m
--- compiler/call_gen.m 26 Apr 2006 03:05:31 -0000 1.175
+++ compiler/call_gen.m 7 Jul 2006 05:25:02 -0000
@@ -390,7 +390,7 @@
call_gen.handle_failure(CodeModel, GoalInfo, FailHandlingCode, !CI) :-
( CodeModel = model_semi ->
goal_info_get_determinism(GoalInfo, Detism),
- ( Detism = failure ->
+ ( Detism = detism_failure ->
code_info.generate_failure(FailHandlingCode, !CI)
;
code_info.get_next_label(ContLab, !CI),
Index: compiler/clause_to_proc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/clause_to_proc.m,v
retrieving revision 1.66
diff -u -r1.66 clause_to_proc.m
--- compiler/clause_to_proc.m 29 Mar 2006 08:06:37 -0000 1.66
+++ compiler/clause_to_proc.m 7 Jul 2006 05:25:06 -0000
@@ -126,7 +126,7 @@
list.duplicate(FuncArity, InMode, FuncArgModes),
FuncRetMode = OutMode,
list.append(FuncArgModes, [FuncRetMode], PredArgModes),
- Determinism = det,
+ Determinism = detism_det,
pred_info_context(PredInfo0, Context),
MaybePredArgLives = no,
varset.init(InstVarSet),
Index: compiler/code_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_info.m,v
retrieving revision 1.322
diff -u -r1.322 code_info.m
--- compiler/code_info.m 8 May 2006 03:35:58 -0000 1.322
+++ compiler/code_info.m 7 Jul 2006 05:25:11 -0000
@@ -3383,7 +3383,7 @@
get_opt_no_return_calls(!.CI, OptNoReturnCalls),
get_module_info(!.CI, ModuleInfo),
(
- Detism = erroneous,
+ Detism = detism_erroneous,
OptNoReturnCalls = yes
->
RealStackVarLocs = [],
Index: compiler/code_model.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_model.m,v
retrieving revision 1.11
diff -u -r1.11 code_model.m
--- compiler/code_model.m 26 Apr 2006 03:05:32 -0000 1.11
+++ compiler/code_model.m 7 Jul 2006 05:58:55 -0000
@@ -58,14 +58,14 @@
:- import_module mdbcomp.program_representation.
:- import_module int.
-determinism_to_code_model(det, model_det).
-determinism_to_code_model(semidet, model_semi).
-determinism_to_code_model(nondet, model_non).
-determinism_to_code_model(multidet, model_non).
-determinism_to_code_model(cc_nondet, model_semi).
-determinism_to_code_model(cc_multidet, model_det).
-determinism_to_code_model(erroneous, model_det).
-determinism_to_code_model(failure, model_semi).
+determinism_to_code_model(detism_det, model_det).
+determinism_to_code_model(detism_semi, model_semi).
+determinism_to_code_model(detism_non, model_non).
+determinism_to_code_model(detism_multi, model_non).
+determinism_to_code_model(detism_cc_non, model_semi).
+determinism_to_code_model(detism_cc_multi, model_det).
+determinism_to_code_model(detism_erroneous, model_det).
+determinism_to_code_model(detism_failure, model_semi).
proc_info_interface_code_model(ProcInfo, CodeModel) :-
proc_info_interface_determinism(ProcInfo, Determinism),
@@ -75,13 +75,13 @@
goal_info_get_determinism(GoalInfo, Determinism),
determinism_to_code_model(Determinism, CodeModel).
-represent_determinism(det) = detism_rep(det_rep).
-represent_determinism(semidet) = detism_rep(semidet_rep).
-represent_determinism(nondet) = detism_rep(nondet_rep).
-represent_determinism(multidet) = detism_rep(multidet_rep).
-represent_determinism(erroneous) = detism_rep(erroneous_rep).
-represent_determinism(failure) = detism_rep(failure_rep).
-represent_determinism(cc_nondet) = detism_rep(cc_nondet_rep).
-represent_determinism(cc_multidet) = detism_rep(cc_multidet_rep).
+represent_determinism(detism_det) = detism_rep(det_rep).
+represent_determinism(detism_semi) = detism_rep(semidet_rep).
+represent_determinism(detism_non) = detism_rep(nondet_rep).
+represent_determinism(detism_multi) = detism_rep(multidet_rep).
+represent_determinism(detism_erroneous) = detism_rep(erroneous_rep).
+represent_determinism(detism_failure) = detism_rep(failure_rep).
+represent_determinism(detism_cc_non) = detism_rep(cc_nondet_rep).
+represent_determinism(detism_cc_multi) = detism_rep(cc_multidet_rep).
%-----------------------------------------------------------------------------%
Index: compiler/common.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/common.m,v
retrieving revision 1.94
diff -u -r1.94 common.m
--- compiler/common.m 29 Mar 2006 08:06:38 -0000 1.94
+++ compiler/common.m 7 Jul 2006 05:27:32 -0000
@@ -589,7 +589,7 @@
simplify_info_incr_cost_delta(Cost, !Info),
simplify_info_set_requantify(!Info),
goal_info_get_determinism(GoalInfo, Detism0),
- ( Detism0 \= det ->
+ ( Detism0 \= detism_det ->
simplify_info_set_rerun_det(!Info)
;
true
@@ -777,7 +777,7 @@
% the input and output.
Modes = [(ToVarInst -> ToVarInst), (free -> ToVarInst)],
GoalExpr = generic_call(cast(unsafe_type_cast), [FromVar, ToVar],
- Modes, det)
+ Modes, detism_det)
),
% `ToVar' may not appear in the original instmap_delta,
@@ -785,7 +785,7 @@
% original instmap_delta here.
instmap_delta_from_assoc_list([ToVar - ToVarInst], InstMapDelta),
- goal_info_init(NonLocals, InstMapDelta, det, purity_pure, GoalInfo),
+ goal_info_init(NonLocals, InstMapDelta, detism_det, purity_pure, GoalInfo),
Goal = GoalExpr - GoalInfo,
record_equivalence(ToVar, FromVar, !Info).
Index: compiler/complexity.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/complexity.m,v
retrieving revision 1.17
diff -u -r1.17 complexity.m
--- compiler/complexity.m 8 Jun 2006 08:19:10 -0000 1.17
+++ compiler/complexity.m 7 Jul 2006 06:10:37 -0000
@@ -298,28 +298,28 @@
int_to_string(NumProfiledVars) ++ ", " ++
IsActiveVarName ++ ");\n",
- complexity_generate_foreign_proc(IsActivePred, det,
+ complexity_generate_foreign_proc(IsActivePred, detism_det,
[IsActiveOutputArg], [], IsActiveStr, [IsActiveVar],
!.ModuleInfo, Context, IsActiveGoal),
ExitPred = "complexity_exit_proc",
ExitStr = "\tMR_" ++ ExitPred ++ "(" ++
ProcNumStr ++ ", " ++ slot_var_name ++ ");\n",
- complexity_generate_foreign_proc(ExitPred, det,
+ complexity_generate_foreign_proc(ExitPred, detism_det,
[SlotInputArg], [], ExitStr, [],
!.ModuleInfo, Context, ExitGoal),
FailPred = "complexity_fail_proc",
FailStr = "\tMR_" ++ FailPred ++ "(" ++
ProcNumStr ++ ", " ++ slot_var_name ++ ");\n",
- complexity_generate_foreign_proc(FailPred, failure,
+ complexity_generate_foreign_proc(FailPred, detism_failure,
[SlotInputArg], [], FailStr, [],
!.ModuleInfo, Context, FailGoal),
RedoPred = "complexity_redo_proc",
RedoStr = "\tMR_" ++ RedoPred ++ "(" ++
ProcNumStr ++ ", " ++ slot_var_name ++ ");\n",
- complexity_generate_foreign_proc(RedoPred, failure,
+ complexity_generate_foreign_proc(RedoPred, detism_failure,
[SlotInputArg], [], RedoStr, [],
!.ModuleInfo, Context, RedoGoal0),
@@ -344,7 +344,7 @@
instmap_delta_init_reachable(AfterInstMapDelta),
goal_info_init(list_to_set([SlotVar]), AfterInstMapDelta,
- multidet, purity_impure, Context, AfterGoalInfo),
+ detism_multi, purity_impure, Context, AfterGoalInfo),
AfterGoal = disj([ExitGoal, RedoGoal]) - AfterGoalInfo,
OrigAfterGoal = conj(plain_conj, [OrigGoal, AfterGoal])
@@ -414,7 +414,7 @@
int_to_string(ProcNum) ++ ", " ++ SlotVarName ++ ");\n",
ProcStr = "\t" ++ ProcVarName ++ " = &MR_complexity_procs[" ++
int_to_string(ProcNum) ++ "];\n",
- complexity_generate_foreign_proc(PredName, det, [SlotVarArg],
+ complexity_generate_foreign_proc(PredName, detism_det, [SlotVarArg],
ForeignArgs, DeclCodeStr ++ PredCodeStr ++ ProcStr ++ FillCodeStr,
[SlotVar], !.ModuleInfo, Context, CallGoal),
list.append(PrefixGoals, [CallGoal], Goals).
Index: compiler/const_prop.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/const_prop.m,v
retrieving revision 1.38
diff -u -r1.38 const_prop.m
--- compiler/const_prop.m 29 Mar 2006 08:06:39 -0000 1.38
+++ compiler/const_prop.m 7 Jul 2006 06:10:53 -0000
@@ -535,7 +535,7 @@
goal_info_get_instmap_delta(!.GoalInfo, Delta0),
instmap_delta_set(OutputArg ^ arg_var, InputArg ^ arg_inst, Delta0, Delta),
goal_info_set_instmap_delta(Delta, !GoalInfo),
- goal_info_set_determinism(det, !GoalInfo).
+ goal_info_set_determinism(detism_det, !GoalInfo).
:- pred make_construction_goal(arg_hlds_info::in, cons_id::in,
hlds_goal_expr::out, hlds_goal_info::in, hlds_goal_info::out) is det.
@@ -546,7 +546,7 @@
instmap_delta_set(OutputArg ^ arg_var, bound(unique, [functor(Cons, [])]),
Delta0, Delta),
goal_info_set_instmap_delta(Delta, !GoalInfo),
- goal_info_set_determinism(det, !GoalInfo).
+ goal_info_set_determinism(detism_det, !GoalInfo).
:- pred make_assignment(arg_hlds_info::in, arg_hlds_info::in,
hlds_goal_expr::out) is det.
Index: compiler/constraint.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/constraint.m,v
retrieving revision 1.75
diff -u -r1.75 constraint.m
--- compiler/constraint.m 13 Apr 2006 03:59:26 -0000 1.75
+++ compiler/constraint.m 7 Jul 2006 06:11:10 -0000
@@ -417,8 +417,8 @@
% need to be careful about reordering the constraints (the cc_nondet
% goal can't be moved before any goals which can fail).
goal_info_get_determinism(GoalInfo, Detism),
- ( Detism = semidet
- ; Detism = failure
+ ( Detism = detism_semi
+ ; Detism = detism_failure
),
% XXX This is probably a bit too conservative. For example,
Index: compiler/deep_profiling.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/deep_profiling.m,v
retrieving revision 1.49
diff -u -r1.49 deep_profiling.m
--- compiler/deep_profiling.m 20 Apr 2006 05:36:49 -0000 1.49
+++ compiler/deep_profiling.m 7 Jul 2006 05:29:05 -0000
@@ -675,7 +675,7 @@
generate_call(ModuleInfo, "semi_exit_port_code_sr", 3,
[TopCSD, MiddleCSD, ActivationPtr1], [], ExitPortCode),
generate_call(ModuleInfo, "semi_fail_port_code_sr", 3,
- [TopCSD, MiddleCSD, ActivationPtr1], no, failure,
+ [TopCSD, MiddleCSD, ActivationPtr1], no, detism_failure,
FailPortCode),
NewNonlocals = list_to_set([TopCSD, MiddleCSD, ActivationPtr1])
;
@@ -688,7 +688,7 @@
generate_call(ModuleInfo, "semi_exit_port_code_ac", 2,
[TopCSD, MiddleCSD], [], ExitPortCode),
generate_call(ModuleInfo, "semi_fail_port_code_ac", 2,
- [TopCSD, MiddleCSD], no, failure, FailPortCode),
+ [TopCSD, MiddleCSD], no, detism_failure, FailPortCode),
NewNonlocals = list_to_set([TopCSD, MiddleCSD])
),
@@ -782,10 +782,10 @@
ExitPortCode),
generate_call(ModuleInfo, "non_fail_port_code_sr", 3,
[TopCSD, MiddleCSD, OldOutermostProcDyn2], no,
- failure, FailPortCode),
+ detism_failure, FailPortCode),
generate_call(ModuleInfo, "non_redo_port_code_sr", 2,
[MiddleCSD, NewOutermostProcDyn], no,
- failure, RedoPortCode0),
+ detism_failure, RedoPortCode0),
NewNonlocals = list_to_set([TopCSD, MiddleCSD, OldOutermostProcDyn2])
;
MaybeOldActivationPtr = no,
@@ -797,10 +797,10 @@
generate_call(ModuleInfo, "non_exit_port_code_ac", 2,
[TopCSD, MiddleCSD], [], ExitPortCode),
generate_call(ModuleInfo, "non_fail_port_code_ac", 2,
- [TopCSD, MiddleCSD], no, failure, FailPortCode),
+ [TopCSD, MiddleCSD], no, detism_failure, FailPortCode),
generate_call(ModuleInfo, "non_redo_port_code_ac", 2,
[MiddleCSD, NewOutermostProcDyn], no,
- failure, RedoPortCode0),
+ detism_failure, RedoPortCode0),
NewNonlocals = list_to_set([TopCSD, MiddleCSD])
),
@@ -823,7 +823,7 @@
ExitRedoNonLocals = set.union(NewNonlocals,
list_to_set([NewOutermostProcDyn])),
ExitRedoGoalInfo = impure_reachable_init_goal_info(ExitRedoNonLocals,
- multidet),
+ detism_multi),
CallExitRedoGoalInfo = goal_info_add_nonlocals_make_impure(GoalInfo1,
ExitRedoNonLocals),
@@ -1222,7 +1222,7 @@
goal_info_add_nonlocals_make_impure(GoalInfo, ExtraVars),
ReturnFailsGoalInfo =
- impure_unreachable_init_goal_info(ExtraVars, failure),
+ impure_unreachable_init_goal_info(ExtraVars, detism_failure),
FailGoalInfo = fail_goal_info,
FailGoal = disj([]) - FailGoalInfo,
@@ -1312,10 +1312,10 @@
FailGoal = disj([]) - FailGoalInfo,
RestoreFailGoalInfo = impure_unreachable_init_goal_info(ExtraNonLocals,
- failure),
+ detism_failure),
RezeroFailGoalInfo = impure_unreachable_init_goal_info(set.init,
- failure),
+ detism_failure),
make_impure(GoalInfo0, GoalInfo),
(
@@ -1589,7 +1589,7 @@
generate_call(ModuleInfo, Name, Arity, ArgVars, OutputVars, Goal) :-
generate_call(ModuleInfo, Name, Arity, ArgVars, yes(OutputVars),
- det, Goal).
+ detism_det, Goal).
:- pred generate_call(module_info::in, string::in, int::in, list(prog_var)::in,
maybe(list(prog_var))::in, determinism::in, hlds_goal::out) is det.
@@ -1619,7 +1619,7 @@
Ground = ground(shared, none),
NonLocals = set.make_singleton_set(Var),
instmap_delta_from_assoc_list([Var - ground(shared, none)], InstMapDelta),
- Determinism = det,
+ Determinism = detism_det,
goal_info_init(NonLocals, InstMapDelta, Determinism, purity_pure,
GoalInfo),
Goal = unify(Var, functor(ConsId, no, []),
@@ -1635,7 +1635,7 @@
Ground = ground(shared, none),
NonLocals = set.list_to_set([Var | Args]),
instmap_delta_from_assoc_list([Var - Ground], InstMapDelta),
- Determinism = det,
+ Determinism = detism_det,
goal_info_init(NonLocals, InstMapDelta, Determinism, purity_pure,
GoalInfo),
ArgMode = ((free - Ground) -> (Ground - Ground)),
@@ -1729,7 +1729,8 @@
fail_goal_info = GoalInfo :-
instmap_delta_init_unreachable(InstMapDelta),
- goal_info_init(set.init, InstMapDelta, failure, purity_pure, GoalInfo).
+ goal_info_init(set.init, InstMapDelta, detism_failure, purity_pure,
+ GoalInfo).
:- pred make_impure(hlds_goal_info::in, hlds_goal_info::out) is det.
Index: compiler/deforest.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/deforest.m,v
retrieving revision 1.64
diff -u -r1.64 deforest.m
--- compiler/deforest.m 29 Mar 2006 08:06:41 -0000 1.64
+++ compiler/deforest.m 7 Jul 2006 06:12:14 -0000
@@ -165,7 +165,8 @@
% so resetting the determinism would cause determinism errors.
true
;
- proc_info_set_inferred_determinism(erroneous, ProcInfo0, ProcInfo),
+ proc_info_set_inferred_determinism(detism_erroneous,
+ ProcInfo0, ProcInfo),
module_info_set_pred_proc_info(PredProcId, PredInfo, ProcInfo,
!ModuleInfo)
).
Index: compiler/dep_par_conj.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/dep_par_conj.m,v
retrieving revision 1.1
diff -u -r1.1 dep_par_conj.m
--- compiler/dep_par_conj.m 28 Jun 2006 04:46:13 -0000 1.1
+++ compiler/dep_par_conj.m 7 Jul 2006 06:12:33 -0000
@@ -413,7 +413,7 @@
InstMapSrc = [WaitVar - ground(shared, none)],
Context = term.context_init,
goal_util.generate_simple_call(ModuleName, PredName, predicate,
- only_mode, det, Args, Features, InstMapSrc, ModuleInfo,
+ only_mode, detism_det, Args, Features, InstMapSrc, ModuleInfo,
Context, WaitGoal).
% Make a goal to signal that a variable is produced.
@@ -431,7 +431,7 @@
InstMapSrc = [],
Context = term.context_init,
goal_util.generate_simple_call(ModuleName, PredName, predicate,
- only_mode, det, Args, Features, InstMapSrc, ModuleInfo,
+ only_mode, detism_det, Args, Features, InstMapSrc, ModuleInfo,
Context, SignalGoal).
% Succeed if Var is a variable bound between InstMap and
@@ -564,7 +564,7 @@
InstMapSrc = [FutureVar - ground(shared, none)],
Context = term.context_init,
goal_util.generate_simple_call(ModuleName, PredName, predicate,
- only_mode, det, Args, Features, InstMapSrc, ModuleInfo,
+ only_mode, detism_det, Args, Features, InstMapSrc, ModuleInfo,
Context, AllocGoal).
% Construct type future(T) given type T.
Index: compiler/det_analysis.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/det_analysis.m,v
retrieving revision 1.193
diff -u -r1.193 det_analysis.m
--- compiler/det_analysis.m 29 Mar 2006 08:06:42 -0000 1.193
+++ compiler/det_analysis.m 8 Jul 2006 07:51:00 -0000
@@ -134,50 +134,53 @@
%-----------------------------------------------------------------------------%
determinism_pass(!ModuleInfo, !IO) :-
- determinism_declarations(!.ModuleInfo, DeclaredProcs,
- UndeclaredProcs, NoInferProcs),
+ determinism_declarations(!.ModuleInfo, DeclaredProcs, UndeclaredProcs,
+ NoInferProcs),
list.foldl(set_non_inferred_proc_determinism, NoInferProcs, !ModuleInfo),
globals.io_lookup_bool_option(verbose, Verbose, !IO),
globals.io_lookup_bool_option(debug_det, Debug, !IO),
(
- UndeclaredProcs = []
+ UndeclaredProcs = [],
+ Msgs = []
;
UndeclaredProcs = [_ | _],
maybe_write_string(Verbose, "% Doing determinism inference...\n", !IO),
- global_inference_pass(!ModuleInfo, UndeclaredProcs, Debug, !IO),
+ global_inference_pass(!ModuleInfo, UndeclaredProcs, Debug, Msgs, !IO),
maybe_write_string(Verbose, "% done.\n", !IO)
),
maybe_write_string(Verbose, "% Doing determinism checking...\n", !IO),
- global_final_pass(!ModuleInfo, DeclaredProcs, Debug, !IO),
+ global_final_pass(!ModuleInfo, UndeclaredProcs, DeclaredProcs, Debug,
+ Msgs, !IO),
maybe_write_string(Verbose, "% done.\n", !IO).
determinism_check_proc(ProcId, PredId, !ModuleInfo, !IO) :-
globals.io_lookup_bool_option(debug_det, Debug, !IO),
- global_final_pass(!ModuleInfo, [proc(PredId, ProcId)], Debug, !IO).
+ global_final_pass(!ModuleInfo, [], [proc(PredId, ProcId)], Debug, [], !IO).
%-----------------------------------------------------------------------------%
:- pred global_inference_pass(module_info::in, module_info::out,
- pred_proc_list::in, bool::in, io::di, io::uo) is det.
+ pred_proc_list::in, bool::in, list(context_det_msg)::out,
+ io::di, io::uo) is det.
% Iterate until a fixpoint is reached. This can be expensive if a module
% has many predicates with undeclared determinisms. If this ever becomes
% a problem, we should switch to doing iterations only on strongly
% connected components of the dependency graph.
%
-global_inference_pass(!ModuleInfo, ProcList, Debug, !IO) :-
- global_inference_single_pass(ProcList, Debug, !ModuleInfo, [], Msgs,
+global_inference_pass(!ModuleInfo, ProcList, Debug, Msgs, !IO) :-
+ global_inference_single_pass(ProcList, Debug, !ModuleInfo, [], Msgs1,
unchanged, Changed, !IO),
maybe_write_string(Debug, "% Inference pass complete\n", !IO),
(
Changed = changed,
- global_inference_pass(!ModuleInfo, ProcList, Debug, !IO)
+ global_inference_pass(!ModuleInfo, ProcList, Debug, Msgs, !IO)
;
Changed = unchanged,
% We have arrived at a fixpoint. Therefore all the messages we have
% are based on the final determinisms of all procedures, which means
- % it is safe to print them.
- det_report_and_handle_msgs(Msgs, !ModuleInfo, !IO)
+ % it is safe to return them to be printed them.
+ Msgs = Msgs1
).
:- pred global_inference_single_pass(pred_proc_list::in, bool::in,
@@ -212,13 +215,19 @@
!Changed, !IO).
:- pred global_final_pass(module_info::in, module_info::out,
- pred_proc_list::in, bool::in, io::di, io::uo) is det.
+ pred_proc_list::in, pred_proc_list::in, bool::in,
+ list(context_det_msg)::in, io::di, io::uo) is det.
-global_final_pass(!ModuleInfo, ProcList, Debug, !IO) :-
- global_inference_single_pass(ProcList, Debug, !ModuleInfo, [], Msgs,
+global_final_pass(!ModuleInfo, UndeclaredProcs, DeclaredProcs, Debug, !.Msgs,
+ !IO) :-
+ % We have already iterated global_inference_single_pass to a fixpoint
+ % on the undeclared procs.
+ global_inference_single_pass(DeclaredProcs, Debug, !ModuleInfo, !Msgs,
unchanged, _, !IO),
- det_report_and_handle_msgs(Msgs, !ModuleInfo, !IO),
- global_checking_pass(ProcList, !ModuleInfo, !IO).
+ % We sort the messages by context.
+ list.sort_and_remove_dups(!Msgs),
+ det_report_and_handle_msgs(!.Msgs, !ModuleInfo, !IO),
+ global_checking_pass(UndeclaredProcs ++ DeclaredProcs, !ModuleInfo, !IO).
%-----------------------------------------------------------------------------%
@@ -305,8 +314,8 @@
module_info_get_pragma_exported_procs(!.ModuleInfo, ExportedProcs),
(
list.member(pragma_exported_proc(PredId, ProcId, _, _), ExportedProcs),
- ( NewDetism = multidet
- ; NewDetism = nondet
+ ( NewDetism = detism_multi
+ ; NewDetism = detism_non
)
->
(
@@ -593,7 +602,8 @@
list(failing_context)::out, list(context_det_msg)::out) is det.
det_infer_conj([], [], _InstMap0, _SolnContext, _RightFailingContexts,
- _MaybePromiseEqvSolutionSets, _DetInfo, det, !ConjFailingContexts, []).
+ _MaybePromiseEqvSolutionSets, _DetInfo, detism_det,
+ !ConjFailingContexts, []).
det_infer_conj([Goal0 | Goals0], [Goal | Goals], InstMap0, SolnContext,
RightFailingContexts, MaybePromiseEqvSolutionSets, DetInfo, Detism,
!ConjFailingContexts, Msgs) :-
@@ -670,7 +680,7 @@
det_infer_par_conj_goals([], [], _InstMap0, _SolnContext,
_RightFailingContexts, _MaybePromiseEqvSolutionSets, _DetInfo,
- det, !ConjFailingContexts, []).
+ detism_det, !ConjFailingContexts, []).
det_infer_par_conj_goals([Goal0 | Goals0], [Goal | Goals], InstMap0,
SolnContext, RightFailingContexts, MaybePromiseEqvSolutionSets,
DetInfo, Detism, !ConjFailingContexts, Msgs) :-
@@ -960,7 +970,7 @@
determinism_components(Detism0, CanFail, NumSolns0),
(
may_throw_exception(Attributes) = will_not_throw_exception,
- Detism0 = erroneous
+ Detism0 = detism_erroneous
->
proc_info_get_context(ProcInfo, ProcContext),
WillNotThrowMsg = will_not_throw_with_erroneous(PredId, ProcId),
@@ -1007,7 +1017,7 @@
Msg = pragma_c_code_without_det_decl(PredId, ProcId),
ContextMsg = context_det_msg(Context, Msg),
!:Msgs = [ContextMsg],
- Detism = erroneous,
+ Detism = detism_erroneous,
GoalFailingContexts = []
).
@@ -1428,17 +1438,25 @@
%-----------------------------------------------------------------------------%
% Determinism_declarations takes a module_info as input and returns
- % two lists of procedure ids, the first being those with determinism
- % declarations, and the second being those without.
+ % three lists of procedure ids:
+ %
+ % - DeclaredProcs holds the procedures that have declarations that need
+ % to be checked.
+ %
+ % - UndeclaredProcs holds the procedures that don't have declarations
+ % whose determinism needs to be inferred.
+ %
+ % - NoInferProcs holds the procedures whose determinism is already
+ % known, and which should not be processed further.
%
:- pred determinism_declarations(module_info::in, pred_proc_list::out,
pred_proc_list::out, pred_proc_list::out) is det.
-determinism_declarations(ModuleInfo, DeclaredProcs,
- UndeclaredProcs, NoInferProcs) :-
+determinism_declarations(ModuleInfo, DeclaredProcs, UndeclaredProcs,
+ NoInferProcs) :-
get_all_pred_procs(ModuleInfo, PredProcs),
- segregate_procs(ModuleInfo, PredProcs, DeclaredProcs,
- UndeclaredProcs, NoInferProcs).
+ segregate_procs(ModuleInfo, PredProcs, DeclaredProcs, UndeclaredProcs,
+ NoInferProcs).
% Get_all_pred_procs takes a module_info and returns a list of all
% the procedure ids for that module (except class methods, which
Index: compiler/det_report.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/det_report.m,v
retrieving revision 1.121
diff -u -r1.121 det_report.m
--- compiler/det_report.m 16 Jun 2006 07:24:41 -0000 1.121
+++ compiler/det_report.m 8 Jul 2006 07:41:29 -0000
@@ -263,7 +263,7 @@
WarnAboutInferredErroneous = yes
;
WarnAboutInferredErroneous = no,
- InferredDetism \= erroneous
+ InferredDetism \= detism_erroneous
)
->
Message = "warning: determinism declaration " ++
@@ -313,11 +313,12 @@
VerboseErrors = yes,
solutions.solutions(get_valid_dets(EvalMethod), Detisms),
DetismStrs = list.map(determinism_to_string, Detisms),
- DetismPieces = list_to_pieces(DetismStrs),
+ list.sort(DetismStrs, SortedDetismStrs),
+ DetismPieces = list_to_pieces(SortedDetismStrs),
write_error_pieces_not_first_line(Context, 0,
[words("The pragma requested is only valid"),
words("for the following determinism(s):") |
- DetismPieces], !IO)
+ DetismPieces] ++ [suffix(".")], !IO)
;
VerboseErrors = no,
globals.io_set_extra_error_info(yes, !IO)
@@ -337,14 +338,14 @@
:- mode determinism(out) is multi.
:- mode determinism(in) is det. % To ensure we don't forget any.
-determinism(det).
-determinism(semidet).
-determinism(multidet).
-determinism(nondet).
-determinism(cc_multidet).
-determinism(cc_nondet).
-determinism(erroneous).
-determinism(failure).
+determinism(detism_det).
+determinism(detism_semi).
+determinism(detism_multi).
+determinism(detism_non).
+determinism(detism_cc_multi).
+determinism(detism_cc_non).
+determinism(detism_erroneous).
+determinism(detism_failure).
:- pred check_determinism_of_main(pred_id::in, proc_id::in,
pred_info::in, proc_info::in, module_info::in, module_info::out,
@@ -360,8 +361,11 @@
pred_info_orig_arity(PredInfo) = 2,
pred_info_is_exported(PredInfo),
MaybeDetism = yes(DeclaredDetism),
- DeclaredDetism \= det,
- DeclaredDetism \= cc_multidet
+ \+ (
+ DeclaredDetism = detism_det
+ ;
+ DeclaredDetism = detism_cc_multi
+ )
->
proc_info_get_context(ProcInfo, Context1),
write_error_pieces(Context1, 0,
@@ -1461,7 +1465,7 @@
module_info_pred_proc_info(ModuleInfo, PredId, ProcId, _, ProcInfo),
proc_info_get_vartypes(ProcInfo, VarTypes),
det_info_init(ModuleInfo, VarTypes, PredId, ProcId, Globals, DetInfo),
- det_diagnose_conj(Goals, det, [], DetInfo, _, [ReportSpec], Specs),
+ det_diagnose_conj(Goals, detism_det, [], DetInfo, _, [ReportSpec], Specs),
write_error_specs(Specs, !IO).
det_report_msg(pragma_c_code_without_det_decl(PredId, ProcId), Context,
ModuleInfo, !IO) :-
Index: compiler/exception_analysis.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/exception_analysis.m,v
retrieving revision 1.27
diff -u -r1.27 exception_analysis.m
--- compiler/exception_analysis.m 5 Jun 2006 05:23:26 -0000 1.27
+++ compiler/exception_analysis.m 7 Jul 2006 06:12:41 -0000
@@ -354,7 +354,7 @@
check_goal_for_exceptions(SCC, VarTypes, Goal - GoalInfo, !Result,
!ModuleInfo, !IO) :-
- ( goal_info_get_determinism(GoalInfo, erroneous) ->
+ ( goal_info_get_determinism(GoalInfo, detism_erroneous) ->
!:Result = !.Result ^ status := may_throw(user_exception)
;
check_goal_for_exceptions_2(SCC, VarTypes, Goal, GoalInfo, !Result,
Index: compiler/fact_table.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/fact_table.m,v
retrieving revision 1.75
diff -u -r1.75 fact_table.m
--- compiler/fact_table.m 8 Jun 2006 08:19:11 -0000 1.75
+++ compiler/fact_table.m 7 Jul 2006 05:34:36 -0000
@@ -833,7 +833,7 @@
fact_table_mode_type(ArgModes, ModuleInfo, ModeType),
(
ModeType = all_in,
- InferredDetism = inferred(semidet),
+ InferredDetism = inferred(detism_semi),
WriteHashTables0 = yes,
WriteDataTable0 = no,
MaybeAllInProc0 = yes(ProcID)
@@ -842,14 +842,14 @@
proc_info_get_declared_determinism(ProcInfo0, MaybeDet),
(
(
- MaybeDet = yes(cc_multidet)
+ MaybeDet = yes(detism_cc_multi)
;
- MaybeDet = yes(cc_nondet)
+ MaybeDet = yes(detism_cc_non)
)
->
- InferredDetism = inferred(cc_multidet)
+ InferredDetism = inferred(detism_cc_multi)
;
- InferredDetism = inferred(multidet)
+ InferredDetism = inferred(detism_multi)
),
WriteHashTables0 = no,
WriteDataTable0 = yes,
@@ -1137,7 +1137,7 @@
)
->
% No duplicate keys => procedure is semidet.
- Determinism = semidet
+ Determinism = detism_semi
;
ExitStatus >= 1
->
@@ -1145,14 +1145,14 @@
proc_info_get_declared_determinism(ProcInfo0, MaybeDet),
(
(
- MaybeDet = yes(cc_multidet)
+ MaybeDet = yes(detism_cc_multi)
;
- MaybeDet = yes(cc_nondet)
+ MaybeDet = yes(detism_cc_non)
)
->
- Determinism = cc_nondet
+ Determinism = detism_cc_non
;
- Determinism = nondet
+ Determinism = detism_non
)
;
io.progname_base("mercury_compile", ProgName, !IO),
@@ -1162,12 +1162,12 @@
[s(ProgName)], Msg),
write_error_pieces_plain([words(Msg)], !IO),
io.set_exit_status(1, !IO),
- Determinism = erroneous
+ Determinism = detism_erroneous
)
;
Result = error(ErrorCode),
write_call_system_error_msg("sort", ErrorCode, !IO),
- Determinism = erroneous
+ Determinism = detism_erroneous
),
proc_info_set_inferred_determinism(Determinism, ProcInfo0, ProcInfo),
map.det_update(!.ProcTable, ProcID, ProcInfo, !:ProcTable),
@@ -2270,27 +2270,27 @@
make_fact_table_identifier(PredName, Identifier),
(
ModeType = all_out,
- Determinism = multidet
+ Determinism = detism_multi
->
generate_multidet_code(Identifier, PragmaVars, ProcID, ArgTypes,
ModuleInfo, FactTableSize, ProcCode, ExtraCode)
;
ModeType = all_out,
- Determinism = cc_multidet
+ Determinism = detism_cc_multi
->
generate_cc_multi_code(Identifier, PragmaVars, ProcCode),
ExtraCode = ""
;
ModeType = all_in,
- Determinism = semidet
+ Determinism = detism_semi
->
generate_all_in_code(Identifier, PragmaVars, ProcID, ArgTypes,
ModuleInfo, FactTableSize, ProcCode),
ExtraCode = ""
;
ModeType = in_out,
- ( Determinism = semidet
- ; Determinism = cc_nondet
+ ( Determinism = detism_semi
+ ; Determinism = detism_cc_non
)
->
generate_semidet_in_out_code(Identifier, PragmaVars, ProcID, ArgTypes,
@@ -2298,14 +2298,14 @@
ExtraCode = ""
;
ModeType = in_out,
- Determinism = nondet,
+ Determinism = detism_non,
ProcID = PrimaryProcID
->
generate_primary_nondet_code(Identifier, PragmaVars, ProcID, ArgTypes,
ModuleInfo, FactTableSize, ProcCode, ExtraCode)
;
ModeType = in_out,
- Determinism = nondet,
+ Determinism = detism_non,
ProcID \= PrimaryProcID
->
generate_secondary_nondet_code(Identifier, PragmaVars, ProcID,
Index: compiler/goal_form.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/goal_form.m,v
retrieving revision 1.30
diff -u -r1.30 goal_form.m
--- compiler/goal_form.m 31 Mar 2006 03:32:10 -0000 1.30
+++ compiler/goal_form.m 7 Jul 2006 05:34:44 -0000
@@ -193,7 +193,7 @@
goal_can_throw(GoalExpr - GoalInfo, Result, !ModuleInfo, !IO) :-
goal_info_get_determinism(GoalInfo, Determinism),
- ( Determinism \= erroneous ->
+ ( Determinism \= detism_erroneous ->
goal_can_throw_2(GoalExpr, GoalInfo, Result, !ModuleInfo, !IO)
;
Result = can_throw
@@ -407,7 +407,7 @@
goal_cannot_throw_aux(MaybeModuleInfo, GoalExpr - GoalInfo) :-
goal_info_get_determinism(GoalInfo, Determinism),
- not Determinism = erroneous,
+ not Determinism = detism_erroneous,
goal_cannot_throw_expr(MaybeModuleInfo, GoalExpr).
% XXX This predicate should be replaced by a function returning a bool.
Index: compiler/goal_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/goal_util.m,v
retrieving revision 1.131
diff -u -r1.131 goal_util.m
--- compiler/goal_util.m 8 Jun 2006 08:19:12 -0000 1.131
+++ compiler/goal_util.m 7 Jul 2006 05:35:32 -0000
@@ -413,7 +413,7 @@
GoalExpr = unify(OrigVar, var(NewVar), Mode, UnifyInfo, UnifyContext),
set.list_to_set([OrigVar, NewVar], NonLocals),
instmap_delta_from_assoc_list([OrigVar - NewInst], UnifyInstMapDelta),
- goal_info_init(NonLocals, UnifyInstMapDelta, det, purity_pure,
+ goal_info_init(NonLocals, UnifyInstMapDelta, detism_det, purity_pure,
term.context_init, GoalInfo),
Goal = GoalExpr - GoalInfo,
!:RevUnifies = [Goal | !.RevUnifies],
@@ -1287,7 +1287,7 @@
instmap_delta_bind_var_to_functor(Var, VarType, ConsId, InstMap,
ExtraInstMapDelta0, ExtraInstMapDelta, !ModuleInfo),
goal_info_init(NonLocals, ExtraInstMapDelta,
- semidet, purity_pure, ExtraGoalInfo),
+ detism_semi, purity_pure, ExtraGoalInfo),
% Conjoin the test and the rest of the case.
goal_to_conj_list(CaseGoal, CaseGoalConj),
@@ -1302,7 +1302,7 @@
instmap_delta_apply_instmap_delta(ExtraInstMapDelta, CaseInstMapDelta,
test_size, InstMapDelta),
goal_info_get_determinism(CaseGoalInfo, CaseDetism0),
- det_conjunction_detism(semidet, CaseDetism0, Detism),
+ det_conjunction_detism(detism_semi, CaseDetism0, Detism),
infer_goal_info_purity(CaseGoalInfo, CasePurity),
goal_info_init(CaseNonLocals, InstMapDelta,
Detism, CasePurity, CombinedGoalInfo),
@@ -1618,10 +1618,10 @@
generate_cast(CastType, InArg, OutArg, InInst, OutInst, Context, Goal) :-
set.list_to_set([InArg, OutArg], NonLocals),
instmap_delta_from_assoc_list([OutArg - OutInst], InstMapDelta),
- goal_info_init(NonLocals, InstMapDelta, det, purity_pure, Context,
+ goal_info_init(NonLocals, InstMapDelta, detism_det, purity_pure, Context,
GoalInfo),
Goal = generic_call(cast(CastType), [InArg, OutArg],
- [in_mode(InInst), out_mode(OutInst)], det) - GoalInfo.
+ [in_mode(InInst), out_mode(OutInst)], detism_det) - GoalInfo.
%-----------------------------------------------------------------------------%
Index: compiler/higher_order.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/higher_order.m,v
retrieving revision 1.154
diff -u -r1.154 higher_order.m
--- compiler/higher_order.m 8 Jun 2006 08:19:12 -0000 1.154
+++ compiler/higher_order.m 7 Jul 2006 06:13:36 -0000
@@ -1110,7 +1110,7 @@
instmap_delta_init_reachable(InstMapDelta0),
instmap_delta_insert(ResultVar, ground(shared, none),
InstMapDelta0, InstMapDelta),
- goal_info_init(NonLocals, InstMapDelta, det, purity_pure, GoalInfo),
+ goal_info_init(NonLocals, InstMapDelta, detism_det, purity_pure, GoalInfo),
CallGoal = call(PredId, ProcId, CallArgs, not_builtin,
MaybeContext, SymName) - GoalInfo,
get_typeclass_info_args_2(TypeClassInfoVar, PredId, ProcId, SymName,
@@ -2153,7 +2153,7 @@
set.list_to_set([ComparisonResult, Arg1, Arg2], NonLocals),
instmap_delta_from_assoc_list(
[ComparisonResult - ground(shared,none)], InstMapDelta),
- Detism = det,
+ Detism = detism_det,
goal_info_init(NonLocals, InstMapDelta, Detism, purity_pure,
Context, GoalInfo),
GoalExpr = conj(plain_conj,
@@ -2183,7 +2183,7 @@
in_mode(In),
NonLocals = NonLocals0,
instmap_delta_init_reachable(InstMapDelta),
- Detism = semidet,
+ Detism = detism_semi,
SpecialGoal = unify(UnwrappedArg1, var(UnwrappedArg2), (In - In),
simple_test(UnwrappedArg1, UnwrappedArg2),
unify_context(explicit, [])),
@@ -2197,7 +2197,7 @@
set.insert(NonLocals0, ComparisonResult, NonLocals),
instmap_delta_from_assoc_list(
[ComparisonResult - ground(shared, none)], InstMapDelta),
- Detism = det,
+ Detism = detism_det,
% Build a new call with the unwrapped arguments.
find_builtin_type_with_equivalent_compare(ModuleInfo, WrappedType,
CompareType, NeedIntCast),
@@ -2370,7 +2370,7 @@
% This will be recomputed later.
instmap_delta_from_assoc_list([UnwrappedArg - ground(shared, none)],
InstMapDelta),
- goal_info_init(NonLocals, InstMapDelta, det, purity_pure, Context,
+ goal_info_init(NonLocals, InstMapDelta, detism_det, purity_pure, Context,
GoalInfo),
Goal = unify(Arg, functor(ConsId, no, [UnwrappedArg]),
in_mode - out_mode,
@@ -3111,8 +3111,8 @@
ConstInst = ground(shared, GroundInstInfo),
instmap_delta_from_assoc_list([LVar - ConstInst],
ConstInstMapDelta),
- goal_info_init(ConstNonLocals, ConstInstMapDelta, det, purity_pure,
- ConstGoalInfo),
+ goal_info_init(ConstNonLocals, ConstInstMapDelta, detism_det,
+ purity_pure, ConstGoalInfo),
RHS = functor(ConsId, no, CurriedHeadVars1),
UniMode = (free -> ConstInst) - (ConstInst -> ConstInst),
ConstGoal = unify(LVar, RHS, UniMode,
Index: compiler/hlds_goal.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_goal.m,v
retrieving revision 1.161
diff -u -r1.161 hlds_goal.m
--- compiler/hlds_goal.m 30 Jun 2006 12:51:53 -0000 1.161
+++ compiler/hlds_goal.m 7 Jul 2006 05:36:16 -0000
@@ -1561,7 +1561,7 @@
:- pragma inline(goal_info_init/1).
goal_info_init(GoalInfo) :-
- Detism = erroneous,
+ Detism = detism_erroneous,
instmap_delta_init_unreachable(InstMapDelta),
set.init(NonLocals),
term.context_init(Context),
@@ -1572,7 +1572,7 @@
:- pragma inline(goal_info_init/2).
goal_info_init(Context, GoalInfo) :-
- Detism = erroneous,
+ Detism = detism_erroneous,
instmap_delta_init_unreachable(InstMapDelta),
set.init(NonLocals),
set.init(Features),
@@ -2063,7 +2063,7 @@
true_goal = true_goal_expr - GoalInfo :-
instmap_delta_init_reachable(InstMapDelta),
- goal_info_init(set.init, InstMapDelta, det, purity_pure, GoalInfo).
+ goal_info_init(set.init, InstMapDelta, detism_det, purity_pure, GoalInfo).
true_goal_expr = conj(plain_conj, []).
@@ -2073,7 +2073,8 @@
fail_goal = fail_goal_expr - GoalInfo :-
instmap_delta_init_unreachable(InstMapDelta),
- goal_info_init(set.init, InstMapDelta, failure, purity_pure, GoalInfo).
+ goal_info_init(set.init, InstMapDelta, detism_failure, purity_pure,
+ GoalInfo).
fail_goal_expr = disj([]).
@@ -2107,7 +2108,7 @@
goal_info_get_determinism(GoalInfo, Det1),
det_conjunction_detism(Det0, Det1, Det)
),
- list.foldl(ComputeDeterminism, Goals, det, Determinism).
+ list.foldl(ComputeDeterminism, Goals, detism_det, Determinism).
goal_list_purity(Goals, Purity) :-
ComputePurity = (func(_ - GoalInfo, Purity0) = Purity1 :-
@@ -2189,7 +2190,7 @@
Unification = simple_test(X, Y),
UnifyContext = unify_context(UnifyMainContext, UnifySubContext),
instmap_delta_init_reachable(InstMapDelta),
- goal_info_init(list_to_set([X, Y]), InstMapDelta, semidet, purity_pure,
+ goal_info_init(list_to_set([X, Y]), InstMapDelta, detism_semi, purity_pure,
GoalInfo),
Goal = unify(X, var(Y), Mode, Unification, UnifyContext) - GoalInfo.
@@ -2274,7 +2275,7 @@
set.singleton_set(NonLocals, Var),
instmap_delta_init_reachable(InstMapDelta0),
instmap_delta_insert(Var, Inst, InstMapDelta0, InstMapDelta),
- goal_info_init(NonLocals, InstMapDelta, det, purity_pure, GoalInfo).
+ goal_info_init(NonLocals, InstMapDelta, detism_det, purity_pure, GoalInfo).
construct_functor(Var, ConsId, Args, Goal) :-
list.length(Args, Arity),
@@ -2288,7 +2289,7 @@
Unify = unify(Var, Rhs, UnifyMode, Unification, UnifyContext),
set.list_to_set([Var | Args], NonLocals),
instmap_delta_from_assoc_list([Var - ground_inst], InstMapDelta),
- goal_info_init(NonLocals, InstMapDelta, det, purity_pure, GoalInfo),
+ goal_info_init(NonLocals, InstMapDelta, detism_det, purity_pure, GoalInfo),
Goal = Unify - GoalInfo.
deconstruct_functor(Var, ConsId, Args, Goal) :-
@@ -2305,7 +2306,7 @@
list.duplicate(Arity, ground_inst, DeltaValues),
assoc_list.from_corresponding_lists(Args, DeltaValues, DeltaAL),
instmap_delta_from_assoc_list(DeltaAL, InstMapDelta),
- goal_info_init(NonLocals, InstMapDelta, det, purity_pure, GoalInfo),
+ goal_info_init(NonLocals, InstMapDelta, detism_det, purity_pure, GoalInfo),
Goal = Unify - GoalInfo.
construct_tuple(Tuple, Args, Goal) :-
Index: compiler/hlds_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_out.m,v
retrieving revision 1.393
diff -u -r1.393 hlds_out.m
--- compiler/hlds_out.m 8 Jun 2006 08:19:14 -0000 1.393
+++ compiler/hlds_out.m 7 Jul 2006 05:37:06 -0000
@@ -3745,14 +3745,14 @@
write_determinism(Detism, !IO) :-
io.write_string(determinism_to_string(Detism), !IO).
-determinism_to_string(det) = "det".
-determinism_to_string(semidet) = "semidet".
-determinism_to_string(nondet) = "nondet".
-determinism_to_string(multidet) = "multi".
-determinism_to_string(cc_nondet) = "cc_nondet".
-determinism_to_string(cc_multidet) = "cc_multi".
-determinism_to_string(erroneous) = "erroneous".
-determinism_to_string(failure) = "failure".
+determinism_to_string(detism_det) = "det".
+determinism_to_string(detism_semi) = "semidet".
+determinism_to_string(detism_non) = "nondet".
+determinism_to_string(detism_multi) = "multi".
+determinism_to_string(detism_cc_non) = "cc_nondet".
+determinism_to_string(detism_cc_multi) = "cc_multi".
+determinism_to_string(detism_erroneous) = "erroneous".
+determinism_to_string(detism_failure) = "failure".
write_can_fail(CanFail, !IO) :-
io.write_string(can_fail_to_string(CanFail), !IO).
@@ -4058,14 +4058,14 @@
:- func det_to_string(determinism) = string.
-det_to_string(erroneous) = "erroneous".
-det_to_string(failure) = "failure".
-det_to_string(det) = "det".
-det_to_string(semidet) = "semidet".
-det_to_string(cc_multidet) = "cc_multi".
-det_to_string(cc_nondet) = "cc_nondet".
-det_to_string(multidet) = "multi".
-det_to_string(nondet) = "nondet".
+det_to_string(detism_erroneous) = "erroneous".
+det_to_string(detism_failure) = "failure".
+det_to_string(detism_det) = "det".
+det_to_string(detism_semi) = "semidet".
+det_to_string(detism_cc_multi) = "cc_multi".
+det_to_string(detism_cc_non) = "cc_nondet".
+det_to_string(detism_multi) = "multi".
+det_to_string(detism_non) = "nondet".
%-----------------------------------------------------------------------------%
Index: compiler/hlds_pred.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_pred.m,v
retrieving revision 1.199
diff -u -r1.199 hlds_pred.m
--- compiler/hlds_pred.m 15 Jun 2006 19:36:59 -0000 1.199
+++ compiler/hlds_pred.m 7 Jul 2006 06:02:17 -0000
@@ -1772,11 +1772,11 @@
:- pred proc_info_set_structure_sharing(structure_sharing_domain::in,
proc_info::in, proc_info::out) is det.
-:- pred proc_info_get_imported_structure_sharing(proc_info::in,
- prog_vars::out, list(mer_type)::out, structure_sharing_domain::out)
+:- pred proc_info_get_imported_structure_sharing(proc_info::in,
+ prog_vars::out, list(mer_type)::out, structure_sharing_domain::out)
is semidet.
-:- pred proc_info_set_imported_structure_sharing(prog_vars::in,
+:- pred proc_info_set_imported_structure_sharing(prog_vars::in,
list(mer_type)::in, structure_sharing_domain::in, proc_info::in,
proc_info::out) is det.
@@ -1786,14 +1786,14 @@
:- pred proc_info_get_structure_reuse(proc_info::in,
maybe(structure_reuse_domain)::out) is det.
-:- pred proc_info_set_structure_reuse(structure_reuse_domain::in,
+:- pred proc_info_set_structure_reuse(structure_reuse_domain::in,
proc_info::in, proc_info::out) is det.
-:- pred proc_info_get_imported_structure_reuse(proc_info::in,
- prog_vars::out, list(mer_type)::out, structure_reuse_domain::out)
+:- pred proc_info_get_imported_structure_reuse(proc_info::in,
+ prog_vars::out, list(mer_type)::out, structure_reuse_domain::out)
is semidet.
-:- pred proc_info_set_imported_structure_reuse(prog_vars::in,
+:- pred proc_info_set_imported_structure_reuse(prog_vars::in,
list(mer_type)::in, structure_reuse_domain::in, proc_info::in,
proc_info::out) is det.
@@ -2059,28 +2059,28 @@
% Structure sharing information as obtained by the structure
% sharing analysis.
- structure_sharing :: structure_sharing_info,
+ structure_sharing :: structure_sharing_info,
% Structure reuse conditions obtained by the structure reuse
% analysis (CTGC).
structure_reuse :: structure_reuse_info
-
+
).
-:- type structure_sharing_info
+:- type structure_sharing_info
---> structure_sharing_info(
maybe_sharing :: maybe(structure_sharing_domain),
maybe_imported_sharing :: maybe(imported_sharing)
% Records the sharing information from any `.opt' or
% `.trans_opt' file. This information needs to be processed
% at the beginning of structure sharing analysis. After that
- % this field is of no use.
+ % this field is of no use.
).
% Sharing information is expressed in terms of headvariables and the
% type variables occurring in their types. In order to correctly process
% (mainly renaming) this information, we need both the list of head
- % variables as well as their types. As this list of headvariables may
+ % variables as well as their types. As this list of headvariables may
% contain any compiler-added headvariables, the processing of imported
% structure sharing information needs to be postponed until the actual
% structure sharing analysis, which explains the need for the type
@@ -2088,39 +2088,39 @@
%
:- type imported_sharing
---> imported_sharing(
- s_headvars :: prog_vars,
+ s_headvars :: prog_vars,
% The list of headvars in which terms the imported sharing
- % is expressed.
- s_types :: list(mer_type),
+ % is expressed.
+ s_types :: list(mer_type),
% The types of the headvars.
s_sharing :: structure_sharing_domain
- ).
+ ).
:- func structure_sharing_info_init = structure_sharing_info.
structure_sharing_info_init = structure_sharing_info(no, no).
-:- type structure_reuse_info
+:- type structure_reuse_info
---> structure_reuse_info(
maybe_reuse :: maybe(structure_reuse_domain),
maybe_imported_reuse :: maybe(imported_reuse)
% Records the reuse information from any `.opt' or
% `.trans_opt' file. This information needs to be processed
% at the beginning of structure reuse analysis. After that
- % this field is of no use.
+ % this field is of no use.
).
% Same rationale as for imported_sharing.
%
:- type imported_reuse
---> imported_reuse(
- r_headvars :: prog_vars,
+ r_headvars :: prog_vars,
% The list of headvars in which terms the imported reuse
- % information is expressed.
- r_types :: list(mer_type),
+ % information is expressed.
+ r_types :: list(mer_type),
% The types of the headvars.
r_reuse :: structure_reuse_domain
- ).
+ ).
:- func structure_reuse_info_init = structure_reuse_info.
@@ -2139,7 +2139,7 @@
varset.init(InstVarSet),
map.from_corresponding_lists(HeadVars, Types, BodyTypes),
ModeErrors = [],
- InferredDet = erroneous,
+ InferredDet = detism_erroneous,
map.init(StackSlots),
set.init(InitialLiveness),
ArgInfo = no,
@@ -2149,9 +2149,9 @@
rtti_varmaps_init(RttiVarMaps),
Term2Info = term_constr_main.term2_info_init,
SharingInfo = structure_sharing_info_init,
- ReuseInfo = structure_reuse_info_init,
+ ReuseInfo = structure_reuse_info_init,
ProcSubInfo = proc_sub_info(no, no, Term2Info, IsAddressTaken, StackSlots,
- ArgInfo, InitialLiveness, no, no, no, no, no, no,
+ ArgInfo, InitialLiveness, no, no, no, no, no, no,
SharingInfo, ReuseInfo),
ProcInfo = proc_info(MContext, BodyVarSet, BodyTypes, HeadVars, InstVarSet,
DeclaredModes, Modes, no, MaybeArgLives, MaybeDet, InferredDet,
@@ -2164,9 +2164,9 @@
IsAddressTaken, StackSlots, ArgInfo, Liveness, ProcInfo) :-
ModeErrors = [],
SharingInfo = structure_sharing_info_init,
- ReuseInfo = structure_reuse_info_init,
+ ReuseInfo = structure_reuse_info_init,
ProcSubInfo = proc_sub_info(ArgSizes, Termination, Termination2,
- IsAddressTaken, StackSlots, ArgInfo, Liveness, no, no, no, no, no,
+ IsAddressTaken, StackSlots, ArgInfo, Liveness, no, no, no, no, no,
no, SharingInfo, ReuseInfo),
ProcInfo = proc_info(Context, BodyVarSet, BodyTypes, HeadVars,
InstVarSet, no, HeadModes, no, HeadLives,
@@ -2188,9 +2188,9 @@
ModeErrors = [],
Term2Info = term_constr_main.term2_info_init,
SharingInfo = structure_sharing_info_init,
- ReuseInfo = structure_reuse_info_init,
+ ReuseInfo = structure_reuse_info_init,
ProcSubInfo = proc_sub_info(no, no, Term2Info, IsAddressTaken,
- StackSlots, no, Liveness, no, no, no, no, no, no,
+ StackSlots, no, Liveness, no, no, no, no, no, no,
SharingInfo, ReuseInfo),
ProcInfo = proc_info(Context, VarSet, VarTypes, HeadVars,
InstVarSet, no, HeadModes, no, MaybeHeadLives,
@@ -2357,53 +2357,53 @@
Termination2Info.
proc_info_get_structure_sharing(ProcInfo, MaybeSharing) :-
- MaybeSharing = ProcInfo ^ proc_sub_info ^ structure_sharing
+ MaybeSharing = ProcInfo ^ proc_sub_info ^ structure_sharing
^ maybe_sharing.
-proc_info_set_structure_sharing(Sharing, !ProcInfo) :-
- !:ProcInfo = !.ProcInfo ^ proc_sub_info ^ structure_sharing
+proc_info_set_structure_sharing(Sharing, !ProcInfo) :-
+ !:ProcInfo = !.ProcInfo ^ proc_sub_info ^ structure_sharing
^ maybe_sharing := yes(Sharing).
-proc_info_get_imported_structure_sharing(ProcInfo, HeadVars, Types,
- Sharing) :-
+proc_info_get_imported_structure_sharing(ProcInfo, HeadVars, Types,
+ Sharing) :-
MaybeImportedSharing = ProcInfo ^ proc_sub_info ^ structure_sharing
- ^ maybe_imported_sharing,
- MaybeImportedSharing = yes(ImportedSharing),
+ ^ maybe_imported_sharing,
+ MaybeImportedSharing = yes(ImportedSharing),
ImportedSharing = imported_sharing(HeadVars, Types, Sharing).
-proc_info_set_imported_structure_sharing(HeadVars, Types, Sharing,
- !ProcInfo) :-
- ImportedSharing = imported_sharing(HeadVars, Types, Sharing),
- MaybeImportedSharing = yes(ImportedSharing),
+proc_info_set_imported_structure_sharing(HeadVars, Types, Sharing,
+ !ProcInfo) :-
+ ImportedSharing = imported_sharing(HeadVars, Types, Sharing),
+ MaybeImportedSharing = yes(ImportedSharing),
!:ProcInfo = !.ProcInfo ^ proc_sub_info ^ structure_sharing
- ^ maybe_imported_sharing := MaybeImportedSharing.
+ ^ maybe_imported_sharing := MaybeImportedSharing.
-proc_info_reset_imported_structure_sharing(!ProcInfo) :-
+proc_info_reset_imported_structure_sharing(!ProcInfo) :-
!:ProcInfo = !.ProcInfo ^ proc_sub_info ^ structure_sharing
^ maybe_imported_sharing := no.
proc_info_get_structure_reuse(ProcInfo, MaybeReuse) :-
MaybeReuse = ProcInfo ^ proc_sub_info ^ structure_reuse ^ maybe_reuse.
-proc_info_set_structure_reuse(Reuse, !ProcInfo) :-
- !:ProcInfo = !.ProcInfo ^ proc_sub_info ^ structure_reuse
+proc_info_set_structure_reuse(Reuse, !ProcInfo) :-
+ !:ProcInfo = !.ProcInfo ^ proc_sub_info ^ structure_reuse
^ maybe_reuse := yes(Reuse).
-proc_info_get_imported_structure_reuse(ProcInfo, HeadVars, Types,
- Reuse) :-
+proc_info_get_imported_structure_reuse(ProcInfo, HeadVars, Types,
+ Reuse) :-
MaybeImportedReuse = ProcInfo ^ proc_sub_info ^ structure_reuse
- ^ maybe_imported_reuse,
- MaybeImportedReuse = yes(ImportedReuse),
+ ^ maybe_imported_reuse,
+ MaybeImportedReuse = yes(ImportedReuse),
ImportedReuse = imported_reuse(HeadVars, Types, Reuse).
-proc_info_set_imported_structure_reuse(HeadVars, Types, Reuse,
- !ProcInfo) :-
- ImportedReuse = imported_reuse(HeadVars, Types, Reuse),
- MaybeImportedReuse = yes(ImportedReuse),
+proc_info_set_imported_structure_reuse(HeadVars, Types, Reuse,
+ !ProcInfo) :-
+ ImportedReuse = imported_reuse(HeadVars, Types, Reuse),
+ MaybeImportedReuse = yes(ImportedReuse),
!:ProcInfo = !.ProcInfo ^ proc_sub_info ^ structure_reuse
- ^ maybe_imported_reuse := MaybeImportedReuse.
+ ^ maybe_imported_reuse := MaybeImportedReuse.
-proc_info_reset_imported_structure_reuse(!ProcInfo) :-
+proc_info_reset_imported_structure_reuse(!ProcInfo) :-
!:ProcInfo = !.ProcInfo ^ proc_sub_info ^ structure_reuse
^ maybe_imported_reuse := no.
@@ -2848,17 +2848,55 @@
unexpected(this_file,
"valid_determinism_for_eval_method called after tabling phase").
valid_determinism_for_eval_method(eval_minimal(_), Detism) = Valid :-
+ % Reason 1:
% Determinism analysis isn't yet smart enough to know whether
- % a cannot_fail execution path is guaranteed not to go through
- % a call to a predicate that is mutually recursive with this one,
- % which (if this predicate is minimal model) is the only way that
- % the predicate can be properly cannot_fail. The problem is that in
- % in general, the mutually recursive predicate may be in another
- % module.
- determinism_components(Detism, CanFail, _),
- ( CanFail = can_fail ->
+ % a cannot_fail execution path is guaranteed not to go through a call
+ % to a predicate that is mutually recursive with this one, which (if this
+ % predicate is minimal model) is the only way that the predicate can be
+ % properly cannot_fail. The problem is that in in general, the mutually
+ % recursive predicate may be in another module.
+ %
+ % Reason 2:
+ % The transformation, as currently implemented, assumes that it is possible
+ % to reach the call table tip, and generates HLDS that refers to the
+ % introduced variable representing this tip. This variable however, will
+ % be optimized away if the code cannot succeed, causing a code generator
+ % abort.
+ %
+ % Reason 3:
+ % Minimal model semantics requires computing to a fixpoint, and this is
+ % incompatible with the notion of Committed choice.
+ %
+ % Reason 4:
+ % Doing the analysis required to ensure that a predicate can't have more
+ % than one solution is much harder if the predicate concerned is
+ % minimal_model. In theory, this analysis could be done, but it would
+ % take a lot of programming, and since there is a simple workaround
+ % make the predicate nondet, and check the number of solutions at the
+ % caller), this would not be cost-effective.
+ (
+ Detism = detism_det,
+ Valid = no % Reason 1
+ ;
+ Detism = detism_semi,
+ Valid = no % Reason 4
+ ;
+ Detism = detism_multi, % Reason 1
+ Valid = yes
+ ;
+ Detism = detism_non,
Valid = yes
;
+ Detism = detism_cc_multi, % Reason 3
+ Valid = no
+ ;
+ Detism = detism_cc_non, % Reason 3
+ Valid = no
+ ;
+ Detism = detism_erroneous, % Reason 2
+ Valid = no
+ ;
+ Detism = detism_failure, % Reason 2
Valid = no
).
@@ -2897,7 +2935,7 @@
eval_method_change_determinism(eval_table_io(_, _), Detism) = Detism.
eval_method_change_determinism(eval_memo, Detism) = Detism.
eval_method_change_determinism(eval_minimal(_), Detism0) = Detism :-
- det_conjunction_detism(semidet, Detism0, Detism).
+ det_conjunction_detism(detism_semi, Detism0, Detism).
%-----------------------------------------------------------------------------%
Index: compiler/inlining.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/inlining.m,v
retrieving revision 1.140
diff -u -r1.140 inlining.m
--- compiler/inlining.m 28 Jun 2006 04:46:14 -0000 1.140
+++ compiler/inlining.m 7 Jul 2006 06:13:54 -0000
@@ -938,7 +938,7 @@
HighLevelCode = no,
CalledGoal = foreign_proc(_, _, _, _, _, _) - _,
proc_info_interface_determinism(ProcInfo, Detism),
- ( Detism = nondet ; Detism = multidet )
+ ( Detism = detism_non ; Detism = detism_multi )
),
% Only inline foreign_code if it is appropriate for
Index: compiler/inst_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/inst_util.m,v
retrieving revision 1.48
diff -u -r1.48 inst_util.m
--- compiler/inst_util.m 30 Jun 2006 12:51:53 -0000 1.48
+++ compiler/inst_util.m 7 Jul 2006 05:49:01 -0000
@@ -182,7 +182,7 @@
% because the only time that this will happen is when we get to the
% recursive case for a recursively defined inst. If the unification
% as a whole is semidet then it must be semidet somewhere else too.
- Det = det
+ Det = detism_det
),
Inst1 = Inst0
;
@@ -227,7 +227,7 @@
!ModuleInfo) :-
( InstB = not_reached ->
Inst = not_reached,
- Det = det
+ Det = detism_det
; InstA = constrained_inst_vars(InstVars, InstA1) ->
abstractly_unify_constrained_inst_vars(IsLive, InstVars, InstA1,
InstB, UnifyIsReal, Inst, Det, !ModuleInfo)
@@ -250,22 +250,22 @@
unify_is_real::in, mer_inst::out, determinism::out,
module_info::in, module_info::out) is semidet.
-abstractly_unify_inst_3(live, not_reached, _, _, not_reached, det,
+abstractly_unify_inst_3(live, not_reached, _, _, not_reached, detism_det,
!ModuleInfo).
abstractly_unify_inst_3(live, any(Uniq), Inst0, Real, Inst, Det,
!ModuleInfo) :-
make_any_inst(Inst0, live, Uniq, Real, Inst, Det, !ModuleInfo).
-abstractly_unify_inst_3(live, free, any(UniqY), Real, any(Uniq), det,
+abstractly_unify_inst_3(live, free, any(UniqY), Real, any(Uniq), detism_det,
!ModuleInfo) :-
- unify_uniq(live, Real, det, unique, UniqY, Uniq).
+ unify_uniq(live, Real, detism_det, unique, UniqY, Uniq).
% abstractly_unify_inst_3(live, free, free, _, _, _, _, _) :- fail.
abstractly_unify_inst_3(live, free, bound(UniqY, List0), Real,
- bound(Uniq, List), det, !ModuleInfo) :-
- unify_uniq(live, Real, det, unique, UniqY, Uniq),
+ bound(Uniq, List), detism_det, !ModuleInfo) :-
+ unify_uniq(live, Real, detism_det, unique, UniqY, Uniq),
% Since both are live, we must disallow free-free unifications.
bound_inst_list_is_ground_or_any(List0, !.ModuleInfo),
% Since both are live, we must make the result shared
@@ -277,22 +277,22 @@
).
abstractly_unify_inst_3(live, free, ground(UniqY, PredInst), Real,
- ground(Uniq, PredInst), det, !ModuleInfo) :-
- unify_uniq(live, Real, det, unique, UniqY, Uniq).
+ ground(Uniq, PredInst), detism_det, !ModuleInfo) :-
+ unify_uniq(live, Real, detism_det, unique, UniqY, Uniq).
% abstractly_unify_inst_3(live, free, abstract_inst(_,_), _, _, _, _) :- fail.
abstractly_unify_inst_3(live, bound(UniqX, List0), any(UniqY), Real,
bound(Uniq, List), Det, !ModuleInfo) :-
allow_unify_bound_any(Real),
- unify_uniq(live, Real, semidet, UniqX, UniqY, Uniq),
+ unify_uniq(live, Real, detism_semi, UniqX, UniqY, Uniq),
make_any_bound_inst_list(List0, live, UniqY, Real, List, Det1,
!ModuleInfo),
- det_par_conjunction_detism(Det1, semidet, Det).
+ det_par_conjunction_detism(Det1, detism_semi, Det).
abstractly_unify_inst_3(live, bound(UniqY, List0), free, Real,
- bound(Uniq, List), det, !ModuleInfo) :-
- unify_uniq(live, Real, det, unique, UniqY, Uniq),
+ bound(Uniq, List), detism_det, !ModuleInfo) :-
+ unify_uniq(live, Real, detism_det, unique, UniqY, Uniq),
% Since both are live, we must disallow free-free unifications.
bound_inst_list_is_ground_or_any(List0, !.ModuleInfo),
make_shared_bound_inst_list(List0, List, !ModuleInfo).
@@ -305,39 +305,39 @@
abstractly_unify_inst_3(live, bound(UniqX, BoundInsts0), ground(UniqY, _),
Real, bound(Uniq, BoundInsts), Det, !ModuleInfo) :-
- unify_uniq(live, Real, semidet, UniqX, UniqY, Uniq),
+ unify_uniq(live, Real, detism_semi, UniqX, UniqY, Uniq),
make_ground_bound_inst_list(BoundInsts0, live, UniqY, Real, BoundInsts,
Det1, !ModuleInfo),
- det_par_conjunction_detism(Det1, semidet, Det).
+ det_par_conjunction_detism(Det1, detism_semi, Det).
% abstract insts not supported
% abstractly_unify_inst_3(live, bound(Uniq, List), abstract_inst(_,_), Real,
-% ground(shared), semidet, !ModuleInfo) :-
-% unify_uniq(live, Real, semidet, unique, UniqY, Uniq),
+% ground(shared), detism_semi, !ModuleInfo) :-
+% unify_uniq(live, Real, detism_semi, unique, UniqY, Uniq),
% bound_inst_list_is_ground(List, !.ModuleInfo).
abstractly_unify_inst_3(live, ground(UniqX, higher_order(PredInst)),
any(UniqY), Real, ground(Uniq, higher_order(PredInst)),
- semidet, !ModuleInfo) :-
+ detism_semi, !ModuleInfo) :-
Real = fake_unify,
- unify_uniq(live, Real, det, UniqX, UniqY, Uniq).
+ unify_uniq(live, Real, detism_det, UniqX, UniqY, Uniq).
abstractly_unify_inst_3(live, ground(Uniq0, higher_order(PredInst)), free,
- Real, ground(Uniq, higher_order(PredInst)), det, !ModuleInfo) :-
- unify_uniq(live, Real, det, unique, Uniq0, Uniq).
+ Real, ground(Uniq, higher_order(PredInst)), detism_det, !ModuleInfo) :-
+ unify_uniq(live, Real, detism_det, unique, Uniq0, Uniq).
abstractly_unify_inst_3(live, ground(UniqX, higher_order(_)),
bound(UniqY, BoundInsts0), Real, bound(Uniq, BoundInsts),
Det, !ModuleInfo) :-
% check `Real = fake_unify' ?
- unify_uniq(live, Real, semidet, UniqX, UniqY, Uniq),
+ unify_uniq(live, Real, detism_semi, UniqX, UniqY, Uniq),
make_ground_bound_inst_list(BoundInsts0, live, UniqX, Real, BoundInsts,
Det1, !ModuleInfo),
- det_par_conjunction_detism(Det1, semidet, Det).
+ det_par_conjunction_detism(Det1, detism_semi, Det).
abstractly_unify_inst_3(live, ground(UniqA, higher_order(PredInstA)),
ground(UniqB, _GroundInstInfoB), Real,
- ground(Uniq, GroundInstInfo), semidet, !ModuleInfo) :-
+ ground(Uniq, GroundInstInfo), detism_semi, !ModuleInfo) :-
% It is an error to unify higher-order preds,
% so if Real \= fake_unify, then we must fail.
Real = fake_unify,
@@ -347,7 +347,7 @@
% fake_unifys, for which it shouldn't make any difference, we just choose
% the information specified by PredInstA.
GroundInstInfo = higher_order(PredInstA),
- unify_uniq(live, Real, semidet, UniqA, UniqB, Uniq).
+ unify_uniq(live, Real, detism_semi, UniqA, UniqB, Uniq).
abstractly_unify_inst_3(live, ground(Uniq, none), Inst0, Real, Inst, Det,
!ModuleInfo) :-
@@ -358,12 +358,12 @@
% abstract insts not supported
% abstractly_unify_inst_3(live, abstract_inst(_,_), bound(Uniq, List), Real,
-% ground(shared, no), semidet, !ModuleInfo) :-
+% ground(shared, no), detism_semi, !ModuleInfo) :-
% check_not_clobbered(Real, Uniq),
% bound_inst_list_is_ground(List, !.ModuleInfo).
%
% abstractly_unify_inst_3(live, abstract_inst(_,_), ground(Uniq, no), Real,
-% ground(shared, no), semidet, !ModuleInfo) :-
+% ground(shared, no), detism_semi, !ModuleInfo) :-
% check_not_clobbered(Real, Uniq).
%
% abstractly_unify_inst_3(live, abstract_inst(Name, ArgsA),
@@ -372,26 +372,26 @@
% abstractly_unify_inst_list(ArgsA, ArgsB, live, Real,
% Args, Det, !ModuleInfo).
-abstractly_unify_inst_3(dead, not_reached, _, _, not_reached, det,
+abstractly_unify_inst_3(dead, not_reached, _, _, not_reached, detism_det,
!ModuleInfo).
abstractly_unify_inst_3(dead, any(Uniq), Inst0, Real, Inst, Det,
!ModuleInfo) :-
make_any_inst(Inst0, dead, Uniq, Real, Inst, Det, !ModuleInfo).
-abstractly_unify_inst_3(dead, free, Inst, _, Inst, det, !ModuleInfo).
+abstractly_unify_inst_3(dead, free, Inst, _, Inst, detism_det, !ModuleInfo).
abstractly_unify_inst_3(dead, bound(UniqX, List0), any(UniqY), Real,
bound(Uniq, List), Det, !ModuleInfo) :-
allow_unify_bound_any(Real),
- unify_uniq(dead, Real, semidet, UniqX, UniqY, Uniq),
+ unify_uniq(dead, Real, detism_semi, UniqX, UniqY, Uniq),
make_any_bound_inst_list(List0, live, UniqY, Real, List, Det1,
!ModuleInfo),
- det_par_conjunction_detism(Det1, semidet, Det).
+ det_par_conjunction_detism(Det1, detism_semi, Det).
abstractly_unify_inst_3(dead, bound(UniqX, List), free, Real,
- bound(Uniq, List), det, !ModuleInfo) :-
- unify_uniq(dead, Real, det, UniqX, unique, Uniq).
+ bound(Uniq, List), detism_det, !ModuleInfo) :-
+ unify_uniq(dead, Real, detism_det, UniqX, unique, Uniq).
abstractly_unify_inst_3(dead, bound(UniqX, ListX), bound(UniqY, ListY),
Real, bound(Uniq, List), Det, !ModuleInfo) :-
@@ -401,10 +401,10 @@
abstractly_unify_inst_3(dead, bound(UniqX, BoundInsts0), ground(UniqY, _),
Real, bound(Uniq, BoundInsts), Det, !ModuleInfo) :-
- unify_uniq(dead, Real, semidet, UniqX, UniqY, Uniq),
+ unify_uniq(dead, Real, detism_semi, UniqX, UniqY, Uniq),
make_ground_bound_inst_list(BoundInsts0, dead, UniqY, Real, BoundInsts,
Det1, !ModuleInfo),
- det_par_conjunction_detism(Det1, semidet, Det).
+ det_par_conjunction_detism(Det1, detism_semi, Det).
% abstract insts aren't really supported
% abstractly_unify_inst_3(dead, bound(Uniq, List), abstract_inst(N,As),
@@ -421,27 +421,27 @@
abstractly_unify_inst_3(dead, ground(UniqX, higher_order(PredInst)),
any(UniqY), Real, ground(Uniq, higher_order(PredInst)),
- semidet, !ModuleInfo) :-
+ detism_semi, !ModuleInfo) :-
allow_unify_bound_any(Real),
- unify_uniq(dead, Real, semidet, UniqX, UniqY, Uniq).
+ unify_uniq(dead, Real, detism_semi, UniqX, UniqY, Uniq).
abstractly_unify_inst_3(dead, ground(Uniq, higher_order(PredInst)), free,
- _Real, ground(Uniq, higher_order(PredInst)), det, !ModuleInfo).
+ _Real, ground(Uniq, higher_order(PredInst)), detism_det, !ModuleInfo).
abstractly_unify_inst_3(dead, ground(UniqA, higher_order(_)),
bound(UniqB, BoundInsts0), Real, bound(Uniq, BoundInsts),
Det, !ModuleInfo) :-
- unify_uniq(dead, Real, semidet, UniqA, UniqB, Uniq),
+ unify_uniq(dead, Real, detism_semi, UniqA, UniqB, Uniq),
make_ground_bound_inst_list(BoundInsts0, dead, UniqA, Real, BoundInsts,
Det1, !ModuleInfo),
- det_par_conjunction_detism(Det1, semidet, Det).
+ det_par_conjunction_detism(Det1, detism_semi, Det).
abstractly_unify_inst_3(dead, ground(UniqA, higher_order(PredInstA)),
ground(UniqB, _GroundInstInfoB), Real,
- ground(Uniq, GroundInstInfo), det, !ModuleInfo) :-
+ ground(Uniq, GroundInstInfo), detism_det, !ModuleInfo) :-
Real = fake_unify,
GroundInstInfo = higher_order(PredInstA),
- unify_uniq(dead, Real, det, UniqA, UniqB, Uniq).
+ unify_uniq(dead, Real, detism_det, UniqA, UniqB, Uniq).
abstractly_unify_inst_3(dead, ground(Uniq, none), Inst0, Real, Inst, Det,
!ModuleInfo) :-
@@ -461,7 +461,7 @@
% ).
%
% abstractly_unify_inst_3(dead, abstract_inst(_,_), ground, _Real,
-% ground, semidet, !ModuleInfo).
+% ground, detism_semi, !ModuleInfo).
%
% abstractly_unify_inst_3(dead, abstract_inst(Name, ArgsA),
% abstract_inst(Name, ArgsB), Real,
@@ -477,8 +477,8 @@
is_live::in, unify_is_real::in, list(mer_inst)::out, determinism::out,
module_info::in, module_info::out) is semidet.
-abstractly_unify_inst_list([], [], _, _, [], det, !ModuleInfo).
-abstractly_unify_inst_list([X|Xs], [Y|Ys], Live, Real, [Z|Zs], Det,
+abstractly_unify_inst_list([], [], _, _, [], detism_det, !ModuleInfo).
+abstractly_unify_inst_list([X | Xs], [Y | Ys], Live, Real, [Z | Zs], Det,
!ModuleInfo) :-
abstractly_unify_inst(Live, X, Y, Real, Z, Det1, !ModuleInfo),
abstractly_unify_inst_list(Xs, Ys, Live, Real, Zs, Det2, !ModuleInfo),
@@ -526,10 +526,10 @@
is semidet.
abstractly_unify_inst_functor_2(live, not_reached, _, _, _, _, _,
- not_reached, erroneous, !ModuleInfo).
+ not_reached, detism_erroneous, !ModuleInfo).
abstractly_unify_inst_functor_2(live, free, ConsId, Args0, ArgLives, _Real,
- _, bound(unique, [functor(ConsId, Args)]), det, !ModuleInfo) :-
+ _, bound(unique, [functor(ConsId, Args)]), detism_det, !ModuleInfo) :-
inst_list_is_ground_or_any_or_dead(Args0, ArgLives, !.ModuleInfo),
maybe_make_shared_inst_list(Args0, ArgLives, Args, !ModuleInfo).
@@ -559,10 +559,10 @@
% fail.
abstractly_unify_inst_functor_2(dead, not_reached, _, _, _, _, _,
- not_reached, erroneous, !ModuleInfo).
+ not_reached, detism_erroneous, !ModuleInfo).
abstractly_unify_inst_functor_2(dead, free, ConsId, Args, _ArgLives, _Real, _,
- bound(unique, [functor(ConsId, Args)]), det, !ModuleInfo).
+ bound(unique, [functor(ConsId, Args)]), detism_det, !ModuleInfo).
abstractly_unify_inst_functor_2(dead, any(Uniq), ConsId, ArgInsts,
_ArgLives, Real, Type, Inst, Det, !ModuleInfo) :-
@@ -617,7 +617,7 @@
% after that goal.
%
L = [],
- Det = erroneous
+ Det = detism_erroneous
;
abstractly_unify_bound_inst_list_2(Live, Xs, Ys, Real,
L, Det0, !ModuleInfo),
@@ -645,10 +645,13 @@
list(bound_inst)::out, determinism::out,
module_info::in, module_info::out) is semidet.
-abstractly_unify_bound_inst_list_2(_, [], [], _, [], erroneous, !ModuleInfo).
-abstractly_unify_bound_inst_list_2(_, [], [_|_], _, [], failure, !ModuleInfo).
-abstractly_unify_bound_inst_list_2(_, [_|_], [], _, [], failure, !ModuleInfo).
-abstractly_unify_bound_inst_list_2(Live, [X|Xs], [Y|Ys], Real, L, Det,
+abstractly_unify_bound_inst_list_2(_, [], [], _, [], detism_erroneous,
+ !ModuleInfo).
+abstractly_unify_bound_inst_list_2(_, [], [_ | _], _, [], detism_failure,
+ !ModuleInfo).
+abstractly_unify_bound_inst_list_2(_, [_ | _], [], _, [], detism_failure,
+ !ModuleInfo).
+abstractly_unify_bound_inst_list_2(Live, [X | Xs], [Y | Ys], Real, L, Det,
!ModuleInfo) :-
X = functor(ConsIdX, ArgsX),
Y = functor(ConsIdY, ArgsY),
@@ -668,13 +671,13 @@
det_switch_detism(Det1, Det2, Det)
;
( compare(<, ConsIdX, ConsIdY) ->
- abstractly_unify_bound_inst_list_2(Live, Xs, [Y|Ys],
+ abstractly_unify_bound_inst_list_2(Live, Xs, [Y | Ys],
Real, L, Det1, !ModuleInfo)
;
- abstractly_unify_bound_inst_list_2(Live, [X|Xs], Ys,
+ abstractly_unify_bound_inst_list_2(Live, [X | Xs], Ys,
Real, L, Det1, !ModuleInfo)
),
- det_switch_detism(Det1, failure, Det)
+ det_switch_detism(Det1, detism_failure, Det)
).
:- pred abstractly_unify_bound_inst_list_lives(list(bound_inst)::in,
@@ -682,9 +685,9 @@
unify_is_real::in, list(bound_inst)::out, determinism::out,
module_info::in, module_info::out) is semidet.
-abstractly_unify_bound_inst_list_lives([], _, _, _, _, [], failure,
+abstractly_unify_bound_inst_list_lives([], _, _, _, _, [], detism_failure,
!ModuleInfo).
-abstractly_unify_bound_inst_list_lives([X|Xs], ConsIdY, ArgsY, LivesY, Real,
+abstractly_unify_bound_inst_list_lives([X | Xs], ConsIdY, ArgsY, LivesY, Real,
L, Det, !ModuleInfo) :-
X = functor(ConsIdX, ArgsX),
(
@@ -703,9 +706,9 @@
list(mer_inst)::out, determinism::out,
module_info::in, module_info::out) is semidet.
-abstractly_unify_inst_list_lives([], [], [], _, [], det, !ModuleInfo).
-abstractly_unify_inst_list_lives([X|Xs], [Y|Ys], [Live|Lives], Real,
- [Z|Zs], Det, !ModuleInfo) :-
+abstractly_unify_inst_list_lives([], [], [], _, [], detism_det, !ModuleInfo).
+abstractly_unify_inst_list_lives([X | Xs], [Y | Ys], [Live | Lives], Real,
+ [Z | Zs], Det, !ModuleInfo) :-
abstractly_unify_inst(Live, X, Y, Real, Z, Det1, !ModuleInfo),
abstractly_unify_inst_list_lives(Xs, Ys, Lives, Real, Zs, Det2,
!ModuleInfo),
@@ -823,7 +826,7 @@
unexpected(this_file,
"allow_unify_with_clobbered: clobbered value is live?").
allow_unify_with_clobbered(dead, fake_unify, _).
-allow_unify_with_clobbered(dead, _, det).
+allow_unify_with_clobbered(dead, _, detism_det).
%-----------------------------------------------------------------------------%
@@ -846,7 +849,7 @@
list(mer_inst)::out, determinism::out,
module_info::in, module_info::out) is semidet.
-make_ground_inst_list_lives([], _, _, _, _, [], det, !ModuleInfo).
+make_ground_inst_list_lives([], _, _, _, _, [], detism_det, !ModuleInfo).
make_ground_inst_list_lives([Inst0 | Insts0], Live, [ArgLive | ArgLives],
Uniq, Real, [Inst | Insts], Det, !ModuleInfo) :-
( Live = live, ArgLive = live ->
@@ -864,7 +867,7 @@
unify_is_real::in, list(mer_inst)::out, determinism::out,
module_info::in, module_info::out) is semidet.
-make_ground_inst_list([], _, _, _, [], det, !ModuleInfo).
+make_ground_inst_list([], _, _, _, [], detism_det, !ModuleInfo).
make_ground_inst_list([Inst0 | Insts0], Live, Uniq, Real, [Inst | Insts], Det,
!ModuleInfo) :-
make_ground_inst(Inst0, Live, Uniq, Real, Inst, Det1, !ModuleInfo),
@@ -879,49 +882,47 @@
unify_is_real::in, mer_inst::out, determinism::out,
module_info::in, module_info::out) is semidet.
-make_ground_inst(not_reached, _, _, _, not_reached, erroneous, !ModuleInfo).
+make_ground_inst(not_reached, _, _, _, not_reached, detism_erroneous,
+ !ModuleInfo).
make_ground_inst(any(Uniq0), IsLive, Uniq1, Real, ground(Uniq, none),
- semidet, !ModuleInfo) :-
- unify_uniq(IsLive, Real, semidet, Uniq0, Uniq1, Uniq).
-make_ground_inst(free, IsLive, Uniq0, Real, ground(Uniq, none), det,
+ detism_semi, !ModuleInfo) :-
+ unify_uniq(IsLive, Real, detism_semi, Uniq0, Uniq1, Uniq).
+make_ground_inst(free, IsLive, Uniq0, Real, ground(Uniq, none), detism_det,
!ModuleInfo) :-
- unify_uniq(IsLive, Real, det, unique, Uniq0, Uniq).
+ unify_uniq(IsLive, Real, detism_det, unique, Uniq0, Uniq).
make_ground_inst(free(T), IsLive, Uniq0, Real,
- defined_inst(typed_ground(Uniq, T)), det, !ModuleInfo) :-
- unify_uniq(IsLive, Real, det, unique, Uniq0, Uniq).
+ defined_inst(typed_ground(Uniq, T)), detism_det, !ModuleInfo) :-
+ unify_uniq(IsLive, Real, detism_det, unique, Uniq0, Uniq).
make_ground_inst(bound(Uniq0, BoundInsts0), IsLive, Uniq1, Real,
bound(Uniq, BoundInsts), Det, !ModuleInfo) :-
- unify_uniq(IsLive, Real, semidet, Uniq0, Uniq1, Uniq),
+ unify_uniq(IsLive, Real, detism_semi, Uniq0, Uniq1, Uniq),
make_ground_bound_inst_list(BoundInsts0, IsLive, Uniq1, Real,
BoundInsts, Det1, !ModuleInfo),
- det_par_conjunction_detism(Det1, semidet, Det).
+ det_par_conjunction_detism(Det1, detism_semi, Det).
make_ground_inst(ground(Uniq0, GroundInstInfo), IsLive, Uniq1, Real,
- ground(Uniq, GroundInstInfo), semidet, !ModuleInfo) :-
- unify_uniq(IsLive, Real, semidet, Uniq0, Uniq1, Uniq).
+ ground(Uniq, GroundInstInfo), detism_semi, !ModuleInfo) :-
+ unify_uniq(IsLive, Real, detism_semi, Uniq0, Uniq1, Uniq).
make_ground_inst(inst_var(_), _, _, _, _, _, _, _) :-
unexpected(this_file, "make_ground_inst: free inst var").
make_ground_inst(constrained_inst_vars(InstVars, InstConstraint), IsLive,
Uniq, Real, Inst, Det, !ModuleInfo) :-
abstractly_unify_constrained_inst_vars(IsLive, InstVars,
- InstConstraint, ground(Uniq, none), Real, Inst, Det,
- !ModuleInfo).
+ InstConstraint, ground(Uniq, none), Real, Inst, Det, !ModuleInfo).
make_ground_inst(abstract_inst(_,_), _, _, _, ground(shared, none),
- semidet, !ModuleInfo).
+ detism_semi, !ModuleInfo).
make_ground_inst(defined_inst(InstName), IsLive, Uniq, Real, Inst, Det,
!ModuleInfo) :-
% Check whether the inst name is already in the ground_inst table.
module_info_get_inst_table(!.ModuleInfo, InstTable0),
inst_table_get_ground_insts(InstTable0, GroundInsts0),
GroundInstKey = ground_inst(InstName, IsLive, Uniq, Real),
- (
- map.search(GroundInsts0, GroundInstKey, Result)
- ->
+ ( map.search(GroundInsts0, GroundInstKey, Result) ->
( Result = known(GroundInst0, Det0) ->
GroundInst = GroundInst0,
Det = Det0
;
GroundInst = defined_inst(GroundInstKey),
- Det = det
+ Det = detism_det
% We can safely assume this is det, since if it were semidet,
% we would have noticed this in the process of unfolding the
% definition.
@@ -961,7 +962,7 @@
list(bound_inst)::out, determinism::out,
module_info::in, module_info::out) is semidet.
-make_ground_bound_inst_list([], _, _, _, [], det, !ModuleInfo).
+make_ground_bound_inst_list([], _, _, _, [], detism_det, !ModuleInfo).
make_ground_bound_inst_list([Bound0 | Bounds0], IsLive, Uniq, Real,
[Bound | Bounds], Det, !ModuleInfo) :-
Bound0 = functor(ConsId, ArgInsts0),
@@ -981,38 +982,39 @@
unify_is_real::in, mer_inst::out, determinism::out,
module_info::in, module_info::out) is semidet.
-make_any_inst(not_reached, _, _, _, not_reached, erroneous, !ModuleInfo).
-make_any_inst(any(Uniq0), IsLive, Uniq1, Real, any(Uniq), semidet,
+make_any_inst(not_reached, _, _, _, not_reached, detism_erroneous, !ModuleInfo).
+make_any_inst(any(Uniq0), IsLive, Uniq1, Real, any(Uniq), detism_semi,
!ModuleInfo) :-
allow_unify_bound_any(Real),
- unify_uniq(IsLive, Real, semidet, Uniq0, Uniq1, Uniq).
-make_any_inst(free, IsLive, Uniq0, Real, any(Uniq), det, !ModuleInfo) :-
- unify_uniq(IsLive, Real, det, unique, Uniq0, Uniq).
-make_any_inst(free(T), IsLive, Uniq, Real, defined_inst(Any), det,
+ unify_uniq(IsLive, Real, detism_semi, Uniq0, Uniq1, Uniq).
+make_any_inst(free, IsLive, Uniq0, Real, any(Uniq), detism_det, !ModuleInfo) :-
+ unify_uniq(IsLive, Real, detism_det, unique, Uniq0, Uniq).
+make_any_inst(free(T), IsLive, Uniq, Real, defined_inst(Any), detism_det,
!ModuleInfo) :-
% The following is a round-about way of doing this
- % unify_uniq(IsLive, Real, det, unique, Uniq0, Uniq),
+ % unify_uniq(IsLive, Real, detism_det, unique, Uniq0, Uniq),
% Any = typed_any(Uniq, T).
% without the need for a `typed_any' inst.
Any = typed_inst(T, unify_inst(IsLive, free, any(Uniq), Real)).
make_any_inst(bound(Uniq0, BoundInsts0), IsLive, Uniq1, Real,
bound(Uniq, BoundInsts), Det, !ModuleInfo) :-
allow_unify_bound_any(Real),
- unify_uniq(IsLive, Real, semidet, Uniq0, Uniq1, Uniq),
+ unify_uniq(IsLive, Real, detism_semi, Uniq0, Uniq1, Uniq),
make_any_bound_inst_list(BoundInsts0, IsLive, Uniq1, Real,
BoundInsts, Det1, !ModuleInfo),
- det_par_conjunction_detism(Det1, semidet, Det).
+ det_par_conjunction_detism(Det1, detism_semi, Det).
make_any_inst(ground(Uniq0, PredInst), IsLive, Uniq1, Real,
- ground(Uniq, PredInst), semidet, !ModuleInfo) :-
+ ground(Uniq, PredInst), detism_semi, !ModuleInfo) :-
allow_unify_bound_any(Real),
- unify_uniq(IsLive, Real, semidet, Uniq0, Uniq1, Uniq).
+ unify_uniq(IsLive, Real, detism_semi, Uniq0, Uniq1, Uniq).
make_any_inst(inst_var(_), _, _, _, _, _, _, _) :-
unexpected(this_file, "make_any_inst: free inst var").
make_any_inst(constrained_inst_vars(InstVars, InstConstraint), IsLive,
Uniq, Real, Inst, Det, !ModuleInfo) :-
abstractly_unify_constrained_inst_vars(IsLive, InstVars,
InstConstraint, any(Uniq), Real, Inst, Det, !ModuleInfo).
-make_any_inst(abstract_inst(_,_), _, _, _, any(shared), semidet, !ModuleInfo).
+make_any_inst(abstract_inst(_,_), _, _, _, any(shared), detism_semi,
+ !ModuleInfo).
make_any_inst(defined_inst(InstName), IsLive, Uniq, Real, Inst, Det,
!ModuleInfo) :-
% check whether the inst name is already in the
@@ -1026,7 +1028,7 @@
Det = Det0
;
AnyInst = defined_inst(AnyInstKey),
- Det = det
+ Det = detism_det
% We can safely assume this is det, since if it were semidet,
% we would have noticed this in the process of unfolding the
% definition.
@@ -1065,7 +1067,7 @@
list(bound_inst)::out, determinism::out,
module_info::in, module_info::out) is semidet.
-make_any_bound_inst_list([], _, _, _, [], det, !ModuleInfo).
+make_any_bound_inst_list([], _, _, _, [], detism_det, !ModuleInfo).
make_any_bound_inst_list([Bound0 | Bounds0], IsLive, Uniq, Real,
[Bound | Bounds], Det, !ModuleInfo) :-
Bound0 = functor(ConsId, ArgInsts0),
@@ -1080,7 +1082,7 @@
unify_is_real::in, list(mer_inst)::out, determinism::out,
module_info::in, module_info::out) is semidet.
-make_any_inst_list([], _, _, _, [], det, !ModuleInfo).
+make_any_inst_list([], _, _, _, [], detism_det, !ModuleInfo).
make_any_inst_list([Inst0 | Insts0], Live, Uniq, Real, [Inst | Insts], Det,
!ModuleInfo) :-
make_any_inst(Inst0, Live, Uniq, Real, Inst, Det1, !ModuleInfo),
@@ -1092,7 +1094,7 @@
list(mer_inst)::out, determinism::out,
module_info::in, module_info::out) is semidet.
-make_any_inst_list_lives([], _, _, _, _, [], det, !ModuleInfo).
+make_any_inst_list_lives([], _, _, _, _, [], detism_det, !ModuleInfo).
make_any_inst_list_lives([Inst0 | Insts0], Live, [ArgLive | ArgLives],
Uniq, Real, [Inst | Insts], Det, !ModuleInfo) :-
( Live = live, ArgLive = live ->
@@ -1119,9 +1121,9 @@
Inst = Inst0
),
maybe_make_shared_inst_list(Insts0, IsLives, Insts, !ModuleInfo).
-maybe_make_shared_inst_list([], [_|_], _, _, _) :-
+maybe_make_shared_inst_list([], [_ | _], _, _, _) :-
unexpected(this_file, "maybe_make_shared_inst_list: length mismatch").
-maybe_make_shared_inst_list([_|_], [], _, _, _) :-
+maybe_make_shared_inst_list([_ | _], [], _, _, _) :-
unexpected(this_file, "maybe_make_shared_inst_list: length mismatch").
make_shared_inst_list([], [], !ModuleInfo).
@@ -1757,7 +1759,7 @@
pred_inst_info_is_nonstandard_func_mode(ModuleInfo, PredInstInfo).
pred_inst_info_standard_func_mode(Arity) =
- pred_inst_info(function, ArgModes, det) :-
+ pred_inst_info(function, ArgModes, detism_det) :-
in_mode(InMode),
out_mode(OutMode),
ArgModes = list.duplicate(Arity - 1, InMode) ++ [OutMode].
Index: compiler/interval.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/interval.m,v
retrieving revision 1.16
diff -u -r1.16 interval.m
--- compiler/interval.m 29 Mar 2006 08:06:52 -0000 1.16
+++ compiler/interval.m 7 Jul 2006 05:49:08 -0000
@@ -1023,7 +1023,7 @@
->
Unification1 = Unification0 ^ deconstruct_can_fail := cannot_fail,
GoalExpr1 = GoalExpr0 ^ unify_kind := Unification1,
- goal_info_set_determinism(det, GoalInfo0, GoalInfo1),
+ goal_info_set_determinism(detism_det, GoalInfo0, GoalInfo1),
(
MaybeFeature = yes(Feature),
goal_info_add_feature(Feature, GoalInfo1, GoalInfo2)
Index: compiler/layout_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/layout_out.m,v
retrieving revision 1.67
diff -u -r1.67 layout_out.m
--- compiler/layout_out.m 8 Jun 2006 08:19:16 -0000 1.67
+++ compiler/layout_out.m 7 Jul 2006 05:50:47 -0000
@@ -809,14 +809,14 @@
:- func detism_to_c_detism(determinism) = string.
-detism_to_c_detism(det) = "MR_DETISM_DET".
-detism_to_c_detism(semidet) = "MR_DETISM_SEMI".
-detism_to_c_detism(nondet) = "MR_DETISM_NON".
-detism_to_c_detism(multidet) = "MR_DETISM_MULTI".
-detism_to_c_detism(erroneous) = "MR_DETISM_ERRONEOUS".
-detism_to_c_detism(failure) = "MR_DETISM_FAILURE".
-detism_to_c_detism(cc_nondet) = "MR_DETISM_CCNON".
-detism_to_c_detism(cc_multidet) = "MR_DETISM_CCMULTI".
+detism_to_c_detism(detism_det) = "MR_DETISM_DET".
+detism_to_c_detism(detism_semi) = "MR_DETISM_SEMI".
+detism_to_c_detism(detism_non) = "MR_DETISM_NON".
+detism_to_c_detism(detism_multi) = "MR_DETISM_MULTI".
+detism_to_c_detism(detism_erroneous) = "MR_DETISM_ERRONEOUS".
+detism_to_c_detism(detism_failure) = "MR_DETISM_FAILURE".
+detism_to_c_detism(detism_cc_non) = "MR_DETISM_CCNON".
+detism_to_c_detism(detism_cc_multi) = "MR_DETISM_CCMULTI".
:- pred output_layout_proc_id_group(proc_label::in, pred_origin::in,
io::di, io::uo) is det.
Index: compiler/lco.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/lco.m,v
retrieving revision 1.37
diff -u -r1.37 lco.m
--- compiler/lco.m 24 Apr 2006 04:23:47 -0000 1.37
+++ compiler/lco.m 7 Jul 2006 06:14:27 -0000
@@ -339,10 +339,10 @@
%
:- pred acceptable_detism_for_lco(determinism::in) is semidet.
-acceptable_detism_for_lco(det).
-acceptable_detism_for_lco(semidet).
-acceptable_detism_for_lco(cc_multidet).
-acceptable_detism_for_lco(cc_nondet).
+acceptable_detism_for_lco(detism_det).
+acceptable_detism_for_lco(detism_semi).
+acceptable_detism_for_lco(detism_cc_multi).
+acceptable_detism_for_lco(detism_cc_non).
%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%
@@ -981,7 +981,7 @@
make_store_goal(ModuleInfo, Var - AddrVar, Goal) :-
generate_simple_call(mercury_private_builtin_module, "store_at_ref",
- predicate, only_mode, det, [AddrVar, Var], [impure_goal], [],
+ predicate, only_mode, detism_det, [AddrVar, Var], [impure_goal], [],
ModuleInfo, term.context_init, Goal).
%-----------------------------------------------------------------------------%
Index: compiler/live_vars.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/live_vars.m,v
retrieving revision 1.120
diff -u -r1.120 live_vars.m
--- compiler/live_vars.m 28 Jun 2006 04:46:14 -0000 1.120
+++ compiler/live_vars.m 7 Jul 2006 05:50:52 -0000
@@ -373,7 +373,7 @@
goal_info_get_determinism(GoalInfo0, Detism),
(
- Detism = erroneous,
+ Detism = detism_erroneous,
AllocData ^ opt_no_return_calls = yes
->
NeedAcrossCall = need_across_call(set.init, set.init, set.init)
Index: compiler/make_hlds_passes.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/make_hlds_passes.m,v
retrieving revision 1.43
diff -u -r1.43 make_hlds_passes.m
--- compiler/make_hlds_passes.m 15 Jun 2006 19:37:01 -0000 1.43
+++ compiler/make_hlds_passes.m 7 Jul 2006 05:51:30 -0000
@@ -1009,7 +1009,7 @@
HeadModes = [ di_mode, uo_mode ],
proc_info_get_declared_determinism(ProcInfo, MaybeDetism),
MaybeDetism = yes(Detism),
- ( Detism = det ; Detism = cc_multidet ),
+ ( Detism = detism_det ; Detism = detism_cc_multi ),
pred_info_get_purity(PredInfo, Purity),
Purity = purity_pure
->
@@ -1027,7 +1027,7 @@
HeadModes = [],
proc_info_get_declared_determinism(ProcInfo, MaybeDetism),
MaybeDetism = yes(Detism),
- ( Detism = det; Detism = cc_multidet ),
+ ( Detism = detism_det; Detism = detism_cc_multi ),
pred_info_get_purity(PredInfo, Purity),
Purity = purity_impure
->
@@ -1117,7 +1117,7 @@
HeadModes = [ di_mode, uo_mode ],
proc_info_get_declared_determinism(ProcInfo, MaybeDetism),
MaybeDetism = yes(Detism),
- ( Detism = det ; Detism = cc_multidet ),
+ ( Detism = detism_det ; Detism = detism_cc_multi ),
pred_info_get_purity(PredInfo, Purity),
Purity = purity_pure
->
@@ -1135,7 +1135,7 @@
HeadModes = [],
proc_info_get_declared_determinism(ProcInfo, MaybeDetism),
MaybeDetism = yes(Detism),
- ( Detism = det; Detism = cc_multidet ),
+ ( Detism = detism_det; Detism = detism_cc_multi ),
pred_info_get_purity(PredInfo, Purity),
Purity = purity_impure
->
Index: compiler/mercury_to_mercury.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mercury_to_mercury.m,v
retrieving revision 1.293
diff -u -r1.293 mercury_to_mercury.m
--- compiler/mercury_to_mercury.m 15 Jun 2006 19:37:01 -0000 1.293
+++ compiler/mercury_to_mercury.m 7 Jul 2006 06:06:21 -0000
@@ -2090,7 +2090,7 @@
list.length(Types, 2)
->
% This determinism will be ignored.
- mercury_format_det_annotation(yes(det), !U)
+ mercury_format_det_annotation(yes(detism_det), !U)
;
mercury_format_det_annotation(MaybeDet, !U)
),
@@ -2512,14 +2512,14 @@
mercury_output_det(Detism, !UI) :-
mercury_format_det(Detism, !UI).
-mercury_det_to_string(det) = "det".
-mercury_det_to_string(semidet) = "semidet".
-mercury_det_to_string(nondet) = "nondet".
-mercury_det_to_string(multidet) = "multi".
-mercury_det_to_string(cc_multidet) = "cc_multi".
-mercury_det_to_string(cc_nondet) = "cc_nondet".
-mercury_det_to_string(failure) = "failure".
-mercury_det_to_string(erroneous) = "erroneous".
+mercury_det_to_string(detism_det) = "det".
+mercury_det_to_string(detism_semi) = "semidet".
+mercury_det_to_string(detism_non) = "nondet".
+mercury_det_to_string(detism_multi) = "multi".
+mercury_det_to_string(detism_cc_multi) = "cc_multi".
+mercury_det_to_string(detism_cc_non) = "cc_nondet".
+mercury_det_to_string(detism_failure) = "failure".
+mercury_det_to_string(detism_erroneous) = "erroneous".
:- pred mercury_format_det(determinism::in,
U::di, U::uo) is det <= output(U).
Index: compiler/ml_call_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_call_gen.m,v
retrieving revision 1.68
diff -u -r1.68 ml_call_gen.m
--- compiler/ml_call_gen.m 8 Jun 2006 08:19:19 -0000 1.68
+++ compiler/ml_call_gen.m 7 Jul 2006 06:00:36 -0000
@@ -473,7 +473,7 @@
% If the called procedure has determinism `erroneous', then mark it
% as never returning (this will ensure that it gets treated as a tail
% call).
- ( Detism = erroneous ->
+ ( Detism = detism_erroneous ->
CallKind = no_return_call
;
CallKind = ordinary_call
Index: compiler/ml_code_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_code_util.m,v
retrieving revision 1.109
diff -u -r1.109 ml_code_util.m
--- compiler/ml_code_util.m 8 Jun 2006 08:19:20 -0000 1.109
+++ compiler/ml_code_util.m 7 Jul 2006 06:02:30 -0000
@@ -2030,7 +2030,8 @@
NonLocals = set.union_list(NonLocalsList),
instmap_delta_from_assoc_list([TypeInfoVar - ground(shared, none)],
InstMapDelta),
- goal_info_init(NonLocals, InstMapDelta, det, purity_impure, GoalInfo),
+ goal_info_init(NonLocals, InstMapDelta, detism_det, purity_impure,
+ GoalInfo),
conj_list_to_goal(HLDS_TypeInfoGoals, GoalInfo, Conj),
% Convert this HLDS code to MLDS.
Index: compiler/mode_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mode_util.m,v
retrieving revision 1.187
diff -u -r1.187 mode_util.m
--- compiler/mode_util.m 28 Jun 2006 04:46:15 -0000 1.187
+++ compiler/mode_util.m 7 Jul 2006 05:51:37 -0000
@@ -748,7 +748,7 @@
list.append(FuncArgModes, [FuncRetMode], PredArgModes0),
propagate_types_into_mode_list(ModuleInfo, PredArgTypes,
PredArgModes0, PredArgModes),
- PredInstInfo = pred_inst_info(function, PredArgModes, det).
+ PredInstInfo = pred_inst_info(function, PredArgModes, detism_det).
constructors_to_bound_insts(ModuleInfo, Uniq, Constructors, BoundInsts) :-
constructors_to_bound_insts_2(ModuleInfo, Uniq,
Index: compiler/modecheck_call.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/modecheck_call.m,v
retrieving revision 1.70
diff -u -r1.70 modecheck_call.m
--- compiler/modecheck_call.m 29 Mar 2006 08:07:08 -0000 1.70
+++ compiler/modecheck_call.m 7 Jul 2006 05:51:45 -0000
@@ -262,13 +262,13 @@
Arity),
!ModeInfo),
Modes = [],
- Det = erroneous,
+ Det = detism_erroneous,
Args = Args0,
ExtraGoals = no_extra_goals
).
modecheck_builtin_cast(Modes, Args0, Args, Det, ExtraGoals, !ModeInfo) :-
- Det = det,
+ Det = detism_det,
% These should always be mode correct.
ArgOffset = 0,
modecheck_arg_list(ArgOffset, Modes, ExtraGoals, Args0, Args, !ModeInfo).
Index: compiler/modecheck_unify.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/modecheck_unify.m,v
retrieving revision 1.103
diff -u -r1.103 modecheck_unify.m
--- compiler/modecheck_unify.m 26 May 2006 04:03:01 -0000 1.103
+++ compiler/modecheck_unify.m 7 Jul 2006 05:52:13 -0000
@@ -563,7 +563,7 @@
InstOfX, InstArgs),
!ModeInfo),
Inst = not_reached,
- Det = erroneous,
+ Det = detism_erroneous,
% If we get an error, set the inst to not_reached to avoid cascading
% errors. But don't call categorize_unification, because that could
% cause an invalid call to `unify_proc.request_unify'.
@@ -654,7 +654,7 @@
% errors. But don't call categorize_unification, because that could
% cause an invalid call to `unify_proc.request_unify'.
Inst = not_reached,
- Det = erroneous,
+ Det = detism_erroneous,
ModeOfX = (InstOfX -> Inst),
ModeOfY = (InstOfY -> Inst),
Mode = ModeOfX - ModeOfY,
@@ -678,7 +678,7 @@
->
Goal = conj(plain_conj, [])
;
- Det = failure
+ Det = detism_failure
->
% This optimisation is safe because the only way that we can analyse
% a unification as having no solutions is that the unification always
@@ -971,12 +971,12 @@
record_optimize_away(GoalInfo, AssignTarget, AssignSource, !ModeInfo)
;
Unification = simple_test(TestVar1, TestVar2),
- Det = det
+ Det = detism_det
->
Unify = conj(plain_conj, []),
record_optimize_away(GoalInfo, TestVar1, TestVar2, !ModeInfo)
;
- Det = failure
+ Det = detism_failure
->
% This optimisation is safe because the only way that we can analyse
% a unification as having no solutions is that the unification
Index: compiler/modes.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/modes.m,v
retrieving revision 1.335
diff -u -r1.335 modes.m
--- compiler/modes.m 28 Jun 2006 04:46:16 -0000 1.335
+++ compiler/modes.m 7 Jul 2006 05:53:19 -0000
@@ -2430,37 +2430,37 @@
candidate_init_vars_2(ModeInfo, Goals, !NonFree, !CandidateVars).
candidate_init_vars_3(ModeInfo, Goal, !NonFree, !CandidateVars) :-
- % XXX Is the determinism field of a generic_call valid at this point?
- % Determinism analysis is run after mode analysis.
- %
- % We assume that generic calls are deterministic.
- % The modes field of higher_order calls is junk until
- % *after* mode analysis, hence we can't handle them here.
- %
+ % XXX Is the determinism field of a generic_call valid at this point?
+ % Determinism analysis is run after mode analysis.
+ %
+ % We assume that generic calls are deterministic. The modes field of
+ % higher_order calls is junk until *after* mode analysis, hence we can't
+ % handle them here.
+ %
Goal = generic_call(Details, Args, ArgModes, _JunkDetism) - _GoalInfo,
Details \= higher_order(_, _, _, _),
candidate_init_vars_call(ModeInfo, Args, ArgModes,
!NonFree, !CandidateVars).
candidate_init_vars_3(ModeInfo, Goal, !NonFree, !CandidateVars) :-
- % A call (at this point the ProcId is just a dummy value
- % since it isn't meaningful until the call is scheduled.)
- %
+ % A call (at this point the ProcId is just a dummy value since it isn't
+ % meaningful until the call is scheduled.)
+ %
Goal = call(PredId, _, Args, _, _, _) - _GoalInfo,
- % Find a deterministic proc for this call.
- %
+
+ % Find a deterministic proc for this call.
mode_info_get_preds(ModeInfo, Preds),
map.lookup(Preds, PredId, PredInfo),
pred_info_get_procedures(PredInfo, ProcTable),
map.values(ProcTable, ProcInfos),
list.member(ProcInfo, ProcInfos),
proc_info_get_declared_determinism(ProcInfo, yes(DeclaredDetism)),
- ( DeclaredDetism = (det) ; DeclaredDetism = (cc_multidet) ),
- % Find the argument modes.
- %
+ ( DeclaredDetism = detism_det ; DeclaredDetism = detism_cc_multi ),
+
+ % Find the argument modes.
proc_info_get_argmodes(ProcInfo, ArgModes),
- % Process the call args.
- %
+
+ % Process the call args.
candidate_init_vars_call(ModeInfo, Args, ArgModes,
!NonFree, !CandidateVars).
Index: compiler/polymorphism.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/polymorphism.m,v
retrieving revision 1.299
diff -u -r1.299 polymorphism.m
--- compiler/polymorphism.m 8 Jun 2006 08:19:27 -0000 1.299
+++ compiler/polymorphism.m 7 Jul 2006 05:54:21 -0000
@@ -2237,7 +2237,7 @@
% to superclass_from_typeclass_info in private_builtin.
goal_util.generate_simple_call(mercury_private_builtin_module,
"superclass_from_typeclass_info", predicate, only_mode,
- det, [SubClassVar, IndexVar, Var], [], [], ModuleInfo,
+ detism_det, [SubClassVar, IndexVar, Var], [], [], ModuleInfo,
term.context_init, SuperClassGoal),
!:ExtraGoals = [SuperClassGoal, IndexGoal | !.ExtraGoals].
@@ -2291,7 +2291,8 @@
set.list_to_set([BaseVar], NonLocals),
instmap_delta_from_assoc_list([BaseVar - ground(shared, none)],
InstmapDelta),
- goal_info_init(NonLocals, InstmapDelta, det, purity_pure, BaseGoalInfo),
+ goal_info_init(NonLocals, InstmapDelta, detism_det, purity_pure,
+ BaseGoalInfo),
BaseGoal = BaseUnify - BaseGoalInfo,
@@ -2328,7 +2329,7 @@
[NewVar - bound(unique, [functor(InstConsId, ArgInsts)])],
InstMapDelta),
goal_info_set_instmap_delta(InstMapDelta, GoalInfo1, GoalInfo2),
- goal_info_set_determinism(det, GoalInfo2, GoalInfo),
+ goal_info_set_determinism(detism_det, GoalInfo2, GoalInfo),
TypeClassInfoGoal = Unify - GoalInfo,
NewGoals0 = [TypeClassInfoGoal, BaseGoal],
@@ -2719,7 +2720,7 @@
instmap_delta_from_assoc_list(
[TypeInfoVar - bound(unique, [functor(InstConsId, ArgInsts)])],
InstMapDelta),
- goal_info_init(NonLocals, InstMapDelta, det, purity_pure, GoalInfo),
+ goal_info_init(NonLocals, InstMapDelta, detism_det, purity_pure, GoalInfo),
TypeInfoGoal = Unify - GoalInfo.
@@ -2749,7 +2750,7 @@
set.list_to_set([TypeCtorInfoVar], NonLocals),
instmap_delta_from_assoc_list([TypeCtorInfoVar - ground(shared, none)],
InstmapDelta),
- goal_info_init(NonLocals, InstmapDelta, det, purity_pure, GoalInfo),
+ goal_info_init(NonLocals, InstmapDelta, detism_det, purity_pure, GoalInfo),
TypeCtorInfoGoal = Unify - GoalInfo.
@@ -2861,7 +2862,7 @@
!VarSet, !VarTypes, !RttiVarMaps),
goal_util.generate_simple_call(mercury_private_builtin_module,
"type_info_from_typeclass_info", predicate, only_mode,
- det, [TypeClassInfoVar, IndexVar, TypeInfoVar], [],
+ detism_det, [TypeClassInfoVar, IndexVar, TypeInfoVar], [],
[TypeInfoVar - ground(shared, none)], ModuleInfo,
term.context_init, CallGoal),
Goals = [IndexGoal, CallGoal].
@@ -3141,7 +3142,7 @@
% just pick some value at random; hopefully something that won't cause
% flow-on errors. We also mark the predicate as invalid, also to avoid
% flow-on errors.
- Detism = nondet,
+ Detism = detism_non,
module_info_remove_predid(PredId, !ModuleInfo)
),
Index: compiler/post_typecheck.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/post_typecheck.m,v
retrieving revision 1.101
diff -u -r1.101 post_typecheck.m
--- compiler/post_typecheck.m 20 Apr 2006 05:36:59 -0000 1.101
+++ compiler/post_typecheck.m 7 Jul 2006 05:54:27 -0000
@@ -766,7 +766,7 @@
% with `call(F, A, B, C, X)')
list.append(FuncArgVars, [X0], ArgVars),
Modes = [],
- Det = erroneous,
+ Det = detism_erroneous,
adjust_func_arity(function, Arity, FullArity),
HOCall = generic_call(
higher_order(FuncVar, Purity, function, FullArity),
Index: compiler/pragma_c_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pragma_c_gen.m,v
retrieving revision 1.93
diff -u -r1.93 pragma_c_gen.m
--- compiler/pragma_c_gen.m 8 Jun 2006 08:19:27 -0000 1.93
+++ compiler/pragma_c_gen.m 7 Jul 2006 05:54:41 -0000
@@ -496,7 +496,7 @@
% <for semidet code, check of SUCCESS_INDICATOR>
goal_info_get_determinism(GoalInfo, Detism),
( CodeModel = model_semi ->
- ( Detism = failure ->
+ ( Detism = detism_failure ->
CheckSuccess_Comp = pragma_c_noop,
MaybeFailLabel = no
;
@@ -606,7 +606,7 @@
FailLabelCode = node([label(TheFailLabel) - ""]),
FailureCode = tree_list([GotoSkipLabelCode, FailLabelCode,
FailCode, SkipLabelCode])
- ; Detism = failure ->
+ ; Detism = detism_failure ->
code_info.generate_failure(FailureCode, !CI)
;
FailureCode = empty
Index: compiler/prog_data.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/prog_data.m,v
retrieving revision 1.168
diff -u -r1.168 prog_data.m
--- compiler/prog_data.m 5 Jul 2006 08:45:34 -0000 1.168
+++ compiler/prog_data.m 7 Jul 2006 06:08:22 -0000
@@ -81,14 +81,14 @@
% may have.
%
:- type determinism
- ---> det
- ; semidet
- ; nondet
- ; multidet
- ; cc_nondet
- ; cc_multidet
- ; erroneous
- ; failure.
+ ---> detism_det
+ ; detism_semi
+ ; detism_multi
+ ; detism_non
+ ; detism_cc_multi
+ ; detism_cc_non
+ ; detism_erroneous
+ ; detism_failure.
:- type can_fail
---> can_fail
@@ -1692,14 +1692,14 @@
% Determinism
%
-determinism_components(det, cannot_fail, at_most_one).
-determinism_components(semidet, can_fail, at_most_one).
-determinism_components(multidet, cannot_fail, at_most_many).
-determinism_components(nondet, can_fail, at_most_many).
-determinism_components(cc_multidet, cannot_fail, at_most_many_cc).
-determinism_components(cc_nondet, can_fail, at_most_many_cc).
-determinism_components(erroneous, cannot_fail, at_most_zero).
-determinism_components(failure, can_fail, at_most_zero).
+determinism_components(detism_det, cannot_fail, at_most_one).
+determinism_components(detism_semi, can_fail, at_most_one).
+determinism_components(detism_multi, cannot_fail, at_most_many).
+determinism_components(detism_non, can_fail, at_most_many).
+determinism_components(detism_cc_multi, cannot_fail, at_most_many_cc).
+determinism_components(detism_cc_non, can_fail, at_most_many_cc).
+determinism_components(detism_erroneous, cannot_fail, at_most_zero).
+determinism_components(detism_failure, can_fail, at_most_zero).
det_conjunction_detism(DetismA, DetismB, Detism) :-
% When figuring out the determinism of a conjunction, if the second goal
@@ -1826,14 +1826,14 @@
det_switch_canfail(cannot_fail, can_fail, can_fail).
det_switch_canfail(cannot_fail, cannot_fail, cannot_fail).
-det_negation_det(det, yes(failure)).
-det_negation_det(semidet, yes(semidet)).
-det_negation_det(multidet, no).
-det_negation_det(nondet, no).
-det_negation_det(cc_multidet, no).
-det_negation_det(cc_nondet, no).
-det_negation_det(erroneous, yes(erroneous)).
-det_negation_det(failure, yes(det)).
+det_negation_det(detism_det, yes(detism_failure)).
+det_negation_det(detism_semi, yes(detism_semi)).
+det_negation_det(detism_multi, no).
+det_negation_det(detism_non, no).
+det_negation_det(detism_cc_multi, no).
+det_negation_det(detism_cc_non, no).
+det_negation_det(detism_erroneous, yes(detism_erroneous)).
+det_negation_det(detism_failure, yes(detism_det)).
%-----------------------------------------------------------------------------%
Index: compiler/prog_io_goal.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/prog_io_goal.m,v
retrieving revision 1.43
diff -u -r1.43 prog_io_goal.m
--- compiler/prog_io_goal.m 29 Mar 2006 08:07:17 -0000 1.43
+++ compiler/prog_io_goal.m 7 Jul 2006 06:08:26 -0000
@@ -408,7 +408,7 @@
list.length(Args0, NumArgs),
list.duplicate(NumArgs, InMode, Modes0),
RetMode = OutMode,
- Det = det,
+ Det = detism_det,
list.append(Modes0, [RetMode], Modes),
inst_var_constraints_are_consistent_in_modes(Modes),
list.append(Args0, [RetTerm], Args1),
Index: compiler/prog_io_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/prog_io_util.m,v
retrieving revision 1.47
diff -u -r1.47 prog_io_util.m
--- compiler/prog_io_util.m 14 Jun 2006 07:42:54 -0000 1.47
+++ compiler/prog_io_util.m 7 Jul 2006 06:08:56 -0000
@@ -619,15 +619,15 @@
% `not_reached' inst
convert_simple_builtin_inst_2("not_reached", not_reached).
-standard_det("det", det).
-standard_det("cc_nondet", cc_nondet).
-standard_det("cc_multi", cc_multidet).
-standard_det("nondet", nondet).
-standard_det("multi", multidet).
-standard_det("multidet", multidet).
-standard_det("semidet", semidet).
-standard_det("erroneous", erroneous).
-standard_det("failure", failure).
+standard_det("det", detism_det).
+standard_det("cc_nondet", detism_cc_non).
+standard_det("cc_multi", detism_cc_multi).
+standard_det("nondet", detism_non).
+standard_det("multi", detism_multi).
+standard_det("multidet", detism_multi).
+standard_det("semidet", detism_semi).
+standard_det("erroneous", detism_erroneous).
+standard_det("failure", detism_failure).
:- pred parse_bound_inst_list(allow_constrained_inst_var::in, term::in,
uniqueness::in, mer_inst::out) is semidet.
Index: compiler/prog_mutable.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/prog_mutable.m,v
retrieving revision 1.11
diff -u -r1.11 prog_mutable.m
--- compiler/prog_mutable.m 8 Jun 2006 08:19:29 -0000 1.11
+++ compiler/prog_mutable.m 7 Jul 2006 06:09:52 -0000
@@ -108,7 +108,7 @@
GetPredDecl = pred_or_func(VarSet, InstVarSet, ExistQVars, predicate,
mutable_get_pred_sym_name(ModuleName, Name),
[type_and_mode(Type, out_mode(Inst))],
- no /* with_type */, no /* with_inst */, yes(det),
+ no /* with_type */, no /* with_inst */, yes(detism_det),
true /* condition */, purity_semipure, Constraints).
std_set_pred_decl(ModuleName, Name, Type, Inst) = SetPredDecl :-
@@ -119,7 +119,7 @@
SetPredDecl = pred_or_func(VarSet, InstVarSet, ExistQVars, predicate,
mutable_set_pred_sym_name(ModuleName, Name),
[type_and_mode(Type, in_mode(Inst))],
- no /* with_type */, no /* with_inst */, yes(det),
+ no /* with_type */, no /* with_inst */, yes(detism_det),
true /* condition */, purity_impure, Constraints).
constant_get_pred_decl(ModuleName, Name, Type, Inst) = GetPredDecl :-
@@ -130,7 +130,7 @@
GetPredDecl = pred_or_func(VarSet, InstVarSet, ExistQVars, predicate,
mutable_get_pred_sym_name(ModuleName, Name),
[type_and_mode(Type, out_mode(Inst))],
- no /* with_type */, no /* with_inst */, yes(det),
+ no /* with_type */, no /* with_inst */, yes(detism_det),
true /* condition */, purity_pure, Constraints).
constant_set_pred_decl(ModuleName, Name, Type, Inst) = SetPredDecl :-
@@ -141,7 +141,7 @@
SetPredDecl = pred_or_func(VarSet, InstVarSet, ExistQVars, predicate,
mutable_secret_set_pred_sym_name(ModuleName, Name),
[type_and_mode(Type, in_mode(Inst))],
- no /* with_type */, no /* with_inst */, yes(det),
+ no /* with_type */, no /* with_inst */, yes(detism_det),
true /* condition */, purity_impure, Constraints).
io_get_pred_decl(ModuleName, Name, Type, Inst) = GetPredDecl :-
@@ -154,7 +154,7 @@
[type_and_mode(Type, out_mode(Inst)),
type_and_mode(io_state_type, di_mode),
type_and_mode(io_state_type, uo_mode)],
- no /* with_type */, no /* with_inst */, yes(det),
+ no /* with_type */, no /* with_inst */, yes(detism_det),
true /* condition */, purity_pure, Constraints).
io_set_pred_decl(ModuleName, Name, Type, Inst) = SetPredDecl :-
@@ -167,7 +167,7 @@
[type_and_mode(Type, in_mode(Inst)),
type_and_mode(io_state_type, di_mode),
type_and_mode(io_state_type, uo_mode)],
- no /* with_type */, no /* with_inst */, yes(det),
+ no /* with_type */, no /* with_inst */, yes(detism_det),
true /* condition */, purity_pure, Constraints).
mutable_init_pred_decl(ModuleName, Name) = InitPredDecl :-
@@ -179,10 +179,10 @@
WithType = no,
WithInst = no,
Condition = true,
- InitPredDecl = pred_or_func(VarSet, InstVarSet, ExistQVars,
- predicate, mutable_init_pred_sym_name(ModuleName, Name),
- ArgDecls, WithType, WithInst, yes(det), Condition, purity_impure,
- Constraints).
+ InitPredDecl = pred_or_func(VarSet, InstVarSet, ExistQVars, predicate,
+ mutable_init_pred_sym_name(ModuleName, Name), ArgDecls,
+ WithType, WithInst, yes(detism_det), Condition,
+ purity_impure, Constraints).
%-----------------------------------------------------------------------------%
Index: compiler/purity.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/purity.m,v
retrieving revision 1.95
diff -u -r1.95 purity.m
--- compiler/purity.m 10 Jul 2006 04:40:50 -0000 1.95
+++ compiler/purity.m 11 Jul 2006 05:16:25 -0000
@@ -477,7 +477,7 @@
Vars = [InputArg, OutputArg]
->
Goal = generic_call(cast(unsafe_type_cast), [InputArg, OutputArg],
- [in_mode, out_mode], det)
+ [in_mode, out_mode], detism_det)
;
Goal = call(PredId, ProcId, Vars, BIState, UContext, Name)
)
Index: compiler/simplify.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/simplify.m,v
retrieving revision 1.179
diff -u -r1.179 simplify.m
--- compiler/simplify.m 10 Jul 2006 04:40:50 -0000 1.179
+++ compiler/simplify.m 11 Jul 2006 05:16:25 -0000
@@ -534,7 +534,7 @@
% if --no-fully-strict,
% replace goals with determinism failure with `fail'.
%
- Detism = failure,
+ Detism = detism_failure,
% ensure goal is pure or semipure
\+ goal_info_is_impure(GoalInfo0),
( det_info_get_fully_strict(DetInfo, no)
@@ -881,7 +881,7 @@
ModuleInfo1, ModuleInfo),
simplify_info_set_module_info(ModuleInfo, !Info),
goal_info_get_determinism(GoalInfo0, CaseDetism),
- det_conjunction_detism(semidet, CaseDetism, Detism),
+ det_conjunction_detism(detism_semi, CaseDetism, Detism),
goal_list_purity(GoalList, Purity),
goal_info_init(NonLocals, InstMapDelta, Detism, Purity,
CombinedGoalInfo),
@@ -1125,10 +1125,10 @@
(
MaybeNegDetism = yes(NegDetism1),
(
- NegDetism1 = erroneous,
+ NegDetism1 = detism_erroneous,
instmap_delta_init_unreachable(NegInstMapDelta1)
;
- NegDetism1 = det,
+ NegDetism1 = detism_det,
instmap_delta_init_reachable(NegInstMapDelta1)
)
->
@@ -1413,7 +1413,7 @@
Unique = ground(unique, none),
ArgInsts = [R - Unique],
goal_util.generate_simple_call(BuiltinModule, "compare", predicate,
- mode_no(ModeNo), det, Args, [], ArgInsts, ModuleInfo, Context,
+ mode_no(ModeNo), detism_det, Args, [], ArgInsts, ModuleInfo, Context,
CmpGoal0),
CmpGoal0 = CmpExpr - CmpInfo0,
goal_info_get_nonlocals(CmpInfo0, CmpNonLocals0),
@@ -1624,7 +1624,7 @@
% builtin_unify_pred (which calls error/1).
goal_info_get_context(GoalInfo0, GContext),
generate_simple_call(mercury_private_builtin_module,
- "builtin_unify_pred", predicate, mode_no(0), semidet,
+ "builtin_unify_pred", predicate, mode_no(0), detism_semi,
[XVar, YVar], [], [], ModuleInfo, GContext, Call0 - _),
simplify_goal_2(Call0, Call1, GoalInfo0, GoalInfo, !Info, !IO),
Call = Call1 - GoalInfo,
@@ -1689,7 +1689,7 @@
ArgVars = [TypeInfoVar, XVar, YVar],
goal_info_get_context(GoalInfo, Context),
goal_util.generate_simple_call(mercury_public_builtin_module,
- "unify", predicate, mode_no(0), semidet, ArgVars, [], [],
+ "unify", predicate, mode_no(0), detism_semi, ArgVars, [], [],
ModuleInfo, Context, Call).
:- pred call_specific_unify(type_ctor::in, list(prog_var)::in,
@@ -2241,7 +2241,7 @@
% The test can't bind any variables, so the InstMapDelta should be empty.
instmap_delta_init_reachable(InstMapDelta),
- goal_info_init(NonLocals, InstMapDelta, semidet, purity_pure,
+ goal_info_init(NonLocals, InstMapDelta, detism_semi, purity_pure,
ExtraGoalInfo).
%-----------------------------------------------------------------------------%
Index: compiler/size_prof.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/size_prof.m,v
retrieving revision 1.39
diff -u -r1.39 size_prof.m
--- compiler/size_prof.m 8 Jun 2006 08:19:30 -0000 1.39
+++ compiler/size_prof.m 7 Jul 2006 06:14:54 -0000
@@ -759,7 +759,7 @@
% so we make it a no_type_info_builtin.
TermSizeProfBuiltin = mercury_term_size_prof_builtin_module,
goal_util.generate_simple_call(TermSizeProfBuiltin,
- "increment_size", predicate, only_mode, det,
+ "increment_size", predicate, only_mode, detism_det,
[Var, SizeVar], [impure_goal], [], !.Info ^ module_info,
Context, UpdateGoal),
% Put UnifyGoal first in case it fails.
@@ -824,7 +824,7 @@
get_new_var(int_type, "FinalSizeVar", SizeVar, !Info),
TermSizeProfModule = mercury_term_size_prof_builtin_module,
goal_util.generate_simple_call(TermSizeProfModule,
- "term_size_plus", function, mode_no(0), det,
+ "term_size_plus", function, mode_no(0), detism_det,
[SizeVar0, KnownSizeVar, SizeVar], [],
[SizeVar - ground(shared, none)],
!.Info ^ module_info, Context, AddGoal),
@@ -887,8 +887,8 @@
!:Info = !.Info ^ vartypes := VarTypes,
PrivateBuiltin = mercury_private_builtin_module,
goal_util.generate_simple_call(PrivateBuiltin,
- "type_info_from_typeclass_info", predicate, only_mode, det,
- [TypeClassInfoVar, SlotVar, TypeInfoVar], [],
+ "type_info_from_typeclass_info", predicate, only_mode,
+ detism_det, [TypeClassInfoVar, SlotVar, TypeInfoVar], [],
[TypeInfoVar - ground(shared, none)],
!.Info ^ module_info, Context, ExtractGoal),
record_type_info_var(Type, TypeInfoVar, !Info),
@@ -1013,7 +1013,7 @@
),
TermSizeProfBuiltin = mercury_term_size_prof_builtin_module,
goal_util.generate_simple_call(TermSizeProfBuiltin, Pred, predicate,
- only_mode, det, Args, [], [SizeVar - ground(shared, none)],
+ only_mode, detism_det, Args, [], [SizeVar - ground(shared, none)],
!.Info ^ module_info, Context, SizeGoal),
MaybeSizeVar = yes(SizeVar).
Index: compiler/special_pred.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/special_pred.m,v
retrieving revision 1.62
diff -u -r1.62 special_pred.m
--- compiler/special_pred.m 8 Jun 2006 08:19:31 -0000 1.62
+++ compiler/special_pred.m 7 Jul 2006 05:56:06 -0000
@@ -153,17 +153,17 @@
spec_pred_name_append_type_id = no.
special_pred_interface(spec_pred_unify, Type, [Type, Type], [In, In],
- semidet) :-
+ detism_semi) :-
in_mode(In).
special_pred_interface(spec_pred_index, Type, [Type, int_type], [In, Out],
- det) :-
+ detism_det) :-
in_mode(In),
out_mode(Out).
special_pred_interface(spec_pred_compare, Type,
- [comparison_result_type, Type, Type], [Uo, In, In], det) :-
+ [comparison_result_type, Type, Type], [Uo, In, In], detism_det) :-
in_mode(In),
uo_mode(Uo).
-special_pred_interface(spec_pred_init, Type, [Type], [InAny], det) :-
+special_pred_interface(spec_pred_init, Type, [Type], [InAny], detism_det) :-
InAny = out_any_mode.
special_pred_get_type(spec_pred_unify, Types, T) :-
Index: compiler/structure_reuse.lbu.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/structure_reuse.lbu.m,v
retrieving revision 1.3
diff -u -r1.3 structure_reuse.lbu.m
--- compiler/structure_reuse.lbu.m 15 Jun 2006 19:37:12 -0000 1.3
+++ compiler/structure_reuse.lbu.m 7 Jul 2006 06:11:37 -0000
@@ -182,10 +182,10 @@
:- pred detism_allows_multiple_solns(prog_data__determinism::in) is semidet.
-detism_allows_multiple_solns(nondet).
-detism_allows_multiple_solns(multidet).
-detism_allows_multiple_solns(cc_nondet).
-detism_allows_multiple_solns(cc_multidet).
+detism_allows_multiple_solns(detism_non).
+detism_allows_multiple_solns(detism_multi).
+detism_allows_multiple_solns(detism_cc_non).
+detism_allows_multiple_solns(detism_cc_multi).
:- pred backward_use_in_conj(vartypes::in, list(hlds_goal)::in,
list(hlds_goal)::out, set(prog_var)::in, set(prog_var)::out) is det.
Index: compiler/structure_sharing.domain.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/structure_sharing.domain.m,v
retrieving revision 1.12
diff -u -r1.12 structure_sharing.domain.m
--- compiler/structure_sharing.domain.m 5 Jul 2006 08:45:36 -0000 1.12
+++ compiler/structure_sharing.domain.m 7 Jul 2006 06:12:03 -0000
@@ -816,9 +816,9 @@
% 1. inferred determinism is erroneous/failure.
proc_info_get_inferred_determinism(ProcInfo, Determinism),
(
- Determinism = erroneous
+ Determinism = detism_erroneous
;
- Determinism = failure
+ Determinism = detism_failure
)
;
% 2. bottom_sharing_is_safe_approximation
Index: compiler/table_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/table_gen.m,v
retrieving revision 1.109
diff -u -r1.109 table_gen.m
--- compiler/table_gen.m 8 Jun 2006 08:19:31 -0000 1.109
+++ compiler/table_gen.m 7 Jul 2006 06:25:11 -0000
@@ -696,15 +696,15 @@
MarkActiveFailCode = "\t" ++ MarkActiveFailMacroName ++
"(" ++ DebugArgStr ++ ", " ++ cur_table_node_name ++ ");\n",
- table_generate_foreign_proc(MarkInactivePredName, det,
+ table_generate_foreign_proc(MarkInactivePredName, detism_det,
tabling_c_attributes, [TableTipArg], [],
MarkInactiveCode, impure_code, [],
ModuleInfo, Context, MarkInactiveGoal),
- table_generate_foreign_proc(MarkInactiveFailPredName, failure,
+ table_generate_foreign_proc(MarkInactiveFailPredName, detism_failure,
tabling_c_attributes, [TableTipArg], [],
MarkInactiveFailCode, impure_code, [],
ModuleInfo, Context, MarkInactiveFailGoal),
- table_generate_foreign_proc(MarkActiveFailPredName, failure,
+ table_generate_foreign_proc(MarkActiveFailPredName, detism_failure,
tabling_c_attributes, [TableTipArg], [],
MarkActiveFailCode, impure_code, [],
ModuleInfo, Context, MarkActiveFailGoal),
@@ -737,7 +737,7 @@
AfterGoalExpr = disj([MarkInactiveGoal, MarkActiveFailGoal]),
instmap_delta_init_reachable(AfterInstMapDelta),
goal_info_init_hide(set.make_singleton_set(TableTipVar),
- AfterInstMapDelta, multidet, purity_impure, Context,
+ AfterInstMapDelta, detism_multi, purity_impure, Context,
AfterGoalInfo),
AfterGoal = AfterGoalExpr - AfterGoalInfo,
FirstGoalExpr = conj(plain_conj, [OrigGoal, AfterGoal]),
@@ -967,7 +967,7 @@
ThenVars = [TableTipVar | OutputVars] ++ NewVars,
set.list_to_set(ThenVars, ThenNonLocals),
goal_info_init_hide(ThenNonLocals, InactiveInstmapDelta,
- det, purity_impure, Context, ThenGoalInfo),
+ detism_det, purity_impure, Context, ThenGoalInfo),
ThenGoal = ThenGoalExpr - ThenGoalInfo,
MarkAsFailedPredName = "table_memo_mark_as_failed",
@@ -978,7 +978,7 @@
DebugArgStr = get_debug_arg_string(!.TableInfo),
MarkAsFailedCode = MarkAsFailedMacroName ++
"(" ++ DebugArgStr ++ ", " ++ cur_table_node_name ++ ");",
- table_generate_foreign_proc(MarkAsFailedPredName, failure,
+ table_generate_foreign_proc(MarkAsFailedPredName, detism_failure,
tabling_c_attributes, [TableTipArg], [],
MarkAsFailedCode, impure_code, [],
ModuleInfo, Context, ElseGoal),
@@ -1068,15 +1068,15 @@
MarkCompleteCode = MarkCompleteMacroName ++
"(" ++ DebugArgStr ++ ", " ++ RecordVarName ++ ");\n",
- table_generate_foreign_proc(MarkIncompletePredName, det,
+ table_generate_foreign_proc(MarkIncompletePredName, detism_det,
tabling_c_attributes, [RecordArg], [],
MarkIncompleteCode, impure_code, [],
ModuleInfo, Context, MarkIncompleteGoal),
- table_generate_foreign_proc(MarkActivePredName, failure,
+ table_generate_foreign_proc(MarkActivePredName, detism_failure,
tabling_c_attributes, [RecordArg], [],
MarkActiveCode, impure_code, [],
ModuleInfo, Context, MarkActiveGoal),
- table_generate_foreign_proc(MarkCompletePredName, failure,
+ table_generate_foreign_proc(MarkCompletePredName, detism_failure,
tabling_c_attributes, [RecordArg], [],
MarkCompleteCode, impure_code, [],
ModuleInfo, Context, MarkCompleteGoal),
@@ -1085,14 +1085,14 @@
set.insert(OrigNonLocals, RecordVar, OrigSaveNonLocals),
create_instmap_delta([OrigGoal | SaveAnswerGoals], OrigSaveIMD0),
instmap_delta_restrict(OrigSaveNonLocals, OrigSaveIMD0, OrigSaveIMD),
- goal_info_init_hide(OrigSaveNonLocals, OrigSaveIMD, nondet, purity_impure,
- Context, OrigSaveGoalInfo),
+ goal_info_init_hide(OrigSaveNonLocals, OrigSaveIMD, detism_non,
+ purity_impure, Context, OrigSaveGoalInfo),
OrigSaveGoal = OrigSaveExpr - OrigSaveGoalInfo,
AfterExpr = disj([MarkIncompleteGoal, MarkActiveGoal]),
AfterNonLocals = set.make_singleton_set(RecordVar),
create_instmap_delta([], AfterInstMapDelta),
- goal_info_init_hide(AfterNonLocals, AfterInstMapDelta, nondet,
+ goal_info_init_hide(AfterNonLocals, AfterInstMapDelta, detism_non,
purity_impure, Context, AfterGoalInfo),
AfterGoal = AfterExpr - AfterGoalInfo,
@@ -1253,16 +1253,16 @@
CounterVar),
generate_new_table_var("StartVar", int_type, !VarSet, !VarTypes,
StartVar),
- generate_call("table_io_in_range", semidet,
+ generate_call("table_io_in_range", detism_semi,
[TableVar, CounterVar, StartVar], impure_code,
ground_vars([TableVar, CounterVar, StartVar]),
ModuleInfo, Context, InRangeGoal),
generate_new_table_var("TipVar", trie_node_type, !VarSet, !VarTypes,
TipVar),
- generate_call("table_lookup_insert_start_int", det,
+ generate_call("table_lookup_insert_start_int", detism_det,
[TableVar, StartVar, CounterVar, TipVar], impure_code,
ground_vars([TipVar]), ModuleInfo, Context, LookupGoal),
- generate_call("table_io_has_occurred", semidet, [TipVar],
+ generate_call("table_io_has_occurred", detism_semi, [TipVar],
semipure_code, [], ModuleInfo, Context, OccurredGoal),
(
TableDecl = table_io_decl,
@@ -1315,7 +1315,7 @@
unexpected(this_file,
"create_new_io_goal: one in / one out violation")
),
- generate_call("table_io_copy_io_state", det,
+ generate_call("table_io_copy_io_state", detism_det,
[IoStateAssignFromVar, IoStateAssignToVar], pure_code,
[IoStateAssignFromVar - ground(clobbered, none),
IoStateAssignToVar - ground(unique, none)],
@@ -1333,7 +1333,7 @@
instmap_delta_restrict(RestoreAnswerNonLocals,
RestoreAnswerInstMapDelta0, RestoreAnswerInstMapDelta),
goal_info_init_hide(RestoreAnswerNonLocals,
- RestoreAnswerInstMapDelta, det, purity_semipure, Context,
+ RestoreAnswerInstMapDelta, detism_det, purity_semipure, Context,
RestoreAnswerGoalInfo),
RestoreAnswerGoal = RestoreAnswerGoalExpr - RestoreAnswerGoalInfo
),
@@ -1346,11 +1346,11 @@
Unitize = table_io_unitize,
generate_new_table_var("SavedTraceEnabled", int_type,
!VarSet, !VarTypes, SavedTraceEnabledVar),
- generate_call("table_io_left_bracket_unitized_goal", det,
+ generate_call("table_io_left_bracket_unitized_goal", detism_det,
[SavedTraceEnabledVar], impure_code,
ground_vars([SavedTraceEnabledVar]),
ModuleInfo, Context, LeftBracketGoal),
- generate_call("table_io_right_bracket_unitized_goal", det,
+ generate_call("table_io_right_bracket_unitized_goal", detism_det,
[SavedTraceEnabledVar], impure_code, [],
ModuleInfo, Context, RightBracketGoal),
CallSaveAnswerGoalList = [LeftBracketGoal, NewGoal,
@@ -1362,7 +1362,7 @@
instmap_delta_restrict(CallSaveAnswerNonLocals,
CallSaveAnswerInstMapDelta0, CallSaveAnswerInstMapDelta),
goal_info_init_hide(CallSaveAnswerNonLocals, CallSaveAnswerInstMapDelta,
- det, purity_impure, Context, CallSaveAnswerGoalInfo0),
+ detism_det, purity_impure, Context, CallSaveAnswerGoalInfo0),
goal_info_add_feature(hide_debug_event,
CallSaveAnswerGoalInfo0, CallSaveAnswerGoalInfo),
CallSaveAnswerGoal = CallSaveAnswerGoalExpr - CallSaveAnswerGoalInfo,
@@ -1374,7 +1374,7 @@
set.insert(OrigNonLocals, TipVar, GenIfNecNonLocals),
instmap_delta_restrict(GenIfNecNonLocals,
GenIfNecInstMapDelta0, GenIfNecInstMapDelta),
- goal_info_init_hide(GenIfNecNonLocals, GenIfNecInstMapDelta, det,
+ goal_info_init_hide(GenIfNecNonLocals, GenIfNecInstMapDelta, detism_det,
purity_impure, Context, GenIfNecGoalInfo),
GenIfNecGoal = GenIfNecGoalExpr - GenIfNecGoalInfo,
@@ -1386,7 +1386,7 @@
instmap_delta_restrict(CheckAndGenAnswerNonLocals,
CheckAndGenAnswerInstMapDelta0, CheckAndGenAnswerInstMapDelta),
goal_info_init_hide(CheckAndGenAnswerNonLocals,
- CheckAndGenAnswerInstMapDelta, det, purity_impure, Context,
+ CheckAndGenAnswerInstMapDelta, detism_det, purity_impure, Context,
CheckAndGenAnswerGoalInfo),
CheckAndGenAnswerGoal = CheckAndGenAnswerGoalExpr
- CheckAndGenAnswerGoalInfo,
@@ -1396,8 +1396,8 @@
create_instmap_delta([InRangeGoal, CheckAndGenAnswerGoal, NewGoal],
BodyInstMapDelta0),
instmap_delta_restrict(OrigNonLocals, BodyInstMapDelta0, BodyInstMapDelta),
- goal_info_init_hide(OrigNonLocals, BodyInstMapDelta, det, purity_impure,
- Context, BodyGoalInfo),
+ goal_info_init_hide(OrigNonLocals, BodyInstMapDelta, detism_det,
+ purity_impure, Context, BodyGoalInfo),
Goal = BodyGoalExpr - BodyGoalInfo.
%-----------------------------------------------------------------------------%
@@ -1490,11 +1490,11 @@
set.insert_list(OrigNonLocals, [SubgoalVar, StatusVar], MainNonLocals),
create_instmap_delta([OrigGoal | SaveAnswerGoals], MainIMD0),
instmap_delta_restrict(MainNonLocals, MainIMD0, MainIMD),
- goal_info_init_hide(MainNonLocals, MainIMD, nondet, purity_impure, Context,
- MainGoalInfo),
+ goal_info_init_hide(MainNonLocals, MainIMD, detism_non, purity_impure,
+ Context, MainGoalInfo),
MainGoal = MainExpr - MainGoalInfo,
- generate_call("table_mm_completion", det, [SubgoalVar], impure_code,
+ generate_call("table_mm_completion", detism_det, [SubgoalVar], impure_code,
[], ModuleInfo, Context, ResumeGoal0),
append_fail(ResumeGoal0, ResumeGoal),
InactiveExpr = disj([MainGoal, ResumeGoal]),
@@ -1511,8 +1511,8 @@
SwitchGoal = SwitchExpr - SwitchGoalInfo,
GoalExpr = conj(plain_conj, [LookUpGoal, SwitchGoal]),
- goal_info_init_hide(OrigNonLocals, OrigInstMapDelta, nondet, purity_impure,
- Context, GoalInfo),
+ goal_info_init_hide(OrigNonLocals, OrigInstMapDelta, detism_non,
+ purity_impure, Context, GoalInfo),
Goal = GoalExpr - GoalInfo.
%-----------------------------------------------------------------------------%
@@ -1650,7 +1650,7 @@
"\t" ++ consumer_name ++ " = " ++
"MR_tbl_mmos_setup_consumer(" ++ generator_name ++
", """ ++ PredName ++ """);\n",
- table_generate_foreign_proc(SetupPredName, det,
+ table_generate_foreign_proc(SetupPredName, detism_det,
make_generator_c_attributes,
[InfoArg, GeneratorPredArg, ConsumerArg], LookupForeignArgs,
LookupDeclCodeStr ++ SetupCode, impure_code,
@@ -1666,9 +1666,9 @@
generate_new_table_var("AnswerBlock", answer_block_type,
!VarSet, !VarTypes, AnswerBlockVar),
- ( Detism = multidet ->
+ ( Detism = detism_multi ->
ConsumePredName = "table_mmos_consume_next_answer_multi"
- ; Detism = nondet ->
+ ; Detism = detism_non ->
ConsumePredName = "table_mmos_consume_next_answer_nondet"
;
unexpected(this_file, "do_own_stack_transform: invalid determinism")
@@ -1685,9 +1685,9 @@
yes(answer_block_name - in_mode), answer_block_type,
native_if_possible),
RestoreAllPredName = "table_mmos_restore_answers",
- table_generate_foreign_proc(RestoreAllPredName, det, tabling_c_attributes,
- [AnswerBlockArg], RestoreArgs, RestoreCodeStr, impure_code,
- RestoreInstMapDeltaSrc, ModuleInfo, Context, RestoreGoal),
+ table_generate_foreign_proc(RestoreAllPredName, detism_det,
+ tabling_c_attributes, [AnswerBlockArg], RestoreArgs, RestoreCodeStr,
+ impure_code, RestoreInstMapDeltaSrc, ModuleInfo, Context, RestoreGoal),
GoalExpr = conj(plain_conj,
LookupSetupGoals ++ [GetNextAnswerGoal, RestoreGoal]),
@@ -1760,7 +1760,7 @@
" = MR_mmos_new_generator;\n",
PickupGeneratorArg = foreign_arg(GeneratorVar,
yes(generator_name - out_mode), generator_type, native_if_possible),
- table_generate_foreign_proc("table_mmos_pickup_inputs", det,
+ table_generate_foreign_proc("table_mmos_pickup_inputs", detism_det,
tabling_c_attributes, [PickupGeneratorArg], PickupForeignArgs,
PickupGeneratorCode ++ PickupVarCode, semipure_code,
PickupInstMapDeltaSrc, ModuleInfo0, Context, PickupGoal),
@@ -1986,7 +1986,7 @@
LookupCodeStr ++
CallTableTipAssignStr ++
MainPredCodeStr,
- table_generate_foreign_proc(PredName, det, tabling_c_attributes,
+ table_generate_foreign_proc(PredName, detism_det, tabling_c_attributes,
Args, LookupForeignArgs, CodeStr, impure_code, ground_vars(BoundVars),
ModuleInfo, Context, SetupGoal0),
attach_call_table_tip(SetupGoal0, SetupGoal),
@@ -1996,7 +1996,7 @@
Vars = list.map(project_var, NumberedVars),
set.list_to_set([StatusVar, TableTipVar | Vars], NonLocals),
goal_info_init_hide(NonLocals, bind_vars([TableTipVar, StatusVar]),
- det, purity_impure, Context, GoalInfo),
+ detism_det, purity_impure, Context, GoalInfo),
Goal = GoalExpr - GoalInfo.
% Generate a goal for doing lookups in call tables for
@@ -2042,9 +2042,10 @@
DebugArgStr ++ ", " ++ BackArgStr ++ ", " ++
cur_table_node_name ++ ", " ++ RecordVarName ++ ", " ++
StatusVarName ++ ");\n",
- table_generate_foreign_proc(SetupPredName, det, tabling_c_attributes, Args,
- LookupForeignArgs, LookupDeclCodeStr ++ PredCodeStr, impure_code,
- ground_vars(BoundVars), ModuleInfo, Context, SetupGoal0),
+ table_generate_foreign_proc(SetupPredName, detism_det,
+ tabling_c_attributes, Args, LookupForeignArgs,
+ LookupDeclCodeStr ++ PredCodeStr, impure_code, ground_vars(BoundVars),
+ ModuleInfo, Context, SetupGoal0),
attach_call_table_tip(SetupGoal0, SetupGoal),
LookupSetupGoals = LookupPrefixGoals ++ [SetupGoal],
@@ -2052,7 +2053,7 @@
Vars = list.map(project_var, NumberedVars),
set.list_to_set([StatusVar, RecordVar | Vars], NonLocals),
goal_info_init_hide(NonLocals, bind_vars([RecordVar, StatusVar]),
- det, purity_impure, Context, GoalInfo),
+ detism_det, purity_impure, Context, GoalInfo),
Goal = GoalExpr - GoalInfo.
% Generate a goal for doing lookups in call tables for
@@ -2097,8 +2098,8 @@
StatusVarName ++ ");\n",
CodeStr = LookupDeclStr ++ LookupCodeStr ++ SetupCodeStr,
ModuleInfo = !.TableInfo ^ table_module_info,
- table_generate_foreign_proc(SetupPredName, det, tabling_c_attributes,
- Args, LookupForeignArgs, CodeStr, impure_code,
+ table_generate_foreign_proc(SetupPredName, detism_det,
+ tabling_c_attributes, Args, LookupForeignArgs, CodeStr, impure_code,
ground_vars(BoundVars), ModuleInfo, Context, SetupGoal0),
attach_call_table_tip(SetupGoal0, SetupGoal),
LookupSetupGoals = LookupPrefixGoals ++ [SetupGoal],
@@ -2107,7 +2108,7 @@
Vars = list.map(project_var, NumberedVars),
set.list_to_set([StatusVar, SubgoalVar | Vars], NonLocals),
goal_info_init_hide(NonLocals, bind_vars([SubgoalVar, StatusVar]),
- det, purity_impure, Context, GoalInfo),
+ detism_det, purity_impure, Context, GoalInfo),
Goal = GoalExpr - GoalInfo.
%-----------------------------------------------------------------------------%
@@ -2406,7 +2407,7 @@
generate_all_save_goals(NumberedSaveVars, TipVarName,
BlockSize, CreateMacroName, Context, !VarSet, !VarTypes,
!TableInfo, SaveArgs, SavePrefixGoals, SaveDeclCode, SaveCode),
- table_generate_foreign_proc(CreatePredName, det,
+ table_generate_foreign_proc(CreatePredName, detism_det,
tabling_c_attributes, [TableArg], SaveArgs,
SaveDeclCode ++ SaveCode, impure_code, [],
ModuleInfo, Context, SaveGoal),
@@ -2416,7 +2417,7 @@
MarkAsSucceededMacroName = "MR_tbl_memo_mark_as_succeeded",
MarkAsSucceededCode = MarkAsSucceededMacroName ++
"(" ++ cur_table_node_name ++ ");",
- table_generate_foreign_proc(MarkAsSucceededPredName, det,
+ table_generate_foreign_proc(MarkAsSucceededPredName, detism_det,
tabling_c_attributes, [TableArg], [],
MarkAsSucceededCode, impure_code, [],
ModuleInfo, Context, SaveGoal),
@@ -2473,7 +2474,7 @@
DuplCheckCodeStr ++
"\tif (" ++ SuccName ++ ") {\n" ++ CreateSaveCode ++ "\t}\n" ++
AssignSuccessCodeStr,
- table_generate_foreign_proc(DuplCheckPredName, semidet,
+ table_generate_foreign_proc(DuplCheckPredName, detism_semi,
tabling_c_attributes, [RecordArg], LookupForeignArgs, CodeStr,
impure_code, [], ModuleInfo, Context, DuplicateCheckSaveGoal),
Goals = LookupPrefixGoals ++ [DuplicateCheckSaveGoal].
@@ -2527,7 +2528,7 @@
CodeStr = LookupDeclCodeStr ++ SaveDeclCode ++
GetCodeStr ++ LookupCodeStr ++ DuplCheckCodeStr ++
CondSaveStr ++ AssignSuccessCodeStr,
- table_generate_foreign_proc(DuplCheckPredName, semidet,
+ table_generate_foreign_proc(DuplCheckPredName, detism_semi,
tabling_c_attributes, Args, LookupForeignArgs,
CodeStr, impure_code, [],
ModuleInfo, Context, DuplicateCheckSaveGoal),
@@ -2609,7 +2610,7 @@
CodeStr = LookupSaveDeclCodeStr ++ GetCodeStr ++ LookupCodeStr ++
DuplCheckCodeStr ++ CondSaveCodeStr ++ AssignSuccessCodeStr,
ModuleInfo = !.TableInfo ^ table_module_info,
- table_generate_foreign_proc(DuplCheckPredName, semidet,
+ table_generate_foreign_proc(DuplCheckPredName, detism_semi,
tabling_c_attributes, Args, LookupForeignArgs,
CodeStr, impure_code, [],
ModuleInfo, Context, DuplicateCheckSaveGoal),
@@ -2707,8 +2708,9 @@
DebugArgStr ++ ", " ++ BaseVarName ++ ", " ++
answer_block_name ++ ");\n" ++
RestoreCodeStr,
- table_generate_foreign_proc(GetPredName, det, tabling_c_attributes,
- Args, RestoreArgs, DeclCodeStr ++ GetRestoreCodeStr, impure_code,
+ table_generate_foreign_proc(GetPredName, detism_det,
+ tabling_c_attributes, Args, RestoreArgs,
+ DeclCodeStr ++ GetRestoreCodeStr, impure_code,
RestoreInstMapDeltaSrc, ModuleInfo, Context, ShortcutGoal),
Goal = ShortcutGoal
;
@@ -2726,9 +2728,9 @@
generate_memo_non_restore_goal(Detism, NumberedOutputVars, OrigInstMapDelta,
RecordVar, Context, !VarSet, !VarTypes, TableInfo, Goal) :-
- ( Detism = multidet ->
+ ( Detism = detism_multi ->
ReturnAllAns = "table_memo_return_all_answers_multi"
- ; Detism = nondet ->
+ ; Detism = detism_non ->
ReturnAllAns = "table_memo_return_all_answers_nondet"
;
unexpected(this_file, "generate_mm_restore_goal: invalid determinism")
@@ -2748,7 +2750,7 @@
answer_block_type, native_if_possible),
Args = [Arg],
PredName = "table_memo_non_return_all_shortcut",
- table_generate_foreign_proc(PredName, det, tabling_c_attributes,
+ table_generate_foreign_proc(PredName, detism_det, tabling_c_attributes,
Args, RestoreArgs, RestoreCodeStr, impure_code,
RestoreInstMapDeltaSrc, ModuleInfo, Context, ShortcutGoal),
@@ -2768,9 +2770,9 @@
generate_mm_restore_goal(Detism, NumberedOutputVars, OrigInstMapDelta,
SubgoalVar, Context, !VarSet, !VarTypes, TableInfo, Goal) :-
- ( Detism = multidet ->
+ ( Detism = detism_multi ->
ReturnAllAns = "table_mm_return_all_multi"
- ; Detism = nondet ->
+ ; Detism = detism_non ->
ReturnAllAns = "table_mm_return_all_nondet"
;
unexpected(this_file, "generate_mm_restore_goal: invalid determinism")
@@ -2790,7 +2792,7 @@
generate_mm_suspend_goal(NumberedOutputVars, OrigInstMapDelta, SubgoalVar,
Context, !VarSet, !VarTypes, TableInfo, Goal) :-
generate_mm_restore_or_suspend_goal("table_mm_suspend_consumer",
- nondet, purity_impure, NumberedOutputVars, OrigInstMapDelta,
+ detism_non, purity_impure, NumberedOutputVars, OrigInstMapDelta,
SubgoalVar, Context, !VarSet, !VarTypes, TableInfo, Goal).
% Generate a goal for restoring the output arguments from
@@ -2821,9 +2823,9 @@
answer_block_type, native_if_possible),
Args = [Arg],
ReturnAllPredName = "table_mm_return_all_shortcut",
- table_generate_foreign_proc(ReturnAllPredName, det, tabling_c_attributes,
- Args, RestoreArgs, RestoreCodeStr, impure_code, RestoreInstMapDeltaSrc,
- ModuleInfo, Context, ReturnAllGoal),
+ table_generate_foreign_proc(ReturnAllPredName, detism_det,
+ tabling_c_attributes, Args, RestoreArgs, RestoreCodeStr, impure_code,
+ RestoreInstMapDeltaSrc, ModuleInfo, Context, ReturnAllGoal),
GoalExpr = conj(plain_conj, [ReturnAnswerBlocksGoal, ReturnAllGoal]),
set.list_to_set([SubgoalVar | OutputVars], NonLocals),
@@ -2912,12 +2914,12 @@
gen_string_construction("Message", Message, !VarSet, !VarTypes,
MessageVar, MessageStrGoal),
- generate_call("table_error", erroneous, [MessageVar], pure_code, [],
+ generate_call("table_error", detism_erroneous, [MessageVar], pure_code, [],
ModuleInfo, Context, CallGoal),
GoalExpr = conj(plain_conj, [MessageStrGoal, CallGoal]),
- goal_info_init_hide(set.init, bind_vars([]), erroneous, purity_impure,
- Context, GoalInfo),
+ goal_info_init_hide(set.init, bind_vars([]), detism_erroneous,
+ purity_impure, Context, GoalInfo),
Goal = GoalExpr - GoalInfo.
%-----------------------------------------------------------------------------%
@@ -2952,7 +2954,7 @@
Goal) :-
mercury_table_builtin_module(BuiltinModule),
Features0 = impure_or_semipure_to_features(Purity),
- ( Detism = failure ->
+ ( Detism = detism_failure ->
Features = [preserve_backtrack_into | Features0]
;
Features = Features0
@@ -2971,7 +2973,7 @@
Code, Purity, InstMapSrc, ModuleInfo, Context, Goal) :-
mercury_table_builtin_module(BuiltinModule),
Features0 = impure_or_semipure_to_features(Purity),
- ( Detism = failure ->
+ ( Detism = detism_failure ->
Features = [preserve_backtrack_into | Features0]
;
Features = Features0
@@ -2987,8 +2989,8 @@
goal_info_get_nonlocals(GoalInfo, NonLocals),
goal_info_get_context(GoalInfo, Context),
instmap_delta_init_unreachable(UnreachInstMapDelta),
- goal_info_init_hide(NonLocals, UnreachInstMapDelta, failure, purity_impure,
- Context, ConjGoalInfo),
+ goal_info_init_hide(NonLocals, UnreachInstMapDelta, detism_failure,
+ purity_impure, Context, ConjGoalInfo),
GoalAndThenFail = conj(plain_conj, [Goal, fail_goal]) - ConjGoalInfo.
:- pred gen_int_construction(string::in, int::in,
Index: compiler/typecheck.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/typecheck.m,v
retrieving revision 1.394
diff -u -r1.394 typecheck.m
--- compiler/typecheck.m 23 Jun 2006 05:37:59 -0000 1.394
+++ compiler/typecheck.m 7 Jul 2006 05:56:21 -0000
@@ -639,7 +639,7 @@
),
pred_info_context(!.PredInfo, Context),
generate_simple_call(mercury_private_builtin_module, CalleeName,
- predicate, only_mode, det, [PredNameVar], [], [], ModuleInfo,
+ predicate, only_mode, detism_det, [PredNameVar], [], [], ModuleInfo,
Context, CallGoal),
% Combine the unification and call into a conjunction.
Index: compiler/unify_proc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/unify_proc.m,v
retrieving revision 1.165
diff -u -r1.165 unify_proc.m
--- compiler/unify_proc.m 20 Apr 2006 05:37:04 -0000 1.165
+++ compiler/unify_proc.m 7 Jul 2006 05:57:04 -0000
@@ -242,7 +242,7 @@
search_mode_num(ModuleInfo, TypeCtor, UniMode, Determinism, ProcId) :-
UniMode = (XInitial - YInitial -> _Final),
(
- Determinism = semidet,
+ Determinism = detism_semi,
inst_is_ground_or_any(ModuleInfo, XInitial),
inst_is_ground_or_any(ModuleInfo, YInitial)
->
@@ -1562,11 +1562,11 @@
instmap_delta_from_assoc_list([X_Index - ground(shared, none)],
X_InstmapDelta),
build_specific_call(Type, spec_pred_index, [X, X_Index],
- X_InstmapDelta, det, Context, Call_X_Index, !Info),
+ X_InstmapDelta, detism_det, Context, Call_X_Index, !Info),
instmap_delta_from_assoc_list([Y_Index - ground(shared, none)],
Y_InstmapDelta),
build_specific_call(Type, spec_pred_index, [Y, Y_Index],
- Y_InstmapDelta, det, Context, Call_Y_Index, !Info),
+ Y_InstmapDelta, detism_det, Context, Call_Y_Index, !Info),
build_call("builtin_int_lt", [X_Index, Y_Index], Context,
Call_Less_Than, !Info),
@@ -1822,8 +1822,8 @@
;
MercuryBuiltin = mercury_private_builtin_module
),
- goal_util.generate_simple_call(MercuryBuiltin, Name, predicate,
- mode_no(0), erroneous, ArgVars, [], [], ModuleInfo, Context, Goal).
+ goal_util.generate_simple_call(MercuryBuiltin, Name, predicate, mode_no(0),
+ detism_erroneous, ArgVars, [], [], ModuleInfo, Context, Goal).
:- pred build_specific_call(mer_type::in, special_pred_id::in,
list(prog_var)::in, instmap_delta::in, determinism::in,
Index: compiler/unneeded_code.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/unneeded_code.m,v
retrieving revision 1.32
diff -u -r1.32 unneeded_code.m
--- compiler/unneeded_code.m 29 Mar 2006 08:07:29 -0000 1.32
+++ compiler/unneeded_code.m 7 Jul 2006 06:25:41 -0000
@@ -490,14 +490,14 @@
:- pred detism_is_moveable(determinism::in, bool::out) is det.
-detism_is_moveable(det, yes).
-detism_is_moveable(semidet, no).
-detism_is_moveable(nondet, no).
-detism_is_moveable(multidet, yes).
-detism_is_moveable(erroneous, no).
-detism_is_moveable(failure, no).
-detism_is_moveable(cc_nondet, no).
-detism_is_moveable(cc_multidet, yes).
+detism_is_moveable(detism_det, yes).
+detism_is_moveable(detism_semi, no).
+detism_is_moveable(detism_non, no).
+detism_is_moveable(detism_multi, yes).
+detism_is_moveable(detism_erroneous, no).
+detism_is_moveable(detism_failure, no).
+detism_is_moveable(detism_cc_non, no).
+detism_is_moveable(detism_cc_multi, yes).
%---------------------------------------------------------------------------%
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing debian/patches
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/gator
cvs diff: Diffing extras/gator/generations
cvs diff: Diffing extras/gator/generations/1
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/solver_types
cvs diff: Diffing extras/solver_types/library
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/windows_installer_generator
cvs diff: Diffing extras/windows_installer_generator/sample
cvs diff: Diffing extras/windows_installer_generator/sample/images
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing mdbcomp
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing slice
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
Index: tests/invalid/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/invalid/Mmakefile,v
retrieving revision 1.194
diff -u -r1.194 Mmakefile
--- tests/invalid/Mmakefile 10 Jul 2006 04:40:56 -0000 1.194
+++ tests/invalid/Mmakefile 11 Jul 2006 05:16:34 -0000
@@ -32,8 +32,8 @@
any_mode \
any_passed_as_ground \
any_should_not_match_bound \
- anys_in_negated_contexts \
any_to_ground_in_ite_cond \
+ anys_in_negated_contexts \
assert_in_interface \
bad_finalise_decl \
bad_initialise_decl \
@@ -75,10 +75,10 @@
errors2 \
exist_foreign_error \
exported_mode \
- external \
- extra_info_prompt \
ext_type \
ext_type_bug \
+ external \
+ extra_info_prompt \
field_syntax_error \
foreign_purity_mismatch \
foreign_singleton \
@@ -89,6 +89,7 @@
funcs_as_preds \
fundeps_unbound_in_ctor \
fundeps_vars \
+ hawkins_mm_fail_reset \
ho_default_func_1 \
ho_default_func_3 \
ho_type_mode_bug \
@@ -97,8 +98,8 @@
impure_method_impl \
inconsistent_instances \
inline_conflict \
- instance_bug \
inst_list_dup \
+ instance_bug \
invalid_export_detism \
invalid_import_detism \
invalid_main \
@@ -161,6 +162,11 @@
tc_err1 \
tc_err2 \
tricky_assert1 \
+ type_inf_loop \
+ type_loop \
+ type_mismatch \
+ type_vars \
+ type_with_no_defn \
typeclass_bogus_method \
typeclass_constraint_extra_var \
typeclass_missing_det \
@@ -183,12 +189,7 @@
typeclass_test_7 \
typeclass_test_8 \
typeclass_test_9 \
- type_inf_loop \
- type_loop \
- type_mismatch \
types \
- type_vars \
- type_with_no_defn \
unbound_type_vars \
undeclared_mode \
undef_inst \
Index: tests/invalid/hawkins_mm_fail_reset.err_exp
===================================================================
RCS file: tests/invalid/hawkins_mm_fail_reset.err_exp
diff -N tests/invalid/hawkins_mm_fail_reset.err_exp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/invalid/hawkins_mm_fail_reset.err_exp 8 Jul 2006 07:27:05 -0000
@@ -0,0 +1,13 @@
+hawkins_mm_fail_reset.m:027: Error: `pragma memo' declaration not allowed for
+hawkins_mm_fail_reset.m:027: procedure with determinism `failure'.
+hawkins_mm_fail_reset.m:036: Error: `pragma memo' declaration not allowed for
+hawkins_mm_fail_reset.m:036: procedure with determinism `failure'.
+hawkins_mm_fail_reset.m:020: In `entry(out)':
+hawkins_mm_fail_reset.m:020: warning: determinism declaration could be
+hawkins_mm_fail_reset.m:020: tighter.
+hawkins_mm_fail_reset.m:020: Declared `nondet', inferred `failure'.
+hawkins_mm_fail_reset.m:030: Warning: this disjunct will never have any
+hawkins_mm_fail_reset.m:030: solutions.
+hawkins_mm_fail_reset.m:033: Warning: this disjunct will never have any
+hawkins_mm_fail_reset.m:033: solutions.
+For more information, recompile with `-E'.
Index: tests/invalid/hawkins_mm_fail_reset.m
===================================================================
RCS file: tests/invalid/hawkins_mm_fail_reset.m
diff -N tests/invalid/hawkins_mm_fail_reset.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/invalid/hawkins_mm_fail_reset.m 7 Jul 2006 04:48:05 -0000
@@ -0,0 +1,40 @@
+% $ mmc --make foo --grade reg.mmsc.gc --no-warn-singleton-variables
+% Making Mercury/int3s/foo.int3
+% Making Mercury/cs/foo.c
+% Uncaught Mercury exception:
+% Software Error: map.lookup: key not found
+% Key Type: term.var(parse_tree.prog_data.prog_var_type)
+% Key Value: var(5)
+% Value Type: ll_backend.var_locn.var_state
+% Stack dump not available in this grade.
+% foo.m:003: In `entry(out)':
+% foo.m:003: warning: determinism declaration could be tighter.
+% foo.m:003: Declared `nondet', inferred `failure'.
+% foo.m:014: Warning: this disjunct will never have any solutions.
+% foo.m:017: Warning: this disjunct will never have any solutions.
+% ** Error making `Mercury/cs/foo.c'.
+
+:- module hawkins_mm_fail_reset.
+:- interface.
+
+:- pred entry(int::out) is nondet.
+
+:- implementation.
+:- import_module int.
+
+entry(0) :- pred1(_).
+
+:- pred pred1(int::out).
+:- pragma minimal_model(pred1/1, [allow_reset]).
+
+pred1(2) :-
+ pred2(_P).
+
+pred1(1) :-
+ pred2(_P).
+
+:- pred pred2(int::out).
+:- pragma minimal_model(pred2/1, [allow_reset]).
+
+pred2(_) :-
+ fail.
Index: tests/invalid/loopcheck.err_exp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/invalid/loopcheck.err_exp,v
retrieving revision 1.3
diff -u -r1.3 loopcheck.err_exp
--- tests/invalid/loopcheck.err_exp 14 Jun 2006 08:14:54 -0000 1.3
+++ tests/invalid/loopcheck.err_exp 8 Jul 2006 09:03:48 -0000
@@ -4,8 +4,8 @@
loopcheck.m:016: Error: `pragma loop_check' declaration not allowed for
loopcheck.m:016: procedure with determinism `erroneous'.
loopcheck.m:016: The pragma requested is only valid for the following
-loopcheck.m:016: determinism(s): det, semidet, nondet, multi, cc_nondet and
-loopcheck.m:016: cc_multi
+loopcheck.m:016: determinism(s): cc_multi, cc_nondet, det, multi, nondet and
+loopcheck.m:016: semidet.
loopcheck.m:017: Warning: recursive call will lead to infinite recursion. If
loopcheck.m:017: this recursive call is executed, the procedure will call
loopcheck.m:017: itself with exactly the same input arguments, leading to
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/par_conj
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/trailing
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at csse.unimelb.edu.au
administrative address: owner-mercury-reviews at csse.unimelb.edu.au
unsubscribe: Address: mercury-reviews-request at csse.unimelb.edu.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at csse.unimelb.edu.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list