Permalink
Browse files

This commit was manufactured by cvs2svn to create tag 'mozart-1-3-0'.

git-svn-id: https://gforge.info.ucl.ac.be/svn/mozart@15878 ada56829-ad1f-0410-b00f-83cda6628aec
  • Loading branch information...
1 parent f8a3575 commit cd226eac35701b1d20412ff9c617b317b76b6db3 (no author) committed Apr 13, 2004
Showing with 2 additions and 17,562 deletions.
  1. +0 −32 platform/Attic/wininstall/README
  2. BIN platform/Attic/wininstall/emacs.inf
  3. BIN platform/Attic/wininstall/mozart.inf
  4. +0 −418 platform/emulator/libdp/dpBuiltins.cc
  5. +1 −1 platform/wish/configure
  6. +1 −1 platform/wish/configure.in
  7. +0 −16 share/Attic/gnats/mozart
  8. +0 −58 share/bin/Makefile
  9. +0 −29 share/bin/Makefile.m4
  10. +0 −35 share/bin/makeEmacs
  11. +0 −38 share/bin/makedist
  12. +0 −4 share/bin/oz2declare
  13. +0 −89 share/bin/oz2lpr
  14. +0 −68 share/bin/oz2lpr.csh
  15. +0 −15 share/bin/ozarch
  16. +0 −4 share/demo/Attic/concurrent/.cvsignore
  17. +0 −153 share/demo/Attic/concurrent/Bounce.oz
  18. +0 −659 share/demo/Attic/concurrent/Lift.oz
  19. +0 −73 share/demo/Attic/concurrent/Transport.oz
  20. +0 −130 share/demo/Attic/concurrent/Trucks.oz
  21. +0 −41 share/demo/Attic/concurrent/transport/agent.oz
  22. +0 −60 share/demo/Attic/concurrent/transport/broker.oz
  23. +0 −54 share/demo/Attic/concurrent/transport/company.oz
  24. +0 −149 share/demo/Attic/concurrent/transport/configure.oz
  25. +0 −79 share/demo/Attic/concurrent/transport/contract.oz
  26. +0 −88 share/demo/Attic/concurrent/transport/country.oz
  27. +0 −96 share/demo/Attic/concurrent/transport/driver.oz
  28. +0 −84 share/demo/Attic/concurrent/transport/environment.oz
  29. +0 −564 share/demo/Attic/concurrent/transport/frontend.oz
  30. +0 −2,333 share/demo/Attic/concurrent/transport/germany.oz
  31. +0 −133 share/demo/Attic/concurrent/transport/makeplan.oz
  32. +0 −95 share/demo/Attic/concurrent/transport/randomizer.oz
  33. +0 −144 share/demo/Attic/concurrent/transport/truck.oz
  34. +0 −179 share/demo/Attic/concurrent/transport/widgets.oz
  35. +0 −4 share/demo/Attic/constraints/.cvsignore
  36. +0 −567 share/demo/Attic/constraints/Animated-queens.oz
  37. +0 −120 share/demo/Attic/constraints/job-shop/Compiler.oz
  38. +0 −65 share/demo/Attic/constraints/job-shop/Configure.oz
  39. +0 −44 share/demo/Attic/constraints/job-shop/Examples.oz
  40. +0 −114 share/demo/Attic/constraints/job-shop/JobShop.oz
  41. +0 −181 share/demo/Attic/constraints/job-shop/Scheduler.oz
  42. +0 −350 share/demo/Attic/constraints/job-shop/TaskBoard.oz
  43. +0 −331 share/demo/Attic/constraints/job-shop/Tools.oz
  44. +0 −26 share/elisp/Makefile
  45. +0 −38 share/elisp/Makefile.m4
  46. +0 −119 share/elisp/blink-paren.el
  47. +0 −1,513 share/elisp/comint.el
  48. +0 −46 share/elisp/oz1.el
  49. +0 −86 share/tools/inspector/Attic/TreeWidget/Create/BaseCreateObject.oz
  50. +0 −99 share/tools/inspector/Attic/TreeWidget/Create/ChunkCreateObjects.oz
  51. +0 −185 share/tools/inspector/Attic/TreeWidget/Create/CreateProcs.oz
  52. +0 −64 share/tools/inspector/Attic/TreeWidget/Create/FDIntCreateObject.oz
  53. +0 −84 share/tools/inspector/Attic/TreeWidget/Create/FSSetCreateObject.oz
  54. +0 −25 share/tools/inspector/Attic/TreeWidget/Create/FreeCreateObject.oz
  55. +0 −368 share/tools/inspector/Attic/TreeWidget/Create/RecordCreateObjects.oz
  56. +0 −148 share/tools/inspector/Attic/TreeWidget/Create/SimpleCreateObjects.oz
  57. +0 −243 share/tools/inspector/Attic/TreeWidget/Create/SupportCreateObjects.oz
  58. +0 −550 share/tools/inspector/Attic/TreeWidget/Create/TupleCreateObjects.oz
  59. +0 −70 share/tools/inspector/Attic/TreeWidget/CreateObjects.oz
  60. +0 −97 share/tools/inspector/Attic/TreeWidget/CycleManager.oz
  61. +0 −264 share/tools/inspector/Attic/TreeWidget/Draw/BaseDrawObject.oz
  62. +0 −112 share/tools/inspector/Attic/TreeWidget/Draw/ChunkDrawObjects.oz
  63. +0 −158 share/tools/inspector/Attic/TreeWidget/Draw/FDIntDrawObject.oz
  64. +0 −132 share/tools/inspector/Attic/TreeWidget/Draw/FSSetDrawObject.oz
  65. +0 −79 share/tools/inspector/Attic/TreeWidget/Draw/FreeDrawObject.oz
  66. +0 −691 share/tools/inspector/Attic/TreeWidget/Draw/RecordDrawObjects.oz
  67. +0 −68 share/tools/inspector/Attic/TreeWidget/Draw/SimpleDrawObjects.oz
  68. +0 −269 share/tools/inspector/Attic/TreeWidget/Draw/SupportDrawObjects.oz
  69. +0 −1,625 share/tools/inspector/Attic/TreeWidget/Draw/TupleDrawObjects.oz
  70. +0 −73 share/tools/inspector/Attic/TreeWidget/DrawObjects.oz
  71. +0 −75 share/tools/inspector/Attic/TreeWidget/Layout/BaseLayoutObject.oz
  72. +0 −161 share/tools/inspector/Attic/TreeWidget/Layout/ChunkLayoutObjects.oz
  73. +0 −58 share/tools/inspector/Attic/TreeWidget/Layout/FDIntLayoutObject.oz
  74. +0 −52 share/tools/inspector/Attic/TreeWidget/Layout/FSSetLayoutObject.oz
  75. +0 −31 share/tools/inspector/Attic/TreeWidget/Layout/FreeLayoutObject.oz
  76. +0 −182 share/tools/inspector/Attic/TreeWidget/Layout/RecordLayoutObjects.oz
  77. +0 −200 share/tools/inspector/Attic/TreeWidget/Layout/SimpleLayoutObjects.oz
  78. +0 −194 share/tools/inspector/Attic/TreeWidget/Layout/SupportLayoutObjects.oz
  79. +0 −508 share/tools/inspector/Attic/TreeWidget/Layout/TupleLayoutObjects.oz
  80. +0 −63 share/tools/inspector/Attic/TreeWidget/LayoutObjects.oz
  81. +0 −147 share/tools/inspector/Attic/TreeWidget/StoreListener.oz
  82. +0 −141 share/tools/inspector/Attic/TreeWidget/SupportNodes.oz
  83. +0 −326 share/tools/inspector/Attic/TreeWidget/TreeNodes.oz
  84. +0 −494 share/tools/inspector/Attic/TreeWidget/TreeWidget.oz
