[m-dev.] Opium-M ---> Morphine

Erwan Jahier Erwan.Jahier at irisa.fr
Wed Dec 15 22:16:37 AEDT 1999


Hi.

This diff is quite boring and pass my non-regression tests. So, I don't think
it needs a review.

BTW, I'd also like to change the directory name opium_m into morphine. How can
you do that with cvs?

I will commit that if/when the "lawyers" people at IRISA agree with that new 
name (next Friday).
--
Estimated hours taken: 5

opium_m/*:
opium_m/non_regression_tests/*:
opium_m/source/*:
	Rename all occurrences of Opium-M by Morphine.

opium_m/source/:
	Rename opium_m_kernel.op into morphine_kernel.op, load_opium.pl 
	into load_morphine.pl and load_opium_without_banner.pl into
	load_morphine_without_banner.pl.


Index: copyright.txt
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/copyright.txt,v
retrieving revision 1.1
diff -u -r1.1 copyright.txt
--- copyright.txt	1999/11/11 04:52:02	1.1
+++ copyright.txt	1999/12/15 10:26:53
@@ -1,4 +1,6 @@
-The software Opium-M in its 0.2 release of November 1999, hereinafter referred
+
+
+The software Morphine in its 0.2 release of November 1999, hereinafter referred
 to as « the software » has been designed and produced by Erwan Jahier and
 Mireille Ducassé, researchers of the LANDE project, a research project of the
 National Computer and Automatics Institute - INRIA - Rennes Research Unit.
@@ -52,7 +54,7 @@
 
 
 %------------------------------------------------------------------------------%
-Le logiciel Opium-M dans sa version 0.2 (novembre 1999), ci-après dénommé "Le
+Le logiciel Morphine dans sa version 0.2 (novembre 1999), ci-après dénommé "Le
 LOGICIEL", a été conçu et réalisé par Erwan Jahier et Mireille Ducassé,
 chercheurs du projet LANDE, projet de recherche de l'Institut National de
 Recherche en Informatique et en Automatique - INRIA - Unité de Recherche de
Index: non-regression-tests/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/non-regression-tests/Mmakefile,v
retrieving revision 1.1
diff -u -r1.1 Mmakefile
--- non-regression-tests/Mmakefile	1999/11/11 04:52:09	1.1
+++ non-regression-tests/Mmakefile	1999/12/15 10:26:53
@@ -6,10 +6,11 @@
 # This file is copied from the Mercury tests repository
 include ./Mmake.common
 
+
 RM_C=:
 #-----------------------------------------------------------------------------#
 
-OPIUM = ../scripts/Opium-M  --no-banner
+MORPHINE = ../scripts/morphine  --no-banner
 
 #-----------------------------------------------------------------------------#
 
@@ -21,10 +22,10 @@
 MLFLAGS = --trace
 C2INITFLAGS = --trace
 
-# We need to use shared libraries for interactive queries to work.
+# We need to use shared libraries for collect to work.
 # The following is necessary for shared libraries to work on Linux.
-MGNUCFLAGS-interactive = --pic-reg
-MLFLAGS-interactive = --shared
+# MGNUCFLAGS-queens = --pic-reg
+# MLFLAGS-queens = --shared
 
 # Base grades `jump' and `fast' cannot be used with
 # stack layouts (which are required for tracing).
@@ -46,7 +47,7 @@
 #-----------------------------------------------------------------------------#
 
 queens.out.orig: queens queens.in 
-	$(OPIUM) < queens.in > queens.out.orig 2>&1
+	$(MORPHINE) < queens.in > queens.out.orig 2>&1
 
 # Filter out things that might chande depending if we use Eclipse3.5.2 
 # or Eclipse4.*, unix or inet socket, etc.
@@ -56,11 +57,14 @@
 		grep -v 'compiled traceable' | \
 		grep -v 'loading' | \
 		grep -v 'is loaded' | \
-		grep -v 'making scenario' \
+		grep -v 'making scenario' | \
+		grep -v 'Compiling collect.m' | \
+		grep -v 'mmc --grade' | \
+		grep -v 'ml --grade' \
 			> queens.out 2>&1
 
 test_vars.out.orig: test_vars test_vars.in
-	$(OPIUM) < test_vars.in > test_vars.out.orig 2>&1
+	$(MORPHINE) < test_vars.in > test_vars.out.orig 2>&1
 
 test_vars.out: test_vars.out.orig
 	cat test_vars.out.orig | \
Index: non-regression-tests/queens.exp
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/non-regression-tests/queens.exp,v
retrieving revision 1.1
diff -u -r1.1 queens.exp
--- non-regression-tests/queens.exp	1999/11/11 04:52:09	1.1
+++ non-regression-tests/queens.exp	1999/12/15 10:26:57
@@ -1,6 +1,6 @@
-[Opium-M 1]: 
+[morphine 1]: 
 **************************************************
-******** Non regression test for Opium-M *********
+******** Non regression test for Morphine *********
 **************************************************
 
 **************************************************
@@ -38,7 +38,7 @@
 
 C = 11
 C2 = 20
-[Opium-M 2]: 
+[morphine 2]: 
 **************************************************
 **** Testing toggle/1...
 run(./, queens,  )
@@ -95,12 +95,12 @@
   3:  2 [2] exit data([1, 2, 3, 4, 5])
   3:  2 [2] exit data([1, 2, 3, 4, 5]) [] 
 no (more) solution.
-[Opium-M 3]: [1, 3, 5, 2, 4]
+[morphine 3]: [1, 3, 5, 2, 4]
 
 ---------------------------------
 End of connection with the traced program
 toggle: ok.
-[Opium-M 4]: 
+[morphine 4]: 
 **************************************************
 **** Testing one by one variable retrieval...
 run(./, queens,  )
@@ -121,7 +121,7 @@
 List = [live_var_names_and_types("HeadVar__1", "list:list(int)"), live_var_names_and_types("HeadVar__2", "list:list(int)")]
 VarName = "HeadVar__1"
 Var = [1, 2, 3, 4, 5]
-[Opium-M 5]: 
+[morphine 5]: 
 **************************************************
 **** Testing current...
 run(./, queens,  )
@@ -243,7 +243,7 @@
 P15 = queen
 MN15 = 0
 P16 = predicate -> queens : queen / 2 - 0
-[Opium-M 6]: 
+[morphine 6]: 
 **************************************************
 **** Testing retry/1...
 run(./, queens,  )
@@ -260,7 +260,7 @@
 ---------------------------------
 End of connection with the traced program
 retry: ok.
-[Opium-M 7]: 
+[morphine 7]: 
 **************************************************
 **** Testing stack dumps...
 run(./, queens,  )
@@ -281,7 +281,7 @@
 stack: ok.
 
 Stack = [[level(0), detail(2, 2, 2), pred, proc("queens", "data", 1, 0), det("det")], [level(1), detail(1, 1, 1), pred, proc("queens", "main", 2, 0), det("cc_multi")]]
-[Opium-M 8]: 
+[morphine 8]: 
 **************************************************
 **** Testing the term browser...
 run(./, queens,  )
@@ -370,7 +370,7 @@
 ---------------------------------
 End of connection with the traced program
 browser: ok.
-[Opium-M 9]: 
+[morphine 9]: 
 **************************************************
 **** Testing collect...
 run(./, queens,  )
@@ -381,18 +381,15 @@
 				       
   1: 1 [1] call main(state('<<c_pointer>>'), -) [] 
 [1, 3, 5, 2, 4]
-Compiling collect.m...
-mmc --grade asm_fast.gc -O6 -c --pic-reg collect.m
-ml --grade asm_fast.gc --make-shared-lib --pic-reg -o collect.so collect.o
 
 ---------------------------------
 End of connection with the traced program
 [sol(proc(predicate, "queens", "print_list_2", 3, 0), [univ([4] : list : list(int)), univ(state('<<c_pointer>>') : io : state)]), sol(proc(predicate, "queens", "print_list_2", 3, 0), [univ([2, 4] : list : list(int)), univ(state('<<c_pointer>>') : io : state)]), sol(proc(predicate, "queens", "print_list_2", 3, 0), [univ([5, 2, 4] : list : list(int)), univ(state('<<c_pointer>>') : io : state)]), sol(proc(predicate, "queens", "print_list_2", 3, 0), [univ([3, 5, 2, 4] : list : list(int)), univ(state('<<c_pointer>>') : io : state)]), sol(proc(predicate, "queens", "print_list_2", 3, 0), [univ([1, 3, 5, 2, 4] : list : list(int)), univ(state('<<c_pointer>>') : io : state)]), sol(proc(predicate, "queens", "print_list", 3, 0), [univ([1, 3, 5, 2, 4] : list : list(int)), univ(state('<<c_pointer>>') : io : state)]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(4 : int), univ(1 : int), univ([] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([4] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(2 : int), univ(2 : int), univ([] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(2 : int), univ(1 : int), univ([4] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([2, 4] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(5 : int), univ(3 : int), univ([] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(5 : int), univ(2 : int), univ([4] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(5 : int), univ(1 : int), univ([2, 4] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([5, 2, 4] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(3 : int), univ(4 : int), univ([] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(3 : int), univ(3 : int), univ([4] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(3 : int), univ(2 : int), univ([2, 4] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(3 : int), univ(1 : int), univ([5, 2, 4] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([3, 5, 2, 4] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(3 : int), univ([2, 4] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(2 : int), univ([5, 2, 4] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(1 : int), univ([3, 5, 2, 4] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([1, 3, 5, 2, 4] : list : list(int))]), sol(proc(predicate, "queens", "qdelete", 3, 0), [univ([2, 4] : list : list(int))]), sol(proc(predicate, "queens", "qperm", 2, 0), [univ([2, 4] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(3 : int), univ(1 : int), univ([4, 5, 2] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([3, 4, 5, 2] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(4 : int), univ([2] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(3 : int), univ([5, 2] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(2 : int), univ([4, 5, 2] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(1 : int), univ([3, 4, 5, 2] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([1, 3, 4, 5, 2] : list : list(int))]), sol(proc(predicate, "queens", "qdelete", 3, 0), [univ([2] : list : list(int))]), sol(proc(predicate, "queens", "qperm", 2, 0), [univ([2] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(4 : int), univ([5] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(3 : int), univ([2, 5] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(2 : int), univ([4, 2, 5] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(1 : int), univ([3, 4, 2, 5] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([1, 3, 4, 2, 5] : list : list(int))]), sol(proc(predicate, "queens", "qdelete", 3, 0), [univ([2, 5] : list : list(int))]), sol(proc(predicate, "queens", "qperm", 2, 0), [univ([2, 5] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(3 : int), univ(1 : int), univ([2, 5, 4] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([3, 2, 5, 4] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(5 : int), univ([] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(4 : int), univ([4] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(3 : int), univ([5, 4] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(2 : int), univ([2, 5, 4] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(1 : int), univ([3, 2, 5, 4] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([1, 3, 2, 5, 4] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(3 : int), univ([4, 5] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(2 : int), univ([2, 4, 5] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(1 : int), univ([3, 2, 4, 5] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([1, 3, 2, 4, 5] : list : list(int))]), sol(proc(predicate, "queens", "qdelete", 3, 0), [univ([2, 4, 5] : list : list(int))]), sol(proc(predicate, "queens", "qperm", 2, 0), [univ([2, 4, 5] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(1 : int), univ([2, 5, 4, 3] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([1, 2, 5, 4, 3] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(1 : int), univ([2, 5, 3, 4] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([1, 2, 5, 3, 4] : list : list(int))]), sol(proc(predicate, "queens", "qdelete", 3, 0), [univ([3, 4] : list : list(int))]), sol(proc(predicate, "queens", "qperm", 2, 0), [univ([3, 4] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(1 : int), univ([2, 4, 5, 3] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([1, 2, 4, 5, 3] : list : list(int))]), sol(proc(predicate, "queens", "qdelete", 3, 0), [univ([3] : list : list(int))]), sol(proc(predicate, "queens", "qperm", 2, 0), [univ([3] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(1 : int), univ([2, 4, 3, 5] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([1, 2, 4, 3, 5] : list : list(int))]), sol(proc(predicate, "queens", "qdelete", 3, 0), [univ([3, 5] : list : list(int))]), sol(proc(predicate, "queens", "qperm", 2, 0), [univ([3, 5] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(1 : int), univ([2, 3, 5, 4] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([1, 2, 3, 5, 4] : list : list(int))]), sol(proc(predicate, "queens", "qdelete", 3, 0), [univ([4] : list : list(int))]), sol(proc(predicate, "queens", "qperm", 2, 0), [univ([4] : list : list(int))]), sol(proc(predicate, "queens", "qdelete", 3, 0), [univ([] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(1 : int), univ(1 : int), univ([2, 3, 4, 5] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([1, 2, 3, 4, 5] : list : list(int))]), sol(proc(predicate, "queens", "qperm", 2, 0), [univ([] : list : list(int))]), sol(proc(predicate, "queens", "qdelete", 3, 0), [univ([5] : list : list(int))]), sol(proc(predicate, "queens", "qperm", 2, 0), [univ([5] : list : list(int))]), sol(proc(predicate, "queens", "qdelete", 3, 0), [univ([4, 5] : list : list(int))]), sol(proc(predicate, "queens", "qperm", 2, 0), [univ([4, 5] : list : list(int))]), sol(proc(predicate, "queens", "qdelete", 3, 0), [univ([3, 4, 5] : list : list(int))]), sol(proc(predicate, "queens", "qperm", 2, 0), [univ([3, 4, 5] : list : list(int))]), sol(proc(predicate, "queens", "qdelete", 3, 0), [univ([2, 3, 4, 5] : list : list(int))]), sol(proc(predicate, "queens", "qperm", 2, 0), [univ([2, 3, 4, 5] : list : list(int))]), sol(proc(predicate, "queens", "qdelete", 3, 0), [univ([1, 2, 3, 4, 5] : list : list(int))]), sol(proc(predicate, "queens", "qperm", 2, 0), [univ([1, 2, 3, 4, 5] : list : list(int))]), sol(proc(predicate, "queens", "queen", 2, 0), [univ([1, 2, 3, 4, 5] : list : list(int))]), sol(proc(predicate, "queens", "data", 1, 0), []), sol(proc(predicate, "queens", "main", 2, 0), [univ(state('<<c_pointer>>') : io : state)])]collect: ok.
 
 Result = [sol(proc(predicate, "queens", "print_list_2", 3, 0), [univ([4] : list : list(int)), univ(state('<<c_pointer>>') : io : state)]), sol(proc(predicate, "queens", "print_list_2", 3, 0), [univ([2, 4] : list : list(int)), univ(state('<<c_pointer>>') : io : state)]), sol(proc(predicate, "queens", "print_list_2", 3, 0), [univ([5, 2, 4] : list : list(int)), univ(state('<<c_pointer>>') : io : state)]), sol(proc(predicate, "queens", "print_list_2", 3, 0), [univ([3, 5, 2, 4] : list : list(int)), univ(state('<<c_pointer>>') : io : state)]), sol(proc(predicate, "queens", "print_list_2", 3, 0), [univ([1, 3, 5, 2, 4] : list : list(int)), univ(state('<<c_pointer>>') : io : state)]), sol(proc(predicate, "queens", "print_list", 3, 0), [univ([1, 3, 5, 2, 4] : list : list(int)), univ(state('<<c_pointer>>') : io : state)]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(4 : int), univ(1 : int), univ([] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([4] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(2 : int), univ(2 : int), univ([] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(2 : int), univ(1 : int), univ([4] : list : list(int))]), sol(proc(predicate, "queens", "safe", 1, 0), [univ([2, 4] : list : list(int))]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(5 : int), univ(3 : int), univ([] : ... : ...)]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(5 : int), univ(2 : int), univ(... : ...)]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(5 : int), univ(... : ...), univ(...)]), sol(proc(predicate, "queens", "safe", 1, 0), [univ(... : ...)]), sol(proc(predicate, "queens", "nodiag", 3, 0), [univ(...), ...]), sol(proc(...), [...]), sol(...), ...]     More? (;) 
-[Opium-M 10]: 
+[morphine 10]: 
 **************************************************
-**** Testing other Opium commands...
+**** Testing other Morphine commands...
 apropos(window)
     man
     manual
@@ -404,9 +401,10 @@
 man(apropos)
 
 apropos(Name)    {a}
-Command which displays all the commands, primitives, procedures, parameters, or types for which Name is a substring of.
+Command which displays all the commands, primitives, procedures, parameters, or 
+types for which Name is a substring of.
 Example: 
-[Opium-M]: apropos man.
+[morphine]: apropos man.
     man
     manual
     latex_manual
@@ -414,11 +412,12 @@
     opium_command_in_module
     print_man
 
+
 Name 	: atom
 type of command : opium
-scenario : help (GloLoc in Opium-M)
+scenario : help (GloLoc in morphine)
 
 ok.
 **************************************************
-[Opium-M 11]: 
+[morphine 11]: 
 bye
Index: non-regression-tests/queens.in
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/non-regression-tests/queens.in,v
retrieving revision 1.1
diff -u -r1.1 queens.in
--- non-regression-tests/queens.in	1999/11/11 04:52:10	1.1
+++ non-regression-tests/queens.in	1999/12/15 10:26:57
@@ -1,5 +1,5 @@
 write("\n**************************************************\n"),
-write("******** Non regression test for Opium-M *********\n"),
+write("******** Non regression test for Morphine *********\n"),
 write("**************************************************\n\n"),
 
 
@@ -184,7 +184,7 @@
 	write("collect: ok.\n").
 
 write("\n**************************************************"),
-	write("\n**** Testing other Opium commands...\n"),
+	write("\n**** Testing other Morphine commands...\n"),
 	write("apropos(window)"), nl, 
 	apropos(man),
 	write("man(apropos)"), nl, 
Index: non-regression-tests/test_vars.exp
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/non-regression-tests/test_vars.exp,v
retrieving revision 1.1
diff -u -r1.1 test_vars.exp
--- non-regression-tests/test_vars.exp	1999/11/11 04:52:11	1.1
+++ non-regression-tests/test_vars.exp	1999/12/15 10:26:57
@@ -1,4 +1,4 @@
-[Opium-M 1]: 
+[morphine 1]: 
 **************************************************
 **** Testing test_vars.m...
 Start debugging test_vars program.
@@ -14,5 +14,5 @@
 test_vars: ok.
 
 Arg = [3 - 8]
-[Opium-M 2]: 
+[morphine 2]: 
 bye
Index: source/collect.op
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/collect.op,v
retrieving revision 1.1
diff -u -r1.1 collect.op
--- source/collect.op	1999/11/11 04:52:20	1.1
+++ source/collect.op	1999/12/15 10:27:01
@@ -131,12 +131,13 @@
 then updated (with filter/4) for all the events of the remaining \
 execution. When the fourth argument of filter is equal to yes, or when \
 the end of the execution is reached, the last value of \
-the collecting variable is send to Opium-M.\n\
+the collecting variable is send to Morphine.\n\
 \n\
 collect/2 can be seen as fold/4 meta-predicate except that (1) the \
 initialization and the updating of the accumulator is done via Mercury \
 predicates defined in a separate file (2) it does not take a list as \
-argument but operates on the fly on a list of events (3) ."
+argument but operates on the fly on a list of events (3) we can stop \
+the process at anytime thanks the fourth argument of filter\4."
 	).
 
 %------------------------------------------------------------------------------%
@@ -254,7 +255,7 @@
 	sh(Command2), 
 	exists("collect.so"),
 	!,
-	opium_write_debug("collect.m has been compiled successfully.\n").
+	morphine_write_debug("collect.m has been compiled successfully.\n").
 
 compile_collect_Op :-
 	write("\n\n***** Compilation of module collect failed.\n"),
@@ -293,8 +294,8 @@
 generate_collect_Op(File) :-
 	sh("rm -f collect.m"),
 	open("collect.m", write, collect),
-	getenv("MERCURY_OPIUM_DIR", OpiumDir),
-	append_strings(OpiumDir, "/source/collect.in", CollectIn),
+	getenv("MERCURY_MORPHINE_DIR", MorphineDir),
+	append_strings(MorphineDir, "/source/collect.in", CollectIn),
 	open(CollectIn, read, collect_in),
 	open(File, read, collect_body),
 	read_string(collect_in, "", _, In),
@@ -377,10 +378,20 @@
 	send_message_to_socket(link_collect("\"./collect.so\"")),
 	read_message_from_socket(Result),
 	( Result = link_collect_succeeded ->
-		opium_write_debug("collect.so has been linked successfully.\n")
+		morphine_write_debug("collect.so has been linked successfully.\n")
 	;
-		print("**** collect.so has not been linked.\n"),
-		abort
+		% if the Mercury program has been compiled in another grade, the 
+		% linking will fail here. So if it fails, we recompile the collect
+		% module and try again.
+		compile_collect,
+		send_message_to_socket(link_collect("\"./collect.so\"")),
+		read_message_from_socket(Result2),
+		( Result2 = link_collect_succeeded ->
+			morphine_write_debug("collect.so has been linked successfully.\n")
+		;
+			print("**** collect.so has not been linked.\n"),
+			abort
+		)
 	).
 
 
@@ -453,7 +464,7 @@
 
 check_a_program_is_running(CommandStr) :-
 	(
-		getval(state_of_opium, State),
+		getval(state_of_morphine, State),
 		State = running,
 		!
 	;
Index: source/control_flow.op
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/control_flow.op,v
retrieving revision 1.1
diff -u -r1.1 control_flow.op
--- source/control_flow.op	1999/11/11 04:52:21	1.1
+++ source/control_flow.op	1999/12/15 10:27:02
@@ -47,7 +47,7 @@
 	).
 
 control_flow_graph_Op(Program) :-
-	( getval(state_of_opium, running) ->
+	( getval(state_of_morphine, running) ->
 		abort_trace
 	;
 		true
@@ -64,13 +64,13 @@
 %:- mode generate_control_flow_graph(out) is det.
 %
 generate_control_flow_graph(G) :-
-	getenv("MERCURY_OPIUM_DIR", OpiumDir),
-	append_strings(OpiumDir, "/source/collect__control_flow_graph", 
+	getenv("MERCURY_MORPHINE_DIR", MorphineDir),
+	append_strings(MorphineDir, "/source/collect__control_flow_graph", 
 		CollectFile),
 	collect(CollectFile, Result),
 	Result = collected_type(_,G).
 
-% This is the pure Opium-M version of generate_control_flow_graph that
+% This is the pure Morphine version of generate_control_flow_graph that
 % I originally wrote and which is about 20 times as slow as the collect 
 % one:
 %
@@ -115,13 +115,13 @@
 %
 
 generate_dynamic_call_graph(G) :-
-	getenv("MERCURY_OPIUM_DIR", OpiumDir),
-	append_strings(OpiumDir, "/source/collect__dynamic_call_graph", 
+	getenv("MERCURY_MORPHINE_DIR", MorphineDir),
+	append_strings(MorphineDir, "/source/collect__dynamic_call_graph", 
 		CollectFile),
 	collect(CollectFile, Result),
 	Result = collected_type(_,G).
 
-% This is the pure Opium-M version:
+% This is the pure Morphine version:
 %
 % generate_dynamic_call_graph(G0, G) :-
 % 	( fget_np(port = call) ->
Index: source/coprocess.op
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/coprocess.op,v
retrieving revision 1.1
diff -u -r1.1 coprocess.op
--- source/coprocess.op	1999/11/11 04:52:21	1.1
+++ source/coprocess.op	1999/12/15 10:27:03
@@ -3,8 +3,8 @@
 %
 % Author : Erwan Jahier <jahier at irisa.fr>
 % 
-%  Opium-M built-ins, primitives and commands related to coprocessing
-%  in the Opium-M process (part of scenario opium_kernel-M.op).
+%  Morphine built-ins, primitives and commands related to coprocessing
+%  in the Morphine process (part of scenario morphine_kernel.op).
 
 
 
@@ -40,11 +40,11 @@
 	listen(sock, 1).
 
 construct_socket_address(Addr) :-
-	mercury_opium_socket_address(Addr0),
+	mercury_morphine_socket_address(Addr0),
 	append_strings(Addr0, "soc", Addr1),
 
 	% We add the pid to the socket path name to make sure that 2 users on 
-	% the same machine can use Opium-M simultaneously.
+	% the same machine can use Morphine simultaneously.
 	get_flag(pid, Pid),
 	number_string(Pid, PidStr),
 	append_strings(Addr1, PidStr, Addr),
@@ -67,7 +67,7 @@
 % :- pred end_connection is det.
 end_connection_Op :-
 	kill_all_socket_address,
-	setval(state_of_opium, not_running),
+	setval(state_of_morphine, not_running),
 	close(sock),
 	close(newsock),
 	write("End of connection with the traced program\n").
@@ -76,11 +76,11 @@
 	get_flag(pid, Pid),
 	number_string(Pid, PidStr),
 	append_strings("*", PidStr, StarPidStr),
-	mercury_opium_socket_address(AddressStr),
+	mercury_morphine_socket_address(AddressStr),
 	append_strings("rm -f ", AddressStr, C),
 	append_strings(C, StarPidStr, Command),
-	opium_write_debug(user, Command),
-	opium_write_debug(user, "\n"),
+	morphine_write_debug(user, Command),
+	morphine_write_debug(user, "\n"),
 	sh(Command).
 	% I should rather use exec(Command, []) here but for
 	% unknown reason, it does not remove the socket file.
@@ -92,12 +92,12 @@
 	% socket.
 
 send_message_to_socket(Query) :-
-	getval(state_of_opium, State),
+	getval(state_of_morphine, State),
 	( 
 		State == running 
 	->
 		printf(newsock, "%w. \n%b", [Query]),
-		opium_printf_debug("SEND    : +%w. +\n", [Query])
+		morphine_printf_debug("SEND    : +%w. +\n", [Query])
 	;
 		State == not_running
 	->
@@ -115,12 +115,12 @@
 	% socket.
 read_message_from_socket(Message) :-
 	read(newsock, Message),
-	opium_printf_debug("RECEIVE : +%w+\n\n", Message).
+	morphine_printf_debug("RECEIVE : +%w+\n\n", Message).
 
 
 %------------------------------------------------------------------------------%
 opium_parameter(
-	name		: mercury_opium_socket_address,
+	name		: mercury_morphine_socket_address,
 	arg_list	: [SocketAdress],
 	arg_type_list	: [string],
 	parameter_type	: single,
@@ -135,29 +135,29 @@
 
 %------------------------------------------------------------------------------%
 opium_parameter(
-	name		: debug_opium,
+	name		: debug_morphine,
 	arg_list	: [OnOff],
 	arg_type_list	: [is_member([on, off])],
 	parameter_type	: single,
 	default		: [off],
-	commands	: [opium_write_debug, opium_printf_debug],
+	commands	: [morphine_write_debug, morphine_printf_debug],
 	message		: 
-'Prints additional information in the trace to debug Opium.'
+'Prints additional information in the trace to debug Morphine.'
 	).
 
 
 %------------------------------------------------------------------------------%
 opium_procedure(
-	name		: opium_write_debug,
+	name		: morphine_write_debug,
 	arg_list	: [X],
-	implementation	: opium_write_debug_Op,
-	parameters	: [debug_opium],
+	implementation	: morphine_write_debug_Op,
+	parameters	: [debug_morphine],
 	message		:
-'This procedure is used to print information to debug Opium.'
+'This procedure is used to print information to debug Morphine.'
 	).
 
-opium_write_debug_Op(X) :-
-	(debug_opium(on) ->
+morphine_write_debug_Op(X) :-
+	(debug_morphine(on) ->
 		write(X)
 	;
 		true
@@ -165,16 +165,16 @@
 
 
 opium_procedure(
-	name		: opium_write_debug,
+	name		: morphine_write_debug,
 	arg_list	: [Stream, X],
-	implementation	: opium_write_debug_Op,
-	parameters	: [debug_opium],
+	implementation	: morphine_write_debug_Op,
+	parameters	: [debug_morphine],
 	message		:
-'This procedure is used to print information to debug Opium.'
+'This procedure is used to print information to debug Morphine.'
 	).
 
-opium_write_debug_Op(Stream, X) :-
-	(debug_opium(on) ->
+morphine_write_debug_Op(Stream, X) :-
+	(debug_morphine(on) ->
 		write(Stream, X)
 	;
 		true
@@ -183,16 +183,16 @@
 
 
 opium_procedure(
-	name		: opium_printf_debug,
+	name		: morphine_printf_debug,
 	arg_list	: [Format, X],
-	implementation	: opium_printf_debug_Op,
-	parameters	: [debug_opium],
+	implementation	: morphine_printf_debug_Op,
+	parameters	: [debug_morphine],
 	message		:
-'This procedure is used to print information to debug Opium.'
+'This procedure is used to print information to debug Morphine.'
 	).
 
-opium_printf_debug_Op(Format, X) :-
-	(debug_opium(on) ->
+morphine_printf_debug_Op(Format, X) :-
+	(debug_morphine(on) ->
 		printf(Format, X)
 	;
 		true
@@ -200,16 +200,16 @@
 
 
 opium_procedure(
-	name		: opium_printf_debug,
+	name		: morphine_printf_debug,
 	arg_list	: [Stream, Format, X],
-	implementation	: opium_printf_debug_Op,
-	parameters	: [debug_opium],
+	implementation	: morphine_printf_debug_Op,
+	parameters	: [debug_morphine],
 	message		:
-'This procedure is used to print information to debug Opium.'
+'This procedure is used to print information to debug Morphine.'
 	).
 
-opium_printf_debug_Op(Stream, Format, X) :-
-	(debug_opium(on) ->
+morphine_printf_debug_Op(Stream, Format, X) :-
+	(debug_morphine(on) ->
 		printf(Stream, Format, X)
 	;
 		true
Index: source/current_arg.op
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/current_arg.op,v
retrieving revision 1.1
diff -u -r1.1 current_arg.op
--- source/current_arg.op	1999/11/11 04:52:21	1.1
+++ source/current_arg.op	1999/12/15 10:27:05
@@ -279,7 +279,7 @@
 		synthetise_list_univ_and_list_string2(L1, L2, Lout),
 		!
 	;
-		write("\nSoftware error in opium-M: "),
+		write("\nSoftware error in Morphine: "),
 		write("synthetise_list_univ_and_list_string failed.\n"),
 		abort
 	).
@@ -293,7 +293,7 @@
 	     Arg = 'error',
 	     Type = 'error',
 	     write("***** Can't retrieve that type of argument. "),
-	     write("This is a bug in Opium-M...\n")
+	     write("This is a bug in Morphine...\n")
 	 ),
 	synthetise_list_univ_and_list_string2(TailArg, TailName, ListArgLeft),
 	ListArgLive = [live_var(Name, Arg, Type) | ListArgLeft].
@@ -335,7 +335,7 @@
 current_live_var(VarId, VarValue, VarType) and typing \";\" at the prompt to \
 search for other solutions. \
 You can also get the list of all the currently live variables of type int \
-with the Opium-M query \
+with the Morphine query \
 setof((Name, Value), current_live_var(Name, Value, int), List).\
 '
 	).
Index: source/current_slots.op
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/current_slots.op,v
retrieving revision 1.1
diff -u -r1.1 current_slots.op
--- source/current_slots.op	1999/11/11 04:52:21	1.1
+++ source/current_slots.op	1999/12/15 10:27:07
@@ -90,7 +90,7 @@
 	).
 
 current_Op(ListOrConj) :-
-	getval(state_of_opium, running),
+	getval(state_of_morphine, running),
 	(
 		is_list(ListOrConj),
 		current_list(ListOrConj),
@@ -151,7 +151,7 @@
 				/*, RetrievedLineNumber */ )
 	->
 		write("The current event is compiler generated event, "),
