[1] | 1 | head 1.2;
|
---|
| 2 | access;
|
---|
| 3 | symbols;
|
---|
| 4 | locks; strict;
|
---|
| 5 | comment @;;; @;
|
---|
| 6 |
|
---|
| 7 |
|
---|
| 8 | 1.2
|
---|
| 9 | date 2009.01.22.04.01.51; author marek; state Exp;
|
---|
| 10 | branches;
|
---|
| 11 | next 1.1;
|
---|
| 12 |
|
---|
| 13 | 1.1
|
---|
| 14 | date 2009.01.19.07.49.49; author marek; state Exp;
|
---|
| 15 | branches;
|
---|
| 16 | next ;
|
---|
| 17 |
|
---|
| 18 |
|
---|
| 19 | desc
|
---|
| 20 | @@
|
---|
| 21 |
|
---|
| 22 |
|
---|
| 23 | 1.2
|
---|
| 24 | log
|
---|
| 25 | @*** empty log message ***
|
---|
| 26 | @
|
---|
| 27 | text
|
---|
| 28 | @#|
|
---|
| 29 | $Id$
|
---|
| 30 | *--------------------------------------------------------------------------*
|
---|
| 31 | | Copyright (C) 1994, Marek Rychlik (e-mail: rychlik@@math.arizona.edu) |
|
---|
| 32 | | Department of Mathematics, University of Arizona, Tucson, AZ 85721 |
|
---|
| 33 | | |
|
---|
| 34 | | Everyone is permitted to copy, distribute and modify the code in this |
|
---|
| 35 | | directory, as long as this copyright note is preserved verbatim. |
|
---|
| 36 | *--------------------------------------------------------------------------*
|
---|
| 37 | |#
|
---|
| 38 |
|
---|
| 39 | (defpackage "CGB-LISP"
|
---|
| 40 | (:use "MAKELIST" "ORDER" "MONOM" "COEFFICIENT-RING"
|
---|
| 41 | "TERM" "POLY" "DIVISION" "PARSE" "PRINTER" "POLY-WITH-SUGAR"
|
---|
| 42 | "GROBNER" "COLORED-POLY" "POLY-GCD" "RAT" "RATPOLY"
|
---|
| 43 | "STRING-GROBNER" "DYNAMICS"
|
---|
| 44 | "INFIX"))
|
---|
| 45 |
|
---|
| 46 | #+debug(proclaim '(optimize (speed 0) (debug 3)))
|
---|
| 47 | #-debug(proclaim '(optimize (speed 3) (debug 0)))
|
---|
| 48 |
|
---|
| 49 | (defun example (symbol &optional (stream t))
|
---|
| 50 | "Run short examples associated with a symbol, which typically is a function name."
|
---|
| 51 | (dolist (e (cdr (assoc symbol *examples*)))
|
---|
| 52 | (run-example e stream))
|
---|
| 53 | (values))
|
---|
| 54 |
|
---|
| 55 | (defun run-example (e stream)
|
---|
| 56 | "Evaluate a single form E and send output to stream STREAM."
|
---|
| 57 | (format stream "~%;;----------------------------------------------------------------")
|
---|
| 58 | (format stream "~%;;")
|
---|
| 59 | (format stream "~%;;~1T~S" e)
|
---|
| 60 | (format stream "~%;;")
|
---|
| 61 | (format stream "~%;;----------------------------------------------------------------~&")
|
---|
| 62 | (dolist (val (multiple-value-list (eval e)))
|
---|
| 63 | (format stream "[ RETURN VALUE ]-->> ~S~&" val))
|
---|
| 64 | (values))
|
---|
| 65 |
|
---|
| 66 | (defun all-examples (&optional (stream t))
|
---|
| 67 | "Run all available examples and send output to STREAM."
|
---|
| 68 | (dolist (a *examples*)
|
---|
| 69 | (dolist (e (cdr a))
|
---|
| 70 | (run-example e stream)))
|
---|
| 71 | (values))
|
---|
| 72 |
|
---|
| 73 |
|
---|
| 74 | (defvar *examples*
|
---|
| 75 | '((string-grobner . ((string-grobner "[x^2+y,x-y]" '(x y))
|
---|
| 76 | (string-grobner "[y-x^2,z-x^3]" '(x y z) :order #'grevlex>)))
|
---|
| 77 | (string-grobner-system . ((string-grobner-system "[u*x+y,x+y]" '(x y) '(u))
|
---|
| 78 | (string-grobner-system "[u*x+y,x+y]" '(x y) '(u) :cover '(("[u-1]" "[]")))))
|
---|
| 79 | (string-read-poly . ((string-read-poly "[x^3+3*x^2+3*x+1]" '(x))))
|
---|
| 80 | (string-elimination-ideal . ((string-elimination-ideal "[x^2+y^2-2,x*y-1]" '(x y) 1)))
|
---|
| 81 | (string-ideal-saturation . ((string-ideal-saturation "[x^2*y,y^3]" "x" '(x y))))
|
---|
| 82 | (string-ideal-polysaturation . ((string-ideal-polysaturation "[x^2*y,y^3]" "[x,y]" '(x y)))))
|
---|
| 83 | "A list of available examples.")
|
---|
| 84 |
|
---|
| 85 |
|
---|
| 86 | @
|
---|
| 87 |
|
---|
| 88 |
|
---|
| 89 | 1.1
|
---|
| 90 | log
|
---|
| 91 | @Initial revision
|
---|
| 92 | @
|
---|
| 93 | text
|
---|
| 94 | @d2 1
|
---|
| 95 | a2 1
|
---|
| 96 | $Id: example.lisp,v 1.30 1997/12/01 05:39:15 marek Exp $
|
---|
| 97 | d19 2
|
---|
| 98 | a20 1
|
---|
| 99 | (proclaim '(optimize (speed 0) (debug 3)))
|
---|
| 100 | @
|
---|