Create two lisp functions.

Get your Assignment in a Minimum of 3 hours

Our academic experts are ready and waiting to assist with any writing project you may have. From simple essay plans, through to full dissertations, you can guarantee we have a service perfectly matched to your needs.

Free Inquiry Order A Paper Now Cost Estimate

I need help with a Programming question. All explanations and answers will be used to help me learn.

Create two lisp functions.

  (apply-sub expr sub)_x000D_
_x000D_
> (apply-sub '(p ?x (f ?y) b) '((?z ?x) (?w ?y)))_x000D_
  (p ?z (f ?w) b)_x000D_
_x000D_
> (apply-sub '(p ?x (f ?y) b) '(((g ?z) ?x) (bill ?y)))_x000D_
  (p (g ?z) (f bill) b)_x000D_
_x000D_
  (compose sub1 sub2)_x000D_
_x000D_
> (compose '((?x ?z) (?w ?y)) '((a ?x) (b ?v)))_x000D_
  ((a ?z) (?w ?y) (a ?x) (b ?v))_x000D_
_x000D_
> (compose '(((g ?x ?y) ?z)) '((a ?x) (b ?y) (c ?w) (d ?z)))_x000D_
  (((g a b) ?z) (a ?x) (b ?y) (c ?w))_x000D_
_x000D_
  (defun isvar (x)_x000D_
     (cond ((null x) nil)_x000D_
           ((pair x) nil)_x000D_
           (t (equal "?" (substring (symbol->string x) 0 1)))_x000D_
     )_x000D_
  )_x000D_
_x000D_
> (isvar '?x)_x000D_
#t_x000D_
_x000D_
> (isvar 'bill)_x000D_
#f

"Is this question part of your assignment? We Can Help!"

"Our Prices Start at $11.99. As Our First Client, Use Coupon Code GET15 to claim 15% Discount This Month!!"

Get Started