-		write("they are not handled yet in Opium-M.\n"),
+		write("they are not handled yet in Morphine.\n"),
 		fail
 		% XXX 
 		% Anyway, this should never arrive here as long as we 
@@ -185,10 +185,10 @@
 		),
 
 		% for 'port' attribute, the name the Mercury process sends is 
-		% not the ones we use at the Opium-M side.
+		% not the ones we use at the Morphine side.
 		( not(Port == '-') ->
-			convert_mercury_port_opium_port_exact(
-				RetrievedPort, OpiumPort)
+			convert_mercury_port_morphine_port_exact(
+				RetrievedPort, MorphinePort)
 		;
 			true
 		),
@@ -210,7 +210,7 @@
 		unify_attribute(RetrievedChrono, Chrono),
 		unify_attribute(RetrievedCall, Call),
 		unify_attribute(RetrievedDepth, Depth),
-		unify_attribute(OpiumPort, Port),
+		unify_attribute(MorphinePort, Port),
 		unify_attribute(RetrievedPredOrFunc, PredOrFunc),
 		unify_attribute(RetrievedDeclModule, DeclModule),
 		unify_attribute(RetrievedDefModule, DefModule),
@@ -232,13 +232,13 @@
 		write(stderr, "Error in current_attributes/11 (current_slots.op)\n"),
 		write(stderr, "   An error occured in the Mercury process: "),
 		write(stderr, ErrorMessage),
