head 1.2; access; symbols; locks; strict; comment @;;; @; 1.2 date 2009.01.22.04.01.51; author marek; state Exp; branches; next 1.1; 1.1 date 2009.01.19.07.49.49; author marek; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @#| $Id$ *--------------------------------------------------------------------------* | Copyright (C) 1994, Marek Rychlik (e-mail: rychlik@@math.arizona.edu) | | Department of Mathematics, University of Arizona, Tucson, AZ 85721 | | | | Everyone is permitted to copy, distribute and modify the code in this | | directory, as long as this copyright note is preserved verbatim. | *--------------------------------------------------------------------------* |# (defpackage "CGB-LISP" (:use "MAKELIST" "ORDER" "MONOM" "COEFFICIENT-RING" "TERM" "POLY" "DIVISION" "PARSE" "PRINTER" "POLY-WITH-SUGAR" "GROBNER" "COLORED-POLY" "POLY-GCD" "RAT" "RATPOLY" "STRING-GROBNER" "DYNAMICS" "INFIX")) #+debug(proclaim '(optimize (speed 0) (debug 3))) #-debug(proclaim '(optimize (speed 3) (debug 0))) (defun example (symbol &optional (stream t)) "Run short examples associated with a symbol, which typically is a function name." (dolist (e (cdr (assoc symbol *examples*))) (run-example e stream)) (values)) (defun run-example (e stream) "Evaluate a single form E and send output to stream STREAM." (format stream "~%;;----------------------------------------------------------------") (format stream "~%;;") (format stream "~%;;~1T~S" e) (format stream "~%;;") (format stream "~%;;----------------------------------------------------------------~&") (dolist (val (multiple-value-list (eval e))) (format stream "[ RETURN VALUE ]-->> ~S~&" val)) (values)) (defun all-examples (&optional (stream t)) "Run all available examples and send output to STREAM." (dolist (a *examples*) (dolist (e (cdr a)) (run-example e stream))) (values)) (defvar *examples* '((string-grobner . ((string-grobner "[x^2+y,x-y]" '(x y)) (string-grobner "[y-x^2,z-x^3]" '(x y z) :order #'grevlex>))) (string-grobner-system . ((string-grobner-system "[u*x+y,x+y]" '(x y) '(u)) (string-grobner-system "[u*x+y,x+y]" '(x y) '(u) :cover '(("[u-1]" "[]"))))) (string-read-poly . ((string-read-poly "[x^3+3*x^2+3*x+1]" '(x)))) (string-elimination-ideal . ((string-elimination-ideal "[x^2+y^2-2,x*y-1]" '(x y) 1))) (string-ideal-saturation . ((string-ideal-saturation "[x^2*y,y^3]" "x" '(x y)))) (string-ideal-polysaturation . ((string-ideal-polysaturation "[x^2*y,y^3]" "[x,y]" '(x y))))) "A list of available examples.") @ 1.1 log @Initial revision @ text @d2 1 a2 1 $Id: example.lisp,v 1.30 1997/12/01 05:39:15 marek Exp $ d19 2 a20 1 (proclaim '(optimize (speed 0) (debug 3))) @