Search found 5 matches

by Power User
Wed Jun 16, 2010 9:53 pm
Forum: Other Dialects
Topic: Debugging Lisp Function. Any Help out There?
Replies: 10
Views: 18386

Re: Debugging Lisp Function. Any Help out There?

;; Referenced lisp source code from Luger 2nd Edition, "Artificial Intelligence 4th Edition" ;; lisp pattern matcher code. ;; implement the * wild card. (..... * .....) (defun variable-q (x) (equal x '?)) (defun variable-a (x) (equal x '*)) (defun match-atom (pattern1 pattern2) (or (equal pattern1 p...
by Power User
Wed Jun 09, 2010 9:00 pm
Forum: Other Dialects
Topic: Debugging Lisp Function. Any Help out There?
Replies: 10
Views: 18386

Re: Debugging Lisp Function. Any Help out There?

The following code of mine is more along the lines I am trying to go. This simply needs debugging, I believe. Aid, anyone? (defun variable-p (x) (equal x '?)) (defun generic-a (x) (equal x '*)) (defun post-a (x) (generic-a (car (cdr x)))) (defun match-atom (pattern1 pattern2) (or (equal pattern1 pat...
by Power User
Tue Jun 08, 2010 10:21 pm
Forum: Other Dialects
Topic: Debugging Lisp Function. Any Help out There?
Replies: 10
Views: 18386

Re: Debugging Lisp Function. Any Help out There?

(defun variable-p (x) (equal x '?)) (defun generic-a (x) (equal x '*)) (defun match-atom (pattern1 pattern2) (or (equal pattern1 pattern2) (variable-p pattern1) (variable-p pattern2) (generic-a pattern1) (generic-a pattern2))) (defun match (pattern1 pattern2) (cond ((or (atom pattern1) (atom patter...
by Power User
Mon Jun 07, 2010 4:58 pm
Forum: Other Dialects
Topic: Debugging Lisp Function. Any Help out There?
Replies: 10
Views: 18386

Re: Debugging Lisp Function. Any Help out There?

What I want is for (..... * ........) to work as the any number of items wildcard, but performing normally where there is any content before or after the *. I understand the algorithmic steps for what I am trying to do: I am simply getting lost in brackets/recursion/associative confusion. I simply n...
by Power User
Sun Jun 06, 2010 7:00 pm
Forum: Other Dialects
Topic: Debugging Lisp Function. Any Help out There?
Replies: 10
Views: 18386

Debugging Lisp Function. Any Help out There?

--I am trying to debug my pattern matcher match function. -- Am trying to implement * symbol as a Generic Wildcard, such: --(match '(likes I computing) '(likes I *)) --Such that anything before and or after is considered. --The bottom most function is from George F Luger, Antificial Intelligence 4th...