-		opium_abort
+		morphine_abort
 	 ;
 		write(stderr, "Error in current_attributes/11 (current_slots.op)\n"),
 		write(stderr, "The Mercury process sends: "),
 		write(Response),
 		write(stderr, "\n"),
-		opium_abort
+		morphine_abort
 	).
 
 
@@ -588,7 +588,7 @@
 	stack_hl(Tail, [X|Level], Stack0, Stack).
 
 stack_ll_Op(StackList) :-
-	getval(state_of_opium, running),
+	getval(state_of_morphine, running),
 	send_message_to_socket(stack),
 	read_message_until_end_stack([], StackList),
  	read_message_from_socket(Message), 
@@ -649,7 +649,7 @@
 	).
 
 nondet_stack_Op :-
-	getval(state_of_opium, running),
+	getval(state_of_morphine, running),
 	send_message_to_socket(nondet_stack),
 	read_message_from_socket(ok),
 	!.
@@ -672,7 +672,7 @@
 	).
 
 stack_regs_Op :-
-	getval(state_of_opium, running),
+	getval(state_of_morphine, running),
 	send_message_to_socket(stack_regs),
 	read_message_from_socket(Message),
 	Message = stack_regs(SP, CURFR, MAXFR),
Index: source/display.op
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/display.op,v
retrieving revision 1.1
diff -u -r1.1 display.op
--- source/display.op	1999/11/11 04:52:22	1.1
+++ source/display.op	1999/12/15 10:27:11
@@ -36,7 +36,7 @@
 
 % :- pred print_event is det.
 print_event_Op :-
