Results 1 to 10 of 10

Thread: FOPL Basics in Prolog

  1. #1
    Maître de Web d'Élite Wind Shear's Avatar
    Join Date
    Nov 2002
    Location
    Lapu-Lapu City, Philippines
    Posts
    171

    Default FOPL Basics in Prolog

    I need some help on First Predicate Order Logic for my project. All I need is just to reverse it.

    Would you like to translate to English statement? These are just examples.

    1. male('Loony BoB').
    2. parent('Loony BoB','Agent Proto').
    3. mother(X,Y) :- parent(X,Y), female(Y).
    4. sister(X,S) :- female(S), parent(S,P), parent(X,P), X \== S.

    Thanks!
    Courage is not the lack of fear. It is acting in spite of it. ~ Mark Twain

    Wind Shear in WikiEoFF

    MILF
    - In Philippines, it's a rebel group.
    - In U.S. of A.,... err... do I have to tell you?

  2. #2
    Quack Shlup's Avatar
    Join Date
    Aug 2000
    Location
    California
    Posts
    34,993
    Articles
    14
    Blog Entries
    37
    Contributions
    • Former Administrator
    • Former Cid's Knight

    Default

    I have no idea what any of that means.

  3. #3
    Maître de Web d'Élite Wind Shear's Avatar
    Join Date
    Nov 2002
    Location
    Lapu-Lapu City, Philippines
    Posts
    171

    Default

    Originally posted by ShlupQuack
    I have no idea what any of that means.
    By the way, the programming language is in PROLOG.
    Courage is not the lack of fear. It is acting in spite of it. ~ Mark Twain

    Wind Shear in WikiEoFF

    MILF
    - In Philippines, it's a rebel group.
    - In U.S. of A.,... err... do I have to tell you?

  4. #4
    Banned Thunday Man's Avatar
    Join Date
    Jan 2004
    Location
    DTP getting POD'ed somewhere.
    Posts
    511

    Default

    I like to make up langauges too. And steal cookies.

  5. #5
    Hypnotising you crono_logical's Avatar
    Join Date
    May 2001
    Location
    Back in Time
    Posts
    9,313
    Contributions
    • Former Administrator
    • Former Cid's Knight

    Default Re: FOPL Basics in Prolog

    Originally posted by Wind Shear
    I need some help on First Predicate Order Logic for my project. All I need is just to reverse it.

    Would you like to translate to English statement? These are just examples.

    1. male('Loony BoB').
    2. parent('Loony BoB','Agent Proto').
    3. mother(X,Y) :- parent(X,Y), female(Y).
    4. sister(X,S) :- female(S), parent(S,P), parent(X,P), X \== S.

    Thanks!
    1. Loony BoB is male, maybe
    2. Agent Proto is the parent of Loony BoB. (Probably )
    3. Y is the mother of X if Y is a parent of X and Y is female.
    4. S is a sister of X if S is female, P is a parent of S, P is also a parent of X, and X is not S (last clause is needed otherwise it'll match X as a sister to itself if the rest are true )
    Problems playing downloaded videos? Try CCCP


  6. #6
    Maître de Web d'Élite Wind Shear's Avatar
    Join Date
    Nov 2002
    Location
    Lapu-Lapu City, Philippines
    Posts
    171

    Default

    Thanks. And I almost forgot! The said codes must be converted to First Order Predicate Logic! *headbangs himself on the wall*

    That's all I need!
    Courage is not the lack of fear. It is acting in spite of it. ~ Mark Twain

    Wind Shear in WikiEoFF

    MILF
    - In Philippines, it's a rebel group.
    - In U.S. of A.,... err... do I have to tell you?

  7. #7
    ORANGE Dr Unne's Avatar
    Join Date
    Dec 1999
    Posts
    7,394
    Articles
    1
    Contributions
    • Former Administrator
    • Former Developer
    • Former Tech Admin

    Default

    I know first-order logic, but I don't know prolog. I'm just guessing the :- represents implication, i.e. ->, or it might represent the <-> operator. Commas likely represent AND, i.e. a symbol I can't post in HTML. 3 and 4 are universal statements, so you need the upside-down A universal quanifier symbol. So for example

    FORALL P,S,X sister(X,S) -> female(S) AND parent(S,P) AND parent(X,P) AND NOT X == S.

    Replacing the words in caps with the appropriate symbols. Don't know if that helps, or if you still even need help.

  8. #8
    Last Exile Baloki's Avatar
    Join Date
    Sep 2003
    Location
    Dreaming a dream~
    Posts
    8,425
    Articles
    5
    Blog Entries
    2

    FFXIV Character

    Baloki Kyuu (Sargatanas)
    Contributions
    • Former Senior Site Staff

    Default

    Gah, prolog, prolog, prolog, why does everyone go on about such a declaritive language? Why? WHY?!?!

    *Goes insane*
    FOA

  9. #9
    ORANGE Dr Unne's Avatar
    Join Date
    Dec 1999
    Posts
    7,394
    Articles
    1
    Contributions
    • Former Administrator
    • Former Developer
    • Former Tech Admin

    Default

    Prolog has its uses though. For example, torturing prisoners of war.

  10. #10
    Last Exile Baloki's Avatar
    Join Date
    Sep 2003
    Location
    Dreaming a dream~
    Posts
    8,425
    Articles
    5
    Blog Entries
    2

    FFXIV Character

    Baloki Kyuu (Sargatanas)
    Contributions
    • Former Senior Site Staff

    Default

    Originally posted by Dr Unne
    Prolog has its uses though. For example, torturing prisoners of war.
    And poor A-level candidates whose teacher talks about it EVERY lesson....
    FOA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •