Advertisement
Guest User

Untitled

a guest
May 16th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 1.56 KB | None | 0 0
  1.  
  2. ;;;;1
  3. (defun alle-kleiner (l1 l2) (
  4.                              every #'< l1 l2))
  5.  
  6.  
  7. ;;;;2
  8. (defparameter *listePos* nil)
  9. (defparameter *listeNeg* nil)
  10.  
  11. (defun add-neg (wort)
  12.   (setq *listeneg* (cons wort *listeneg*))
  13.   )
  14.  
  15. (defun add-pos (wort)
  16.   (setq *listepos* (cons wort *listepos*)))
  17.  
  18. (defun einordnen (sym) (cond ((listp sym) (add-neg (second sym))) (T (add-pos sym))))
  19.  
  20.  
  21. (defun isAnyIn (l1 l2) (cond ((null l1) nil)
  22.                                        ((member (first l1) l2) T)
  23.                                        (T (isAnyIn (cdr l1) l2))
  24.                                        ))
  25.  
  26.  
  27. (defun klausel-ist-tautologie (klausel) (and (mapcar #'einordnen klausel)
  28.                                              (isAnyIn *listepos* *listeneg*))
  29.   )
  30.  
  31.  
  32. ;;;;3
  33.  
  34. (defvar *wort-nr* 0)
  35. (setq *wort-nr* 0)
  36. (defun stringliste-binde (stringliste)
  37.     (labels ((f (sl ausgabe)
  38.               (if (not (null sl))
  39.                   (let (wort)
  40.                     (setq wort (read-from-string (concatenate 'string "wort-" (prin1-to-string (setq *wort-nr* (1+ *wort-nr*))))))
  41.                     (setf (symbol-plist wort) nil)
  42.                     (setf (get wort 'nummer) *wort-nr*)
  43.                     (setf (get wort 'wort) (read-from-string (pop sl)))
  44.                     (f sl (cons wort ausgabe))
  45.                     )
  46.                   (reverse ausgabe)
  47.                   ))
  48.              )
  49.                (f stringliste ())
  50.       )
  51.   )
  52.  
  53. ;;
  54. (setq ergebnisse (stringliste-binde '("a" "b" "c")))
  55. (get (first ergebnisse) 'wort)
  56. ;;;;4
  57. ;;missing code :(
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement