(define loan-names '(House Bills Income Credit)) (define loan-data '((Yes (Rent Late Low Bad)) (Yes (Rent Late High Bad)) (Yes (Rent On-time Low Bad)) (Yes (Rent On-time Medium Bad)) (Yes (Own Late Medium Good)) (No (Own Late Low Bad)) (No (Own Late Medium Good)) (No (Own On-time Low Bad)) (Yes (Own On-time High Good)) (Yes (Own On-time Medium Good)) (No (Own On-time High Bad)) (Yes (Own On-time High Good)))) ; example from "Artificial Intelligence: a modern approach" by Russell ; and Norvig ; ; goal predicate: Will Stuart Russell wait for a table at a restaurant? ; (define restaurant-names '(alternate bar fri hungry patrons price rain reservation type wait-estimate)) (define restaurant-data '((yes (yes no no yes some $$$ no yes french upto10)) (no (yes no no yes full $ no no thai upto60)) (yes (no yes no no some $ no no burger upto10)) (yes (yes no yes yes full $ no no thai upto30)) (no (yes no yes no full $$$ no yes french above60)) (yes (no yes no yes some $$ yes yes italian upto10)) (no (no yes no no none $ yes no burger upto10)) (yes (no no no yes some $$ yes yes thai upto10)) (no (no yes yes no full $ yes no burger above60)) (no (yes yes yes yes full $$$ no yes italian upto30)) (no (no no no no none $ no no thai upto10)) (yes (yes yes yes yes full $ no no burger upto60)))) ; part of the data set from the UCI Machine Learning Repository ; ; goal predicate: Is the mushroom edible (e) or poisonous (p) ; (define mushroom-names '(cap-shape cap-surface cap-color bruises? odor gill-attachment gill-spacing gill-size gill-color stalk-shape stalk-root stalk-surface-above-ring stalk-surface-below-ring stalk-color-above-ring stalk-color-below-ring veil-type veil-color ring-number ring-type spore-print-color population habitat)) (define mushroom-data1 '((e (f f e t n f c b p t b s s p p p w o p k y d)) (p (f f y f f f c b h e b k k n p p w o l h v g)) (e (f s g f n f w b n t e s s w w p w o e n a g)) (p (x f g f f f c b p e b k k b n p w o l h y d)) (e (x f n t n f c b w t b s s w g p w o p k v d)) (p (f f g f f f c b h e b k k p b p w o l h y d)) (p (x y g f f f c b p e b k k b b p w o l h y g)) (p (x y g f f f c b g e b k k p b p w o l h y p)) (e (f y n t n f c b n t b s s w w p w o p k v d)) (e (f f g f n f w b n t e f s w w p w o e k a g)) (e (x y e t n f c b u t b s s g w p w o p k y d)) (e (f f n t n f c b u t b s s g g p w o p k y d)) (e (f y n t n f c b p t b s s g p p w o p n v d)) (p (x s w t f f c b w t b s f w w p w o p h s u)) (e (b s y t a f c b k e c s s w w p w o p k n g)) (e (x y e t n f c b p t b s s g p p w o p k y d)) (e (b y y t l f c b n e c s s w w p w o p k n m)) (p (f y y f f f c b g e b k k b p p w o l h y g)) (p (x y y f f f c b h e b k k b p p w o l h y d)) (e (f f n f n f c n k e e s s w w p w o p k y u)) (e (x y n t n f c b u t b s s g p p w o p k v d)) (p (x y y f f f c b h e b k k n p p w o l h y d)) (e (x f g t n f c b n t b s s p p p w o p n y d)) (p (f s b t n f c b w e b s s w w p w t p r v g)) (e (x y y t a f c b p e r s y w w p w o p k y g)) (e (x s y t l f c b w e c s s w w p w o p n s m)) (p (f s b t f f c b h t b f s w w p w o p h s g)) (e (x y n t n f c b w t b s s w g p w o p n v d)) (e (f y n t l f c b p e r s y w w p w o p n s p)) (e (x y e t n f c b n t b s s w g p w o p k v d)) (e (f f g t n f c b w t b s s g p p w o p n v d)) (p (f y g f f f c b p e b k k n b p w o l h v p)) (e (x f w f n f w b k t e s s w w p w o e k s g)) (e (x f e t n f c b u t b s s p p p w o p k v d)) (e (x y p t n f c b w e b s s w w p w t p w y p)) (p (f s b t f f c b w t b s f w w p w o p h v g)) (p (f s n t p f c n n e e s s w w p w o p n s u)) (e (f y g t n f c b n t b s s p p p w o p n v d)) (p (x f y f f f c b g e b k k p b p w o l h y p)) (e (x f g f n f c n p e e s s w w p w o p k v u)) (e (f f n t n f c b u t b s s w g p w o p k v d)) (p (x y y f f f c b g e b k k n n p w o l h v g)) (p (x f y f f f c b h e b k k n p p w o l h v g)) (e (f s g f n f w b h t e s s w w p w o e n s g)) (p (x s b t f f c b w t b s s w w p w o p h s g)) (e (f f e t n f c b n t b s s p p p w o p k v d)) (e (f y n t n f c b n t b s s p g p w o p k v d)) (e (f y e t n f c b n t b s s w g p w o p n v d)) (e (f y e t n f c b p t b s s w p p w o p k y d)) (p (f y g f f f c b h e b k k b n p w o l h v p)) (p (f s b t n f c b r e b s s w w p w t p r v m)) (e (f f n t n f c b u t b s s p p p w o p k v d)) (e (x f n f n f w b k t e f f w w p w o e n s g)) (p (f f y f f f c b p e b k k p b p w o l h y d)) (p (x y y f f f c b g e b k k n p p w o l h v g)) (e (f y n t l f c b w e r s y w w p w o p k y p)) (p (x y g f f f c b g e b k k n p p w o l h y p)) (p (f f y f f f c b p e b k k p p p w o l h y p)) (e (x y g t n f c b u t b s s w w p w o p k y d)) (e (f y y t a f c b w e r s y w w p w o p n s g)) (e (f f n f n f w b h t e f s w w p w o e k a g)) (e (x y n t n f c b u t b s s p p p w o p n y d)) (e (x y e t n f c b w t b s s p p p w o p k y d)) (e (x s n f n f w b k t e s f w w p w o e k a g)) (p (x f y f f f c b h e b k k b b p w o l h y g)) (p (c y w t n f w n w e b s s w w p w o p w c l)) (e (f f n t n f c b w t b s s p g p w o p n y d)) (p (x f g f f f c b h e b k k p n p w o l h v d)) (e (f f n f n f w b p t e f s w w p w o e k a g)) (e (x y n t n f c b u t b s s g g p w o p k y d)) (e (x y g t n f c b u t b s s g p p w o p k v d)) (e (f y c f n f w n w e b s s w n p w o e w v l)) (e (f f g t n f c b u t b s s p w p w o p n v d)) (p (b y y f n f w n y e c y y y y p y o e w c l)) (e (f y g t n f c b u t b s s g g p w o p k y d)) (p (x s g f c f w n g e b s s w w p w o p n s d)) (e (f y n t n f c b n t b s s w w p w o p n y d)) (e (x s y t l f c b w e c s s w w p w o p k s g)) (e (x f g f n f w b h t e s f w w p w o e n s g)) (e (x f e t n f c b n t b s s p p p w o p n v d)) (e (x y g t n f c b p t b s s g w p w o p k y d)) (e (x y g t n f c b n t b s s w p p w o p k v d)) (p (f s b t f f c b p t b f f w w p w o p h v g)) (e (x y e t n f c b n t b s s w w p w o p k v d)) (p (f y g f f f c b h e b k k n n p w o l h v d)) (p (f f y f f f c b g e b k k p b p w o l h y d)) (p (x f g f f f c b h e b k k p n p w o l h y g)) (p (f f g f f f c b p e b k k p n p w o l h v g)) (e (f f n f n f c n p e e s s w w p w o p k v u)) (e (f y e t n f c b w t b s s p g p w o p k y d)) (p (f y y f f f c b p e b k k b p p w o l h v d)) (e (f y g t n f c b w t b s s g w p w o p n v d)) (p (f y y f f f c b h e b k k p p p w o l h y g)) (e (f f g f n f w b p t e s f w w p w o e n s g)) (e (f y e t n f c b w t b s s p p p w o p k y d)) (p (f y g f f f c b g e b k k b n p w o l h y p)) (p (f y g f f f c b h e b k k p b p w o l h y d)) (e (f f e t n f c b p t b s s w p p w o p k v d)) (e (x s w f n f w b h t e f f w w p w o e k s g)) (e (k y n f n f w n w e b s f w n p w o e w v l)) (e (x s n f n f w b h t e f f w w p w o e k a g)) (e (f f g f n f c n k e e s s w w p w o p n v u)) (e (x y n t n f c b p t b s s p p p w o p n v d)) (e (x y y t a f c b n e c s s w w p w o p k n g)) (p (f f g f f f c b h e b k k p b p w o l h y p)) (p (f y y f f f c b g e b k k p b p w o l h v p)) (e (f y g t n f c b n t b s s p g p w o p k y d)) (e (x y w t a f c b g e c s s w w p w o p n s m)) (e (f y g t n f c b n t b s s g g p w o p n v d)) (p (f y y f f f c b p e b k k n n p w o l h v p)) (p (x y y f f f c b h e b k k n p p w o l h v d)) (e (x y g t n f c b n t b s s g w p w o p n y d)) (e (f y e t n f c b p t b s s g w p w o p k v d)) (p (f s w t p f c n n e e s s w w p w o p n s u)) (p (f s g t f f c b p t b s f w w p w o p h s g)) (p (f y g f f f c b g e b k k b p p w o l h y g)) (e (x y n t a f c b w e r s y w w p w o p k s p)) (e (f y n t l f c b n e r s y w w p w o p k y p)) (e (f y n t n f c b u t b s s p w p w o p k v d)) (e (x f n f n f w b h t e s s w w p w o e n a g)) (p (f f g f f f c b p e b k k n n p w o l h y p)) (p (f y y f f f c b h e b k k n b p w o l h v d)) (p (f s w t f f c b p t b f f w w p w o p h s u)) (e (b y w t l f c b n e c s s w w p w o p k n m)) (e (x y y t a f c b w e r s y w w p w o p n s g)) (e (x y y t l f c b g e c s s w w p w o p n s m)) (e (x f y t l f w n p t b s s w w p w o p n v d)) (e (x f y t l f w n w t b s s w w p w o p n v d)) (e (f f e t n f c b u t b s s g p p w o p k y d)) (p (x s w t f f c b h t b s f w w p w o p h v u)) (p (x f y f f f c b g e b k k p p p w o l h y g)) (e (f f g f n f w b h t e s f w w p w o e k a g)) (e (f y n t l f c b p e r s y w w p w o p k s g)) (e (f f g t n f c b u t b s s p p p w o p n v d)) (e (f y e t n f c b p t b s s p p p w o p k v d)) (p (f y y f f f c b h e b k k p p p w o l h v g)) (p (f s w t p f c n k e e s s w w p w o p n s u)) (e (x f n t n f c b p t b s s p w p w o p k v d)) (e (b s w t l f c b g e c s s w w p w o p k n m)) (p (c y y f n f w n y e c y y y y p y o e w c l)) (p (f s w t f f c b p t b s s w w p w o p h v u)) (e (f f n t n f c b p t b s s w p p w o p n v d)) (p (x s g t f f c b p t b f f w w p w o p h v u)) (e (x f g t n f c b u t b s s w p p w o p k y d)) (p (f s w t f f c b p t b s f w w p w o p h s u)) (e (x y g t n f c b p t b s s p w p w o p k y d)) (p (x y w t p f c n n e e s s w w p w o p k s g)) (e (f f g t n f c b w t b s s w g p w o p k v d)) (e (f y n t l f c b w e r s y w w p w o p k s g)) (p (x y g f f f c b p e b k k b p p w o l h v g)) (p (f f y f f f c b h e b k k p n p w o l h y g)) (e (f f w f n f w b h t e s s w w p w o e k a g)) (e (f f n f n f w b k t e s f w w p w o e k a g)) (e (x f e t n f c b w t b s s w p p w o p k v d)) (p (f f g f f f c b p e b k k n p p w o l h y p)) (p (x y g f f f c b p e b k k n n p w o l h v g)) (e (x f g t n f c b w t b s s w p p w o p k v d)) (e (f f w f n f w b n t e s f w w p w o e k s g)) (e (f f n t n f c b w t b s s g p p w o p k y d)) (e (x s w t l f c b w e c s s w w p w o p n n g)) (e (f f n f n f w n w e b f s w n p w o e w v l)) (e (x s n f n f w b p t e f s w w p w o e k a g)) (e (f y y t a f c b p e r s y w w p w o p n s g)) (e (x y n t n f c b w t b s s p g p w o p k y d)) (e (x f e t n f c b n t b s s g g p w o p k y d)) (e (x f n f n f c n n e e s s w w p w o p n v u)) (e (f y g t n f c b p t b s s p g p w o p n v d)) (e (b y y t a f c b n e c s s w w p w o p k n g)) (e (x y n t n f c b w t b s s p p p w o p k y d)) (e (f s g t n f c b w e b s s w w p w t p w y p)) (p (f f y f f f c b g e b k k b n p w o l h v g)) (e (x y g t n f c b p t b s s w g p w o p n v d)) (e (x f g f n f w b k t e s s w w p w o e k s g)) (e (f s g f n f w b n t e f f w w p w o e n s g)) (e (x f g t n f c b p t b s s p w p w o p k y d)) (e (x y e t n f c b p t b s s g p p w o p n v d)) (p (x y g f f f c b p e b k k p p p w o l h y p)) (e (x f g f n f w b n t e s f w w p w o e k s g)) (e (f f e t n f c b p t b s s g p p w o p k y d)) (e (x y w t a f c b k e c s s w w p w o p k n g)) (p (f f y f f f c b g e b k k p n p w o l h v p)) (e (f y e t n f c b p t b s s p w p w o p n y d)) (p (f y n t p f c n n e e s s w w p w o p k s u)) (e (x f n t n f c b p t b s s g p p w o p n v d)) (p (x y y f f f c b h e b k k b p p w o l h v d)) (e (f f n t n f c b w t b s s p g p w o p n v d)) (p (x y g f f f c b p e b k k p n p w o l h y p)) (e (f y g t n f c b n t b s s w w p w o p n y d)) (e (f f g t n f c b p t b s s g g p w o p k y d)) (e (x f g t n f c b w t b s s p p p w o p n v d)) (e (f f n t n f c b w t b s s p p p w o p n v d)) (p (f f g f f f c b h e b k k b p p w o l h y d)) (e (f y n t n f c b w t b s s p g p w o p k v d)) (e (x y n t n f c b n t b s s p w p w o p n v d)) (e (x s w f n f w b k t e f f w w p w o e n s g)) (p (f f g f f f c b g e b k k n b p w o l h v g)) (e (f f n f n f c n n e e s s w w p w o p n y u)) (e (f s w f n f w b n t e f s w w p w o e k s g)) (e (f f g t n f c b p t b s s p g p w o p k y d)) (e (b y w t a f c b g e c s s w w p w o p n n m)))) (define mushroom-data2 '((p (f s w t f f c b w t b f s w w p w o p h v u)) (e (f s n f n f w b k t e s f w w p w o e k s g)) (e (x s w t l f c b n e c s s w w p w o p n n m)) (e (x f g f n f w b h t e f f w w p w o e n s g)) (p (f y g f f f c b h e b k k b p p w o l h y d)) (e (f y g t n f c b w t b s s g w p w o p k v d)) (e (x f n t n f c b n t b s s p w p w o p k y d)) (e (x f g f n f w b p t e f s w w p w o e n a g)) (p (x s n t p f c n k e e s s w w p w o p k s u)) (p (x s n t p f c n w e e s s w w p w o p n s g)) (p (x s w t p f c n n e e s s w w p w o p k v u)) (e (f y g t n f c b w t b s s p w p w o p n y d)) (p (f s b t f f c b p t b s f w w p w o p h v g)) (e (f f g f n f c n k e e s s w w p w o p k y u)) (e (x y g t n f c b p t b s s g p p w o p k y d)) (e (x f g t n f c b u t b s s w w p w o p k y d)) (p (x y y f f f c b p e b k k n p p w o l h y d)) (p (x f y f f f c b h e b k k n p p w o l h v g)) (e (x f e t n f c b u t b s s p p p w o p k y d)) (p (f s w t f f c b p t b f s w w p w o p h s g)) (p (f s w t n f c b r e b s s w w p w t p r v g)) (e (x s g f n f w b p t e f f w w p w o e n a g)) (e (x s y t l f c b w e c s s w w p w o p k n g)) (e (f f g t n f c b p t b s s p w p w o p k v d)) (e (x y e t n f c b n t b s s p g p w o p n v d)) (e (x y w t l f c b g e c s s w w p w o p n n g)) (e (f f e t n f c b w t b s s w w p w o p n y d)) (e (x y g t n f c b p t b s s g p p w o p k v d)) (p (x f y f f f c b g e b k k b p p w o l h v p)) (p (f y y f f f c b h e b k k n n p w o l h v p)) (p (x s p f c f w n g e b s s w w p w o p k s d)) (e (x f e t n f c b n t b s s w p p w o p n y d)) (p (f y g f f f c b g e b k k n p p w o l h v g)) (p (x f y f f f c b g e b k k b p p w o l h v g)) (e (b y y t l f c b n e c s s w w p w o p k s m)) (e (f f g t n f c b w t b s s g p p w o p n v d)) (e (x y y t l f c b p e r s y w w p w o p n s g)) (e (f f n t n f c b w t b s s g g p w o p n y d)) (e (f y e t n f c b u t b s s w w p w o p k v d)) (p (f s p t n f c b r e b s s w w p w t p r v g)) (e (f y g t n f c b p t b s s w w p w o p k v d)) (p (x f g f c f c n n e b s s w w p w o p n v d)) (p (x s b t f f c b p t b f s w w p w o p h s g)) (e (x y y t l f c b n e r s y w w p w o p k y g)) (e (f y n t l f c b n e r s y w w p w o p k s g)) (e (x y n t n f c b n t b s s g w p w o p k y d)) (p (x f g f c f c n g e b s s w w p w o p n s d)) (p (f y y f f f c b p e b k k b p p w o l h v p)) (p (x s g t f f c b p t b f f w w p w o p h s u)) (e (x y g t n f c b n t b s s p w p w o p n v d)) (e (f f g t n f c b u t b s s w g p w o p k v d)) (e (f y n t n f c b u t b s s p p p w o p k v d)) (p (x s w t p f c n w e e s s w w p w o p n v u)) (p (f f g f f f c b h e b k k p b p w o l h v g)) (e (f s c t n f c b w e b s s w w p w t p w y p)) (e (x y y t a f c b p e r s y w w p w o p n s g)) (e (f y g t n f c b p t b s s p p p w o p k y d)) (p (x y y f f f c b p e b k k p p p w o l h v g)) (e (x f g t n f c b n t b s s p p p w o p k y d)) (p (f y g f f f c b h e b k k b b p w o l h y p)) (e (x f n f n f c n g e e s s w w p w o p n y u)) (e (f y y t a f c b p e r s y w w p w o p k y p)) (p (f f y f f f c b p e b k k p b p w o l h v d)) (p (f y y f f f c b p e b k k n b p w o l h v g)) (p (x f y f f f c b h e b k k p b p w o l h y p)) (e (x y n t a f c b w e r s y w w p w o p k y g)) (e (f f n f n f c n g e e s s w w p w o p k y u)) (p (x y w t p f c n n e e s s w w p w o p k v u)) (p (x y g f f f c b p e b k k p b p w o l h y p)) (p (x s n t p f c n k e e s s w w p w o p k v g)) (e (x s n f n f w b n t e s s w w p w o e k a g)) (p (f y y f f f c b h e b k k n p p w o l h y d)) (p (x s w f c f c n p e b s s w w p w o p n v d)) (e (f f g t n f c b w t b s s g w p w o p n y d)) (e (f f g t n f c b p t b s s w p p w o p k v d)) (e (x y e t n f c b u t b s s g p p w o p n y d)) (e (x f g t n f c b n t b s s p p p w o p n v d)) (e (f f n t n f c b n t b s s g g p w o p k y d)) (e (x y y t a f c b n e c s s w w p w o p n n m)) (e (f y y t l f c b n e r s y w w p w o p k s g)) (e (x f g t n f c b u t b s s w w p w o p n y d)) (e (f f g t n f c b n t b s s g g p w o p n v d)) (e (b s y t a f c b g e c s s w w p w o p k n g)) (e (b s w t l f c b k e c s s w w p w o p k s m)) (p (x y w t p f c n p e e s s w w p w o p k v u)) (e (f s y t l f w n w t b s s w w p w o p n v d)) (p (k y c f m f c b w e c k y c c p w n n w c d)) (e (x s y t a f c b g e c s s w w p w o p n s g)) (p (f f y f f f c b p e b k k b p p w o l h v d)) (e (x s n t n f c b w e b s s w w p w t p w y p)) (e (x f e t n f c b p t b s s w p p w o p k y d)) (e (x s g f n f w b k t e s s w w p w o e k a g)) (e (f f n f n f w b h t e s f w w p w o e k a g)) (p (b s p t n f c b w e b s s w w p w t p r v g)) (e (b y y t a f c b w e c s s w w p w o p n s m)) (e (x f g t n f c b u t b s s w p p w o p k y d)) (e (f f g t n f c b n t b s s w p p w o p k v d)) (e (f f g t n f c b p t b s s p g p w o p k y d)) (e (x f e t n f c b w t b s s p w p w o p n v d)) (e (x y g t n f c b u t b s s w g p w o p n y d))))