-    ( getval(state_of_opium, running) ->
+    ( getval(state_of_morphine, running) ->
 	attribute_display(ChronoFlag, CallFlag, PortFlag, DepthFlag, DeterFlag,
 				PredOrFuncFlag, DeclModuleFlag, DefModuleFlag, 
 				NameFlag, ArityFlag, ModeNumFlag, ArgFlag, 
@@ -1297,7 +1297,6 @@
 get_optype(fy,  prefix)  :- !.
 
 %------------------------------------------------------------------------------%
-% I copied that stuff from eclipse/opium/interface.op to avoid warnings.
 opium_procedure(
 	name		: read_input,
 	arg_list	: [Input],
@@ -1305,7 +1304,7 @@
 	parameters	: [],
 	message		:
 "Procedure which reads an input from within the current input stream \
-of Opium-M.\
+of Morphine.\
 "
 	).
 
Index: source/exec_control.op
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/exec_control.op,v
retrieving revision 1.1
diff -u -r1.1 exec_control.op
--- source/exec_control.op	1999/11/11 04:52:22	1.1
+++ source/exec_control.op	1999/12/15 10:27:16
@@ -3,57 +3,57 @@
 %
 % Author : Erwan Jahier <jahier at irisa.fr>
 %
-% Opium-M built-ins, primitives and commands related to the control
-% of the execution (part of scenario opium_kernel-M.op). All predicates
+% Morphine built-ins, primitives and commands related to the control
+% of the execution (part of scenario morphine_kernel.op). All predicates
 % of this file are written to be run on an unix-like architecture.
 
 
 %--------------------------------------------------------------------------%
 opium_primitive(
-	name		: init_opium_session,
+	name		: init_morphine_session,
 	arg_list	: [],
 	arg_type_list	: [],
 	abbrev		: _,
-	implementation	: init_opium_session_Op,
+	implementation	: init_morphine_session_Op,
 	message		:
-"Initializes Opium-M."
+"Initializes Morphine."
 	).
 
 
-% :- pred init_opium_session_Op is det.
-init_opium_session_Op :-
-	load_opium_m_rc,
-	setval(state_of_opium, not_running),
+% :- pred init_morphine_session_Op is det.
+init_morphine_session_Op :-
+	load_morphine_rc,
+	setval(state_of_morphine, not_running),
 	setval(a_program_has_been_run, no).
 
 
-load_opium_m_rc :-
+load_morphine_rc :-
 	( 
 		getenv('PWD', Cwd),
-		append_strings(Cwd, "/.opium-m-rc", CurrentOpiumRc),
-		exists(CurrentOpiumRc) 
+		append_strings(Cwd, "/.morphine-rc", CurrentMorphineRc),
+		exists(CurrentMorphineRc) 
 	->
-		% If a `.opium-m-rc' exists in the current directory, load it.
-		( get_file_info(CurrentOpiumRc, size, 0) ->
+		% If a `.morphine-rc' exists in the current directory, load it.
+		( get_file_info(CurrentMorphineRc, size, 0) ->
 		    true
 		;
-		    % Only print thet message if .opium-m-rc is not empty
-		    compile(CurrentOpiumRc)
+		    % Only print thet message if .morphine-rc is not empty
+		    compile(CurrentMorphineRc)
 		)
 	;
-		% If no `.opium-m-rc' exists in the current directory, look
+		% If no `.morphine-rc' exists in the current directory, look
 		% in the home directory if such a file is available to load it.
 
 		getenv('HOME', Dir),
-		append_strings(Dir, "/.opium-m-rc", HomeOpiumRc),
+		append_strings(Dir, "/.morphine-rc", HomeMorphineRc),
 		( 
-			exists(HomeOpiumRc) 
+			exists(HomeMorphineRc) 
 		->
-			( get_file_info(HomeOpiumRc, size, 0) ->
+			( get_file_info(HomeMorphineRc, size, 0) ->
 			    true
 			;
-			    % Only print thet message if .opium-m-rc is not empty
-			    compile(HomeOpiumRc)
+			    % Only print thet message if .morphine-rc is not empty
+			    compile(HomeMorphineRc)
 			)
 		;
 			true
@@ -62,25 +62,25 @@
 
 %--------------------------------------------------------------------------%
 opium_command(
-	name		: re_init_opium,
+	name		: re_init_morphine,
 	arg_list	: [],
 	arg_type_list	: [],
 	abbrev		: _,
 	interface	: menu,
 	command_type	: opium,
-	implementation	: re_init_opium_Op,
+	implementation	: re_init_morphine_Op,
 	parameters	: [],
 	message		:
-'Re-initializes Opium-M. This command migth be useful if Opium-M is broken.\
+'Re-initializes Morphine. This command migth be useful if Morphine is broken.\
 '
 	).
 
-re_init_opium_Op :-
-	init_opium_session_Op.
+re_init_morphine_Op :-
+	init_morphine_session_Op.
 
 
 %--------------------------------------------------------------------------%
-opium_abort :-
+morphine_abort :-
 	end_connection,
 	abort.
 
@@ -95,10 +95,10 @@
 	implementation	: run_Op,
 	parameters	: [],
 	message		:
-'Executes a Mercury program from Opium-M. \n\
+'Executes a Mercury program from Morphine. \n\
 \n\
 Example:  \
-run(hello) will run the Mercury program hello under the control of Opium-M .\
+run(hello) will run the Mercury program hello under the control of Morphine .\
 run(\"./cat filename\") will run \
 the Mercury program \"cat\" that takes \"filename\" as argument.\
 '
@@ -106,7 +106,7 @@
 
 % :- pred run_Op(atom).
 % :- mode run_Op(in) is det.
-	% run_Op(PathCallArgs) run the program ProgramName within Opium-M.
+	% run_Op(PathCallArgs) run the program ProgramName within Morphine.
 run_Op(PathCallArgs0) :-
 	( string(PathCallArgs0) ->
 		PathCallArgs = PathCallArgs0
@@ -146,8 +146,8 @@
 
 	accept(sock, _, newsock),
 
-	% state_of_opium = running | not_running | eot (| bot) 
-	setval(state_of_opium, running),
+	% state_of_morphine = running | not_running | eot (| bot) 
+	setval(state_of_morphine, running),
 
 	read_message_from_socket(hello),
 	send_message_to_socket(hello_reply),
@@ -233,7 +233,7 @@
 run_program(ProgramPathStr, PathCallStr, ListArgsStr, 
 	SocketAddressStr, SocketDomain, RemoteMachine) :-
 	(
-		getenv('MERCURY_OPIUM_DIR', Dir),
+		getenv('MERCURY_MORPHINE_DIR', Dir),
 		window_command(WindowsStr),
 		concat_string([
 			Dir, "/scripts/exec_mercury_program ", 
@@ -242,12 +242,12 @@
 			WindowsStr, " ",
 			" ", ProgramPathStr, 
 			PathCallStr, "", ListArgsStr," &"],Command),
-		opium_write_debug("Command ="),
-		opium_write_debug(Command ),
+		morphine_write_debug("Command ="),
+		morphine_write_debug(Command ),
 		sh(Command),
 		!
 	;
-		write(stderr, "eclipse.pl: error in opium_run_program/2")
+		write(stderr, "eclipse.pl: error in morphine_run_program/2")
 	).
 
 % :- pred list_args_to_string(list(atom), list(string)).
@@ -351,7 +351,7 @@
 % 	implementation	: run_remote_Op,
 % 	parameters	: [],
 % 	message		:
-% 'Executes a Mercury program from Opium-M on a remote machine. \n\
+% 'Executes a Mercury program from Morphine on a remote machine. \n\
 % \n\
 % Example: run_remote(\"cripure.irisa.fr\",\"~mercury/sample/hello\") will \
 % run the mercury program \"hello\" on the machine cripure.\
@@ -387,8 +387,8 @@
 
 	accept(sock, _, newsock),
 
-	% state_of_opium = running | not_running | eot (| bot) 
-	setval(state_of_opium, running),
+	% state_of_morphine = running | not_running | eot (| bot) 
+	setval(state_of_morphine, running),
 
 	read_message_from_socket(hello),
 	send_message_to_socket(hello_reply),
@@ -462,7 +462,7 @@
 ').
 
 % XX if the connection with the debuggee process ended with a crash,
-% this command may not work properly because the global variable state_of_opium
+% this command may not work properly because the global variable state_of_morphine
 % would be set to running instead of not running. I should intercept the CTRL-C
 % to fix that.
 
@@ -471,7 +471,7 @@
 rerun_Op :-
 	getval(a_program_has_been_run, yes),
 	getval(re_run_program, ReStartCommand), 
-	getval(state_of_opium, State),
+	getval(state_of_morphine, State),
 	write(ReStartCommand),nl,
 	( 
 		State = eot
@@ -571,7 +571,7 @@
 	parameters	: [window_command],
 	message		:
 "Set the `window_command' parameter to \"\" (its default value). \
-The Mercury program executes in the same window as Opium-M."
+The Mercury program executes in the same window as Morphine."
 	).
 
 no_window_Op :-
@@ -590,7 +590,7 @@
 	message		:
 "Set the `window_command' parameter to \"xterm -e \", which make the Mercury \
 executes in a new xterm window; the program's Input/Output will go to that \
-window and the Opium-M's Input/Output will go to the current terminal."
+window and the Morphine's Input/Output will go to the current terminal."
 	).
 
 use_xterm_Op :-
@@ -607,9 +607,9 @@
 	implementation	: use_gdb_Op,
 	parameters	: [window_command],
 	message		:
-"Set the `window_command' parameter to \"xterm -e gdb \". This is to be able to use \
-both gdb and Opium-M. Note that to use gdb, you will need to compile your mercury \
-program with the option `--c-debug'."
+"Set the `window_command' parameter to \"xterm -e gdb \". This is to be able \
+to use both gdb and Morphine. Note that to use gdb, you will need to compile \
+your mercury program with the option `--c-debug'."
 	).
 
 use_gdb_Op :-
Index: source/forward_move.op
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/forward_move.op,v
retrieving revision 1.1
diff -u -r1.1 forward_move.op
--- source/forward_move.op	1999/11/11 04:52:22	1.1
+++ source/forward_move.op	1999/12/15 10:27:21
@@ -10,10 +10,10 @@
 
 %------------------------------------------------------------------------------%
 % New operator to denotate intervals (ex: 2..9).
-% Also defined in Opium-M.pl 
+% Also defined in Morphine.pl 
 :- op(350, xfx, ..).
 
-% Also defined in Opium-M.pl and current_slots.op
+% Also defined in Morphine.pl and current_slots.op
 :- op(900, xfy, and).
 
 
@@ -74,7 +74,7 @@
 Each attribute has a list of possible aliases that you can list with the \
 command list_alias_attributes/0.\n\
 \n\
-Example: the Opium-M goal fget(chrono = [20, 789] and depth = 3..6 and \
+Example: the Morphine goal fget(chrono = [20, 789] and depth = 3..6 and \
 proc = foo/2)  \
 will make the execution move forwards until the first event \
 which chronological event number is 20 or 789, depth is 3, 4, 5 or 6, \
@@ -87,7 +87,7 @@
 
 
 fget_Op(ConjOrList) :-
-	getval(state_of_opium, running),
+	getval(state_of_morphine, running),
 	(
 		is_list(ConjOrList),
 		fget_1_list(ConjOrList)
@@ -421,7 +421,7 @@
 	Arity, ModeNumber, Det, Arg, GoalPath) :-
     (
  	( not(Port == '-') ->
-		convert_mercury_port_opium_port(MercuryPort, Port)
+		convert_mercury_port_morphine_port(MercuryPort, Port)
 	;
 		MercuryPort = '-'
 	),
@@ -453,7 +453,7 @@
 		Response = forward_move_match_not_found 
 	->
 		write("last event is reached\n"),
-		setval(state_of_opium, eot),
+		setval(state_of_morphine, eot),
 	% we should not end the connection anymore here when [EOT] is fix
 		end_connection,
 		fail
@@ -463,17 +463,17 @@
 		write(stderr, "Error in fget_ll/13 (forward_move.op)\n"),
 		write(stderr, "   An error occured in the Mercury process: "),
 		write(stderr, ErrorMessage),
-		opium_abort
+		morphine_abort
 	;	
 		write(stderr, "Error in fget_ll/13 (forward_move.op)\n"),
 		write(stderr, "The Mercury process sends: "),
 		write(stderr, Response),
 		write(stderr, "\n"),
-		opium_abort
+		morphine_abort
 	)
    ;
 	% to make fget backtrackable.
-	( getval(state_of_opium, running) ->
+	( getval(state_of_morphine, running) ->
 		fget_ll(Chrono, Call, Depth, Port, PredOrFunc, DeclModule, 
 			DefModule, Pred,  Arity, ModeNumber, Det, Arg, GoalPath)
 	;
@@ -507,9 +507,9 @@
 		!
 	; 
 		% Should never occurs.
-		write(stderr, "Software error in Opium-M.\n"),
+		write(stderr, "Software error in Morphine.\n"),
 		write(stderr, "--> convert_integer_determinism_/2\n"),
-		opium_abort	
+		morphine_abort	
 	). 
 
 % :- pred convert_goal_path_string_list_list(list(integer), list(determinism)).
@@ -552,9 +552,9 @@
 		!
 	;
 		% Should never occurs.
-		write(stderr, "Software error in Opium-M.\n"),
+		write(stderr, "Software error in Morphine.\n"),
 		write(stderr, "--> convert_integer_determinism_/2\n"),
-		opium_abort	
+		morphine_abort	
 	). 
 
 % :- pred convert_integer_determinism_list(list(integer), list(determinism)).
@@ -573,116 +573,116 @@
 %:- mode convert_integer_determinism_exact(in, out) is semidet.
 convert_integer_determinism_exact(-, -) :-
 	!.
-convert_integer_determinism_exact(0, OpiumAtt) :-
-	(OpiumAtt = failure ; OpiumAtt = 'FAIL'),
+convert_integer_determinism_exact(0, MorphineAtt) :-
+	(MorphineAtt = failure ; MorphineAtt = 'FAIL'),
 	!.
-convert_integer_determinism_exact(2, OpiumAtt) :-
-	(OpiumAtt = semidet ; OpiumAtt = 'SEMI'),
+convert_integer_determinism_exact(2, MorphineAtt) :-
+	(MorphineAtt = semidet ; MorphineAtt = 'SEMI'),
 	!.
-convert_integer_determinism_exact(3, OpiumAtt) :-
-	(OpiumAtt = nondet ; OpiumAtt = 'NON'),
+convert_integer_determinism_exact(3, MorphineAtt) :-
+	(MorphineAtt = nondet ; MorphineAtt = 'NON'),
 	!.
-convert_integer_determinism_exact(4, OpiumAtt) :-
-	(OpiumAtt = erroneous ; OpiumAtt = 'ERR'),
+convert_integer_determinism_exact(4, MorphineAtt) :-
+	(MorphineAtt = erroneous ; MorphineAtt = 'ERR'),
 	!.
-convert_integer_determinism_exact(6, OpiumAtt) :-
-	(OpiumAtt = det ; OpiumAtt = 'DET'),
+convert_integer_determinism_exact(6, MorphineAtt) :-
+	(MorphineAtt = det ; MorphineAtt = 'DET'),
 	!.
-convert_integer_determinism_exact(7, OpiumAtt) :-
-	(OpiumAtt = multidet ; OpiumAtt = 'MUL'),
+convert_integer_determinism_exact(7, MorphineAtt) :-
+	(MorphineAtt = multidet ; MorphineAtt = 'MUL'),
 	!.
-convert_integer_determinism_exact(10, OpiumAtt) :-
-	(OpiumAtt = cc_nondet ; OpiumAtt = 'CCNON'),
+convert_integer_determinism_exact(10, MorphineAtt) :-
+	(MorphineAtt = cc_nondet ; MorphineAtt = 'CCNON'),
 	!.
-convert_integer_determinism_exact(14, OpiumAtt) :-
-	(OpiumAtt = cc_multidet ; OpiumAtt = 'CCMUL'),
+convert_integer_determinism_exact(14, MorphineAtt) :-
+	(MorphineAtt = cc_multidet ; MorphineAtt = 'CCMUL'),
 	!.
 
 
 %------------------------------------------------------------------------------%
-%:- pred convert_mercury_port_opium_port(mercury_port, opium_port).
-%:- mode convert_mercury_port_opium_port(out, in) is det.
-convert_mercury_port_opium_port(Mport, Oport) :-
+%:- pred convert_mercury_port_morphine_port(mercury_port, morphine_port).
+%:- mode convert_mercury_port_morphine_port(out, in) is det.
+convert_mercury_port_morphine_port(Mport, Oport) :-
 	(
 		Oport = '-',
 		Mport = '-',
 		!
 	; 
 		is_list(Oport),
-		convert_mercury_port_opium_port_list(Mport, Oport),
+		convert_mercury_port_morphine_port_list(Mport, Oport),
 		!
 	;
 		is_negated_value(Oport, NegOport),
-		convert_mercury_port_opium_port(NegMport, NegOport),
+		convert_mercury_port_morphine_port(NegMport, NegOport),
 		Mport = not(NegMport),
 		!
 	;
 		is_exact_value(Oport),
-		convert_mercury_port_opium_port_exact(Mport, Oport),
+		convert_mercury_port_morphine_port_exact(Mport, Oport),
 		!
 	;
-		write(stderr, "Software error in Opium-M !\n"),
-		write(stderr, "--> convert_mercury_port_opium_port/2 \n"),
-		opium_abort	
+		write(stderr, "Software error in Morphine !\n"),
+		write(stderr, "--> convert_mercury_port_morphine_port/2 \n"),
+		morphine_abort	
 	). 
 
-%:- pred convert_mercury_port_opium_port_list(list(mercury_port), 
-%	list(opium_port)).
-%:- mode convert_mercury_port_opium_port_list(out, in) is semidet.
-convert_mercury_port_opium_port_list([], []).
-convert_mercury_port_opium_port_list([Mport | MportTail], 
+%:- pred convert_mercury_port_morphine_port_list(list(mercury_port), 
+%	list(morphine_port)).
+%:- mode convert_mercury_port_morphine_port_list(out, in) is semidet.
+convert_mercury_port_morphine_port_list([], []).
+convert_mercury_port_morphine_port_list([Mport | MportTail], 
     [Oport | OportTail]) :-
-	convert_mercury_port_opium_port_exact(Mport, Oport),
-	convert_mercury_port_opium_port_list(MportTail, OportTail).
+	convert_mercury_port_morphine_port_exact(Mport, Oport),
+	convert_mercury_port_morphine_port_list(MportTail, OportTail).
 
-%:- pred convert_mercury_port_opium_port_exact(trace_port_type, atom).
-%:- mode convert_mercury_port_opium_port_exact(in, out) is semidet.
-%:- mode convert_mercury_port_opium_port_exact(out, in) is semidet.
-convert_mercury_port_opium_port_exact(-, -) :- 
+%:- pred convert_mercury_port_morphine_port_exact(trace_port_type, atom).
+%:- mode convert_mercury_port_morphine_port_exact(in, out) is semidet.
+%:- mode convert_mercury_port_morphine_port_exact(out, in) is semidet.
+convert_mercury_port_morphine_port_exact(-, -) :- 
 	!.
-convert_mercury_port_opium_port_exact(call, Ocall) :- 
+convert_mercury_port_morphine_port_exact(call, Ocall) :- 
 	(Ocall = call ; Ocall = 'CALL'),
 	!.
-convert_mercury_port_opium_port_exact(exit, Oexit) :- 
+convert_mercury_port_morphine_port_exact(exit, Oexit) :- 
 	(Oexit = exit ; Oexit = 'EXIT'),
 	!.
-convert_mercury_port_opium_port_exact(redo, Oredo) :-  
+convert_mercury_port_morphine_port_exact(redo, Oredo) :-  
 	(Oredo = redo ; Oredo = 'REDO'),
 	!.
-convert_mercury_port_opium_port_exact(fail, Ofail) :-  
+convert_mercury_port_morphine_port_exact(fail, Ofail) :-  
 	(Ofail = fail ; Ofail = 'FAIL'),
 	!.
-convert_mercury_port_opium_port_exact(ite_cond, Ocond) :-  
+convert_mercury_port_morphine_port_exact(ite_cond, Ocond) :-  
 	(Ocond = cond ; Ocond = 'COND'),
 	!.
-convert_mercury_port_opium_port_exact(ite_then, Othen) :-  
+convert_mercury_port_morphine_port_exact(ite_then, Othen) :-  
 	(Othen = then ; Othen = 'THEN'),
 	!.
-convert_mercury_port_opium_port_exact(ite_else, Oelse) :-  
+convert_mercury_port_morphine_port_exact(ite_else, Oelse) :-  
 	(Oelse = else ; Oelse = 'ELSE'),
 	!.
-convert_mercury_port_opium_port_exact(neg_enter, Oneg_enter) :-  
+convert_mercury_port_morphine_port_exact(neg_enter, Oneg_enter) :-  
 	(Oneg_enter = neg_enter ; Oneg_enter = 'NEGE'),
 	!.
-convert_mercury_port_opium_port_exact(neg_success, Oneg_success) :-  
+convert_mercury_port_morphine_port_exact(neg_success, Oneg_success) :-  
 	(Oneg_success = neg_success ; Oneg_success = 'NEGS'),
 	!.
-convert_mercury_port_opium_port_exact(neg_failure, Oneg_failure) :-  
+convert_mercury_port_morphine_port_exact(neg_failure, Oneg_failure) :-  
 	(Oneg_failure = neg_failure ; Oneg_failure = 'NEGF'),
 	!.
-convert_mercury_port_opium_port_exact(disj, Odisj) :-  
+convert_mercury_port_morphine_port_exact(disj, Odisj) :-  
 	(Odisj = disj ; Odisj = 'DISJ'),
 	!.
-convert_mercury_port_opium_port_exact(switch, Oswitch) :-  
+convert_mercury_port_morphine_port_exact(switch, Oswitch) :-  
 	(Oswitch = switch ; Oswitch = 'SWITCH' ; Oswitch = 'SWTC'),
 	!.
-convert_mercury_port_opium_port_exact(nondet_pragma_first, Ofirst) :-  
+convert_mercury_port_morphine_port_exact(nondet_pragma_first, Ofirst) :-  
 	(Ofirst = first ; Ofirst = 'FIRST' ; Ofirst = 'FRST'),
 	!.
-convert_mercury_port_opium_port_exact(nondet_pragma_later, Olater) :-  
+convert_mercury_port_morphine_port_exact(nondet_pragma_later, Olater) :-  
 	(Olater = later ; Olater =  'LATER' ; Olater = 'LATR'),
 	!.
-convert_mercury_port_opium_port_exact(exception, Oexception) :-  
+convert_mercury_port_morphine_port_exact(exception, Oexception) :-  
 	(Oexception = exception ; Oexception =  'EXCEPTION' ; 
 		Oexception = 'EXCP'),
 	!.
@@ -750,9 +750,9 @@
 		AttributeMatch = exact(Attribute),
 		!
 	;
-		write(stderr, "Software error in Opium-M !\n"),
+		write(stderr, "Software error in Morphine !\n"),
 		write(stderr, "--> attribute_to_match/2 \n"),
-		opium_abort	
+		morphine_abort	
 	).
 
 
@@ -819,7 +819,7 @@
 		AttributeMatch = exact(AttrStrQuoted)
 	;
 		write(stderr, "error in forward_move/attribute_to_match_str\n"),
-		opium_abort	
+		morphine_abort	
 	).
 
 
@@ -855,9 +855,9 @@
 		AttributeMatch = exact(AttrQuoted),
 		!
 	;
-		write(stderr, "Software error in Opium-M !\n"),
+		write(stderr, "Software error in Morphine !\n"),
 		write(stderr, "--> attribute_to_match_gp/2 \n"),
-		opium_abort	
+		morphine_abort	
 	).
 
 det_fget_Op(Chrono, Call, Depth, Port, PredOrFunc, DeclModule, DefModule, 
@@ -914,7 +914,7 @@
 	).
 
 retry_Op :-
-	getval(state_of_opium, running),
+	getval(state_of_morphine, running),
 	send_message_to_socket(retry),
 	read_message_from_socket(Message), 
 	( 
Index: source/interactive_queries.op
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/interactive_queries.op,v
retrieving revision 1.1
diff -u -r1.1 interactive_queries.op
--- source/interactive_queries.op	1999/11/11 04:52:23	1.1
+++ source/interactive_queries.op	1999/12/15 10:27:22
@@ -31,7 +31,7 @@
 (goals) interactively in the debugger. When you use one of these commands, the \
 debugger will respond with a query prompt (`?-' or `run <--'), at which you \
 can type in a goal; the debugger will the compile and execute the goal and \
-display the answer(s). You can return from the query prompt to the Opium-M \
+display the answer(s). You can return from the query prompt to the Morphine \
 prompt by typing the end-of-file indicator (typically control-D or \
 control-Z), or by typing `quit.'. \n\
 \n\
@@ -70,7 +70,7 @@
 	any_query(ModuleList, query).
 
 any_query(ModuleList, QueryType) :-
-	( not getval(state_of_opium, running) ->
+	( not getval(state_of_morphine, running) ->
 		write("No program is running, you can't make a query.\n")
 	;
 		true
@@ -94,7 +94,7 @@
 	send_message_to_socket(Term2),
 	nl,
 	read_message_from_socket(Response),
-	get_parameter(debug_opium, OnOff),
+	get_parameter(debug_morphine, OnOff),
 	( OnOff == on ->
 		printf("response to query = %w\n", [Response])
 	;
@@ -198,7 +198,7 @@
 
 
 mmc_options_Op(Options) :- 
-	( not getval(state_of_opium, running) ->
+	( not getval(state_of_morphine, running) ->
 		write("No program is running, you can't set mmc options.\n")
 	;
 		true
Index: source/load_scenario.pl
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/load_scenario.pl,v
retrieving revision 1.1
diff -u -r1.1 load_scenario.pl
--- source/load_scenario.pl	1999/11/11 04:52:24	1.1
+++ source/load_scenario.pl	1999/12/15 10:27:31
@@ -4,10 +4,10 @@
 % Authors : Erwan Jahier <jahier at irisa.fr>, 
 %           Mireille Ducassé <ducasse at irisa.fr>
 % 
-% This file loads the Opium-M files. It is loaded from the load_opium.pl.
+% This file loads the Morphine files. It is loaded from the load_morphine.pl.
  
 
-:- module('Opium-M').
+:- module(morphine).
 	
 
 /* 
@@ -16,37 +16,37 @@
 */
 
 :-	
-	getenv('MERCURY_OPIUM_DIR', OpiumDir),
-	append_strings(OpiumDir, "/source/opiumfiles/", OpiumfilesStr),
-	append_strings(OpiumDir, "/source/", SourceStr),
+	getenv('MERCURY_MORPHINE_DIR', MorphineDir),
+	append_strings(MorphineDir, "/source/morphinefiles/", MorphinefilesStr),
+	append_strings(MorphineDir, "/source/", SourceStr),
 
 	% compile the *.op files
 	append_strings(SourceStr, "util.pl", Util),
-	compile(Util, 'Opium-M'),
+	compile(Util, morphine),
 
-	append_strings(OpiumfilesStr, "autoload.load", AutoloadLoad),
-	append_strings(OpiumfilesStr, "scenario.load", ScenarioLoad),
-	append_strings(OpiumfilesStr, "scenario_handler.load", ScenarioHLoad),
-	append_strings(OpiumfilesStr, "parameter.load", ParameterLoad),
-	append_strings(OpiumfilesStr, "translate.load", TranslateLoad),
-	append_strings(OpiumfilesStr, "error.load", ErrorLoad),
-	append_strings(OpiumfilesStr, "types.load", TypesLoad),
-	append_strings(OpiumfilesStr, "make.load", MakeLoad),
-	append_strings(OpiumfilesStr, "help.load", HelpLoad), 
-	append_strings(OpiumfilesStr, "opium_m_kernel.load", OpiumLoad),
-	append_strings(OpiumfilesStr, "coprocess.load", CoprocessLoad),
-	append_strings(OpiumfilesStr, "exec_control.load", ExecLoad),
-	append_strings(OpiumfilesStr, "current_arg.load", Current_argLoad),
-	append_strings(OpiumfilesStr, "current_slots.load", Current_slotsLoad),
-	append_strings(OpiumfilesStr, "event_attributes.load", EventLoad),
-	append_strings(OpiumfilesStr, "forward_move.load", ForwardLoad),
-	append_strings(OpiumfilesStr, "display.load", DisplayLoad),
-	append_strings(OpiumfilesStr, "browse.load", BrowseLoad),
-	append_strings(OpiumfilesStr, "interactive_queries.load", IQLoad),
-	append_strings(OpiumfilesStr, "source.load", SourceLoad),
-	append_strings(OpiumfilesStr, "step_by_step.load", StepLoad),
-	append_strings(OpiumfilesStr, "collect.load", CollectLoad),
-	append_strings(OpiumfilesStr, "control_flow.load", CFLoad),
+	append_strings(MorphinefilesStr, "autoload.load", AutoloadLoad),
+	append_strings(MorphinefilesStr, "scenario.load", ScenarioLoad),
+	append_strings(MorphinefilesStr, "scenario_handler.load", ScenarioHLoad),
+	append_strings(MorphinefilesStr, "parameter.load", ParameterLoad),
+	append_strings(MorphinefilesStr, "translate.load", TranslateLoad),
+	append_strings(MorphinefilesStr, "error.load", ErrorLoad),
+	append_strings(MorphinefilesStr, "types.load", TypesLoad),
+	append_strings(MorphinefilesStr, "make.load", MakeLoad),
+	append_strings(MorphinefilesStr, "help.load", HelpLoad), 
+	append_strings(MorphinefilesStr, "morphine_kernel.load", MorphineLoad),
+	append_strings(MorphinefilesStr, "coprocess.load", CoprocessLoad),
+	append_strings(MorphinefilesStr, "exec_control.load", ExecLoad),
+	append_strings(MorphinefilesStr, "current_arg.load", Current_argLoad),
+	append_strings(MorphinefilesStr, "current_slots.load", Current_slotsLoad),
+	append_strings(MorphinefilesStr, "event_attributes.load", EventLoad),
+	append_strings(MorphinefilesStr, "forward_move.load", ForwardLoad),
+	append_strings(MorphinefilesStr, "display.load", DisplayLoad),
+	append_strings(MorphinefilesStr, "browse.load", BrowseLoad),
+	append_strings(MorphinefilesStr, "interactive_queries.load", IQLoad),
+	append_strings(MorphinefilesStr, "source.load", SourceLoad),
+	append_strings(MorphinefilesStr, "step_by_step.load", StepLoad),
+	append_strings(MorphinefilesStr, "collect.load", CollectLoad),
+	append_strings(MorphinefilesStr, "control_flow.load", CFLoad),
 
 	append_strings(SourceStr, "autoload.op", AutoloadOp), 
 	append_strings(SourceStr, "interface.op", InterfaceOp),
@@ -58,7 +58,7 @@
 	append_strings(SourceStr, "types.op", TypesOp), 
 	append_strings(SourceStr, "translate.op", TranslateOp), 
 	append_strings(SourceStr, "parameter.op", ParameterOp), 
-	append_strings(SourceStr, "opium_m_kernel.op", OpiumOp),
+	append_strings(SourceStr, "morphine_kernel.op", MorphineOp),
 	append_strings(SourceStr, "coprocess.op", CoprocessOp),
 	append_strings(SourceStr, "exec_control.op", ExecOp),
 	append_strings(SourceStr, "current_arg.op", Current_argOp),
@@ -81,41 +81,41 @@
 
 	compile([ScenarioHLoad, ErrorLoad, MakeLoad, ParameterLoad, ScenarioLoad, 
 		AutoloadLoad, TranslateLoad, TypesLoad]),
-	initialize_parameters(single, scenario_handler, 'Opium-M'),
-	initialize_parameters(multiple, scenario_handler, 'Opium-M'),
+	initialize_parameters(single, scenario_handler, morphine),
+	initialize_parameters(multiple, scenario_handler, morphine),
 
 	compile(InterfaceOp),
 
 	compile([HelpOp, HelpLoad]),
-	initialize_parameters(single, help, 'Opium-M'),
-	initialize_parameters(multiple, help, 'Opium-M'),
+	initialize_parameters(single, help, morphine),
+	initialize_parameters(multiple, help, morphine),
 
-	compile([OpiumOp, ForwardOp, Current_slotsOp, Current_argOp, 
+	compile([MorphineOp, ForwardOp, Current_slotsOp, Current_argOp, 
 		EventOp, ExecOp, CoprocessOp, BrowseOp, IQOp]),
-	compile([OpiumLoad, ForwardLoad, Current_slotsLoad, Current_argLoad, 
+	compile([MorphineLoad, ForwardLoad, Current_slotsLoad, Current_argLoad, 
 		EventLoad, ExecLoad, CoprocessLoad, BrowseLoad, IQLoad]),	
-	initialize_parameters(single, 'opium_m_kernel', 'Opium-M'),
-	initialize_parameters(multiple, 'opium_m_kernel', 'Opium-M'),
+	initialize_parameters(single, 'morphine_kernel', morphine),
+	initialize_parameters(multiple, 'morphine_kernel', morphine),
 
 	compile([DisplayOp, DisplayLoad]),
-	initialize_parameters(single, 'display' , 'Opium-M'),
-	initialize_parameters(multiple, 'display', 'Opium-M'),
+	initialize_parameters(single, 'display' , morphine),
+	initialize_parameters(multiple, 'display', morphine),
 
 	compile([StepOp, StepLoad]),
-	initialize_parameters(single, 'step_by_step', 'Opium-M'),
-	initialize_parameters(multiple, 'step_by_step', 'Opium-M'),
+	initialize_parameters(single, 'step_by_step', morphine),
+	initialize_parameters(multiple, 'step_by_step', morphine),
 
 	compile([CollectOp, CollectLoad]),
-	initialize_parameters(single, 'collect', 'Opium-M'),
-	initialize_parameters(multiple, 'collect', 'Opium-M'),
+	initialize_parameters(single, 'collect', morphine),
+	initialize_parameters(multiple, 'collect', morphine),
 
 	compile([CFOp, CFLoad]),
-	initialize_parameters(single, 'control_flow', 'Opium-M'),
-	initialize_parameters(multiple, 'control_flow', 'Opium-M'),
+	initialize_parameters(single, 'control_flow', morphine),
+	initialize_parameters(multiple, 'control_flow', morphine),
 
 	compile([SourceOp, SourceLoad]),
-	initialize_parameters(single, 'source', 'Opium-M'),
-	initialize_parameters(multiple, 'source', 'Opium-M'),
+	initialize_parameters(single, 'source', morphine),
+	initialize_parameters(multiple, 'source', morphine),
 
 	setval(already_global, yes).	%% XXX [md] pas completement  satisfaisant
 
Index: source/make_scenario.pl
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/make_scenario.pl,v
retrieving revision 1.1
diff -u -r1.1 make_scenario.pl
--- source/make_scenario.pl	1999/11/11 04:52:24	1.1
+++ source/make_scenario.pl	1999/12/15 10:27:31
@@ -4,18 +4,18 @@
 % Authors : Erwan Jahier <jahier at irisa.fr>, 
 %           Mireille Ducassé <ducasse at irisa.fr>
 % 
-% This file builds the Opium-M files. It is loaded from the INSTALL-OPIUM-M
+% This file builds the Morphine files. It is loaded from the INSTALL-MORPHINE
 % script.
 
-:- module('Opium-M').
+:- module(morphine).
 
 % We are using some files (the scenario handler) that are part of Eclipse.
-% To avoid licensing issues, we did not include them in the Opium-M distribution.
+% To avoid licensing issues, we did not include them in the Morphine distribution.
 % But since we need to patch them, we copy them and then apply the patches.
  
 patch_opium_files(FileName) :-
-	getenv('MERCURY_OPIUM_DIR', OpiumDir),
-	append_strings(OpiumDir, "/source/", SourceDir),
+	getenv('MERCURY_MORPHINE_DIR', MorphineDir),
+	append_strings(MorphineDir, "/source/", SourceDir),
 	atom_string(FileName, FileNameStr),
 	get_flag(installation_directory, InstallDir),
 	append_strings(InstallDir, "/lib_pd/opium_light/", OPIUM_LIGTH_DIR),
@@ -55,42 +55,42 @@
 :- patch_all_files.
 
 :- 
-	getenv('MERCURY_OPIUM_DIR', OpiumDir),
-	append_strings(OpiumDir, "/source/", SourceStr),
+	getenv('MERCURY_MORPHINE_DIR', MorphineDir),
+	append_strings(MorphineDir, "/source/", SourceStr),
 	atom_string(Source, SourceStr),
 
 	append_strings(SourceStr, "util.pl", Util),
-	compile(Util, 'Opium-M'),
+	compile(Util, morphine),
 
-	append_strings(OpiumDir, "/source/error.op", Error),
-	append_strings(OpiumDir, "/source/scenario_handler.op", 
+	append_strings(MorphineDir, "/source/error.op", Error),
+	append_strings(MorphineDir, "/source/scenario_handler.op", 
 		Scenario_handler),
-	append_strings(OpiumDir, "/source/make.op", Make),
-	append_strings(OpiumDir, "/source/scenario.op", Scenario),
-	append_strings(OpiumDir, "/source/translate.op", Translate),
-	append_strings(OpiumDir, "/source/types.op", Types),
-	append_strings(OpiumDir, "/source/parameter.op", Parameter),
-	append_strings(OpiumDir, "/source/autoload.op", Autoload),
-	append_strings(OpiumDir, "/source/interface.op", Interface),
-	compile(Scenario_handler, 'Opium-M'),
-	compile(Error, 'Opium-M'),
-	compile(Make, 'Opium-M'),
-	compile(Parameter, 'Opium-M'),
-	compile(Scenario, 'Opium-M'),
-	compile(Autoload, 'Opium-M'),
-	compile(Translate, 'Opium-M'),
-	compile(Types, 'Opium-M'),
-	compile(Interface, 'Opium-M'),
+	append_strings(MorphineDir, "/source/make.op", Make),
+	append_strings(MorphineDir, "/source/scenario.op", Scenario),
+	append_strings(MorphineDir, "/source/translate.op", Translate),
+	append_strings(MorphineDir, "/source/types.op", Types),
+	append_strings(MorphineDir, "/source/parameter.op", Parameter),
+	append_strings(MorphineDir, "/source/autoload.op", Autoload),
+	append_strings(MorphineDir, "/source/interface.op", Interface),
+	compile(Scenario_handler, morphine),
+	compile(Error, morphine),
+	compile(Make, morphine),
+	compile(Parameter, morphine),
+	compile(Scenario, morphine),
+	compile(Autoload, morphine),
+	compile(Translate, morphine),
+	compile(Types, morphine),
+	compile(Interface, morphine),
 
 	build_obj_dir(OD),
-	make(scenario_handler, 'Opium-M', [active, traceable, global], Source, OD),
-	make('opium_m_kernel', 'Opium-M', [active, traceable, global], Source, OD),
-	make('source', 'Opium-M', [active, traceable, global], Source, OD),
-	make('display', 'Opium-M', [active, traceable, global], Source, OD),
-	make('step_by_step', 'Opium-M', [active, traceable, global], Source, OD),
-	make(collect, 'Opium-M', [active, traceable, global], Source, OD),
-	make(control_flow, 'Opium-M', [active, traceable, global], Source, OD),
-	make(help, 'Opium-M', [active, traceable, global], Source, OD),
+	make(scenario_handler, morphine, [active, traceable, global], Source, OD),
+	make('morphine_kernel', morphine, [active, traceable, global], Source, OD),
+	make('source', morphine, [active, traceable, global], Source, OD),
+	make('display', morphine, [active, traceable, global], Source, OD),
+	make('step_by_step', morphine, [active, traceable, global], Source, OD),
+	make(collect, morphine, [active, traceable, global], Source, OD),
+	make(control_flow, morphine, [active, traceable, global], Source, OD),
+	make(help, morphine, [active, traceable, global], Source, OD),
 
 	halt.
 
Index: source/patch.error
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/patch.error,v
retrieving revision 1.1
diff -u -r1.1 patch.error
--- source/patch.error	1999/11/11 04:52:24	1.1
+++ source/patch.error	1999/12/15 10:27:32
@@ -8,8 +8,8 @@
  :- call_explicit(traceable check_arg_type/4, sepia_kernel).
 -:- ((call(is_predicate(current_options/1), opium_kernel),
 -     call(current_options([active, traceable, _]), opium_kernel)) ->
-+:- ((call(is_predicate(current_options/1), 'Opium-M'),
-+     call(current_options([active, traceable, _]), 'Opium-M')) ->
++:- ((call(is_predicate(current_options/1), morphine),
++     call(current_options([active, traceable, _]), morphine)) ->
  		call_explicit(unskipped check_arg_type/4, sepia_kernel)
     	;
  		call_explicit(skipped check_arg_type/4, sepia_kernel)
Index: source/patch.help
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/patch.help,v
retrieving revision 1.1
diff -u -r1.1 patch.help
--- source/patch.help	1999/11/11 04:52:24	1.1
+++ source/patch.help	1999/12/15 10:27:33
@@ -1,33 +1,31 @@
-%------------------------------------------------------------------------------%
-% Copyright (C) 1999 INRIA/INSA.
 --- /soft/eclipse/eclipse4.1/lib_pd/opium_light/help.op	Sat Feb 20 16:09:16 1999
-+++ help.op	Thu Nov  4 09:00:02 1999
++++ help.op	Mon Dec 13 13:41:17 1999
 @@ -41,8 +41,28 @@
  :- tool(show_all/2).
  
  help_Op :-
 -	opium_write(help, "\nThere are the following help commands: \n"),
 -	show_all(commands, help).
-+	opium_write(help, 
-+		"\nThere are the following help commands for Opium-M: \n"),
++	write(help, 
++		"\nThere are the following help commands for Morphine: \n"),
 +	show_all(commands, help),
 +
 +	% I copied this message here because I found no way to extend the
 +	% help/0 command by using its previous definition. 
-+        opium_write(help, "\nAnd here is the help message for ECLiPSe: \n\n"),
-+	opium_write(help, 
++        write(help, "\nAnd here is the help message for ECLiPSe: \n\n"),
++	 write(help, 
 +	    "   After the prompt [<module>]: ECLiPSe waits for a goal.\n"),
-+        opium_write(help, 
++        write(help, 
 +	    "   To type in clauses, call [user] or compile(user), and then\n"),
-+        opium_write(help, 
++        write(help, 
 +	    "   enter the clauses ended by ^D (EOF).\n\n"),
-+        opium_write(help, 
++        write(help, 
 +	    "   Call help(Pred/Arity) or help(Pred) or help(String)\n"),
-+        opium_write(help, 
++        write(help, 
 +	    "   to get help on a specific built-in predicate.\n\n"),
-+        opium_write(help, 
++        write(help, 
 +	    "   Call demo (in xeclipse) to invoke the demo programs.\n\n"),
-+        opium_write(help, 
++        write(help, 
 +	    "   This message can be modified by setting the handler for event 231.\n").
 +
  
@@ -62,8 +60,74 @@
  	system(Cmd1),
  	concat_atom([File, '.tex'], LatexFile),
  	concat_atom(['rm -f ', LatexFile], Cmd2),
-@@ -777,5 +799,63 @@
+@@ -728,16 +750,63 @@
+ 	opium_printf(help, "demo_goal: %w\ncondition: %w\n%w\n", [DemoGoal, Condition, Message]).
+ print_man_Op(tty, ArgList, ArgType, Message, DefaultValue, ObjType) :-
+ 	!,
+-	opium_printf(help, "%w\n", [Message]),
++	print_message(help, Message), nl,
+ 	print_arg_type(tty, ArgList, ArgType),
+ 	print_default_value(tty, DefaultValue),
+ 	print_object_type(tty, DefaultValue, ObjType).
+ print_man_Op(Manual, ArgList, ArgType, Message, DefaultValue, ObjType) :-
+-	writeln(Manual, Message),
++	print_message(Manual, Message), nl,
+ 	print_arg_type(Manual, ArgList, ArgType),
+ 	print_default_value(Manual, DefaultValue),
+ 	print_object_type(Manual, DefaultValue, ObjType).
  
++
++% Print on-line help messages in such a way that they fit into 80 columns. 
++print_message(Stream, Msg) :-
++	% To take into account the existing `\n\'.
++	split_string(Msg, "\n\\", "", ListStr),
++	print_message_list(Stream, ListStr).
++
++print_message_list(Stream, []).
++print_message_list(Stream, [X|Tail]) :-
++	print_message2([Stream, X]),
++	print_message_list(Stream, Tail).
++
++print_message2([Stream, Msg]) :-
++	Max = 80,
++	string_length(Msg, Length),
++	( Length > Max ->
++		print_message3(Stream, Msg, Max)
++	;
++		writeln(Stream, Msg)
++	).
++
++print_message3(Stream, Msg, Max) :-
++	(
++		% Make sure that there is at least one " " character in the Msg
++		% before trying to truncate the line at the first " ".
++		not(substring(Msg, " ", _)),
++		write(Stream, Msg),
++		!
++	;
++		(
++			% The Max th character is a " ". We truncate the line here.
++			substring(Msg, " ", Max),
++			substring(Msg, 1, Max, MsgBegin),
++			append_strings(MsgBegin, MsgEnd, Msg),
++			writeln(Stream, MsgBegin),
++			print_message2([Stream, MsgEnd]),
++			!
++		;
++			% The Max nt character is not a " ". We recursively try again
++			% Max - 1. 
++			Max2 is Max - 1,
++			print_message3(Stream, Msg, Max2)
++		)
++	).
++% To prevent print_message3/3 from looping. Should not be necessary
++print_message3(_,_,0).
++
+ print_arg_type(_, _, []) :- !.
+ print_arg_type(tty, [Arg | AList], [Type | TList]) :-
+ 	!,
+@@ -777,5 +846,63 @@
+ 
  
  
 -
@@ -82,7 +146,7 @@
 +"Command which displays all the commands, primitives, procedures, parameters, \
 +or types for which Name is a substring of.\n\
 +Example: \n\
-+[Opium-M]: apropos man.\n\
++[morphine]: apropos man.\n\
 +    man\n\
 +    manual\n\
 +    latex_manual\n\
Index: source/patch.interface
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/patch.interface,v
retrieving revision 1.1
diff -u -r1.1 patch.interface
--- source/patch.interface	1999/11/11 04:52:25	1.1
+++ source/patch.interface	1999/12/15 10:27:37
@@ -7,7 +7,7 @@
  /*
   * 	INTERFACE scenario
 - * It has to be compiled in opium_kernel module.
-+ * It has to be compiled in 'Opium-M' module.
++ * It has to be compiled in morphine module.
   */
  
  opium_scenario(
Index: source/patch.make
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/patch.make,v
retrieving revision 1.1
diff -u -r1.1 patch.make
--- source/patch.make	1999/11/11 04:52:25	1.1
+++ source/patch.make	1999/12/15 10:27:38
@@ -8,9 +8,9 @@
  make_scenario_Op(S, Mod, OptionList) :-
 -	get_opiumdir(ODS),
 -	append_strings(ODS, "opiumfiles/", ObjDirS),
-+	getenv('MERCURY_OPIUM_DIR', OpiumDir),
-+	append_strings(OpiumDir, "/source/", ODS),
-+	append_strings(ODS, "/opiumfiles/", ObjDirS),
++	getenv('MERCURY_MORPHINE_DIR', MorphineDir),
++	append_strings(MorphineDir, "/source/", ODS),
++	append_strings(ODS, "/morphinefiles/", ObjDirS),
  	atom_string(OD, ODS),
  	atom_string(ObjDir, ObjDirS),
  	make_scenario_Op(S, Mod, OptionList, OD, ObjDir).
@@ -49,7 +49,7 @@
   	update(Scenario, Mod, [A, T, GL], FileList, Time, SrcDir, ObjDir),
  	retract_all(current_options(_)),
 -	make_interface_list(Scenario, GL, Mod),	% for windowing user-interface
-+% [R1] Not available for Opium-M.
++% [R1] Not available for Morphine.
 +%	make_interface_list(Scenario, GL, Mod),	% for windowing user-interface
  	(opium_level(0) ->
  		/* we are booting Opium, so c parameters cannot be set */
@@ -90,7 +90,7 @@
  	!,
 -	call(current_options(O), opium_kernel),
 -	opium_printf(output, "loading %w\n", [SrcF]),
-+	call(current_options(O), 'Opium-M'),
++	call(current_options(O), morphine),
 +	printf(output, "loading %w\n", [SrcF]),
  	compile(SrcF, Mod),
  	compile(LoadF, Mod),
@@ -130,7 +130,7 @@
  
  add_gloloc_directive(Clause, Module) :-
 -	call(current_options([_,_,GloLoc]), opium_kernel),
-+	call(current_options([_,_,GloLoc]), 'Opium-M'),
++	call(current_options([_,_,GloLoc]), morphine),
  	add_gloloc_directive(Clause, Module, GloLoc).
  
  add_gloloc_directive(_, _, global) :-
@@ -149,7 +149,7 @@
 -	get_opium_file("opium_module", File),
 -	compile(File, Mod).
 +
-+% [R1] Removed because update_opium_module_menu is not available in Opium-M
++% [R1] Removed because update_opium_module_menu is not available in Morphine
 +% provide_opium_module(Mod) :-
 +% 	update_opium_module_menu(Mod),		% for wui interface
 +% 	printf(output, "creating opium module %w\n", [Mod]),
Index: source/patch.parameter
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/patch.parameter,v
retrieving revision 1.1
diff -u -r1.1 patch.parameter
--- source/patch.parameter	1999/11/11 04:52:25	1.1
+++ source/patch.parameter	1999/12/15 10:27:40
@@ -9,7 +9,7 @@
 -get_parameter_value(c, Parameter, _, [Value], _) :-
 -	!,	
 -	remote_once(getval(Parameter, Value), sepia_kernel).
-+% XXX  remote_once is not available in Opium-M
++% XXX  remote_once is not available in Morphine
 +% get_parameter_value(c, Parameter, _, [Value], _) :-
 +% 	!,	
 +% 	remote_once(getval(Parameter, Value), sepia_kernel).
@@ -23,7 +23,7 @@
  
 -set_parameter_value(c, Parameter, _, [NewVal], _) :-
 -	remote_once(setval(Parameter, NewVal), sepia_kernel).
-+% XXX  remote_once is not available in Opium-M
++% XXX  remote_once is not available in Morphine
 +% set_parameter_value(c, Parameter, _, [NewVal], _) :-
 +% 	remote_once(setval(Parameter, NewVal), sepia_kernel).
  set_parameter_value(single, Parameter, ArgList, NewValueList, Module) :-
@@ -45,7 +45,7 @@
 -set_default_value(c, Parameter, _, [DefaultVal], _) :-
 -	/* there is always a default value for c parameters */
 -	remote_once(setval(Parameter, DefaultVal), sepia_kernel).
-+% XXX  remote_once is not available in Opium-M
++% XXX  remote_once is not available in Morphine
 +% set_default_value(c, Parameter, _, [DefaultVal], _) :-
 +% 	/* there is always a default value for c parameters */
 +% 	remote_once(setval(Parameter, DefaultVal), sepia_kernel).
@@ -70,12 +70,12 @@
 -	remote_once(getval(Parameter, Val), sepia_kernel),
 -	G =.. [Parameter | [Val]],
 -	opium_printf(help, "    %w\n", [G]).
-+% XXX  remote_once is not available in Opium-M
++% XXX  remote_once is not available in Morphine
 +% list_parameter(c, Parameter, _, _) :-
 +% 	!,
 +% 	remote_once(getval(Parameter, Val), sepia_kernel),
 +% 	G =.. [Parameter | [Val]],
-+% 	opium_printf(help, "    %w\n", [G]).
++% 	printf(help, "    %w\n", [G]).
  list_parameter(single, Parameter, ArgList, Module) :-
  	!,
  	length(ArgList, L),
@@ -86,7 +86,7 @@
 -get_current_values(c, Name, Module, ArgList, [Val]) :-
 -	remote_once(getval(Name, Val), sepia_kernel),
 -	!.
-+% XXX  remote_once is not available in Opium-M
++% XXX  remote_once is not available in Morphine
 +% get_current_values(c, Name, Module, ArgList, [Val]) :-
 +% 	remote_once(getval(Name, Val), sepia_kernel),
 +% 	!.
Index: source/patch.scenario
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/patch.scenario,v
retrieving revision 1.1
diff -u -r1.1 patch.scenario
--- source/patch.scenario	1999/11/11 04:52:25	1.1
+++ source/patch.scenario	1999/12/15 10:27:41
@@ -8,12 +8,12 @@
  
 -opium_module_Op(opium_kernel).
 -	/* to get opium_kernel as first module always (manual) */
-+opium_module_Op('Opium-M').
-+	/* to get 'Opium-M' as first module always (manual) */
++opium_module_Op(morphine).
++	/* to get morphine as first module always (manual) */
  opium_module_Op(M) :-
  	current_module(M),
 -	M \== opium_kernel,
-+	M \== 'Opium-M',
++	M \== morphine,
  	not is_locked(M),
  	call(is_predicate(opium_module/0), M).
  
Index: source/patch.scenario_handler
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/patch.scenario_handler,v
retrieving revision 1.1
diff -u -r1.1 patch.scenario_handler
--- source/patch.scenario_handler	1999/11/11 04:52:26	1.1
+++ source/patch.scenario_handler	1999/12/15 10:27:42
@@ -30,7 +30,7 @@
 -def_module_ok(P/A, CallMod, DefMod) :-
 -	exchange_with_prolog_asynchronously(def_module_pk(P/A, CallMod, D), 
 -					def_module_pk(P/A, CallMod, DefMod)).
-+% Useless in Opium-M ???
++% Useless in Morphine ???
 +% /*
 +%  *	DEF-MODULE
 +%  */
@@ -84,7 +84,7 @@
 -get_prolog_filename_Op(F, File) :-
 -	remote_once(get_flag(prolog_suffix, Suffixes), sepia_kernel),
 -	get_filename(F, Suffixes, File).
-+% XXX R1 remote_once is not available in Opium-M
++% XXX R1 remote_once is not available in Morphine
 +% /*
 +%  *	GET-PROLOG-FILENAME
 +%  */
Index: source/source.op
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/source.op,v
retrieving revision 1.1
diff -u -r1.1 source.op
--- source/source.op	1999/11/11 04:52:26	1.1
+++ source/source.op	1999/12/15 10:27:46
@@ -37,7 +37,7 @@
 listing/3, you need to have the source of the Mercury library somewhere \
 and you need \
 to make sure that the environment variable LIB_MERCURY has been set correctly \
-to the path of the Mercury library in the sh script Opium-M. \
+to the path of the Mercury library in the sh script morphine. \
 "
 	).
 
Index: source/util.pl
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/opium_m/source/util.pl,v
retrieving revision 1.1
diff -u -r1.1 util.pl
--- source/util.pl	1999/11/11 04:52:27	1.1
+++ source/util.pl	1999/12/15 10:27:47
@@ -14,7 +14,7 @@
 
 :- get_flag(prolog_suffix, S), set_flag(prolog_suffix, [".op" | S]).
 
-% to initialize module 'Opium-M'
+% to initialize module morphine
 
 :- op(500, fx, =).
 :- op(500, fx, <).
@@ -87,9 +87,9 @@
 opium_nl(V) :- opium_nl_Op(V).
 
 
-get_opium_file("opium_module", File) :-
-	getenv('MERCURY_OPIUM_DIR', Path),
-	append_strings(Path, "source/opium_module.sd", File).
+get_morphine_file("morphine_module", File) :-
+	getenv('MERCURY_MORPHINE_DIR', Path),
+	append_strings(Path, "source/morphine_module.sd", File).
 
 
 /*
@@ -120,7 +120,7 @@
 
 build_obj_dir(OD) :-
 	getcwd(Cwd),
-	append_strings(Cwd, "opiumfiles/", ODS),
+	append_strings(Cwd, "morphinefiles/", ODS),
 	atom_string(OD, ODS).
 
 

-- 
R1.


--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list