Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
This notebook is a theorem prover for an extended syllogistic logic which allows one to make assertions about comparative cardinalities of finite sets. The logic is complete and efficiently decidable. If an assertion follows from a set of assumptions, this notebook displays the proof. If it doesn't follow, it outputs a counter-model.
License: GPL3
Image: ubuntu2004
Inference involving the sizes of sets
by Lawrence S. Moss
This notebook has an implementation of syllogistic logic plus cardinality comparison information. One can enter premises and a possible conclusion, and the program will either return a proof or a counterexample. The logic has 23 syllogistic rules plus ex falso quodlibet. It has no boolean connectives. It is sound and complete for interpretations in finite sets. The proof system comes from my 2016 paper "Syllogistic Logic with Cardinality Comparisons".
Enter the cell below by clicking on it and then typing shift-return.
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
/tmp/ipykernel_516/1391208896.py in <cell line: 1>()
----> 1 ccc
NameError: name 'ccc' is not defined
The rest of this notebook is a set of examples. You may copy or modify them. You also can find further things to do in the cell above. These are the only things going on in this notebook.
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
/tmp/ipykernel_516/1974504622.py in <cell line: 1>()
----> 1 follows(['All a are b', 'Some a are a','All b are c'], 'All c are b')
NameError: name 'follows' is not defined
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
/tmp/ipykernel_516/3031566759.py in <cell line: 1>()
----> 1 garrulous()
NameError: name 'garrulous' is not defined
The conclusion follows from the assumptions.
Here is a formal proof in our system:
Here is the full set of proof rules of the logic:
The system does not have Reductio ad Absurdum,
since we only need Ex Falso Quodlibet:
Some x are y
No x are y
-------------- X
S
There are more x than y
There are at least as many y as x
------------------------------------ X
S
Here S is any sentence.
Notice that the (Maj) rule has three premises.
The system is complete: all valid consequences can be proved in it.
In fact, the X rule is only needed at the end of derivations.
The conclusion does not follow from the assumptions.
Here is a counter-model.
We take the universe of the model to be {0, 1, 2}.
The conclusion follows from the assumptions.
Here is a formal proof in our system:
The conclusion does not follow from the assumptions.
Here is a counter-model.
We take the universe of the model to be {0, 1}.
The conclusion does not follow from the assumptions.
Here is a counter-model.
We take the universe of the model to be {0, 1}.
The conclusion does not follow from the assumptions.
Here is a counter-model.
We take the universe of the model to be {0, 1, 2, 3, 4}.
Here is the full set of proof rules of the logic:
The system does not have Reductio ad Absurdum,
since we only need Ex Falso Quodlibet:
Some x are y
No x are y
-------------- X
S
There are more x than y
There are at least as many y as x
------------------------------------ X
S
Here S is any sentence.
Notice that the (Maj) rule has three premises.
The system is complete: all valid consequences can be proved in it.
In fact, the X rule is only needed at the end of derivations.
The conclusion does not follow from the assumptions.
Here is a counter-model.
We take the universe of the model to be {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}.
The conclusion does not follow from the assumptions.
Here is a counter-model.
We take the universe of the model to be {0, 1}.
The conclusion does not follow from the assumptions.
Here is a counter-model.
We take the universe of the model to be {0, 1, 2}.
The conclusion follows from the assumptions.
Here is a formal proof in our system:
The conclusion follows from the assumptions.
Here is a formal proof in our system:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-dd6d0f21abf7> in <module>()
----> 1 rules()
NameError: name 'rules' is not defined
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-7-2159f4810029> in <module>()
----> 1 import matplotlib_venn
2 from matplotlib_venn import venn3
ModuleNotFoundError: No module named 'matplotlib_venn'