;; start of manchester syntax reader (eval-when (:compile-toplevel :load-toplevel :execute) (defun manch-1 (form) (cond ((atom form) form) ((consp form) (case (car form) (and `(intersection-of ,@(mapcar 'manch-1 (cdr form)))) (or `(union-of ,@(mapcar 'manch-1 (cdr form)))) (some `(restriction ,(second form) (some-values-from ,(manch-1 (third form))))) (all `(restriction ,(second form) (all-values-from ,(manch-1 (third form))))) ((has that) `(restriction ,(second form) (has-value ,(third form)))) (min `(restriction ,(second form) (min-cardinality ,(third form)))) (max `(restriction ,(second form) (min-cardinality ,(third form)))) (exactly `(restriction ,(second form) (cardinality ,(third form)))) (not `(complement-of ,@(mapcar 'manch-1 (cdr form)))) (otherwise form))))) (defmacro manch (form) (eval-uri-reader-macro (manch-1 form)))) '(assert (equal (manch (and (some !part_of !head) (some !develops_from !Ectoderm))) (intersection-of (restriction !ex:part_of (some-values-from !ex:head)) (restriction !ex:develops_from (some-values-from !ex:Ectoderm)))) () "Manch macro not working!")