Commit Graph

26 Commits

Author SHA1 Message Date
Fergus Henderson
7cb525fde3 Undo Zoltan's bogus update of all the copyright dates.
Estimated hours taken: 0.5

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:33:43 +00:00
Zoltan Somogyi
9ae7acc593 Update all the copyright dates for 1998.
Estimated hours taken: 0.5

library/*.m:
	Update all the copyright dates for 1998.
1998-01-13 10:01:32 +00:00
Fergus Henderson
174b860b2c Use "mercury_foo.h" instead of "foo.h".
Estimated hours taken: 0.25

library/benchmarking.m:
library/float.m:
library/int.m:
library/io.m:
library/mercury_builtin.m:
library/std_util.m:
	Use "mercury_foo.h" instead of "foo.h".
	Use `pragma c_code(...)' instead of the obsolete syntax
	`pragma(c_code, ...)' (I only changed some of the
	occurrences of this).
1997-11-21 06:49:26 +00:00
Fergus Henderson
04b720630b Update the copyright messages so that (a) they contain the correct years
and (b) they say "Copyright (C) ... _The_ University of Melbourne".
1997-07-27 15:09:59 +00:00
Fergus Henderson
838e6f6a4a - Add a function `func float(int) = float' for converting
Estimated hours taken: 4

library/float.m:
	- Add a function `func float(int) = float' for converting
	  from int to float.
	- Add function versions of all the predicates.
	- Reorder the declarations so that the functions and predicates
	  defined are grouped according to their purpose.
	- Add `pragma obsolete' declarations for all the
	  `builtin_float_*' predicates (XXX commented out for now,
	  until my recently committed change to simplify.m to avoid
	  spurious warnings has been installed on all our machines)
	  and move the declarations of those predicates so that they
	  don't appear in the Mercury Library Reference Manual.
	- Update the old `pragma(c_code, ...)' declarations to use
	  the next syntax for `pragma c_code'.

library/mercury_builtin.m:
	Use `<' and `>' rather than the obsolete predicates
	`builtin_float_lt' and `builtin_float_gt'.
1997-07-16 17:49:34 +00:00
David Overton
4bf71fa904 Add new predicate `float__hash' to the standard library for computing a
Estimated hours taken: 4

Add new predicate `float__hash' to the standard library for computing a
non-negative integer hash value for a float.

Add a C function to the runtime to do the actual hashing.  This
function is in the runtime so that it can be called from both
the library and from C code generated for `pragma fact_table'
indexing.

library/float.m
        Add a new predicate `float__hash' that calls the runtime
	function `hash_float()'.

runtime/mercury_float.h
	Add a declaration for `hash_float()'.

runtime/mercury_float.c
	Add new file mercury_float.c for runtime code related to
	floats.
	Add a new function `hash_float()' for hashing floats.
1997-02-28 05:25:52 +00:00
Andrew Bromage
ab79b4bf5b Added float-to-int predicates:
Estimated hours taken: 0.25

library/float.m:
	Added float-to-int predicates:
	{ float__ceiling_to_int/2, float__floor_to_int/2
	  float__round_to_int/2, float__truncate_to_int/2 }

library/math.m:
	Very minor documentation fix.
1996-07-26 06:00:15 +00:00
Zoltan Somogyi
80d080985d Add a comment.
Estimated hours taken: 0.05

float.m:
	Add a comment.
1996-07-23 08:29:00 +00:00
Zoltan Somogyi
37e99553e5 Remove the definitions of the unary plus and minus operators and
Estimated hours taken: 0.1

int, float:
	Remove the definitions of the unary plus and minus operators and
	predicates, since they have been built in for some time now.

	Once this change has been installed on all our machines,
	we will need to reenable the code in make_hlds that prevents
	the redefinition of builtins.
1996-07-23 07:37:27 +00:00
Simon Taylor
fbdce2b679 Module qualification of types, insts and modes.
Estimated hours taken: 2

Module qualification of types, insts and modes.

library/std_util.m
Qualified type names in the labels in the C code for __Unify__ etc.
Left the old labels in temporarily to allow the compiler to bootstrap.

library/mercury_builtin.m
library/term.m
Moved type var and predicates term__var_to_int, term__init_var_supply
and term__new_var to mercury_builtin.m to prevent module qualification
conflicts due to type var being defined as a local type to term.m when
it is needed in mercury_builtin.m for term_to_type.

library/library.m
Added assoc_list to the list of modules imported.

library/float.m
Remove the declaration for type float, since it is a builtin.

library/Mmake
Fergus' fix to a VPATH problem.
1996-06-11 06:35:13 +00:00
Fergus Henderson
24931c80a1 Uncomment the definitions of unary plus and minus, since
Estimated hours taken: 0.25

int.m, float.m:
	Uncomment the definitions of unary plus and minus, since
	they're necessary for bootstrapping.
1996-05-30 10:00:20 +00:00
Zoltan Somogyi
87acc4b618 Add reverse modes for the arithmetic predicates and functions,
Estimated hours taken: 6

float, int:
	Add reverse modes for the arithmetic predicates and functions,
	and make unary plus and minus builtins.

io.m, mercury_builtin, std_util, string:
	Make the C code work with --args compact.
	In std_util, reduce the number of comment formats used from 4 to 2.
1996-05-29 10:58:02 +00:00
Zoltan Somogyi
4cff2e339d Add comments showing the future backward modes of arithmetic
Estimated hours taken: 0.5

int, float:
	Add comments showing the future backward modes of arithmetic
	operators; their order is important.

io:
	Add the ability to print strings on binary files, and fix a bug
	in the declaration of io__write_byte/4.

string:
	Removed spaces from ends of lines, etc.
1996-05-15 07:22:35 +00:00
Fergus Henderson
e2c9cb5fa1 Uncomment the floating point comparison operators ('<', '>=', etc.)
Estimated hours taken: 0.5

library/float.m:
	Uncomment the floating point comparison operators ('<', '>=', etc.)
	since now that we support overloading properly, they don't
	conflict with the ones in int.m.
1996-04-23 18:24:56 +00:00
Fergus Henderson
d421728586 Implement the builtin arithmetic operations using functions,
Estimated hours taken: 1

int.m, float.m:
	Implement the builtin arithmetic operations using functions,
	rather than ad-hoc hacks in the parser.  You can know use
	use arithmetic operators such as `+', `-', etc. on floats.
	(You can't yet use relational operators such as <, >=, etc.
	-- that's coming soon.)
1996-04-07 13:41:50 +00:00
Fergus Henderson
39eaab90c0 Move the C implementation of various builtins from the `runtime' directory
Estimated hours taken: 24

Move the C implementation of various builtins from the `runtime' directory
to inside pragma(c_code) declarations in the `library' directory sources.

library/{io,string,require,std_util,mercury_builtin}.m:
	Add lots of pragma(c_code) and pragma(c_header_code) declarations.

Also a few other miscellaneous changes.

library/list.m:
	Fix a bug in the as yet unused list__merge_sort.

library/io.m:
	Combine io__do_open_{input,output,append} into a single
	predicate io__do_open.

library/std_util.m:
	Fix the implementation of report_statistics so that it gives
	useful information when using conservative garbage collection.
1996-02-28 14:52:32 +00:00
Fergus Henderson
fa5226ee67 Improve the documentation.
library/*.m:
	Improve the documentation.
	Add a "Stability: low/medium/high" comment to all modules,
	which describes the stability of the interface to that module.

ops.m:
	Add `:' as an infix operator.

require.m:
	Implement require/1, since higher-order predicates now work.

term.m:
	Use the type `comparison_result' from mercury_builtin.m,
	rather than defining an identical type `comparison'.
1995-10-05 11:31:52 +00:00
Andrew Bromage
676a7392f8 Added system constants to float.m 1995-09-04 05:09:28 +00:00
Fergus Henderson
4ba85c26c2 Fix layout: if-then-else chains only need one set of parentheses.
library/float.m:
	Fix layout: if-then-else chains only need one set of parentheses.
1995-08-01 13:22:50 +00:00
Dylan Shuttleworth
a7916ea0d7 Modified documentation.
float.m:
	Modified documentation.
1995-07-31 04:58:44 +00:00
Dylan Shuttleworth
d724a54b65 Added a simple exponent function to float. Efficiency is ordinary. 1995-07-19 06:41:46 +00:00
Fergus Henderson
93a755d563 Add copyright notices.
library/*:
	Add copyright notices.
1995-03-28 16:19:34 +00:00
Fergus Henderson
77b16b11d9 Implement floating point.
code_util.nl, float.nl, llds.nl, mercury_builtin.nl, opt_debug.nl,
parser.nl, polymorphism.nl, sp_lib.nl, string.nl, string.nu.nl,
type_util.nl, typecheck.nl, unify_gen.nl:
	Implement floating point.

Makefile.common:
	Remove `-include test.dep' line.  Use Mmake.

int.nl:
	Update a few of the comments.

io.nu.nl:
	For Sicstus Prolog, if main/2 is not defined then enter the
	debugger.
1995-03-15 14:28:24 +00:00
Fergus Henderson
8f84be6e14 Add a (bogus) definition for type `float', to avoid a link
float.nl:
	Add a (bogus) definition for type `float', to avoid a link
	error for `mercury__unify_float_2_0'.
1995-02-02 08:14:12 +00:00
Fergus Henderson
c074b02970 In term__create_var, use bit reversals rather than random numbers
term.nl:
	In term__create_var, use bit reversals rather than random numbers
	to ensure that the binary trees remain balanced.

call_gen.nl:
	For polymorphic unifications, generate a call to fatal_error().

code_gen.nl, hlds.nl, make_hlds.nl, modes.nl, unify_proc.nl:
	Move the unify_request data structure from code_info to the HLDS,
	and move the unify_request handling from code_gen.nl to modes.nl.
	This is because we now generate HLDS code rather than LLDS code
	for complicated unifications.

code_util.nl, hlds_out.nl:
	Do some special name mangling for =/2.

float.nl, typecheck.nl, undef_types.nl, term.nl, hlds.nl:
	Until we implement `float' properly, define it as an abstract type
	in float.nl.

hlds.nl, make_hlds.nl:
	Rename `local_pred, imported_pred, exported_pred' to just
	`local, imported, exported' since they also apply to types, etc.,
	not just to preds.

mercury_compile.pp, mercury_to_goedel.nl, prog_util.nl:
	Replace to goedel__ prefixes in prog_util.nl with prog_util__.

std_util.nl:
	Change the code for semidet_succeed to avoid determinism warning.
1994-12-29 01:12:12 +00:00
Fergus Henderson
344c714f62 Added new module. 1994-02-02 11:35:50 +00:00