Part of the Occam utility. Laurent Siebenmann Master posting 1994, ftp ftp.math.u-psud.fr ************************************************* ****** ****** OCCAM'S RAZOR AND MACRO MANAGEMENT ****** ****** Laurent Siebenmann ****** ****** lcs@topo.math.u-psud.fr ****** ************************************************* THE APHORISM: entia non sunt multiplicanda praeter necessitatem entities should not be multiplied beyond necessity William of Occam 1285-1349(?) \footnote{Occam's Razor is not just a trendy novel of this decade; it is the aphorism quoted! Experts believe that Occam did not formulated it in exactly these famous words, but rather as What can be done with fewer assumptions is done in vain with more. or Plurality is not to be assumed without necessity. The term Principle of Parcimony is also used for the Razor.} THE SOFTWARE: --- occam.pub --- auditor.tex --- DefStrip-QUEDM-Macros (Macintosh only) --- defstrip.hlp help file for above --- occam.spc specifications for source macro files to be minimized --- defstrip.tex (is mere wishful thinking in summer 1994) MASTER POSTING in 1994: --- ftp ftp.math.u-psud.fr directory pub/TeX/defstrip.dir/ Have you ever felt guilty about burdening a friend with macros that are not really necessary for composing your typescript? I certainly have; and would ideally like to follow Knuth's example of using macro files which define exactly what is necessary for a document and nothing more. However, pruning a macro file that has served for another purpose is a pain. Most of us respond to this pain by adopting a rather messy maximalist approach in which all the macros that have a geneology related to the necessary macros are transmitted. But there is another approach! One can seek efficient mechanisms to ease the task of weeding out unnecessary macros. One such mechanism is auditor.tex, which sets up a list of names of those macros of macro file that turn out to be *unnecessary* in a given typescript. A complementary tool is the utility DefStrip which combines a specially arranged version of the macro file to be "cleaned up" with the list of unused macros provided by auditor.tex to delete the unneeded macros listed together with some related material. Ultimately, DefStrip will hopefully be a ".tex" program "defstrip.tex" resembling the "docstrip.cmd" utility of LaTeX fame. At the present time there exists instead a QUEDM script called DefStrip-QUEDM-Macros; QUEDM is a editor with convenient "macro" (=composite command) capabilities that is available on Macintosh computers. DefStrip and Auditor together make up a system called "Occam". Let us consider two plausible examples of use of the Occam system. Only the first has proved genuinely useful thus far. (A) Many TeX users build up a cumulative personal macro file through composing many articles with TeX. A time inevitably comes when it is embarrassing, cumbersome, or confusing to submit the whole macro file along with the article. The Occam system makes the pruning of the macro file painless. It is advisable to tidy up the macro file and maintain it in "Occam" format as explained in "occam.spc"; then and only then will auditor.tex and DefStrip collaborate to *automatically* produce a minimal version of the macro file suitable for the article at hand. (B) Suppose that one proposes to post in electronic ".tex" form an article prepared using the TUGboat macro package. (The alternative ".dvi" form is less flexible; for instance the ".tex" version can be reformatted to be read in comfort on any computer screen whereas a ".dvi" version often does not have an appropriate width.) Such a macro package is not immune to alteration with time and unfortunately the principles of upward compatibility are pious hopes, not laws. Consequently, one is well-advised to post, along with the article the macros necessary to compile it --- especially if modifications to the macros have been used. Unfortunately, the TUGboat macros are more voluminous than most articles. This is an unfortunate obstacle to electronic posting of ".tex" typescripts. An attractive solution would be to have a version of the TUGboat macros that have been set out in a form suitable for use with Occam. Then the necessary macros for a given article can quickly be extracted from the total package to make the total posting both compact and archival. The archival nature of such TeX postings still depends on Knuth's Plain format being archival. Plain probably will be at least upwards compatible in the best sense. However, the article (or a book, say) could perhaps be made archival on the scale of many decades by subjecting the Plain macros to the same process as the TUGboat macros; this incidentally seems necessary to realize best economy. The article would then have its own format built with initex. This may seem needlessly radical to an English speaking user. But I consider bootstrapping from initex the best approach for fully archival ".tex" postings where other languages are concerned. Afterthoughts 1) Occam as presently realized does not make much sense in the LaTeX world. The LaTeX group is building official macro modules that cover all needs and are univerally available. I suspect this will require continuing exponential growth of the LaTeX project, of the computers that run LaTeX, and of the of the time invested by LaTeX users. I may be wrong. 2) Bootstrapping on initex as mentioned above seems to have a parallel in classical programming, namely the use of assembly language --- whereas the LaTeX approach is parallel to the use of a big and constantly evolving interpreter. 3) Occam's razor was one of the guiding principles of scientific thought in the era before the coming of age of computers. I suspect the philosophy of Aristotle or Descartes is far more likely to appeal to computer scientists. One might go so far as to say that Occam's razor has by now been discarded --- indeed object oriented programming consciously cultivates the art of multiplication of entities, and this sort of thing is to be found in TeX in commands such as \newheading of LaTeX. What can the minimalism of Occam's razor offer TeX users at this late date? Probably just a few things. (a) Friendliness to human beings. Unnecessary entities that cost a microprocessor only a fraction of a second can cost the human mind a significant amount of time. (b) Extra storage space and computing power. Both are in a period of exponential growth. But so is the TeX software we use. Where performance in a fixed task is concerned these growths may even cancel one another. When this happens the old-fashioned minimalism of Occam's razor can help derive pleasure from progress. Laurent Siebenmann