]> www.ginac.de Git - ginac.git/commitdiff
- */Makefile.in: changes triggered by newer automake.
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Mon, 7 Feb 2000 17:57:15 +0000 (17:57 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Mon, 7 Feb 2000 17:57:15 +0000 (17:57 +0000)
- added relational::rhs() and relational::lhs() also available from ex.
- added two new checks in check/linear_solve.cpp (formerly
  check/lsolve_onedim.cpp) shamelessly ripped from the Maple online-help.
- added keyword warranty to ginsh as dictated by the bible (emacs).

25 files changed:
Makefile.in
check/Makefile.am
check/Makefile.in
check/check.h
check/linear_solve.cpp [new file with mode: 0644]
check/lsolve_onedim.cpp [deleted file]
check/main.cpp
cint/Makefile.am
cint/Makefile.in
cint/ginaccint.1
cint/ginaccint.bin.cpp
doc/Makefile.in
doc/reference/Makefile.in
doc/tutorial/Makefile.in
ginac/Makefile.in
ginac/ex.cpp
ginac/ex.h
ginac/numeric.cpp
ginac/numeric.h
ginac/relational.cpp
ginac/relational.h
ginsh/Makefile.in
ginsh/ginsh_lexer.ll
ginsh/ginsh_parser.yy
tools/Makefile.in

index ae1dd8dbfd5264be57f6e36ec686cd1b88174568..a61a6e7495e6e5f76a74d1052e2b8224c9a790d6 100644 (file)
@@ -359,7 +359,7 @@ distdir: $(DISTFILES)
        @for file in $(DISTFILES); do \
          d=$(srcdir); \
          if test -d $$d/$$file; then \
-           cp -pr $$/$$file $(distdir)/$$file; \
+           cp -pr $$d/$$file $(distdir)/$$file; \
          else \
            test -f $(distdir)/$$file \
            || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
index 3e1ed8bda4d5dfd27e256590aeac69ea8e85b2b4..87976d8f26bab0983b95e311eadee860cd32d1ee 100644 (file)
@@ -3,8 +3,8 @@ TESTS = run_checks
 check_PROGRAMS = check_ginac
 check_ginac_SOURCES = paranoia_check.cpp numeric_output.cpp \
   numeric_consist.cpp powerlaws.cpp expand_subs.cpp inifcns_consist.cpp \
-  differentiation.cpp poly_gcd.cpp normalization.cpp lsolve_onedim.cpp \
-  matrix_checks.cpp series_expansion.cpp lortensor_check.cpp \
+  differentiation.cpp poly_gcd.cpp normalization.cpp matrix_checks.cpp \
+  linear_solve.cpp series_expansion.cpp lortensor_check.cpp \
   fcntimer.cpp main.cpp check.h
 check_ginac_LDADD = ../ginac/libginac.la
 INCLUDES = -I$(srcdir)/../ginac
index 01810c8e4a56e0c4525b3e91e7cf07064013a069..ffdee01a629d284cebeacd44ba62560c5cd1b6de 100644 (file)
@@ -106,7 +106,7 @@ YACC = @YACC@
 
 TESTS = run_checks
 check_PROGRAMS = check_ginac
-check_ginac_SOURCES = paranoia_check.cpp numeric_output.cpp   numeric_consist.cpp powerlaws.cpp expand_subs.cpp inifcns_consist.cpp   differentiation.cpp poly_gcd.cpp normalization.cpp lsolve_onedim.cpp   matrix_checks.cpp series_expansion.cpp lortensor_check.cpp   fcntimer.cpp main.cpp check.h
+check_ginac_SOURCES = paranoia_check.cpp numeric_output.cpp   numeric_consist.cpp powerlaws.cpp expand_subs.cpp inifcns_consist.cpp   differentiation.cpp poly_gcd.cpp normalization.cpp matrix_checks.cpp   linear_solve.cpp series_expansion.cpp lortensor_check.cpp   fcntimer.cpp main.cpp check.h
 
 check_ginac_LDADD = ../ginac/libginac.la
 INCLUDES = -I$(srcdir)/../ginac
@@ -122,8 +122,8 @@ LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
 check_ginac_OBJECTS =  paranoia_check.o numeric_output.o \
 numeric_consist.o powerlaws.o expand_subs.o inifcns_consist.o \
-differentiation.o poly_gcd.o normalization.o lsolve_onedim.o \
-matrix_checks.o series_expansion.o lortensor_check.o fcntimer.o main.o
+differentiation.o poly_gcd.o normalization.o matrix_checks.o \
+linear_solve.o series_expansion.o lortensor_check.o fcntimer.o main.o
 check_ginac_DEPENDENCIES =  ../ginac/libginac.la
 check_ginac_LDFLAGS = 
 CXXFLAGS = @CXXFLAGS@
@@ -144,8 +144,8 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 TAR = tar
 GZIP_ENV = --best
 DEP_FILES =  .deps/differentiation.P .deps/expand_subs.P \
-.deps/fcntimer.P .deps/inifcns_consist.P .deps/lortensor_check.P \
-.deps/lsolve_onedim.P .deps/main.P .deps/matrix_checks.P \
+.deps/fcntimer.P .deps/inifcns_consist.P .deps/linear_solve.P \
+.deps/lortensor_check.P .deps/main.P .deps/matrix_checks.P \
 .deps/normalization.P .deps/numeric_consist.P .deps/numeric_output.P \
 .deps/paranoia_check.P .deps/poly_gcd.P .deps/powerlaws.P \
 .deps/series_expansion.P
@@ -254,7 +254,7 @@ distdir: $(DISTFILES)
        @for file in $(DISTFILES); do \
          d=$(srcdir); \
          if test -d $$d/$$file; then \
-           cp -pr $$/$$file $(distdir)/$$file; \
+           cp -pr $$d/$$file $(distdir)/$$file; \
          else \
            test -f $(distdir)/$$file \
            || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
index d9ebbb6636228e70ffc70cae5ce66db8e0f28efd..7bdfe2c906cb2f463efacd84bd7516fc3d01b1b9 100644 (file)
@@ -38,7 +38,7 @@ unsigned differentiation();
 unsigned poly_gcd();
 unsigned normalization();
 unsigned matrix_checks();
-unsigned lsolve_onedim();
+unsigned linear_solve();
 unsigned series_expansion();
 unsigned lortensor_check();
 
diff --git a/check/linear_solve.cpp b/check/linear_solve.cpp
new file mode 100644 (file)
index 0000000..0faabb0
--- /dev/null
@@ -0,0 +1,120 @@
+/** @file linear_solve.cpp
+ *
+ * These test routines do some simple checks on solving linear systems of
+ * symbolic equations. */
+
+/*
+ *  GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "ginac.h"
+
+#ifndef NO_NAMESPACE_GINAC
+using namespace GiNaC;
+#endif // ndef NO_NAMESPACE_GINAC
+
+static unsigned lsolve1(void)
+{
+    unsigned result = 0;
+    symbol x("x");
+    ex eq, aux;
+    
+    eq = (3*x+5 == numeric(8));
+    aux = lsolve(eq, x);
+    if (aux != 1) {
+        result++;
+        clog << "solution of 3*x+5==8 erroneously returned "
+             << aux << endl;
+    }
+    
+    return result;
+}
+
+static unsigned lsolve2a(void)
+{
+    unsigned result = 0;
+    symbol a("a"), b("b"), x("x"), y("y");
+    lst eqns, vars;
+    ex sol;
+    
+    // Create the linear system [a*x+b*y==3,x-y==b]...
+    eqns.append(a*x+b*y==3).append(x-y==b);
+    // ...to be solved for [x,y]...
+    vars.append(x).append(y);
+    // ...and solve it:
+    sol = lsolve(eqns, vars);
+    ex sol_x = sol.op(0).rhs();  // rhs of solution for first variable (x)
+    ex sol_y = sol.op(1).rhs();  // rhs of solution for second variable (y)
+    
+    // It should have returned [x==(3+b^2)/(a+b),y==(3-a*b)/(a+b)]
+    if (!(sol_x - (3+pow(b,2))/(a+b)).is_zero() ||
+        !(sol_y - (3-a*b)/(a+b)).is_zero()) {
+        result++;
+        clog << "solution of the system " << eqns << " for " << vars
+             << " erroneously returned " << sol << endl;
+    }
+    
+    return result;
+}
+
+static unsigned lsolve2b(void)
+{
+    unsigned result = 0;
+    symbol x("x"), y("y");
+    lst eqns, vars;
+    ex sol;
+    
+    // Create the linear system [I*x+y==1,I*x-y==2]...
+    eqns.append(I*x+y==1).append(I*x-y==2);
+    // ...to be solved for [x,y]...
+    vars.append(x).append(y);
+    // ...and solve it:
+    sol = lsolve(eqns, vars);
+    ex sol_x = sol.op(0).rhs();  // rhs of solution for first variable (x)
+    ex sol_y = sol.op(1).rhs();  // rhs of solution for second variable (y)
+
+    // It should have returned [x==-3/2*I,y==-1/2]
+    if (!(sol_x - numeric(-3,2)*I).is_zero() ||
+        !(sol_y - numeric(-1,2)).is_zero()) {
+        result++;
+        clog << "solution of the system " << eqns << " for " << vars
+             << " erroneously returned " << sol << endl;
+    }
+    
+    return result;
+}
+
+unsigned linear_solve(void)
+{
+    unsigned result = 0;
+    
+    cout << "checking linear solve..." << flush;
+    clog << "---------linear solve:" << endl;
+    
+    result += lsolve1();
+    result += lsolve2a();
+    result += lsolve2b();
+    
+    if (!result) {
+        cout << " passed ";
+        clog << "(no output)" << endl;
+    } else {
+        cout << " failed ";
+    }
+    
+    return result;
+}
diff --git a/check/lsolve_onedim.cpp b/check/lsolve_onedim.cpp
deleted file mode 100644 (file)
index 9931124..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/** @file lsolve_onedim.cpp
- *
- * This test routine does some simple checks on solving a polynomial for a
- * variable. */
-
-/*
- *  GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include "ginac.h"
-
-#ifndef NO_NAMESPACE_GINAC
-using namespace GiNaC;
-#endif // ndef NO_NAMESPACE_GINAC
-
-unsigned lsolve_onedim(void)
-{
-    unsigned result = 0;
-    symbol x("x");
-    ex eq, aux;
-    
-    cout << "checking linear solve..." << flush;
-    clog << "---------linear solve:" << endl;
-    
-    eq = (3*x+5 == numeric(8));
-    aux = lsolve(eq,x);
-    if (aux != 1) {
-        result++;
-        clog << "solution of 3*x+5==8 erroneously returned "
-             << aux << endl;
-    }
-    
-    if (!result) {
-        cout << " passed ";
-        clog << "(no output)" << endl;
-    } else {
-        cout << " failed ";
-    }
-    
-    return result;
-}
index c55794a6fe0a96f61ef78fb0bea85baefda610dc..d3fbea984322e509655e36a2a7fa5ea9ba3eb3cf 100644 (file)
@@ -41,7 +41,7 @@ int main()
             result += fcntimer(poly_gcd);
             result += fcntimer(normalization);
             result += fcntimer(matrix_checks);
-            result += fcntimer(lsolve_onedim);
+            result += fcntimer(linear_solve);
             result += fcntimer(series_expansion);
             result += fcntimer(lortensor_check);
         }
index 2884e6de82f0c0971377b22ef8269ab35bd05dab..c43b552320cff41bce343fde2955d1cbb4c4f812 100644 (file)
@@ -21,12 +21,16 @@ EXTRA_DIST = dummies.pl
 
 # Files which are generated by perl scripts
 $(srcdir)/dummies.h $(srcdir)/dummies.cpp: $(srcdir)/dummies.pl
-       cd $(srcdir) && perl dummies.pl
+       cd $(srcdir) && perl -w dummies.pl
 
 # Force build of headers before compilation
 $(srcdir)/ginaccint.bin.cpp: $(srcdir)/dummies.h
 
-# Force make clean to call Makecint's own Makefile
+# Force targets clean and distclean to call Makecint's own Makefile
 makecint_clean:
        (if [ -f Makefile.makecint ]; then $(MAKE) -f Makefile.makecint clean; fi)
+
 clean: makecint_clean
+       -rm -f libginac.*
+
+distclean: makecint_clean
index 00851a0a60fed183111935b70ad6faddaa11f1c5..acbcb7935e784977be73fdaaa3ad23f234180ff2 100644 (file)
@@ -341,7 +341,7 @@ distdir: $(DISTFILES)
        @for file in $(DISTFILES); do \
          d=$(srcdir); \
          if test -d $$d/$$file; then \
-           cp -pr $$/$$file $(distdir)/$$file; \
+           cp -pr $$d/$$file $(distdir)/$$file; \
          else \
            test -f $(distdir)/$$file \
            || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
@@ -496,15 +496,19 @@ ginaccint.bin: libginac.la ginaccint.bin.cpp
 
 # Files which are generated by perl scripts
 $(srcdir)/dummies.h $(srcdir)/dummies.cpp: $(srcdir)/dummies.pl
-       cd $(srcdir) && perl dummies.pl
+       cd $(srcdir) && perl -w dummies.pl
 
 # Force build of headers before compilation
 $(srcdir)/ginaccint.bin.cpp: $(srcdir)/dummies.h
 
-# Force make clean to call Makecint's own Makefile
+# Force targets clean and distclean to call Makecint's own Makefile
 makecint_clean:
        (if [ -f Makefile.makecint ]; then $(MAKE) -f Makefile.makecint clean; fi)
+
 clean: makecint_clean
+       -rm -f libginac.*
+
+distclean: makecint_clean
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
index fe313d0bef633735b1fb3551074dbb1a94b9cb2e..7940a5c47b2d05174eeba9cbd3bc6521a3e141f8 100644 (file)
@@ -146,17 +146,6 @@ CLN \- A Class Library for Numbers, Bruno Haible
 .PP
 \fBginsh\fP(1)
 .SH COPYRIGHT
-.SS CINT COPYRIGHT
-Copyright \(co of Cint and associated tools are owned by Agilent
-Technologies Japan Company and the author.  Acknowledgement to the
-author by e-mail is recommended at installation.  Source code, binary
-executable or library of Cint and associated tools can be used,
-modified and distributed free of charge for any purpose provided that
-the copyright notice appear in all copies and that both that copyright
-notice and this permission notice appear in documentation.
-Registration is requested, at this moment, for commercial use.  Send
-e-mail to the author <MXJ02154@niftyserve.or.jp>.  The registration is
-free.
 .SS GINAC COPYRIGHT
 Copyright \(co 1999-2000 Johannes Gutenberg Universit\(:at Mainz, Germany
 
@@ -173,3 +162,14 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+.SS CINT COPYRIGHT
+Copyright \(co of Cint and associated tools are owned by Agilent
+Technologies Japan Company and the author.  Acknowledgement to the
+author by e-mail is recommended at installation.  Source code, binary
+executable or library of Cint and associated tools can be used,
+modified and distributed free of charge for any purpose provided that
+the copyright notice appear in all copies and that both that copyright
+notice and this permission notice appear in documentation.
+Registration is requested, at this moment, for commercial use.  Send
+e-mail to the author <MXJ02154@niftyserve.or.jp>.  The registration is
+free.
index 4c134b4e7a81dcfc7eb28f48ffe96f78e7b1313f..109583378447345e9247b41d69225df0152218b8 100644 (file)
@@ -156,7 +156,8 @@ void greeting(void)
          << "  __,  _______  requested, at this moment, for commercial use.  Send e-mail to" << endl
          << " (__) *       | <MXJ02154@niftyserve.or.jp>.  The registration is free." << endl
          << "  ._) i N a C | The GiNaC framework is Copyright by Johannes Gutenberg Univ.," << endl
-         << "<-------------' Germany and licensed under the terms and conditions of the GPL." << endl << endl;
+         << "<-------------' Germany and licensed under the terms and conditions of the GPL." << endl
+         << endl;
 }
 
 int main(void) 
@@ -183,7 +184,7 @@ int main(void)
         string command;
         while (!end_of_command) {
             line = G__input(prompt);
-        
+            
             int pos = 0;
             bool double_quote=false;
             bool single_quote=false;
index 7b5a3f9ba43b455965578f58d737d9e4e46168cd..6fa6eccbcc4d065f8c97e0f9c5206e1e1880f028 100644 (file)
@@ -274,7 +274,7 @@ distdir: $(DISTFILES)
        @for file in $(DISTFILES); do \
          d=$(srcdir); \
          if test -d $$d/$$file; then \
-           cp -pr $$/$$file $(distdir)/$$file; \
+           cp -pr $$d/$$file $(distdir)/$$file; \
          else \
            test -f $(distdir)/$$file \
            || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
index 53ca7fa109524e4705bce3fb924ac61828abdc42..d9e8155508af5860ce0d00719639176899481bb2 100644 (file)
@@ -170,7 +170,7 @@ distdir: $(DISTFILES)
        @for file in $(DISTFILES); do \
          d=$(srcdir); \
          if test -d $$d/$$file; then \
-           cp -pr $$/$$file $(distdir)/$$file; \
+           cp -pr $$d/$$file $(distdir)/$$file; \
          else \
            test -f $(distdir)/$$file \
            || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
index 158a13357a427495675746059882f346a7b7ff70..16fc4f9397a62c9624d8a795c7f010feffccc64a 100644 (file)
@@ -327,7 +327,7 @@ distdir: $(DISTFILES)
        @for file in $(DISTFILES); do \
          d=$(srcdir); \
          if test -d $$d/$$file; then \
-           cp -pr $$/$$file $(distdir)/$$file; \
+           cp -pr $$d/$$file $(distdir)/$$file; \
          else \
            test -f $(distdir)/$$file \
            || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
index 596304e25ca74925939334a9dd863193019c3772..e9eff67cb3e3005ef1a414b6cad7fc081d3ae668 100644 (file)
@@ -295,7 +295,7 @@ distdir: $(DISTFILES)
        @for file in $(DISTFILES); do \
          d=$(srcdir); \
          if test -d $$d/$$file; then \
-           cp -pr $$/$$file $(distdir)/$$file; \
+           cp -pr $$d/$$file $(distdir)/$$file; \
          else \
            test -f $(distdir)/$$file \
            || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
index a390d71475f58d4dc71cc26783ca547ef18563a0..412f8c95509fb3af03367b5a4a9de4d90474e44d 100644 (file)
@@ -28,6 +28,7 @@
 #include "ncmul.h"
 #include "numeric.h"
 #include "power.h"
+#include "relational.h"
 #include "debugmsg.h"
 #include "utils.h"
 
@@ -427,6 +428,7 @@ ex ex::operator[](int i) const
     return (*bp)[i];
 }
 
+/** Return operand/member at position i. */
 ex ex::op(int i) const
 {
     debugmsg("ex op()",LOGLEVEL_MEMBER_FUNCTION);
@@ -434,6 +436,7 @@ ex ex::op(int i) const
     return bp->op(i);
 }
 
+/** Return modifyable operand/member at position i. */
 ex & ex::let_op(int i)
 {
     debugmsg("ex let_op()",LOGLEVEL_MEMBER_FUNCTION);
@@ -442,6 +445,22 @@ ex & ex::let_op(int i)
     return bp->let_op(i);
 }
 
+/** Left hand side of relational expression. */
+ex ex::lhs(void) const
+{
+    debugmsg("ex lhs()",LOGLEVEL_MEMBER_FUNCTION);
+    GINAC_ASSERT(is_ex_of_type(*this,relational));
+    return (*static_cast<relational *>(bp)).lhs();
+}
+
+/** Right hand side of relational expression. */
+ex ex::rhs(void) const
+{
+    debugmsg("ex rhs()",LOGLEVEL_MEMBER_FUNCTION);
+    GINAC_ASSERT(is_ex_of_type(*this,relational));
+    return (*static_cast<relational *>(bp)).rhs();
+}
+
 #ifndef INLINE_EX_CONSTRUCTORS
 int ex::compare(const ex & other) const
 {
index 974bfde3cde5f8a6d3fca144885376b3b097e116..6bc4879ea427aec76b3f19bd4a5d45389b6fe0ad 100644 (file)
@@ -245,6 +245,8 @@ public:
     ex operator[](int i) const;
     ex op(int i) const;
     ex & let_op(int i);
+    ex lhs(void) const;
+    ex rhs(void) const;
     int compare(const ex & other) const
 #ifdef INLINE_EX_CONSTRUCTORS
         {
@@ -382,6 +384,18 @@ inline ex subs(const ex & thisex, const ex & e)
 inline ex subs(const ex & thisex, const lst & ls, const lst & lr)
 { return thisex.subs(ls, lr); }
 
+inline ex op(const ex & thisex, int i)
+{ return thisex.op(i); }
+
+inline ex lhs(const ex & thisex)
+{ return thisex.lhs(); }
+
+inline ex rhs(const ex & thisex)
+{ return thisex.rhs(); }
+
+inline bool is_zero(const ex & thisex)
+{ return thisex.is_zero(); }
+
 inline void swap(ex & e1, ex & e2)
 { e1.swap(e2); }
 
index e504186aadae431f3b87d13477f12b597be17c0a..ab132a0751422bf3a5dc895507c0147f146c807a 100644 (file)
@@ -231,7 +231,7 @@ numeric::numeric(const char *s) : basic(TINFO_numeric)
 
 /** Ctor from CLN types.  This is for the initiated user or internal use
  *  only. */
-numeric::numeric(cl_N const & z) : basic(TINFO_numeric)
+numeric::numeric(const cl_N & z) : basic(TINFO_numeric)
 {
     debugmsg("numeric constructor from cl_N", LOGLEVEL_CONSTRUCT);
     value = new cl_N(z);
index 03fcb4310689a5a45d5bcdf6738709ce794d89f6..b130eb9a40bfd0968729cf62c1a18c14a2ca0859 100644 (file)
@@ -117,8 +117,8 @@ public:
     explicit numeric(long numer, long denom);
     explicit numeric(double d);
     explicit numeric(const char *);
-    numeric(cl_N const & z);
-
+    numeric(const cl_N & z);
+    
     // functions overriding virtual functions from bases classes
 public:
     basic * duplicate() const;
index 9511319cc4f7965b7b403b4e7404a60d1cc998c6..55b705447d7ab254b6aea24ee28dc6e9e4b14036 100644 (file)
@@ -348,7 +348,17 @@ unsigned relational::return_type_tinfo(void) const
 // new virtual functions which can be overridden by derived classes
 //////////
 
-// none
+/** Left hand side of relational. */
+ex relational::lhs(void) const
+{
+    return lh;
+}
+
+/** Right hand side of relational. */
+ex relational::rhs(void) const
+{
+    return rh;    
+}
 
 //////////
 // non-virtual functions in this class
index 93673111bfabc930480463eff8b5b8817e1dc66b..1ca6089336c71d3517df247c2b1a678c37172767 100644 (file)
@@ -80,7 +80,9 @@ protected:
     unsigned return_type_tinfo(void) const;
 
     // new virtual functions which can be overridden by derived classes
-    // none
+public:
+    virtual ex lhs(void) const;
+    virtual ex rhs(void) const;
 
     // non-virtual functions in this class
 public:
index b33a865b737867fbe7f61d52954d11ea515ad2c5..8d73e2b4482a126369b121575d63e70fab68b523 100644 (file)
@@ -317,7 +317,7 @@ distdir: $(DISTFILES)
        @for file in $(DISTFILES); do \
          d=$(srcdir); \
          if test -d $$d/$$file; then \
-           cp -pr $$/$$file $(distdir)/$$file; \
+           cp -pr $$d/$$file $(distdir)/$$file; \
          else \
            test -f $(distdir)/$$file \
            || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
index 2d925b58d121b9df88e2366285b412870e915246..fddc0b3718c47618a51a5860114a0435bb580400 100644 (file)
@@ -67,6 +67,7 @@ Digits                        yylval = (long)Digits; return T_DIGITS;
 
                        /* keywords */
 quit|exit              return T_QUIT;
+warranty               return T_WARRANTY;
 print                  return T_PRINT;
 read                   return T_READ;
 write                  return T_WRITE;
index fb6edb05ed92d98526b70988e4025f801a927a4e..9ffaaa4f5b0ee31ded6b5407bce05f350abd543d 100644 (file)
@@ -86,7 +86,7 @@ static ex lst2matrix(const ex &l);
 %token T_NUMBER T_SYMBOL T_LITERAL T_DIGITS T_QUOTE T_QUOTE2 T_QUOTE3
 %token T_EQUAL T_NOTEQ T_LESSEQ T_GREATEREQ T_MATRIX_BEGIN T_MATRIX_END
 
-%token T_QUIT T_PRINT T_READ T_WRITE T_TIME T_XYZZY T_INVENTORY T_LOOK T_SCORE
+%token T_QUIT T_WARRANTY T_PRINT T_READ T_WRITE T_TIME T_XYZZY T_INVENTORY T_LOOK T_SCORE
 
 /* Operator precedence and associativity */
 %right '='
@@ -139,6 +139,20 @@ line       : ';'
        | '?' T_SYMBOL          {print_help(ex_to_symbol($2).getname());}
        | '?' '?'               {print_help_topics();}
        | T_QUIT                {YYACCEPT;}
+       | T_WARRANTY {
+               cout << "This program is free software; you can redistribute it and/or modify it under\n";
+               cout << "the terms of the GNU General Public License as published by the Free Software\n";
+               cout << "Foundation; either version 2 of the License, or (at your option) any later\n";
+               cout << "version.\n";
+               cout << "This program is distributed in the hope that it will be useful, but WITHOUT\n";
+               cout << "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n";
+               cout << "FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\n";
+               cout << "details.\n";
+               cout << "You should have received a copy of the GNU General Public License along with\n";
+               cout << "this program. If not, write to the Free Software Foundation, 675 Mass Ave,\n";
+               cout << "Cambridge, MA 02139, USA.\n";
+
+       }
        | T_XYZZY               {cout << "Nothing happens.\n";}
        | T_INVENTORY           {cout << "You're not carrying anything.\n";}
        | T_LOOK                {cout << "You're in a twisty little maze of passages, all alike.\n";}
@@ -728,7 +742,7 @@ void greeting(void)
     cout << "  __,  _______  Copyright (C) 1999-2000 Johannes Gutenberg University Mainz,\n"
          << " (__) *       | Germany.  This is free software with ABSOLUTELY NO WARRANTY.\n"
          << "  ._) i N a C | You are welcome to redistribute it under certain conditions;\n"
-         << "<-------------' see the file COPYING for details." << endl;
+         << "<-------------' see the file COPYING for details.\n" << endl;
     cout << "Type ?? for a list of help topics." << endl;
 }
 
index 0033fd6d4f9416304647dd3708d1ce5280eeb02f..a0a6800239f772dd609bccedf213d3df81fa64fe 100644 (file)
@@ -300,7 +300,7 @@ distdir: $(DISTFILES)
        @for file in $(DISTFILES); do \
          d=$(srcdir); \
          if test -d $$d/$$file; then \
-           cp -pr $$/$$file $(distdir)/$$file; \
+           cp -pr $$d/$$file $(distdir)/$$file; \
          else \
            test -f $(distdir)/$$file \
            || ln $$d/$$file $(distdir)/$$file 2> /dev/null \