Propositional Logic in Prolog - Incorrect Representations

48 views Asked by At

There are certain premises which I am unable to represent correctly in prolog, which are as follows:

  1. "I can only sleep well if I am neither in a noisy environment nor have caffeine before bedtime."

    SleepWell <-> (-Noisy & -Caffeine)

  2. "When I drive or take the subway to work, I am not stuck in traffic."

    (GoToWork) & (GoByDrive | GoBySubway) -> -StuckInTraffic

  3. "I cannot access the internet except through Wi-Fi, Ethernet, or mobile data."

    (Internet | Ethernet | MobileData) -> Internet

  4. "If I forget my umbrella when I'm not at home and not wearing my raincoat, I get wet."

    (ForgetUmbrella & -Home & -Raincoat) -> GetWet

  5. "If it snows, I don't go skiing, and it is never windy except when it's snows."

    Snows -> -Skiing & (Snows -> Windy)

  6. "When I play basketball, I wear my sneakers; otherwise, I never wear it."

    PlayBasketBall <-> WearSneakers

  7. "If I'm not at home during a thunderstorm and can't find shelter, I get soaked."

    (-Home & ThunderStorm & -Shelter) -> Soaked

  8. "I will get wet unless I go to city by car."

    (GoToCity & GoByCar) -> -Wet

These premises are part of exercises (with distinct goals) I am currently practicing with Prolog. However, while I have been able to figure out the rest, these above mentioned premises are being shown as incorrect representations.

0

There are 0 answers