Janko-dev / plogic

Propositional logic evaluator and rule-based pattern matcher
MIT License
20 stars 1 forks source link

Add quantifiers #3

Open L0uisc opened 2 years ago

L0uisc commented 2 years ago

Something missing in this iteration is quantifiers. I would like to take a shot at implementing them, but I will probably not get around to it before exams (October-November in the southern hemisphere).

NS Ek sien jy is 'n Nederlander. Hoe goed verstaan jy Afrikaans?

Janko-dev commented 2 years ago

Afrikaans looks funky to me, but I can comprehend it. Hoe goed versta jij Nederlands? :) Could you give an example of what a quantifier is? I'm not sure what you mean. And you can absolutely contribute. The only changes I wanted to make still, concern applying multiple rules after each other (i.e., expr => rule1 => rule2 => etc.).

L0uisc commented 2 years ago

I can understand Dutch when I see it, but not when I hear it. You speak too fast! But it looks funky to me too, so the feeling is mutual...

Quantifiers in logic is the mirrored E and upside down A, denoting claims such as "for all x, P(x) is true" and "there exists an x for which P(x) is true".

Janko-dev commented 2 years ago

Ah I see what you mean. I've studied them under the name "predicate logic". I was thinking of implementing them (and still do), however you can't represent them with basic truth tables. So what would the representation be in your view?

L0uisc commented 2 years ago

I have no idea. I'll have to study the guts of your system first. That's why I said not before exams! I do think it should be possible to add consciousness of simple quantification operations like \~(AxP(x)) <-> Ex\~P(x) in the system.

Janko-dev commented 2 years ago

maybe it would be cool to assign human readable sentences to variables, do some logic evaluation with them, and then print the transformed result. so in the example above, define P(x) to be "x is a car" and then the left hand side would read: "not for every x, there exists an x that is a car". the right hand side would read: "there is an x that is not a car". just food for thought :)