View
32 platform/Attic/wininstall/README
@@ -1,32 +0,0 @@
-The *.inf files are input for Freeman Installer to create executable
-files that will install oz2/oz3/emacs when being executed.
-
-Freeman installer is available from
-
- http://netnet.net/~freeman/
-
-----------------------------------------------------------------------------
-
-
-Q: How do I create the exe files:
-
-A: Here is the example for oz3.
-
- - Under UNIX do: "make oz-win"
- This copies all the files needed for Windows from the installation
- directory into "Oz/oz3"
-
- - Now invoke Freeman Installer on a Windows machine and open
- "oz3.inf". (it expects to find its input under "Y:\Oz\oz3",
- so make sure that "Y:" is mounted appropriately.
-
- - Then choose "Run --> Build" in Freeman Installer
-
- - Have a cup of coffee
-
- - The step before (no not the one with the coffee) creates:
-
- C:\prj\online\run\setup.exe.
-
- Take this file, rename it to oz-<VERSION>.exe and put it onto
- your ftp server.
View
BIN platform/Attic/wininstall/emacs.inf
Binary file not shown.
View
BIN platform/Attic/wininstall/mozart.inf
Binary file not shown.
View
418 platform/emulator/libdp/dpBuiltins.cc
@@ -1,418 +0,0 @@
-/*
- * Authors:
- * Per Brand (perbrand@sics.se)
- * Michael Mehl (mehl@dfki.de)
- * Ralf Scheidhauer (Ralf.Scheidhauer@ps.uni-sb.de)
- *
- * Contributors:
- * optional, Contributor's name (Contributor's email address)
- *
- * Copyright:
- * Organization or Person (Year(s))
- *
- * Last change:
- * $Date$ by $Author$
- * $Revision$
- *
- * This file is part of Mozart, an implementation
- * of Oz 3:
- * http://mozart.ps.uni-sb.de
- *
- * See the file "LICENSE" or
- * http://mozart.ps.uni-sb.de/LICENSE.html
- * for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL
- * WARRANTIES.
- *
- */
-
-#include "base.hh"
-#include "perdio.hh"
-#include "table.hh"
-#include "os.hh"
-#include "builtins.hh"
-#include "wsock.hh"
-#include "fail.hh"
-#include "port.hh"
-#include "network.hh"
-
-#ifndef WINDOWS
-#include <sys/types.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <sys/socket.h>
-#include <sys/utsname.h>
-#endif
-#include <errno.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <string.h>
-
-/*************************************************************/
-/* Port interface to Gate */
-/*************************************************************/
-
-//
-// Trigger holder;
-static int perdioTrigger = 1;
-
-static OZ_Term GateStream;
-
-//
-// Interface method, BTW
-Bool isPerdioInitialized() {
- return (!perdioTrigger);
-}
-
-void perdioInitLocal()
-{
- //
-#ifdef DEBUG_CHECK
- // fprintf(stderr, "Waiting 10 secs... hook up (pid %d)!\n", osgetpid());
- // fflush(stderr);
- // sleep(10);
-#endif
-
- if(perdioTrigger==0)
- return;
-
- //
- perdioTrigger = 0;
- initPerdio();
-
- //
- // The gate is implemented as a Port reciding at location 0 in
- // the ownertable. The gateStream is keept alive, the Connection
- // library will fetch it later.
- // The port is made persistent so it should not disapear.
- //
- GateStream = oz_newVariable();
- OZ_protect(&GateStream);
- {
- Tertiary *t=(Tertiary*)new PortWithStream(oz_currentBoard(),GateStream);
- globalizeTert(t);
- int ind = t->getIndex();
- Assert(ind == 0);
- OwnerEntry* oe=OT->getOwner(ind);
- oe->makePersistent();
- }
- //
- // potentially - kost@, Per -
- // link perdio interface in perdioInit();
-}
-
-OZ_BI_define(BIGetPID,0,1)
-{
- // pid = pid(host:String port:Int time:Int#Int)
-
- //
- perdioInitLocal();
-
- char *nodename = oslocalhostname();
- if(nodename==NULL) { return oz_raise(E_ERROR,E_SYSTEM,"getPidUname",0); }
- struct hostent *hostaddr=gethostbyname(nodename);
- free(nodename);
- struct in_addr tmp;
- memcpy(&tmp,hostaddr->h_addr_list[0],sizeof(in_addr));
-
- OZ_Term host = oz_pairA("host",oz_string(inet_ntoa(tmp)));
- OZ_Term port = oz_pairA("port",oz_int(myDSite->getPort()));
- OZ_Term time =
- oz_pairA("time",
- OZ_pair2(oz_unsignedLong((unsigned long) myDSite->getTimeStamp()->start),
- oz_int(myDSite->getTimeStamp()->pid)));
- // NOTE: converting time_t to an unsigned long, maybe a [long] double!
-
- OZ_Term l = oz_cons(host,oz_cons(port,oz_cons(time,oz_nil())));
- OZ_RETURN(OZ_recordInit(OZ_atom("PID"),l));
-} OZ_BI_end
-
-OZ_BI_define(BIReceivedPID,1,0)
-{
- oz_declareIN(0,stream);
- //
- perdioInitLocal();
- return oz_unify(GateStream,stream);
-} OZ_BI_end
-
-
-OZ_BI_define(BITicket2Port,4,1)
-{
- oz_declareVirtualStringIN(0,host);
- oz_declareIntIN(1,port);
- oz_declareNonvarIN(2,timeV);
- oz_declareIntIN(3,pid);
-
- //
- perdioInitLocal();
-
- time_t time;
- if (oz_isSmallInt(timeV)) {
- int i = oz_IntToC(timeV);
- if (i <= 0) goto tbomb;
- time = (time_t) i;
- } else if (oz_isBigInt(timeV)) {
- unsigned long i = tagged2BigInt(timeV)->getUnsignedLong();
- if (i==0 && i == OzMaxUnsignedLong) goto tbomb;
- time = (time_t) i;
- } else {
- tbomb:
- return oz_raise(E_ERROR,E_SYSTEM,"PID.send",2,
- OZ_atom("badTime"),OZ_in(2));
- }
-
- struct hostent *hostaddr = gethostbyname(host);
- if (!hostaddr) {
- return oz_raise(E_ERROR,E_SYSTEM,"PID.send",2,
- OZ_atom("gethostbyname"),OZ_in(0));
- }
- struct in_addr tmp;
- memcpy(&tmp,hostaddr->h_addr_list[0],sizeof(in_addr));
- ip_address addr;
- addr = ntohl(tmp.s_addr);
- TimeStamp ts(time,pid);
- DSite *site = findDSite(addr, port, ts);
-
- if (!site) {
- return oz_raise(E_ERROR,E_SYSTEM,"Ticket2Port",4,
- OZ_atom("findDSite"),OZ_in(0),OZ_in(1),
- OZ_in(2));}
-
- OZ_RETURN(getGatePort(site));
-} OZ_BI_end
-
-//
-OZ_BI_define(BIsetNetBufferSize,1,0)
-{
- OZ_Term s = OZ_in(0);
- DEREF(s,_1,tagS);
- int size = 0;
- if (isSmallIntTag(tagS))
- size = smallIntValue(s);
- if(size < 0)
- oz_raise(E_ERROR,E_KERNEL,
- "NetBufferSize must be of type int and larger than 0",0);
- PortSendTreash = size * 20000;
- return PROCEED;
-} OZ_BI_end
-
-OZ_BI_define(BIgetNetBufferSize,0,1)
-{
- OZ_RETURN(oz_int(PortSendTreash / 20000));
-} OZ_BI_end
-
-
-OZ_BI_define(BIcrash,0,0) /* only for debugging */
-{
- exit(1);
-
- return PROCEED;
-} OZ_BI_end
-
-Bool isWatcherEligible(Tertiary *c){
- switch(c->getType()){
- case Co_Object:
- case Co_Cell:
- case Co_Lock:
- case Co_Port: return TRUE;
- default: return FALSE;}
- Assert(0);
- return FALSE;
-}
-
-OZ_BI_define(BIhwInstall,3,0){
- OZ_Term e0 = OZ_in(0);
- OZ_Term c0 = OZ_in(1);
- OZ_Term proc = OZ_in(2);
-
-
- NONVAR(c0, c);
- SRecord *condStruct;
- if(oz_isSRecord(c)) condStruct = tagged2SRecord(c);
- else return IncorrectFaultSpecification;
-
- if(isVariableSpec(condStruct)){
- DEREF(e0,vs_ptr,vs_tag);
- if(!isVariableTag(vs_tag)) return PROCEED; // mm3
- VarKind vk=classifyVar(vs_ptr); //mm3 - follow
- if(vk == VAR_KINDED) return IncorrectFaultSpecification;
- return varWatcherInstall(vs_ptr,condStruct,proc);}
-
- NONVAR(e0, e);
- Tertiary* tert;
- if(!oz_isConst(e)) return IncorrectFaultSpecification;
- tert = tagged2Tert(e);
- if(!isWatcherEligible(tert))return IncorrectFaultSpecification;
- return WatcherInstall(tert,condStruct,proc);
-
-}OZ_BI_end
-
-
-OZ_BI_define(BIhwDeInstall,3,0){
- OZ_Term e0 = OZ_in(0);
- OZ_Term c0 = OZ_in(1);
- OZ_Term proc = OZ_in(2);
-
- NONVAR(c0, c);
- SRecord *condStruct;
- if(oz_isSRecord(c)) condStruct = tagged2SRecord(c);
- else return IncorrectFaultSpecification;
-
- if(isVariableSpec(condStruct)){
- DEREF(e0,vs_ptr,vs_tag);
- if(!isVariableTag(vs_tag)) return PROCEED; // mm3
- VarKind vk=classifyVar(vs_ptr); //mm3 - follow
- if((vk==VAR_KINDED) || (vk==VAR_FREE) ||
- (vk==VAR_READONLY)) return IncorrectFaultSpecification;
- return varWatcherDeinstall(vs_ptr,condStruct,proc);} //mm3 - follow
-
- NONVAR(e0, e);
- if(!oz_isConst(e)) return IncorrectFaultSpecification;
- Tertiary* tert;
- tert = tagged2Tert(e);
- if(!isWatcherEligible(tert)) return IncorrectFaultSpecification;
- return WatcherDeInstall(tert,condStruct,proc);
-
-}OZ_BI_end
-
-OZ_BI_define(BIgetEntityCond,2,1)
-{
-OZ_Term e0 = OZ_in(0);
-OZ_Term v0 = OZ_in(1);
-
- NONVAR(v0, v);
- if(!isAtom(v)) return IncorrectFaultSpecification;
- if(v==AtomVar) {
- DEREF(e0,vs_ptr,vs_tag);
- if(!isVariableTag(vs_tag)) goto normal; // mm3
- VarKind vk=classifyVar(vs_ptr); //mm3 - follow
- if((vk==VAR_KINDED) || (vk==VAR_FREE) ||
- (vk==VAR_READONLY)) goto normal;
- getEntityCondVar(makeTaggedRef(v));} // mm3 - follow
-
- if(v!=AtomNonVar) return IncorrectFaultSpecification;
-
- NONVAR(e0, e);
- if(!oz_isConst(e)) return IncorrectFaultSpecification;
-
- Tertiary *tert = tagged2Tert(entity);
- if(!isWatcherEligible(tert)) return IncorrectFaultSpecification;
- EntityCond ec = getEntityCond(tert);
- if(ec!= ENTITY_NORMAL){
- OZ_RETURN(listifyWatcherCond(ec));}
-
- normal:
- OZ_RETURN(oz_cons(AtomNormal,oz_nil()));
-
-}OZ_BI_end
-
-
-/**********************************************************************/
-/* Misc Builtins */
-/**********************************************************************/
-
-OZ_BI_define(BItablesExtract,0,1)
-{
- perdioInitLocal();
-
- OZ_Term borrowlist = oz_nil();
- int bt_size=BT->getSize();
- for(int ctr=0; ctr<bt_size; ctr++){
- BorrowEntry *be = BT->getEntry(ctr);
- if(be==NULL){continue;}
- Assert(be!=NULL);
- borrowlist = oz_cons(be->extract_info(ctr), borrowlist);}
- OZ_RETURN(oz_cons(OZ_recordInit(oz_atom("bt"),
- oz_cons(oz_pairAI("size", bt_size),
- oz_cons(oz_pairA("list", borrowlist), oz_nil()))),
- oz_cons(OT->extract_info(), oz_nil())));
-} OZ_BI_end
-
-OZ_BI_define(BIsiteStatistics,0,1)
-{
- perdioInitLocal();
-
- int indx;
- DSite* found;
- GenHashNode *node = getPrimaryNode(NULL, indx);
- OZ_Term sitelist = oz_nil();
- int sent, received;
- Bool primary = TRUE;
- while(node!=NULL){
- GenCast(node->getBaseKey(),GenHashBaseKey*,found,DSite*);
- if(found->remoteComm() && found->isConnected()){
- received = getNORM_RemoteSite(found->getRemoteSite());
- sent = getNOSM_RemoteSite(found->getRemoteSite());}
- else{
- received = 0;
- sent = 0;}
- TimeStamp *ts = found->getTimeStamp();
- sitelist=
- oz_cons(OZ_recordInit(oz_atom("site"),
- oz_cons(oz_pairA("siteString", oz_atom(found->stringrep_notype())),
- oz_cons(oz_pairAI("port",(int)found->getPort()),
- oz_cons(oz_pairAI("timeint",(int)ts->start),
- oz_cons(oz_pairA("timestr",oz_atom(ctime(&ts->start))),
- oz_cons(oz_pairAI("ipint",(unsigned int)found->getAddress()),
- oz_cons(oz_pairAI("hval",(int)found),
- oz_cons(oz_pairAI("sent",sent),
- oz_cons(oz_pairAI("received",received),
- oz_cons(oz_pairA("table", oz_atom(primary?"p":"s")),
- oz_cons(oz_pairAI("strange",ts->pid),
- oz_cons(oz_pairAI("type",(int)found->getTypeStatistics()),
- oz_nil())))))))))))),sitelist);
- if(primary){
- node = getPrimaryNode(node,indx);
- if(node!=NULL) {
- continue;}
- else primary = FALSE;}
- node = getSecondaryNode(node,indx);}
- OZ_RETURN(sitelist);
-
-} OZ_BI_end
-
-
-//
-#ifndef VIRTUALSITES
-
-/**********************************************************************/
-/* Virtual Site Builtins KOST-LOOK */
-/**********************************************************************/
-
-//
-// Builtins for virtual sites - only two of them are needed:
-// (I) Creating a new mailbox (at the master site):
-OZ_BI_define(BIVSnewMailbox,0,1)
-{
- return oz_raise(E_ERROR, E_SYSTEM,
- "VSnewMailbox: virtual sites not configured", 0);
-} OZ_BI_end
-
-//
-// (II) Initializing a virtual site given its mailbox (which contains
-// also the parent's id);
-OZ_BI_define(BIVSinitServer,1,0)
-{
- return oz_raise(E_ERROR, E_SYSTEM,
- "VSinitServer: virtual sites not configured", 0);
-} OZ_BI_end
-
-//
-//
-OZ_BI_define(BIVSremoveMailbox,1,0)
-{
- return oz_raise(E_ERROR, E_SYSTEM,
- "VSremoveMailbox: virtual sites not configured", 0);
-} OZ_BI_end
-
-#endif // VIRTUALSITES
-
-
-
-
-
-
View
2 platform/wish/configure
@@ -2253,7 +2253,7 @@ case "$platform" in
WITH_TCLTK=$with_tcl/lib
INSTALLWINDLLS=installwindlls
: ${WINDLLDIR=$windlldir}
- for i in tcl84.dll tk84.dll msvcrt.dll; do
+ for i in tcl83.dll tk83.dll msvcrt.dll; do
dll=$WINDLLDIR/$i
echo $ac_n "checking for DLL $dll""... $ac_c" 1>&6
echo "configure:2260: checking for DLL $dll" >&5
View
2 platform/wish/configure.in
@@ -51,7 +51,7 @@ case "$platform" in
WITH_TCLTK=$with_tcl/lib
INSTALLWINDLLS=installwindlls
: ${WINDLLDIR=$windlldir}
- for i in tcl84.dll tk84.dll msvcrt.dll; do
+ for i in tcl83.dll tk83.dll msvcrt.dll; do
dll=$WINDLLDIR/$i
AC_MSG_CHECKING(for DLL $dll)
if test -f $dll
View
16 share/Attic/gnats/mozart
@@ -1,16 +0,0 @@
-vm
-pickles
-distributed-oz
-compiler
-standard-modules
-system-modules
-constraints
-tools
-ozdoc
-doc
-opi
-wp
-contrib
-install
-demo
-testsuite
View
58 share/bin/Makefile
@@ -1,58 +0,0 @@
-# Makefile generated by imake - do not edit!
-# $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
-#
-# The cpp used on this machine replaces all newlines and multiple tabs and
-# spaces in a macro expansion with a single space. Imake tries to compensate
-# for this, but is not always successful.
-#
-
-OZHOME = /usr/share/gs/soft/oz
-
-SUBDIRS =
-
-all::
-
-BINDIR = $(OZHOME)/bin
-SHELL = /bin/sh
-
-SCRIPTS = oz oz2lpr oz+ oz2declare ozplatform
-LINKS = oz- ozc oz.compiler oz.machine ozwindowmanager
-
-help:
- @echo ""
- @echo "The following targets are available"
- @echo " install {scheidhr,mehl}@dfki.uni-sb.de"
- @echo ""
-
-install:
- install -m 555 $(SCRIPTS) $(OZHOME)/bin
- @set -x; cd $(BINDIR);\
- for file in $(LINKS); \
- do\
- rm -f $$file; \
- ln -s oz $$file; \
- done
-
-CURRENTDIR=.
-
-Makefile:: Imakefile
-
-Makefile::
- @ imake -DXX`$(OZHOME)/bin/ozarch` -I. -I.. -I../.. -I../../.. -I../../../..
-
-all:: Makefile
-
-clean::
-
-depend::
- @ true
-
-depends:: depend
-
-World::
- make clean
- make depend
- make
-
-Makefiles:: Makefile
-
View
29 share/bin/Makefile.m4
@@ -1,29 +0,0 @@
-SHELL = /bin/sh
-
-
-define(OzDir,/usr/share/gs/soft/oz)
-define(OzLib,OzDir/lib)
-define(OzInc,OzDir/`include')
-define(OzLisp,OzDir/elisp)
-define(OzBin,OzDir/bin)
-
-define(installOz,
-$1: OzBin/$1
-
-OzBin/$1: $2$1.csh
- install -m 555 $< $@
-)
-
-help:
- @echo ""
- @echo "The following targets are available"
- @echo "(use 'make <target>' for installation)"
- @echo " oz2lpr mehl@dfki.uni-sb.de"
- @echo ""
-
-Makefile: Makefile.m4
- m4 Makefile.m4 > Makefile
-
-
-installOz(oz2lpr)
-
View
35 share/bin/makeEmacs
@@ -1,35 +0,0 @@
-#! /bin/sh
-
-LEMACS=/usr/gnu/lib/lemacs
-LEMACS=/usr/share/gs/soft/lemacs-19.9
-CP="gcp -av"
-
-echo -n "Copying Lucid Emacs ..."
-mkdir -p lemacs/etc lemacs/lisp lemacs/info lemacs/lock
-cd lemacs
-$CP /usr/gnu/info/dir /usr/gnu/info/lemacs* info
-$CP $LEMACS/etc/DOC* etc
-$CP $LEMACS/lemacs* .
-
-
-# Copy the elisp files. To save space: if a byte compiled
-# version of a file exists (ending in ".elc" instead of ".el")
-# copy only this and not its ".el" counterpart
-
-whereami=`pwd`
-cd $LEMACS
-#cp lisp/*.el $whereami/lisp
-
-
-for i in lisp/*
-do
- if [ -d $i ]; then
- mkdir -p $whereami/$i
- if [ "$i" != "lisp/sunview" ]; then
- $CP $i/*.elc $whereami/$i
- fi
- echo -n . # to see that we are still working echo a dot from time to time
- fi
-done
-
-
View
38 share/bin/makedist
@@ -1,38 +0,0 @@
-#!/bin/sh
-#
-# Create a directory containing all files necessary for
-# a standalone version of the Oz system
-#
-
-if [ ${1-0} = 0 ]; then
- echo "Usage: `basename $0` distribution-directory"
- exit 1
-fi
-
-
-# where to put the distribution:
-DIR=$1
-
-echo ""
-echo "Building Oz System distribution directory "\"$DIR\"
-echo ""
-
-OZDIR=/usr/share/gs/soft/oz
-
-# program to copy files (we use GNU cp, since
-# it allows to preserve links; if not available
-# use tar or something like this)
-
-GCP="/usr/share/gs/bin/gcp -a"
-
-# create distribution directory:
-mkdir -p $1
-cd $1
-
-echo "Copying Oz ..."
-$GCP /usr/share/gs/soft/oz/* .
-
-echo ""
-echo "don't forget to copy an emacs !!"
-exit 0
-
View
4 share/bin/oz2declare
@@ -1,4 +0,0 @@
-#!/usr/share/gs/bin/perl -pi.bak
-
-s/\bexists\b/declare/g
-
View
89 share/bin/oz2lpr
@@ -1,89 +0,0 @@
-#! /bin/sh
-# this file is maintained by CVS in module 'Oz/bin'
-
-# drucke oz dateien aus
-# prinzip: oz2tex --> latex --> dvips
-# Argumente: -landscape oz-files
-
-DVIPS=dvips
-if [ $1 = "-landscape" ]
-then
- shift
- DVIPS=dvi2to1p
-fi
-
-if [ $# -lt 1 ]; then
- echo "usage: $0 <oz-files>"
- exit 1
-fi
-
-
-cleanup() { rm -f /tmp/$tmpfile* /tmp/$ozfile* /tmp/oz2tex_preamble*; }
-
-trap cleanup 0 1 2 15
-
-tmpfile=oz2lpr-tex-$$
-ozfile=oz2lpr-oz-$$
-
-for i in $@
-do
-
-if [ "$i" = "-" ]; then # input from stdin?
- file="stdin"
- cat > /tmp/$ozfile.oz
-else
- if [ -f "$i" ]; then
- file=$i
- else
- file=$i.oz
- fi
- if [ ! -f $file ]; then
- echo "file not found: $file"
- continue
- fi
-
- cp $file /tmp/$ozfile.oz
-fi
-
-oz2tex /tmp/$ozfile.oz > /dev/null 2>&1
-
-if [ $? != 0 ]; then
- echo "oz2tex failed: $file"
- continue
-fi
-
-cat >> /tmp/$tmpfile.tex << EOF
-
-\documentstyle{article}
-\include{oz2tex_preamble}
-\pagestyle{empty}
-
-\setlength{\topmargin}{-2cm}
-
-\setlength{\evensidemargin}{-1cm}
-\setlength{\oddsidemargin}{-1cm}
-
-\setlength{\textwidth}{18cm}
-\setlength{\textheight}{26cm}
-
-\begin{document}
-\input{/tmp/$ozfile.tex}
-\end{document}
-
-EOF
-
-echo "latex $tmpfile ..."
-(cd /tmp; latex $tmpfile > /dev/null < /dev/null)
-
-if [ $? != 0 ]; then
- echo "latex failed: $file"
- egrep '^\!' /tmp/$tmpfile.log
- cleanup
- continue
-fi
-
-echo "${DVIPS} $tmpfile ..."
-${DVIPS} /tmp/$tmpfile > /dev/null 2>&1
-cleanup
-
-done # for
View
68 share/bin/oz2lpr.csh
@@ -1,68 +0,0 @@
-#! /bin/csh -f
-
-# this file is maintained by CVS in module 'Oz/bin'
-
-# drucke oz dateien aus
-# prinzip: oz2tex --> latex --> dvips
-# Argumente: oz-files
-
-if ($#argv < 1) then
- echo "usage: $0 <oz-files>"
- exit 1
-endif
-
-
-
-set tmpfile = `mktemp oz2lpr-tex-`
-set ozfile = `mktemp oz2lpr-oz-`
-
-foreach i ($*)
-
-if ("$i" == "-") then # input from stdin?
- set file = "stdin"
- cat >! /tmp/$ozfile.oz
-else
- if ( -f $i ) then
- set file = $i
- else
- set file = $i.oz
- endif
-
- if (! -f $file ) then
- echo "file not found: $file"
- continue
- endif
-
- cp $file /tmp/$ozfile.oz
-endif
-
-oz2tex /tmp/$ozfile.oz >& /dev/null
-
-if ($status) then
- echo "oz2tex failed: $file"
- continue
-endif
-
-echo "\documentstyle[11pt,dina4]{article}\
-\include{oz2tex_preamble}\
-\pagestyle{empty}\
-\begin{document}\
-\input{/tmp/$ozfile.tex}\
-\end{document}\
-" >> /tmp/$tmpfile.tex
-
-(cd /tmp; latex $tmpfile > /dev/null < /dev/null)
-
-if ($status) then
- echo "latex failed: $file"
- egrep '^\!' /tmp/$tmpfile.log
- goto next
-endif
-
-dvips /tmp/$tmpfile >& /dev/null
-
-next:
-rm /tmp/$tmpfile* /tmp/$ozfile* /tmp/oz2tex_preamble*
-
-end # foreach
-
View
15 share/bin/ozarch
@@ -1,15 +0,0 @@
-#!/bin/sh
-# determine machine architecture and OS version
-system="`/bin/uname -m` `/bin/uname -s` `/bin/uname -r`"
-
-case $system in
- sun4*\ SunOS\ 4.1*) OZARCH=sun4
- ;;
- sun4*\ SunOS\ 5*) OZARCH=sol2
- ;;
- RISC\ ULTRIX\ 4.*) OZARCH=mips
- ;;
- *) echo "Cannot determine machine type and OS version" 1>&2 ; exit 1
-esac
-
-echo $OZARCH
View
4 share/demo/Attic/concurrent/.cvsignore
@@ -1,4 +0,0 @@
-*~
-*.oza
-*.html
-*.ozc
View
153 share/demo/Attic/concurrent/Bounce.oz
@@ -1,153 +0,0 @@
-%%%
-%%% Authors:
-%%% Michael Mehl (mehl@dfki.de)
-%%% Gert Smolka (smolka@dfki.de)
-%%% Christian Schulte (schulte@dfki.de)
-%%% Joerg Wuertz (wuertz@dfki.de)
-%%%
-%%% Copyright:
-%%% Michael Mehl, 1998
-%%% Gert Smolka, 1998
-%%% Christian Schulte, 1998
-%%% Joerg Wuertz, 1998
-%%%
-%%% Last change:
-%%% $Date$ by $Author$
-%%% $Revision$
-%%%
-%%% This file is part of Mozart, an implementation
-%%% of Oz 3
-%%% http://mozart.ps.uni-sb.de
-%%%
-%%% See the file "LICENSE" or
-%%% http://mozart.ps.uni-sb.de/LICENSE.html
-%%% for information on usage and redistribution
-%%% of this file, and for a DISCLAIMER OF ALL
-%%% WARRANTIES.
-%%%
-
-
-functor
-
-import
- Tk
- Application(exit)
-
-define
-
- CanvasWidth = 400.0
- CanvasHeight = 400.0
- BallRadius = 50.0
- XDelta = 5.0
- YDelta = 5.0
- Gravity = 3.0
- Fraction = 0.9
- RepeatTime = 100
- Mouth = 30
- MouthDelta = 5
-
- BackColor = '#fffff0'
- BallColors = if Tk.isColor then
- red | blue | yellow | green |
- plum | cyan | tan | bisque | BallColors
- else
- black | BallColors
- end
-
- class Ball
- from Time.repeat Tk.canvasTag
- prop final
-
- attr
- x: 0.0
- xd: XDelta
- y: 0.0
- yd: YDelta
- mouth: Mouth
- d: ~MouthDelta
-
- meth init(X Y Canvas Color)
- Tk.canvasTag,tkInit(parent:Canvas)
- {Canvas tk(crea arc X Y X+BallRadius Y+BallRadius
- fill:Color start:30 extent:300 tag:self)}
- x <- X
- y <- Y
- Time.repeat, setRepAll(action:bounce delay:RepeatTime)
-
- thread
- try {self go}
- catch system(...) then skip
- end
- end
- end
-
- meth bounce
- %increment @x and @d
- x <- @x + @xd
- if @x =< 0.0 then
- x <- 0.0
- xd <- ~@xd
- elseif @x>=CanvasWidth-BallRadius then
- x <- CanvasWidth-BallRadius
- xd <- ~@xd
- end
- %increment @y and @yd
- y <- @y - @yd
- yd <- @yd - Gravity
- if @y>=CanvasHeight-BallRadius then
- y <- CanvasHeight-BallRadius
- yd <- Fraction * ~@yd
- end
- Tk.canvasTag,tk(coords @x @y @x+BallRadius @y+BallRadius)
- %% set the new mouth
- mouth <- @mouth+@d
- if @mouth>=Mouth then mouth <- Mouth d <- ~@d
- elseif @mouth=<MouthDelta then mouth <- MouthDelta d <- ~@d
- end
- Tk.canvasTag,tk(itemconf start:@mouth extent:360-2*@mouth)
- end
-
- meth close
- Time.repeat, stop
- Tk.canvasTag, tkClose
- end
- end
-
- class Manager
- from Tk.canvas
- prop final
- attr
- Balls: nil
- Colors: BallColors
-
- meth init(parent:P)
- Tk.canvas,tkInit(parent:P bg:BackColor bd:3 relief:sunken
- width:CanvasWidth height:CanvasHeight)
- Tk.canvas,tkBind(action: self # NewBall
- event: '<1>'
- args: [float(x) float(y)])
- Tk.canvas,tkBind(action: self # KillBall
- event: '<3>')
- end
-
- meth NewBall(X Y)
- C|Cr = @Colors
- in
- Balls <- {New Ball init(X Y self C)}|@Balls
- Colors <- Cr
- end
-
- meth KillBall
- case @Balls of nil then skip
- [] B|Br then {B close} Balls <- Br
- end
- end
- end
-
-
- Top = {New Tk.toplevel tkInit(title: 'Oz Bouncer'
- delete: Application.exit # 0)}
-
- {Tk.send pack({New Manager init(parent:Top)})}
-
-end
View
659 share/demo/Attic/concurrent/Lift.oz
@@ -1,659 +0,0 @@
-%%%
-%%% Authors:
-%%% Martin Müller, (mmueller@ps.uni-sb.de)
-%%%
-%%% Contributor:
-%%% Christian Schulte (schulte@dfki.de)
-%%%
-%%% Copyright:
-%%% Martin Müller, 1998
-%%% Christian Schulte, 1998
-%%%
-%%% Last change:
-%%% $Date$ by $Author$
-%%% $Revision$
-%%%
-%%% This file is part of Mozart, an implementation
-%%% of Oz 3
-%%% http://mozart.ps.uni-sb.de
-%%%
-%%% See the file "LICENSE" or
-%%% http://mozart.ps.uni-sb.de/LICENSE.html
-%%% for information on usage and redistribution
-%%% of this file, and for a DISCLAIMER OF ALL
-%%% WARRANTIES.
-%%%
-
-functor
-
-import
- Tk
- TkTools
- Application
-
-define
- %%
- %% Lift Simulation -- Randomised and Interactive Lift Requests
- %%
- %% The Scheduling Algorithm is taken from the book
- %% 'Concurrent Programming in Erlang', Chapter 11: Real-Time Control
- %%
-
- %%
- %% Colors
- %%
- [BGColor FGColor FloorsColor KnobColor NumColor]
- = if Tk.isColor then
- [steelblue bisque lightsteelblue blue 'IndianRed']
- else
- [grey55 grey55 grey55 black black]
- end
-
- %%
- %% Parameters
- %%
-
- NumFloors = 5 %% number of floors
- NumLifts = 3 %% number of lifts
-
- CallMode = call %% lift called from floor
- SendMode = send %% lift sent from inside
- DelayLift = 2500 %% delay between simulated lift calls
- DelayOpen = 500 %% delay for opening doors
- DelayStep = 120 %% delay for lift speed
-
- %%
- %% Images
- %%
-
- Images = {TkTools.images
- {Map [upF downF upE downE lift liftUp liftDown]
- fun {$ A}
- 'http://mozart.ps.uni-sb.de/home/doc/demo/images/lift/'#A#'.xbm'
- end}}
-
- Bold = 'lucidasanstypewriter-bold-18'
-
- %%
- %% constants and procedures for the graphical representation
- %%
-
- FloorDelta = 10
- FloorSteps = 7
- FloorLeft = 10
- FloorRight = 220
- FloorSize = FloorDelta * FloorSteps
- Height = FloorSize * NumFloors - 15
- Width = 230
- LeftMost = 110
- Bound = 3
- LiftDelta = 38
-
- fun {Pos2Floor Y} (Height - Y) div FloorSize + 1 end
- fun {Floor2Pos N} Height - (N-1) * FloorSize end
-
- GroundLevel = {Floor2Pos 1} - LiftDelta
-
-
- %%
- %% Random Number Generator (alternatively, see OS.rand)
- %%
-
- class Randomizer from BaseObject
- prop
- final
-
- feat
- a: 24298
- b: 9991
- c: 199017
-
- attr
- seed:24676
-
- meth next(?N)
- S=@seed
- in
- N={IntToFloat S}/{IntToFloat self.c}
- seed <- (self.a * S + self.b) mod self.c
- end
-
- meth uniform(A B ?R)
- N in Randomizer, next(N) R=N*(B-A)+A
- end
- end
-
- Random = {New Randomizer noop}
-
- fun {RandomChoice N M}
- {FloatToInt {Random uniform({IntToFloat N}
- {IntToFloat M}
- $)}}
- end
-
- fun {RanChoiceFloor}
- {RandomChoice 1 NumFloors}
- end
-
- fun {RanChoiceBin X Y}
- if {RandomChoice 0 1}==1 then X else Y end
- end
-
- %%
- %% Compute the cost of a request from floor Floor with direction
- %% Dir for a lift at floor At with current task stack CurrSch,
- %% and also return the corresponding new schedule NewSch.
- %%
-
- CostWait = 5 %% cost estimate for opening and closing the doors
-
- fun {Insert Task At CurrSch}
- {Cost Task At CurrSch _} % ignore cost
- end
-
- proc {Cost Task At CurrSch Offer NewSch}
- goto(To _ Dir _) = Task
- in
- case CurrSch
- of nil then
- Offer = {Abs At-To}
- NewSch = [Task]
-
- [] CurrTask|RCurrSch then
- goto(CurrTo _ _ _) = CurrTask
- in
- if At=<To
- andthen To=<CurrTo
- andthen Dir==up
- then
- Offer = {Abs At-To}
- NewSch = Task|CurrSch
-
- elseif CurrTo=<To
- andthen To=<At
- andthen Dir==down
- then
- Offer = {Abs At-CurrTo}
- NewSch = Task|CurrSch
-
- else
- ROffer RNewSch
- in
- {Cost Task CurrTo RCurrSch ROffer RNewSch}
- Offer = {Abs At-CurrTo} + CostWait + ROffer
- NewSch = CurrTask|RNewSch
- end
- end
- end
-
- %%
- %% Interactively send the lift somewhere
- %%
-
- class Press from BaseObject
-
- prop final
- attr val
-
- meth init(Choice)
- val <- Choice
- end
- meth press(N)
- @val = N
- end
- end
-
- proc {PopChoice View P ?Choice}
- Select = {New Press init(Choice)}
- proc {Button N}
- At = NumFloors - N + 1
- Y = P + LiftDelta - At * 8
- Knob = {New Tk.canvasTag tkInit(parent:View)}
- Num = {New Tk.canvasTag tkInit(parent:View)}
- in
- {View tk(crea oval 92 Y 100 Y+5 tag:Knob fill:KnobColor)}
- {View tk(crea text 85 Y tag:Num text:At fill:NumColor)}
- {Knob tkBind(event:'<1>' action: Select # press(At))}
-
- thread
- {Wait Choice}
- {Knob tkClose}
- {Num tkClose}
- end
- end
- in
- {Loop.for 1 NumFloors 1 Button}
- end
-
- %%
- %% Individual Lift Object
- %%
-
- class Lift from Tk.canvasTag
-
- prop
- locking
- final
-
- feat
- View
- PosX
-
- attr
- PosY : GroundLevel
- CurrFloor: 1
- Agenda : nil
- State : idle
-
- meth init(L)
- self.PosX = {L join(self $)}
- self.View = L
-
- Tk.canvasTag, tkInit(parent:L)
- Lift, drawInit
- end
-
- meth request(Task ?Offer Cont)
-
- lock
- ReqCost NewAgenda
- in
- {Cost Task @CurrFloor @Agenda ReqCost NewAgenda}
-
- case @State
- of openDoor then
- %%
- %% guess a high delay dependent on current agenda
- %%
- Offer = ({Length @Agenda}+1)*1000
- else
- Offer = ReqCost
- end
-
- %%
- %% wait for release (false) or commit (true)
- %%
- if Cont then
- Agenda <- NewAgenda
- case @Agenda of [_] then
- case @State of openDoor
- then skip else Lift, proceed
- end
- else skip end
- end
- end
-
- end
-
- meth moveBy(Y)
- PosY <- @PosY+Y
- CurrFloor <- {Pos2Floor @PosY}
- Tk.canvasTag, tk(move 0 Y)
- end
-
- meth proceed
-
- if @Agenda==nil then
- State <- idle
- Lift, draw(lift)
- else
- To = @Agenda.1.1
- PosTo = {Floor2Pos To}
- CurrPos = @PosY+LiftDelta
- in
- Lift, draw(if To>@CurrFloor then liftUp
- elseif To<@CurrFloor then liftDown
- else lift end)
-
- if {Abs CurrPos-PosTo}<5 then
- Lift, reached
- elseif CurrPos>PosTo then
- Lift, moveBy(~FloorDelta)
-
- thread
- {Delay DelayStep}
- {self proceed}
- end
-
- else
- Lift, moveBy(FloorDelta)
-
- thread
- {Delay DelayStep}
- {self proceed}
- end
- end
- end
-
- end
-
- meth reached
-
- Mode Who RestAgenda
- in
-
- lock
- goto(_ Mode _ Who)|RestAgenda = @Agenda
- {self.View reached(@CurrFloor)}
- Agenda <- RestAgenda
- end
-
- if Mode==!CallMode then
- To
- CurrY = @PosY
- Num = @CurrFloor
- in
- State <- openDoor
-
- thread
- To = case Who of sim then
- {Delay DelayOpen}
- {RanChoiceFloor}
- elseof press then
- {PopChoice self.View CurrY}
- end
- end
-
- {Wait To}
-
- Agenda <- {Insert
- goto(To
- SendMode
- if To>Num then up else down end
- Who)
- @CurrFloor
- @Agenda}
- end
- Lift, closeDoor
-
- end
-
- meth closeDoor
- State <- idle
- Lift, proceed
- end
-
- meth drawInit
- {self.View
- tk(crea image self.PosX+12 @PosY+12 image:Images.lift tag:self)}
- end
-
- meth draw(I)
- Tk.canvasTag, tk(itemconf image:Images.I)
- end
- end
-
- %%
- %% request a lift
- %%
-
- local
- fun {ListMin Xs}
- case Xs of [X] then X
- elseof (X#CX)|Xr then
- MXr#CXr = {ListMin Xr}
- in
- if X<MXr then
- CXr = false % release
- X#CX % current minimal offer
- else
- CX = false % release
- MXr#CXr % current minimal offer
- end
- end
- end
- in
- proc {Request Ls Task}
- fun {DoReq L}
- O C
- in
- thread
- {L request(Task O C)}
- end
- O#C
- end
- in
- true = {ListMin {Map Ls DoReq}}.2 % commit
- end
- end
-
- %%
- %% Individual Floor Object
- %%
-
- class Floor from BaseObject
-
- prop
- final
-
- feat
- Num
- PosY
- View
- Up UpTag
- Down DownTag
-
- meth init(L N)
- self.Num = N
- self.PosY = {Floor2Pos N}
- self.View = L
- self.Down = N>1
- self.Up = N<NumFloors
-
- Floor, drawText
-
- if self.Up then
- Floor, drawButton(self.UpTag
- 35
- self.PosY-15
- upF
- doUp(press))
- end
-
- if self.Down then
- Floor, drawButton(self.DownTag
- 55
- self.PosY-15
- downF
- doDown(press))
- end
-
- Floor, show
- end
-
- meth doUp(Who)
- if self.Up then
- Ms = {self.View members($)}
- in
- Floor, draw(true false) % up/empty
- {Request Ms goto(self.Num CallMode up Who)}
- end
- end
-
- meth doDown(Who)
- if self.Down then
- Ms = {self.View members($)}
- in
- Floor, draw(false false) % down/empty
- {Request Ms goto(self.Num CallMode down Who)}
- end
- end
-
- meth reached
- if self.Up then
- Floor, draw(true true) % up/full
- end
- if self.Down then
- Floor, draw(false true) % down/full
- end
- end
-
- meth show
- {self.View
- tk(crea line FloorLeft self.PosY FloorRight self.PosY)}
- end
-
- meth draw(Up Full)
- if Up then
- if Full
- then {self.UpTag tk(itemconf image:Images.'upF')}
- else {self.UpTag tk(itemconf image:Images.'upE')}
- end
- else
- if Full
- then {self.DownTag tk(itemconf image:Images.'downF')}
- else {self.DownTag tk(itemconf image:Images.'downE')}
- end
- end
- end
-
- meth drawText
- {self.View tk(crea text 15 self.PosY-17
- text: self.Num
- font: Bold
- tag : {New Tk.canvasTag tkInit(parent:self.View)}
- fill: blue)}
- end
-
- meth drawButton(Tag X Y I Action)
- Tag = {New Tk.canvasTag tkInit(parent:self.View)}
- {self.View tk(crea image X Y image:Images.I tag:Tag)}
- {Tag tkBind(event:'<1>' action:proc {$} {self Action} end)}
- end
- end
-
- %%
- %% Lift Manager
- %%
-
- class LiftManager from Tk.canvas Time.repeat
-
- prop
- final
-
- feat
- Floors
-
- attr
- Members: nil
- PosX : LeftMost
- Queue : nil
-
- meth init(parent:W floors:AllFloors)
- self.Floors = AllFloors
-
- Tk.canvas, tkInit(parent: W
- width: Width
- height: Height
- relief: sunken
- bd: Bound
- background: FloorsColor)
-
- Time.repeat, setRepAll(action:press delay:DelayLift)
- end
-
- meth join(L ?X)
- X = @PosX
- PosX <- X + LiftDelta
- Members <- L|@Members
- end
-
- meth members($)
- @Members
- end
-
- meth press
- R={RanChoiceFloor}
- Action = if R==NumFloors then doDown
- elseif R==1 then doUp
- else {RanChoiceBin doUp doDown}
- end
- in
- {{Nth self.Floors R} Action(sim)}
- end
-
- meth reached(N)
- {{Nth self.Floors N} reached}
- end
-
- meth close
- Time.repeat, stop
- Tk.canvas, tkClose
- end
- end
-
-
- %%
- %% Create Window and Lifts object as manager for group of Lift objects
- %%
-
- Top = {New Tk.toplevel tkInit(title: 'Oz Lifts'
- delete: Application.exit # 0)}
-
- BFrame = {New Tk.frame tkInit(parent: Top
- width: 20
- background: BGColor)}
-
- L1 = {New Tk.label tkInit(parent: BFrame
- text: "automatic operation"
- background: BGColor)}
-
- L2 = {New Tk.label tkInit(parent: Top
- text: "Press arrows for manual operation"
- width: 30
- background: BGColor)}
-
- AllFloors = {List.make NumFloors}
- AllLifts = {List.make NumLifts}
-
- Lifts = {New LiftManager init(parent:Top floors:AllFloors)}
-
- GoB = {New Tk.label tkInit(parent: BFrame
- text: " start "
- relief: raised
- bd: 2
- width: 9
- background: FGColor)}
-
- proc {AutoOn}
- {GoB tk(conf text:" stop ")}
- {GoB tkBind(action:AutoOff event:'<1>')}
- {Lifts go}
- end
-
- proc {AutoOff}
- {GoB tk(conf text:" start ")}
- {GoB tkBind(action:AutoOn event:'<1>')}
- {Lifts stop}
- end
-
- {GoB tkBind(action:AutoOn event:'<1>')}
-
- {Tk.batch [pack(Lifts padx:10 pady:20)
- pack(BFrame side:top)
- pack(GoB L1 side:left padx:2 expand:true)
- pack(L2 side:top pady:2)
- ]}
-
-
- %%
- %% Create lift and floor objects
- %%
-
- if NumFloors>=2 then
-
- {List.forAllInd AllFloors
- fun {$ N}
- {New Floor init(Lifts N)}
- end}
-
- {ForAll AllLifts
- fun{$}
- {New Lift init(Lifts)}
- end}
-
- end
-
-
-end
-
View
73 share/demo/Attic/concurrent/Transport.oz
@@ -1,73 +0,0 @@
-%%%
-%%% Authors:
-%%% Christian Schulte (schulte@dfki.de)
-%%%
-%%% Copyright:
-%%% Christian Schulte, 1998
-%%%
-%%% Last change:
-%%% $Date$ by $Author$
-%%% $Revision$
-%%%
-%%% This file is part of Mozart, an implementation
-%%% of Oz 3
-%%% http://mozart.ps.uni-sb.de
-%%%
-%%% See the file "LICENSE" or
-%%% http://mozart.ps.uni-sb.de/LICENSE.html
-%%% for information on usage and redistribution
-%%% of this file, and for a DISCLAIMER OF ALL
-%%% WARRANTIES.
-%%%
-
-local
-
- \insert 'transport/country.oz'
-
- ArgSpec = single(defaults(type:bool default:true)
- random(type:bool default:true))
-
-in
-
- functor
-
- import
- Tk
- TkTools
- Application
- OS
- Search(base)
- FD
-
- define
-
- Args = {Application.getCmdArgs ArgSpec}
-
- \insert 'transport/configure.oz'
- \insert 'transport/widgets.oz'
- \insert 'transport/randomizer.oz'
- \insert 'transport/agent.oz'
- \insert 'transport/frontend.oz'
- \insert 'transport/makeplan.oz'
- \insert 'transport/contract.oz'
- \insert 'transport/truck.oz'
- \insert 'transport/driver.oz'
- \insert 'transport/company.oz'
- \insert 'transport/broker.oz'
-
- T = {New Tk.toplevel tkInit(title: 'Transportation'
- delete: Application.exit # 0)}
-
- F = {New Frontend init(toplevel:T)}
-
- if Args.defaults orelse Args.random then
- {F addDefaults}
- end
-
- if Args.random then
- {F random}
- end
-
- end
-
-end
View
130 share/demo/Attic/concurrent/Trucks.oz
@@ -1,130 +0,0 @@
-%%%
-%%% Authors:
-%%% Martin Mueller (mmueller@ps.uni-sb.de)
-%%%
-%%% Contributors:
-%%% Christian Schulte (schulte@dfki.de)
-%%%
-%%% Copyright:
-%%% Martin Mueller, 1998
-%%% Christian Schulte, 1998
-%%%
-%%% Last change:
-%%% $Date$ by $Author$
-%%% $Revision$
-%%%
-%%% This file is part of Mozart, an implementation
-%%% of Oz 3
-%%% http://mozart.ps.uni-sb.de
-%%%
-%%% See the file "LICENSE" or
-%%% http://mozart.ps.uni-sb.de/LICENSE.html
-%%% for information on usage and redistribution
-%%% of this file, and for a DISCLAIMER OF ALL
-%%% WARRANTIES.
-%%%
-
-
-local
-
- Width = 600
- Height = 165
- TruckHeight = 60
- Free = 25
- ImageUrl = 'http://mozart.ps.uni-sb.de/home/doc/demo/images/trucks/'
-
-in
-
- functor
-
- import
- Tk
- TkTools
- Application
-
- define
- Images = {TkTools.images [ImageUrl#'truck-right.gif'
- ImageUrl#'truck-left.gif']}
-
- class Truck
-
- prop
- final
-
- from
- Time.repeat Tk.canvasTag
-
- attr
- state:off
- step:1
-
- meth init(c:Canvas x:X<=0 y:Y<=0)
- Truck, tkInit(parent:Canvas)
-
- {Canvas tk(crea image X Y image:Images.'truck-right' tag:self)}
-
- {self setRepAll(delay: 100
- number: Width div @step
- action: moveTruck
- final: switch)}
-
- {self tkBind(event:'<1>' action:self#toggle)}
- {self tkBind(event:'<2>' action:self#change(~1))}
- {self tkBind(event:'<3>' action:self#change(1))}
- end
-
- meth moveTruck
- Truck, tk(move @step 0)
- end
-
- meth switch
- step <- ~1 * @step
- if @step>0
- then {self tk(itemconf image:Images.'truck-right')}
- else {self tk(itemconf image:Images.'truck-left')}
- end
- {self go}
- end
-
- meth toggle
- try
- case @state
- of off then state<-on {self go}
- [] on then state<-off {self stop}
- end
- catch system(...) then skip
- end
- end
-
- meth change(S)
- N = {self getRep(delay:$)}
- in
- {self setRepDelay({Max 2 N+S*(N div 2)})}
- end
-
- meth close
- Time.repeat, stop
- Tk.canvasTag, tkClose
- end
- end
-
- T = {New Tk.toplevel tkInit(title: 'Truckrace'
- delete: Application.exit # 0)}
-
- C = {New Tk.canvas tkInit(parent: T
- bg: white
- width: Width
- height: Height)}
-
- {Tk.send pack(C fill:both)}
-
- thread {New Truck init(c:C y:Free) _} end
- thread {New Truck init(c:C y:Free+TruckHeight) _} end
- thread {New Truck init(c:C y:Free+TruckHeight*2) _} end
-
- end
-
-end
-
-
-
View
41 share/demo/Attic/concurrent/transport/agent.oz
@@ -1,41 +0,0 @@
-%%%
-%%% Authors:
-%%% Christian Schulte (schulte@dfki.de)
-%%%
-%%% Copyright:
-%%% Christian Schulte, 1998
-%%%
-%%% Last change:
-%%% $Date$ by $Author$
-%%% $Revision$
-%%%
-%%% This file is part of Mozart, an implementation
-%%% of Oz 3
-%%% http://mozart.ps.uni-sb.de
-%%%
-%%% See the file "LICENSE" or
-%%% http://mozart.ps.uni-sb.de/LICENSE.html
-%%% for information on usage and redistribution
-%%% of this file, and for a DISCLAIMER OF ALL
-%%% WARRANTIES.
-%%%
-
-fun {NewAgent Class Mess}
- Stream
- ThisPort = {NewPort Stream}
-in
- thread
- ThisObject = {New Class Mess}
- in
- try
- {ForAll Stream ThisObject}
- catch system(_ debug:_) then
- %% The toplevel widget has been closed
- {ThisObject close}
- end
- end
-
- proc {$ Mess}
- {Send ThisPort Mess}
- end
-end
View
60 share/demo/Attic/concurrent/transport/broker.oz
@@ -1,60 +0,0 @@
-%%%
-%%% Authors:
-%%% Christian Schulte (schulte@dfki.de)
-%%%
-%%% Copyright:
-%%% Christian Schulte, 1998
-%%%
-%%% Last change:
-%%% $Date$ by $Author$
-%%% $Revision$
-%%%
-%%% This file is part of Mozart, an implementation
-%%% of Oz 3
-%%% http://mozart.ps.uni-sb.de
-%%%
-%%% See the file "LICENSE" or
-%%% http://mozart.ps.uni-sb.de/LICENSE.html
-%%% for information on usage and redistribution
-%%% of this file, and for a DISCLAIMER OF ALL
-%%% WARRANTIES.
-%%%
-
-class Broker from Contract History
- prop final
- feat toplevel map
-
- meth init(toplevel:T)
- Contract, init
- History, init(master:T suffix:'Broker')
- self.toplevel = T
- end
-
- meth announce(...) = M
- A R
- in
- Contract, {Adjoin M announce(answer:?A reply:R)}
- if A\=reject then R=grant end
- History, M
- end
-
- meth add(company:C driver:D<=unit ...) = M
- if D==unit then
- Contract,add(C {NewAgent Company init(name:C toplevel:self.toplevel)})
- else
- {Contract,get(C $) add(driver:D city:M.city)}
- end
- end
-
- meth remove(company:C driver:D<=unit)
- if D==unit then Contract,remove(C) else
- {Contract,get(C $) remove(D)}
- end
- end
-
- meth close
- History, tkClose
- Contract, close
- end
-
-end
View
54 share/demo/Attic/concurrent/transport/company.oz
@@ -1,54 +0,0 @@
-%%%
-%%% Authors:
-%%% Christian Schulte (schulte@dfki.de)
-%%%
-%%% Copyright:
-%%% Christian Schulte, 1998
-%%%
-%%% Last change:
-%%% $Date$ by $Author$
-%%% $Revision$
-%%%
-%%% This file is part of Mozart, an implementation
-%%% of Oz 3
-%%% http://mozart.ps.uni-sb.de
-%%%
-%%% See the file "LICENSE" or
-%%% http://mozart.ps.uni-sb.de/LICENSE.html
-%%% for information on usage and redistribution
-%%% of this file, and for a DISCLAIMER OF ALL
-%%% WARRANTIES.
-%%%
-
-class Company from Contract History
- prop final
- feat toplevel
-
- meth init(toplevel:T name:C)
- Contract, init
- History, init(master:T suffix:C)
- self.toplevel = T
- end
-
- meth announce(answer:A reply:R ...) = Announcement
- Contract, Announcement
- History, Announcement
- end
-
- meth add(driver:D city:C)
- T = self.toplevel
- ThisDriver = {NewAgent Driver init(toplevel:T name:D city:C
- truck:ThisTruck)}
- ThisTruck = {NewAgent Truck init(parent:T.map city:C
- driver:ThisDriver)}
- in
- Contract, add(D ThisDriver)
- end
-
- meth close
- History, tkClose
- Contract, close
- end
-
-
-end
View
149 share/demo/Attic/concurrent/transport/configure.oz
@@ -1,149 +0,0 @@
-%%%
-%%% Authors:
-%%% Christian Schulte (schulte@dfki.de)
-%%%
-%%% Copyright:
-%%% Christian Schulte, 1998
-%%%
-%%% Last change:
-%%% $Date$ by $Author$
-%%% $Revision$
-%%%
-%%% This file is part of Mozart, an implementation
-%%% of Oz 3
-%%% http://mozart.ps.uni-sb.de
-%%%
-%%% See the file "LICENSE" or
-%%% http://mozart.ps.uni-sb.de/LICENSE.html
-%%% for information on usage and redistribution
-%%% of this file, and for a DISCLAIMER OF ALL
-%%% WARRANTIES.
-%%%
-
-
-%% Trucks
-Capacity = 100 % Capacity of a truck
-Delta = 5 % How many pixels per movement
-DelayMove = 100 % Delay in milliseconds between each move
-
-
-%% Randomizer
-local
- Speed = (1000 * Delta) div DelayMove % Relative speed
-in
- MedLowTime = 20 * Speed % Lower bound for random time interval
- MedHighTime = 3 * MedLowTime % Upper bound for random time interval
- SlowLowTime = MedLowTime div 2 % Lower bound for random time interval
- SlowHighTime = MedHighTime div 2 % Upper bound for random time interval
- FastLowTime = 2 * MedLowTime % Lower bound for random time interval
- FastHighTime = 2 * MedHighTime % Upper bound for random time interval
-end
-
-LowGood = Capacity div 10 % Lower bound for random weight of goods
-HighGood = Capacity % Upper bound for random weight of goods
-
-
-%% Colors
-BackColor # StreetColor # CityColor #
-TruckColors # FrameColor # WinColor # GoodColor =
-if Tk.isColor then
- aquamarine # black # red #
- [red blue yellow green plum cyan tan bisque] #
- black # steelblue # brown
-else
- white # black # black #
- [white] #
- black # white # black
-end
-
-local
- %% Somehow append is buggy, check!
- fun {Link Cs}
- case Cs of nil then CycColors
- [] C|Cr then C|{Link Cr}
- end
- end
- CycColors = {Link TruckColors}
- ColMan = {New class $ from BaseObject
- prop final
- attr ColS: CycColors
- meth get(?Col) ColR in Col|ColR=(ColS<-ColR) end
- end noop}
-in
- fun {GetFillColor}
- {ColMan get($)}
- end
-end
-
-%% Where to find the bitmaps?
-local
- Url = 'http://www.ps.uni-sb.de/ozhome/demo/images/transport/'
- RI = {TkTools.images
- {Map [down
- truck_frame_left truck_frame_right
- truck_win_left truck_win_right]
- fun {$ B}
- Url#B#'.xbm'
- end}}
- {RI.truck_frame_left tk(configure foreground:FrameColor)}
- {RI.truck_frame_right tk(configure foreground:FrameColor)}
- {RI.truck_win_left tk(configure foreground:WinColor)}
- {RI.truck_win_right tk(configure foreground:WinColor)}
- CI = {List.toRecord c
- {Map TruckColors
- fun {$ C}
- I = {TkTools.images [Url#'truck_fill_right.xbm'
- Url#'truck_fill_left.xbm']}
- in
- {I.truck_fill_left tk(configure foreground:C)}
- {I.truck_fill_right tk(configure foreground:C)}
- C#c(left: I.truck_fill_left
- right: I.truck_fill_right)
- end}}
-in
- Images = images(down: RI.down
- truck: t(fill: CI
- frame: f(left: RI.truck_frame_left
- right: RI.truck_frame_right)
- win: w(left: RI.truck_win_left
- right: RI.truck_win_right)))
-
-end
-
-
-LoadLeftX = ~3.0
-LoadRightX = ~24.0
-LoadY = ~8.0
-LoadHeight = 6.0
-LoadWidth = 27.0
-
-%% Dialogs
-TitleName = 'Transportation'
-AboutFont = '-adobe-times-bold-r-normal-*-*-240*'
-
-
-%% Misc
-Pad = 2
-BigPad = 4
-TextWidth = 4
-BigTextWidth = 17
-TextHeight = 6
-TextFont = '-adobe-helvetica-medium-r-normal-*-*-120*'
-TextBg = wheat
-HistoryWidth = 60
-HistoryHeight = 8
-HistoryFont = '-adobe-helvetica-medium-r-normal-*-*-100*'
-HistoryBg = '#fffff0'
-
-%% Predefined goods
-Goods = bananas # cheese # cream # computers # rye # oil # sugar # salt #
- vinegar # apples # whisky # beer # garbage # ketchup # coffee # ham #
- umbrellas # paper # books # yoghurt # engines # oranges # juice #
- tea # jam # grease # cigarettes # toys # corn # hamburgers
-
-
-%% Default companies and drivers
-
-DefaultScenario = d('Disney': ['Mickey'('Düsseldorf') 'Goofy'('Berlin')]
- 'Oz': ['Tinman'('München') 'Toto'('Saarbrücken')])
-
View
79 share/demo/Attic/concurrent/transport/contract.oz
@@ -1,79 +0,0 @@
-%%%
-%%% Authors:
-%%% Christian Schulte (schulte@dfki.de)
-%%%
-%%% Copyright:
-%%% Christian Schulte, 1998
-%%%
-%%% Last change:
-%%% $Date$ by $Author$
-%%% $Revision$
-%%%
-%%% This file is part of Mozart, an implementation
-%%% of Oz 3
-%%% http://mozart.ps.uni-sb.de
-%%%
-%%% See the file "LICENSE" or
-%%% http://mozart.ps.uni-sb.de/LICENSE.html
-%%% for information on usage and redistribution
-%%% of this file, and for a DISCLAIMER OF ALL
-%%% WARRANTIES.
-%%%
-
-local
- fun {SendSlaves Ss M}
- case Ss of nil then nil
- [] S|Sr then NewM={Adjoin M announce(answer:_ reply:_)} in
- {S NewM}
- NewM|{SendSlaves Sr M}
- end
- end
-
- fun {FindBest As BA}
- case As of nil then BA
- [] A|Ar then
- RA#KA = if A.answer==reject then A#BA
- elseif BA.answer==reject then BA#A
- elseif A.answer>BA.answer then A#BA
- else BA#A
- end
- in
- RA.reply=reject {FindBest Ar KA}
- end
- end
-in
-
- class Contract from BaseObject
- feat MySlaves
-
- meth init
- self.MySlaves = {Dictionary.new}
- end
- meth add(Name Slave)
- {Dictionary.put self.MySlaves Name Slave}
- end
- meth remove(Name)
- Slave = {Dictionary.get self.MySlaves Name}
- in
- {Dictionary.remove self.MySlaves Name}
- {Slave close}
- end
- meth announce(...) = M
- case {SendSlaves {Map {Dictionary.entries self.MySlaves}
- fun {$ E} E.2 end} M}
- of nil then M.answer=reject
- [] A|Ar then M={FindBest Ar A}
- end
- end
- meth get(Name $)
- {Dictionary.get self.MySlaves Name}
- end
- meth close
- {ForAll {Dictionary.entries self.MySlaves}
- proc {$ E}
- {E.2 close}
- end}
- end
- end
-
-end
View
88 share/demo/Attic/concurrent/transport/country.oz
@@ -1,88 +0,0 @@
-%%%
-%%% Authors:
-%%% Christian Schulte (schulte@dfki.de)
-%%%
-%%% Copyright:
-%%% Christian Schulte, 1998
-%%%
-%%% Last change:
-%%% $Date$ by $Author$
-%%% $Revision$
-%%%
-%%% This file is part of Mozart, an implementation
-%%% of Oz 3
-%%% http://mozart.ps.uni-sb.de
-%%%
-%%% See the file "LICENSE" or
-%%% http://mozart.ps.uni-sb.de/LICENSE.html
-%%% for information on usage and redistribution
-%%% of this file, and for a DISCLAIMER OF ALL
-%%% WARRANTIES.
-%%%
-
-local
- Germany = \insert 'germany.oz'
-
- fun {GetDist Src Dst}
- if Src==Dst then 0
- else V=Germany.map.Src.Dst in
- if {IsInt V} then V else V.1 end
- end
- end
-
- fun {GetDetourDist Src Via Dst}
- if Via==Dst orelse Via==Src then 0
- elseif Src==Dst then 2*{GetDist Src Via}
- else
- %% Due to sampling errors in the map data the detour might be
- %% negative!
- {Max {GetDist Src Via} + {GetDist Via Dst} - {GetDist Src Dst} 0}
- end
- end
-
- fun {GetRoute Src Dst}
- if Src==Dst then [Dst#0]
- else SrcDst=Germany.map.Src.Dst in
- if {IsInt SrcDst} then [Src#SrcDst Dst#0]
- else Via=SrcDst.2 in Src#Germany.map.Src.Via|{GetRoute Via Dst}
- end
- end
- end
-
- Cities = {Arity Germany.map}
-
- local
- fun {MkSrc Cs F}
- case Cs of nil then nil
- [] C|Cr then
- if {IsInt Germany.map.F.C} then Germany.coord.C|{MkSrc Cr F}
- else {MkSrc Cr F}
- end
- end
- end
- in
- fun {MkGraph Cs}
- case Cs of nil then nil
- [] C|Cr then C#Germany.coord.C#{MkSrc Cr C}|{MkGraph Cr}
- end
- end
- end
-
- fun {IsCity A}
- {HasFeature Germany.map A}
- end
-
-in
-
- Country = country(getDist: GetDist
- getDetourDist: GetDetourDist
- getRoute: GetRoute
- width: Germany.width
- height: Germany.height
- coord: Germany.coord
- cities: Cities
- graph: fun {$} {MkGraph Cities} end
- isCity: IsCity)
-
-end
-
View
96 share/demo/Attic/concurrent/transport/driver.oz
@@ -1,96 +0,0 @@
-%%%
-%%% Authors:
-%%% Christian Schulte (schulte@dfki.de)
-%%%
-%%% Copyright:
-%%% Christian Schulte, 1998
-%%%
-%%% Last change:
-%%% $Date$ by $Author$
-%%% $Revision$
-%%%
-%%% This file is part of Mozart, an implementation
-%%% of Oz 3
-%%% http://mozart.ps.uni-sb.de
-%%%
-%%% See the file "LICENSE" or
-%%% http://mozart.ps.uni-sb.de/LICENSE.html
-%%% for information on usage and redistribution
-%%% of this file, and for a DISCLAIMER OF ALL
-%%% WARRANTIES.
-%%%
-
-class Driver from History
- prop final
-
- feat truck
-
- attr plan:nil status:idle
-
- meth init(toplevel:M name:N truck:T city:C)
- History, init(master:M suffix:N)
- plan <- [act(city:C load:0 lift:nil drop:nil)]
- %% Create the truck
- self.truck = T
- end
-
- meth deiconify