Show
Ignore:
Timestamp:
01/02/08 15:20:05 (4 years ago)
Author:
BCS
Message:

added a bunch more rules
did a compile time performance tweak in backmath.d
improved automation in do.lisp

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/backmath/do.lisp

    r175 r176  
     1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
     2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
     3;;;;; 
     4;;;;; This is a program for atomating parts of 
     5;;;;; the rule generation process for BackMath 
     6;;;;; 
     7;;;;; For instruction on how to use it, look at 
     8;;;;; the end of the file. 
     9;;;;; 
     10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
     11;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
     12 
    113;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
    214;; convert in place a op> exp to a normal exp 
     
    383395                    ) 
    384396                ) 
     397                ( 
     398                    (and    ; (* a (/ 1 b)) 
     399                        (partof    (        cdr exp) ) 
     400                        (something (       cadr exp) ) 
     401                            ; a               (cadr exp) 
     402                        (partof    (       cddr exp) ) 
     403                        (partof    (      caddr exp) ) 
     404                        (something (     caaddr exp) ) 
     405                            ; /             (caaddr exp) 
     406                        (equal '/  (     caaddr exp) ) 
     407                        (partof    (     cdaddr exp) ) 
     408                        (something  (car(cdaddr exp))) 
     409                            ; 1         (car(cdaddr exp)) 
     410                        (equal 1    (car(cdaddr exp))) 
     411                        (something  (cdr(cdaddr exp))) 
     412                        (something (cadr(cdaddr exp))) 
     413                            ; b        (cadr(cdaddr exp)) 
     414                    ) 
     415                    `(/ ; (/ a b) 
     416                        ,(cadr exp) 
     417                        ,(cadr(cdaddr exp)) 
     418                    ) 
     419                ) 
    385420 
    386421                ( 
     
    463498;(- (*> h x) (/> e x)) 
    464499 
    465 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
    466 ;;;; #1) Copy and pastes the requiered form here  ;;;;;;;;;; 
    467 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
    468  
    469 (+ (/> k (-> h x)) (*> f (-> e x))) 
    470 
    471  
    472  
    473 ;;;;;;;;; #2) Run the program 
     500;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
     501;;;; #1) Copy and pastes the required form here  ;;;;;;;;;; 
     502;;;; #2) Run the program                         ;;;;;;;;;; 
     503;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
     504 
     505(+ (*> h x) (*> f (-> e x))) 
     506 
     507
     508 
     509 
    474510"#3) copy this expression for step 4" 
    475511(Convert_to_exp in) 
     
    479515 
    480516;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
    481 ;;;; #4) pastes expression from step 3 here  ;;;;;;;;;; 
    482 ;;;; #5) rearange so that is is of the form: ;;;;;;;;;; 
    483 ;;;;       (*/ A (+- X B))                   ;;;;;;;;;; 
     517;;;; #4) pastes expression from step 3 here  ;;;;;;;;; 
     518;;;; #5) rearrange so that is is of the form: ;;;;;;;;; 
     519;;;;       (*/ A (+- X B))                    ;;;;;;;;; 
    484520;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
    485521 
    486 (* (+ K (/ 1 F))(+ (* X ) (/ (+(* H K) (/ E F)) (+ K (/ 1 F))))) 
     522(* (+ (/ H) (/ F)) (+ (* x ) (/ (/ E F)(+ (/ H) (/ F))))) 
    487523 
    488524)