3 ms·
There seems to an interesting difference between Prolog and conventional (predicate) logic. In Prolog, anything that can't be inferred from the knowledge base
by cubefox 1y ago
There seems to an interesting difference between Prolog and conventional (predicate) logic.
In Prolog, anything that can't be inferred from the knowledge base is false. If nothing about "playsAirGuitar(mia)" is implied by the knowledge base, it's false. All the facts are assumed to be given; therefore, if something isn't given, it must be false.
Predicate logic is the opposite: If I can't infer anything about "playsAirGuitar(mia)" from my axioms, it might be true or false. It's truth value is unknown. It's true in some model of the axioms, and false in others. The statement is independent of the axioms.
Deductive logic assumes an open universe, Prolog a closed universe.
- rramadass 1y agoThis is called the Closed World Assumption (CWA) - https://en.wikipedia.org/wiki/Closed-world_assumption https://en.wikipedia.org/wiki/Closed-world_assumption Prolog’s Closed-World Assumption: A Journey Through Time - https://medium.com/@kenichisasagawa/prologs-closed-world-assumption-a-journey-through-time-a2392b654750 https://medium.com/@kenichisasagawa/prologs-closed-world-ass... Is Prolog really based on the closed-world assumption? - https://stackoverflow.com/questions/65014705/is-prolog-really-based-on-the-closed-world-assumption https://stackoverflow.com/questions/65014705/is-prolog-reall...
- scotty79 1y agoIt's not really false I think. It's 'no', which is an answer to a question "Do I know this to be true?" I think there should be a room for three values there: true, unprovable, false. Where false things are also unprovable. I wonder if Prolog has false, defined as "yes" of the opposite.
- cubefox 1y ago> It's not really false I think. It's 'no', which is an answer to a question "Do I know this to be true?" I don't think so, because in this case both x and not-x could be "no", but I think in Prolog, if x is "no", not-x is "yes", even if neither is known to be true. It's not a three-valued logic that doesn't adhere to the law of the excluded middle.
- scotty79 1y agoIf x is "no" (I do not know this to be true) then not-x is "yes" (I do know this to be true). So negation still works as usual. "Yes" is not "true" but rather "provably true". And "no" is not "false" but rather "not provably true". Third sensible value in this framework (which I think Prolog doesn't have) would be "false" meaning "it's provably false" ("the opposite of it is provably true"). To be frank I think Prolog in newer implementations completely abandoned this nuance and just call states "true" and "false" instead of "yes" and "no".
- cubefox 1y ago> If x is "no" (I do not know this to be true) then not-x is "yes" (I do know this to be true). So negation still works as usual. As I said though, that doesn't make sense. Because if I don't know x to be true because it is not mentioned in the knowledge base, I also don't know not-x to be true. So both would have to be "no". But they aren't. Therefore the knowledge interpretation is incorrect. Knowledge wouldn't be closed under negation. If you don't know something to be true, that doesn't imply that you know it to be false.
- scotty79 1y agoYou are right. If X is 'no' then not-X wouldn't necessarily be "yes". After looking around I see that Prolog recognizes some nuance around not: https://en.wikipedia.org/wiki/Prolog#Negation https://en.wikipedia.org/wiki/Prolog#Negation And aldready deprecated one 'not' operator: https://www.swi-prolog.org/pldoc/man?predicate=not/1 https://www.swi-prolog.org/pldoc/man?predicate=not/1 Look at how they are not using not, but rather "not provable". I'm not sure if Prolog has straight up negation behaving in binary arithmetic way.