Files
mercury/compiler/inst.m
Fergus Henderson 73131e8df3 Undo Zoltan's bogus update of all the copyright dates.
Estimated hours taken: 0.75

library/*.m:
compiler/*.m:
	Undo Zoltan's bogus update of all the copyright dates.
	The dates in the copyright header should reflect the years
	in which the file was modified (and no, changes to the
	copyright header itself don't count as modifications).
1998-01-23 12:57:08 +00:00

91 lines
3.0 KiB
Mathematica

%-----------------------------------------------------------------------------%
% Copyright (C) 1997 The University of Melbourne.
% This file may only be copied under the terms of the GNU General
% Public License - see the file COPYING in the Mercury distribution.
%-----------------------------------------------------------------------------%
%
% inst.m - Contains the (inst) data type.
% Main author: bromage
%
%-----------------------------------------------------------------------------%
:- module (inst).
:- interface.
:- import_module prog_data, hlds_data, hlds_pred.
:- import_module list, std_util, term.
%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%
:- type (inst)
---> any(uniqueness)
; free
; free(type)
; bound(uniqueness, list(bound_inst))
% The list(bound_inst) must be sorted
; ground(uniqueness, maybe(pred_inst_info))
% The pred_inst_info is used for
% higher-order pred modes
; not_reached
; inst_var(var)
% A defined_inst is possibly recursive
% inst whose value is stored in the
% inst_table. This is used both for
% user-defined insts and for
% compiler-generated insts.
; defined_inst(inst_name)
% An abstract inst is a defined inst which
% has been declared but not actually been
% defined (yet).
; abstract_inst(sym_name, list(inst)).
:- type uniqueness
---> shared % there might be other references
; unique % there is only one reference
; mostly_unique % there is only one reference
% but there might be more on
% backtracking
; clobbered % this was the only reference, but
% the data has already been reused
; mostly_clobbered.
% this was the only reference, but
% the data has already been reused;
% however, there may be more references
% on backtracking, so we will need to
% restore the old value on backtracking
% higher-order predicate terms are given the inst
% `ground(shared, yes(PredInstInfo))'
% where the PredInstInfo contains the extra modes and the determinism
% for the predicate. Note that the higher-order predicate term
% itself must be ground.
:- type pred_inst_info
---> pred_inst_info(
pred_or_func, % is this a higher-order func
% mode or a higher-order pred
% mode?
list(mode), % the modes of the additional
% (i.e. not-yet-supplied)
% arguments of the pred;
% for a function, this includes
% the mode of the return value
% as the last element of the
% list.
determinism % the determinism of the
% predicate or function
).
:- type bound_inst ---> functor(cons_id, list(inst)).
%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%
:- implementation.
% Empty for now.
%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%