Do some work on this. It still doesn't compile, let

followvars.nl:
	Do some work on this.  It still doesn't compile, let
	alone work.

mode_info.nl:
	Fix bug in last change.

hlds_out.nl:
	A couple of very minor fixes.

switch_detection.nl:
	Fix a bug so that 2nd-argument indexing works.
This commit is contained in:
Fergus Henderson
1994-06-09 16:06:18 +00:00
parent 59dcd8f161
commit 075391d03a
3 changed files with 36 additions and 40 deletions

View File

@@ -230,7 +230,8 @@ hlds_out__write_pred(Indent, PredId, PredInfo) -->
{ ClausesInfo = clauses_info(VarSet, VarTypes, HeadVars, Clauses) },
hlds_out__write_var_types(Indent, VarSet, VarTypes, TVarSet),
hlds_out__write_clauses(Indent, PredId, VarSet, HeadVars, Clauses),
hlds_out__write_procs(Indent, PredId, Imported, ProcTable).
hlds_out__write_procs(Indent, PredId, Imported, ProcTable),
io__write_string("\n").
:- pred hlds_out__write_clauses(int, pred_id, varset, list(var), list(clause),
io__state, io__state).
@@ -571,24 +572,21 @@ hlds_out__write_var_types_2([Var | Vars], Indent, VarSet, VarTypes, TypeVarSet)
hlds_out__write_types(Indent, _X) -->
hlds_out__write_indent(Indent),
% XXX
io__write_string("\n").
io__write_string("% types (sorry, output of types not implemented)\n").
:- pred hlds_out__write_insts(int, inst_table, io__state, io__state).
:- mode hlds_out__write_insts(in, in, in, out).
hlds_out__write_insts(Indent, _X) -->
hlds_out__write_indent(Indent),
% XXX
io__write_string("\n").
io__write_string("% insts (sorry, output of insts not implemented)\n").
:- pred hlds_out__write_modes(int, mode_table, io__state, io__state).
:- mode hlds_out__write_modes(in, in, in, out).
hlds_out__write_modes(Indent, _X) -->
hlds_out__write_indent(Indent),
% XXX
io__write_string("\n").
io__write_string("% modes (sorry, output of modes not implemented)\n").
:- pred hlds_out__write_mode_list(int, list(mode), io__state, io__state).
:- mode hlds_out__write_mode_list(in, in, in, out).

View File

@@ -163,6 +163,35 @@
:- pred mode_info_set_delay_info(delay_info, mode_info, mode_info).
:- mode mode_info_set_delay_info(in, mode_info_di, mode_info_uo) is det.
:- inst uniq_mode_info = bound_unique(
mode_info(
ground_unique, ground,
ground, ground, ground, ground,
ground, ground, ground, ground,
ground
)
).
:- mode mode_info_uo :: free -> uniq_mode_info.
:- mode mode_info_ui :: uniq_mode_info -> uniq_mode_info.
:- mode mode_info_di :: uniq_mode_info -> dead.
% Some fiddly modes used when we want to extract
% the io_state from a mode_info struct and then put it back again.
:- inst mode_info_no_io = bound_unique(
mode_info(
dead, ground,
ground, ground, ground, ground,
ground, ground, ground, ground,
ground
)
).
:- mode mode_info_get_io_state :: uniq_mode_info -> mode_info_no_io.
:- mode mode_info_no_io :: mode_info_no_io -> mode_info_no_io.
:- mode mode_info_set_io_state :: mode_info_no_io -> dead.
%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%
@@ -195,35 +224,6 @@
% the io_state and the struct itself unique, but with
% multiple references allowed for the other parts.
:- inst uniq_mode_info = bound_unique(
mode_info(
ground_unique, ground,
ground, ground, ground, ground,
ground, ground, ground, ground,
ground
)
).
:- mode mode_info_uo :: free -> uniq_mode_info.
:- mode mode_info_ui :: uniq_mode_info -> uniq_mode_info.
:- mode mode_info_di :: uniq_mode_info -> dead.
% Some fiddly modes used when we want to extract
% the io_state from a mode_info struct and then put it back again.
:- inst mode_info_no_io = bound_unique(
mode_info(
dead, ground,
ground, ground, ground, ground,
ground, ground, ground, ground,
ground
)
).
:- mode mode_info_get_io_state :: uniq_mode_info -> mode_info_no_io.
:- mode mode_info_no_io :: mode_info_no_io -> mode_info_no_io.
:- mode mode_info_set_io_state :: mode_info_no_io -> dead.
%-----------------------------------------------------------------------------%
% Initialize the mode_info

View File

@@ -219,14 +219,12 @@ partition_disj_2([Goal | Goals], Var, Cases0, Cases) :-
:- mode find_unify_var_functor(in, in, out) is semidet.
find_unify_var_functor([Goal - _GoalInfo | Goals], Var, Functor) :-
( Goal = unify(term__variable(Var0), term__functor(Name, Args, _),
( Goal = unify(term__variable(Var), term__functor(Name, Args, _),
_, _, _) ->
Var = Var0,
list__length(Args, Arity),
make_functor_cons_id(Name, Arity, Functor)
; Goal = unify(term__functor(Name, Args, _), term__variable(Var0),
; Goal = unify(term__functor(Name, Args, _), term__variable(Var),
_, _, _) ->
Var = Var0,
list__length(Args, Arity),
make_functor_cons_id(Name, Arity, Functor)
; Goal = unify(_, _, _, _, _) ->