:- module term.
:- interface.
:- import_module enum.
:- import_module list.
:- import_module map.
:- import_module type_desc.
:- import_module univ.
:- type const
	--->	atom(string)
	;	integer(int)
	;	string(string)
	;	float(float)
	;	implementation_defined(string).
:- type context
	--->	context(string, int).
:- type generic
	--->	generic .
:- type substitution == term.substitution(term.generic).
:- type term == term.term(term.generic).
:- type term_to_type_arg_context
	--->	arg_context(term.const, int, term.context).
:- type term_to_type_context == list.list(term.term_to_type_arg_context).
:- type var == term.var(term.generic).
:- type substitution(T) == map.map(term.var(T), term.term(T)).
:- type term(T)
	--->	functor(term.const, list.list(term.term(T)), term.context)
	;	variable(term.var(T), term.context).
:- type term_to_type_error(T)
	--->	type_error(term.term(T), type_desc.type_desc, term.context, term.term_to_type_context)
	;	mode_error(term.var(T), term.term_to_type_context).
:- type term_to_type_result(T) == term.term_to_type_result(T, term.generic).
:- type var(T).
:- type var_supply(T).
:- type term_to_type_result(T, U)
	--->	ok(T)
	;	error(term.term_to_type_error(U)).
:- instance (enum.enum(term.var(V_1))).
