; Logic puzzle initial asserts ; Author: Bruno Wolff III ; Last updated: 2020-08-10 ; You may use/modify this code for any purpose (assert (forall ((n1 name) (n2 name)) (=> (distinct n1 n2) (distinct (select fishes n1) (select fishes n2))))) (assert (forall ((n1 name) (n2 name)) (=> (distinct n1 n2) (distinct (select weights n1) (select weights n2))))) (assert (forall ((n name)) (or (= (select weights n) 10) (= (select weights n) 15) (= (select weights n) 25) (= (select weights n) 33) (= (select weights n) 40)))) (assert (forall ((n1 name) (n2 name)) (=> (distinct n1 n2) (distinct (select baits n1) (select baits n2))))) (assert (forall ((n1 name) (n2 name)) (=> (distinct n1 n2) (distinct (select platforms n1) (select platforms n2))))) ; The 10 lb. fish was a carp caught on a worm. (assert (forall ((n name)) (=> (= (select weights n) 10) (and (= (select fishes n) carp) (= (select baits n) worm))))) ; The combined weight of Frank and Febo's fishes equaled Filo's bluefish. (assert (and (= (+ (select weights Frank) (select weights Febo)) (select weights Filo)) (= (select fishes Filo) bluefish))) ; Febo didn't catch a carp and he didn't use grubs or lures. (assert (and (not (= (select fishes Febo) carp)) (not (= (select baits Febo) grub)) (not (= (select baits Febo) lure)))) ; Farley's shark wasn't the biggest fish and it wasn't caught on a grub or a dry fly or from a pier. (assert (and (= (select fishes Farley) shark) (< (select weights Farley) 40) (not (= (select baits Farley) grub)) (not (= (select baits Farley) dryfly)) (not (= (select platforms Farley) pier)))) ; The sailfish was caught on a minnow from a boat. (assert (forall ((n name)) (=> (= (select fishes n) sailfish) (and (= (select baits n) minnow) (= (select platforms n) boat))))) ; The salmon was caught on a grub from a dam. (assert (forall ((n name)) (=> (= (select fishes n) salmon) (and (= (select baits n) grub) (= (select platforms n) dam))))) ; Febo didn't catch a salmon and the 25 lb. fish was not caught from a raft. (assert (and (not (= (select fishes Febo) salmon)) (forall ((n name)) (=> (= (select weights n) 25) (not (= (select platforms n) raft)))))) ; The dry fly was not used from a pier. (assert (forall ((n name)) (=> (= (select baits n) dryfly) (not (= (select platforms n) pier)))))