[m-rev.] for review: trace builtin and private_builtin
Ian MacLarty
maclarty at cs.mu.OZ.AU
Tue Dec 6 21:37:48 AEDT 2005
For review by anyone.
Estiamted hours taken: 4
Branches: main
Trace builtin and private_builtin (with the exception of external predicates
and those that are polymorhphic, but have no extra type_info arguments).
This allows subterms to be traced through calls to predicates in builtin
and private_builtin and fixes an assertion failure in the declarative debugger
that was triggered when an untraced builtin called a traced predicate
(the debugger would then think the events from the traced predicate were
child events of the parent of the untraced predicate, which would cause the
assertion failure).
compiler/code_gen.m:
compiler/hlds_pred.m:
compiler/mercury_compile.m:
compiler/ml_code_util.m:
compiler/polymorphism.m:
compiler/stack_layout.m:
compiler/term_constr_initial.m:
mdbcomp/prim_data.m:
mdbcomp/program_representation.m:
Move no_type_info_builtin from compiler/hlds_pred.m to
mdbcomp/program_representation.m, so that the debugger can call it
to see what builtin polymorphic predicates do not have extra type_info
arguments.
Define pred_is_external to be true for predicates defined with
:- external. The debugger needs to know not to expect any events for
such predicates.
Trace the builtin and private_builtin modules.
tests/debugger/loopcheck.exp3:
tests/debugger/uci.exp2:
tests/debugger/uci_index.exp:
Changes to expected output due to the fact that builtins are now
traced.
tests/debugger/declarative/Mmakefile:
tests/debugger/declarative/typed_unify.exp:
tests/debugger/declarative/typed_unify.inp:
tests/debugger/declarative/typed_unify.m:
Test tracking of a subterm through a builtin.
Index: browser/declarative_tree.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/declarative_tree.m,v
retrieving revision 1.34
diff -u -r1.34 declarative_tree.m
--- browser/declarative_tree.m 4 Nov 2005 07:27:23 -0000 1.34
+++ browser/declarative_tree.m 28 Nov 2005 20:43:24 -0000
@@ -1525,7 +1525,6 @@
;
Contour = [],
(
- AllTraced = no,
MaybeEnd = no
->
Primitive = primitive(File, Line, BoundVars,
Index: compiler/code_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/code_gen.m,v
retrieving revision 1.145
diff -u -r1.145 code_gen.m
--- compiler/code_gen.m 28 Oct 2005 02:09:59 -0000 1.145
+++ compiler/code_gen.m 28 Nov 2005 18:40:52 -0000
@@ -101,6 +101,7 @@
:- import_module ll_backend.trace.
:- import_module ll_backend.unify_gen.
:- import_module mdbcomp.prim_data.
+:- import_module mdbcomp.program_representation.
:- import_module parse_tree.prog_data.
:- import_module parse_tree.prog_out.
:- import_module parse_tree.prog_util.
Index: compiler/hlds_pred.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_pred.m,v
retrieving revision 1.185
diff -u -r1.185 hlds_pred.m
--- compiler/hlds_pred.m 4 Nov 2005 03:40:47 -0000 1.185
+++ compiler/hlds_pred.m 28 Nov 2005 18:14:02 -0000
@@ -2766,21 +2766,6 @@
:- pred non_special_body_should_use_typeinfo_liveness(globals::in,
bool::out) is det.
- % Some predicates that operate on polymorphic values do not need
- % the type_infos describing the types bound to the variables.
- % It is of course faster not to pass type_infos to such predicates
- % (especially since may also be able to avoid constructing those
- % type_infos), and it can also be easier for a compiler module
- % (e.g. common.m, size_prof.m) that generates calls to such predicates
- % not to have to create those type_infos.
- %
- % All the predicates for whose names no_type_info_builtin succeeds
- % are defined by compiler implementors. They are all predicates
- % implemented by foreign language code in the standard library.
- % For some, but not all, the compiler generates code inline.
- %
-:- pred no_type_info_builtin(module_name::in, string::in, int::in) is semidet.
-
% If the procedure has a input/output pair of io__state arguments,
% return the positions of those arguments in the argument list.
% The positions are given as argument numbers, with the first argument
@@ -2827,7 +2812,9 @@
is semidet.
:- implementation.
+
:- import_module check_hlds.mode_errors.
+:- import_module mdbcomp.program_representation.
:- type proc_info --->
proc_info(
@@ -3374,48 +3361,6 @@
globals__lookup_bool_option(Globals, body_typeinfo_liveness,
BodyTypeInfoLiveness).
-no_type_info_builtin(ModuleName, PredName, Arity) :-
- no_type_info_builtin_2(ModuleNameType, PredName, Arity),
- (
- ModuleNameType = builtin,
- mercury_public_builtin_module(ModuleName)
- ;
- ModuleNameType = private_builtin,
- mercury_private_builtin_module(ModuleName)
- ;
- ModuleNameType = table_builtin,
- mercury_table_builtin_module(ModuleName)
- ;
- ModuleNameType = term_size_prof_builtin,
- mercury_term_size_prof_builtin_module(ModuleName)
- ).
-
-:- type builtin_mod
- ---> builtin
- ; private_builtin
- ; table_builtin
- ; term_size_prof_builtin.
-
-:- pred no_type_info_builtin_2(builtin_mod::out, string::in, int::in)
- is semidet.
-
-no_type_info_builtin_2(private_builtin, "store_at_ref", 2).
-no_type_info_builtin_2(private_builtin, "unsafe_type_cast", 2).
-no_type_info_builtin_2(builtin, "unsafe_promise_unique", 2).
-no_type_info_builtin_2(private_builtin,
- "superclass_from_typeclass_info", 3).
-no_type_info_builtin_2(private_builtin,
- "instance_constraint_from_typeclass_info", 3).
-no_type_info_builtin_2(private_builtin,
- "type_info_from_typeclass_info", 3).
-no_type_info_builtin_2(private_builtin,
- "unconstrained_type_info_from_typeclass_info", 3).
-no_type_info_builtin_2(table_builtin, "table_restore_any_answer", 3).
-no_type_info_builtin_2(table_builtin, "table_lookup_insert_enum", 4).
-no_type_info_builtin_2(table_builtin, "table_lookup_insert_typeinfo", 3).
-no_type_info_builtin_2(table_builtin, "table_lookup_insert_typeclassinfo", 3).
-no_type_info_builtin_2(term_size_prof_builtin, "increment_size", 2).
-
proc_info_has_io_state_pair(ModuleInfo, ProcInfo, InArgNum, OutArgNum) :-
proc_info_headvars(ProcInfo, HeadVars),
proc_info_argmodes(ProcInfo, ArgModes),
Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.360
diff -u -r1.360 mercury_compile.m
--- compiler/mercury_compile.m 12 Nov 2005 10:16:47 -0000 1.360
+++ compiler/mercury_compile.m 28 Nov 2005 18:53:12 -0000
@@ -152,6 +152,7 @@
:- import_module make.options_file.
:- import_module make.util.
:- import_module mdbcomp.prim_data.
+:- import_module mdbcomp.program_representation.
:- import_module parse_tree.error_util.
:- import_module parse_tree.mercury_to_mercury.
:- import_module parse_tree.prog_data.
@@ -1151,7 +1152,7 @@
globals.io_lookup_bool_option(trace_prof, TraceProf, !IO),
(
- any_mercury_builtin_module(ModuleName),
+ non_traced_mercury_builtin_module(ModuleName),
not (
mercury_profiling_builtin_module(ModuleName),
TraceProf = yes
Index: compiler/ml_code_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_code_util.m,v
retrieving revision 1.101
diff -u -r1.101 ml_code_util.m
--- compiler/ml_code_util.m 4 Nov 2005 03:40:50 -0000 1.101
+++ compiler/ml_code_util.m 28 Nov 2005 18:49:59 -0000
@@ -740,6 +740,7 @@
:- import_module libs.compiler_util.
:- import_module libs.globals.
:- import_module libs.options.
+:- import_module mdbcomp.program_representation.
:- import_module ml_backend.ml_call_gen.
:- import_module ml_backend.ml_code_gen.
:- import_module parse_tree.prog_data.
Index: compiler/polymorphism.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/polymorphism.m,v
retrieving revision 1.284
diff -u -r1.284 polymorphism.m
--- compiler/polymorphism.m 4 Nov 2005 03:40:53 -0000 1.284
+++ compiler/polymorphism.m 28 Nov 2005 18:38:38 -0000
@@ -387,6 +387,7 @@
:- import_module libs.globals.
:- import_module libs.options.
:- import_module mdbcomp.prim_data.
+:- import_module mdbcomp.program_representation.
:- import_module parse_tree.prog_io.
:- import_module parse_tree.prog_mode.
:- import_module parse_tree.prog_out.
Index: compiler/stack_layout.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/stack_layout.m,v
retrieving revision 1.109
diff -u -r1.109 stack_layout.m
--- compiler/stack_layout.m 28 Oct 2005 02:10:36 -0000 1.109
+++ compiler/stack_layout.m 28 Nov 2005 18:48:19 -0000
@@ -87,6 +87,7 @@
:- import_module ll_backend.llds_out.
:- import_module ll_backend.prog_rep.
:- import_module ll_backend.trace.
+:- import_module mdbcomp.program_representation.
:- import_module parse_tree.prog_out.
:- import_module parse_tree.prog_util.
@@ -421,8 +422,9 @@
).
:- pred find_valid_return_context(
- assoc_list(code_addr, pair(prog_context, goal_path))::in,
- code_addr::out, prog_context::out, goal_path::out) is semidet.
+ assoc_list(code_addr, pair(prog_context, hlds.hlds_goal.goal_path))::in,
+ code_addr::out, prog_context::out, hlds.hlds_goal.goal_path::out)
+ is semidet.
find_valid_return_context([TargetContext | TargetContexts],
ValidTarget, ValidContext, ValidGoalPath) :-
Index: compiler/term_constr_initial.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/term_constr_initial.m,v
retrieving revision 1.7
diff -u -r1.7 term_constr_initial.m
--- compiler/term_constr_initial.m 28 Oct 2005 02:10:38 -0000 1.7
+++ compiler/term_constr_initial.m 28 Nov 2005 18:55:05 -0000
@@ -70,6 +70,7 @@
:- import_module libs.polyhedron.
:- import_module libs.rat.
:- import_module mdbcomp.prim_data.
+:- import_module mdbcomp.program_representation.
:- import_module parse_tree.mercury_to_mercury.
:- import_module parse_tree.modules.
:- import_module parse_tree.prog_data.
@@ -516,7 +517,7 @@
PredArity = pred_info_orig_arity(PredInfo),
make_size_var_map(HeadVars, _SizeVarset, SizeVarMap),
(
- hlds_pred.no_type_info_builtin(PredModule, PredName, PredArity)
+ no_type_info_builtin(PredModule, PredName, PredArity)
->
Constrs = process_no_type_info_builtin(PredName, HeadVars,
SizeVarMap)
Index: mdbcomp/prim_data.m
===================================================================
RCS file: /home/mercury1/repository/mercury/mdbcomp/prim_data.m,v
retrieving revision 1.7
diff -u -r1.7 prim_data.m
--- mdbcomp/prim_data.m 5 Oct 2005 06:34:16 -0000 1.7
+++ mdbcomp/prim_data.m 27 Nov 2005 18:04:17 -0000
@@ -223,6 +223,10 @@
%
:- pred any_mercury_builtin_module(sym_name::in) is semidet.
+ % Succeeds iff the specified module will never be traced.
+ %
+:- pred non_traced_mercury_builtin_module(sym_name::in) is semidet.
+
%-----------------------------------------------------------------------------%
:- implementation.
@@ -316,3 +320,10 @@
; mercury_term_size_prof_builtin_module(Module)
; aditi_private_builtin_module(Module)
).
+
+non_traced_mercury_builtin_module(Module) :-
+ ( mercury_table_builtin_module(Module)
+ ; mercury_profiling_builtin_module(Module)
+ ; mercury_term_size_prof_builtin_module(Module)
+ ; aditi_private_builtin_module(Module)
+ ).
Index: mdbcomp/program_representation.m
===================================================================
RCS file: /home/mercury1/repository/mercury/mdbcomp/program_representation.m,v
retrieving revision 1.9
diff -u -r1.9 program_representation.m
--- mdbcomp/program_representation.m 19 Oct 2005 05:39:08 -0000 1.9
+++ mdbcomp/program_representation.m 5 Dec 2005 18:23:02 -0000
@@ -35,7 +35,12 @@
:- interface.
-:- import_module char, list, std_util, bool.
+:- import_module mdbcomp.prim_data.
+
+:- import_module bool.
+:- import_module char.
+:- import_module list.
+:- import_module std_util.
% A representation of the goal we execute. These need to be generated
% statically and stored inside the executable.
@@ -177,11 +182,12 @@
%
:- func goal_generates_internal_event(goal_rep) = bool.
- % call_is_primitive(ModuleName, PredName): succeeds iff a call to the
- % named predicate behaves like a primitive operation, in the sense that
- % it does not generate events.
+ % call_does_not_generate_events(ModuleName, PredName, Arity): succeeds iff
+ % a call to the named predicate will not generate events in a debugging
+ % grade.
%
-:- pred call_is_primitive(string::in, string::in) is semidet.
+:- pred call_does_not_generate_events(string::in, string::in, int::in)
+ is semidet.
% The atomic goal's module, name and arity.
:- type atomic_goal_id
@@ -315,6 +321,21 @@
:- mode var_num_rep_byte(in, out) is det.
:- mode var_num_rep_byte(out, in) is semidet.
+ % Some predicates that operate on polymorphic values do not need
+ % the type_infos describing the types bound to the variables.
+ % It is of course faster not to pass type_infos to such predicates
+ % (especially since may also be able to avoid constructing those
+ % type_infos), and it can also be easier for a compiler module
+ % (e.g. common.m, size_prof.m) that generates calls to such predicates
+ % not to have to create those type_infos.
+ %
+ % All the predicates for whose names no_type_info_builtin succeeds
+ % are defined by compiler implementors. They are all predicates
+ % implemented by foreign language code in the standard library.
+ % For some, but not all, the compiler generates code inline.
+ %
+:- pred no_type_info_builtin(module_name::in, string::in, int::in) is semidet.
+
%-----------------------------------------------------------------------------%
:- implementation.
@@ -323,8 +344,6 @@
:- import_module require.
:- import_module string.
-:- import_module mdbcomp.prim_data.
-
atomic_goal_generates_event(unify_construct_rep(_, _, _)) = no.
atomic_goal_generates_event(unify_deconstruct_rep(_, _, _)) = no.
atomic_goal_generates_event(partial_construct_rep(_, _, _)) = no.
@@ -337,21 +356,26 @@
atomic_goal_generates_event(method_call_rep(_, _, Args)) = yes(Args).
atomic_goal_generates_event(builtin_call_rep(_, _, _)) = no.
atomic_goal_generates_event(plain_call_rep(ModuleName, PredName, Args)) =
- ( call_is_primitive(ModuleName, PredName) ->
- % These calls behave as primitives and do not generate events.
+ ( call_does_not_generate_events(ModuleName, PredName, list.length(Args)) ->
no
;
yes(Args)
).
-call_is_primitive(ModuleName, PredName) :-
+call_does_not_generate_events(ModuleName, PredName, Arity) :-
(
string_to_sym_name(ModuleName, ".", SymModuleName),
- any_mercury_builtin_module(SymModuleName)
+ non_traced_mercury_builtin_module(SymModuleName)
+ ;
+ % The debugger cannot handle calls to polymorphic builtins that
+ % do not take a type_info argument, so such calls are not traced.
+ string_to_sym_name(ModuleName, ".", SymModuleName),
+ no_type_info_builtin(SymModuleName, PredName, Arity)
+ ;
+ pred_is_external(ModuleName, PredName, Arity)
;
- % The following are also treated as primitive since events from
- % compiler generated predicates are not included in the annotated trace
- % at the moment.
+ % Events from compiler generated predicates are not included in the
+ % annotated trace at the moment.
(
PredName = "__Unify__"
;
@@ -503,3 +527,59 @@
var_num_rep_byte(short, 1).
%-----------------------------------------------------------------------------%
+
+no_type_info_builtin(ModuleName, PredName, Arity) :-
+ no_type_info_builtin_2(ModuleNameType, PredName, Arity),
+ (
+ ModuleNameType = builtin,
+ mercury_public_builtin_module(ModuleName)
+ ;
+ ModuleNameType = private_builtin,
+ mercury_private_builtin_module(ModuleName)
+ ;
+ ModuleNameType = table_builtin,
+ mercury_table_builtin_module(ModuleName)
+ ;
+ ModuleNameType = term_size_prof_builtin,
+ mercury_term_size_prof_builtin_module(ModuleName)
+ ).
+
+:- type builtin_mod
+ ---> builtin
+ ; private_builtin
+ ; table_builtin
+ ; term_size_prof_builtin.
+
+:- pred no_type_info_builtin_2(builtin_mod::out, string::in, int::in)
+ is semidet.
+
+no_type_info_builtin_2(private_builtin, "store_at_ref", 2).
+no_type_info_builtin_2(private_builtin, "unsafe_type_cast", 2).
+no_type_info_builtin_2(builtin, "unsafe_promise_unique", 2).
+no_type_info_builtin_2(private_builtin,
+ "superclass_from_typeclass_info", 3).
+no_type_info_builtin_2(private_builtin,
+ "instance_constraint_from_typeclass_info", 3).
+no_type_info_builtin_2(private_builtin,
+ "type_info_from_typeclass_info", 3).
+no_type_info_builtin_2(private_builtin,
+ "unconstrained_type_info_from_typeclass_info", 3).
+no_type_info_builtin_2(table_builtin, "table_restore_any_answer", 3).
+no_type_info_builtin_2(table_builtin, "table_lookup_insert_enum", 4).
+no_type_info_builtin_2(table_builtin, "table_lookup_insert_typeinfo", 3).
+no_type_info_builtin_2(table_builtin, "table_lookup_insert_typeclassinfo", 3).
+no_type_info_builtin_2(term_size_prof_builtin, "increment_size", 2).
+
+ % True iff the given predicate is defined with an :- external
+ % declaration. Note that the arity includes the hidden type info
+ % arguments for polymorphic predicates.
+ %
+:- pred pred_is_external(string::in, string::in, int::in) is semidet.
+
+pred_is_external("exception", "builtin_catch", 4).
+pred_is_external("exception", "builtin_throw", 1).
+pred_is_external("builtin", "unify", 3).
+pred_is_external("builtin", "compare", 4).
+pred_is_external("builtin", "compare_representation", 4).
+
+%-----------------------------------------------------------------------------%
Index: tests/debugger/loopcheck.exp3
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/loopcheck.exp3,v
retrieving revision 1.3
diff -u -r1.3 loopcheck.exp3
--- tests/debugger/loopcheck.exp3 1 Apr 2005 02:09:39 -0000 1.3
+++ tests/debugger/loopcheck.exp3 29 Nov 2005 07:14:00 -0000
@@ -22,5 +22,5 @@
mdb> continue
Uncaught Mercury exception:
Software Error: detected infinite recursion in pred loopcheck.loop/1
-Last trace event was event #312.
+Last trace event was event #314.
Last trace event before the unhandled exception was event #8.
Index: tests/debugger/uci.exp2
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/uci.exp2,v
retrieving revision 1.1
diff -u -r1.1 uci.exp2
--- tests/debugger/uci.exp2 30 Mar 2005 00:54:49 -0000 1.1
+++ tests/debugger/uci.exp2 5 Dec 2005 18:58:55 -0000
@@ -63,7 +63,7 @@
mdb> print goal
__Compare__(_, ai(1), bi(11))
mdb> c
- 99: 40 3 EXIT __Compare__ for uci.i/3-0 (det)
+ 101: 40 3 EXIT __Compare__ for uci.i/3-0 (det)
mdb> print goal
__Compare__('<', ai(1), bi(11))
mdb> c
Index: tests/debugger/uci_index.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/uci_index.exp,v
retrieving revision 1.1
diff -u -r1.1 uci_index.exp
--- tests/debugger/uci_index.exp 6 Dec 2004 01:32:48 -0000 1.1
+++ tests/debugger/uci_index.exp 5 Dec 2005 18:59:47 -0000
@@ -14,5 +14,5 @@
mdb> step
6: 4 2 CALL __Compare__ for uci_index.i/0-0 (det)
mdb> step
- 7: 4 2 EXIT __Compare__ for uci_index.i/0-0 (det)
+ 7: 5 3 CALL pred private_builtin.builtin_int_lt/2-0 (semidet)
mdb> quit -y
Index: tests/debugger/declarative/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/Mmakefile,v
retrieving revision 1.85
diff -u -r1.85 Mmakefile
--- tests/debugger/declarative/Mmakefile 2 Nov 2005 14:17:37 -0000 1.85
+++ tests/debugger/declarative/Mmakefile 13 Nov 2005 05:18:10 -0000
@@ -84,7 +84,8 @@
DECLDEBUG_DECLARATIVE_PROGS= \
builtin_call_rep \
sort \
- priv_builtin_bug
+ priv_builtin_bug \
+ typed_unify
# The following should not be run in decldebug grades.
#
@@ -425,6 +426,11 @@
priv_builtin_bug.out 2>&1 \
|| { grep . $@ /dev/null; exit 1; }
+typed_unify.out: typed_unify typed_unify.inp
+ $(MDB_STD) ./typed_unify < typed_unify.inp > \
+ typed_unify.out 2>&1 \
+ || { grep . $@ /dev/null; exit 1; }
+
propositional.out: propositional propositional.inp
$(MDB_STD) ./propositional < propositional.inp > \
propositional.out 2>&1 || { grep . $@ /dev/null; exit 1; }
Index: tests/debugger/declarative/typed_unify.exp
===================================================================
RCS file: tests/debugger/declarative/typed_unify.exp
diff -N tests/debugger/declarative/typed_unify.exp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/debugger/declarative/typed_unify.exp 28 Nov 2005 20:47:29 -0000
@@ -0,0 +1,32 @@
+ E1: C1 CALL pred typed_unify.main/2-0 (det) typed_unify.m:13
+mdb> mdb> echo on
+Command echo enabled.
+mdb> table_io start
+I/O tabling started.
+mdb> step
+ E2: C2 CALL func std_util.univ/1-1 (det) std_util.m:1652 (typed_unify.m:14)
+mdb> finish
+ E3: C2 EXIT func std_util.univ/1-1 (det) std_util.m:1652 (typed_unify.m:14)
+mdb> step
+ E4: C1 COND pred typed_unify.main/2-0 (det) c4;?; typed_unify.m:15
+mdb> step
+ E5: C3 CALL pred std_util.type_to_univ/2-2 (semidet) std_util.m:1676 (typed_unify.m:15)
+mdb> finish
+ E6: C3 EXIT pred std_util.type_to_univ/2-2 (semidet) std_util.m:1676 (typed_unify.m:15)
+mdb> untrust 0
+mdb> dd
+type_to_univ(1, univ_cons(1))
+Valid? b 1
+browser> track -a
+1
+type_to_univ(_, univ_cons(1))
+Valid? info
+Context of current question : std_util.m:1670 (std_util.m:1652)
+Search mode : top down
+The current question was chosen because the marked subterm was bound by
+the untraced call inside the predicate std_util.type_to_univ/2
+(std_util.m:1672). The path to the subterm in the atom is 2/2.
+dd> quit
+Diagnosis aborted.
+ E6: C3 EXIT pred std_util.type_to_univ/2-2 (semidet) std_util.m:1676 (typed_unify.m:15)
+mdb> quit -y
Index: tests/debugger/declarative/typed_unify.inp
===================================================================
RCS file: tests/debugger/declarative/typed_unify.inp
diff -N tests/debugger/declarative/typed_unify.inp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/debugger/declarative/typed_unify.inp 17 Nov 2005 09:35:53 -0000
@@ -0,0 +1,15 @@
+register --quiet
+echo on
+table_io start
+step
+finish
+step
+step
+finish
+untrust 0
+dd
+b 1
+track -a
+info
+quit
+quit -y
Index: tests/debugger/declarative/typed_unify.m
===================================================================
RCS file: tests/debugger/declarative/typed_unify.m
diff -N tests/debugger/declarative/typed_unify.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/debugger/declarative/typed_unify.m 16 Nov 2005 02:55:29 -0000
@@ -0,0 +1,20 @@
+:- module typed_unify.
+
+:- interface.
+
+:- import_module io.
+
+:- pred main(io::di, io::uo) is det.
+
+:- implementation.
+
+:- import_module std_util.
+
+main(!IO) :-
+ U = univ(1),
+ ( type_to_univ(I, U) ->
+ io.write_int(I, !IO)
+ ;
+ true
+ ),
+ nl(!IO).
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list