disjunctive-syllogism-2 (python sample)๏
See also
math concept | python declaration class | python inclusion class
This page shows how to infer new statements in a theory-derivation by applying the disjunctive-syllogism-2 inference-rule.
Usage๏
Call the infer_statement method from the inference-rule inclusion class listed in the i (unabridged inference_rules ) property of the theory-derivation :
u = pu.create_universe()
t = u.t()
...
# some theory derivation code
...
t.i.disjunctive_syllogism_2.infer_statement(...)
Sample code๏
Code output๏
๐ซ๐พ๐ โ๐ฐโโโ ๐ป๐พ ๐บ ๐ข๐๐๐ฃ๐๐๐ ๐-๐๐-๐๐๐ ๐๐๐ข๐๐ ๐.
๐ซ๐พ๐ โ๐ฏโโ ๐ป๐พ ๐บ ๐กโ๐๐๐๐ฆ-๐๐๐๐๐ฃ๐๐ก๐๐๐ ๐๐ ๐ฐโโ.
๐๐
๐ถ๐ผ๐บ (๐ฏโ.๐ดโ): ๐ซ๐พ๐ ๐๐ฅ๐๐๐ ๐โ โ๐๐ถ๐ฎ๐ฎ๐บ ๐ข๐น๐ช๐ฐ๐ฎ ๐ง๐ฐ๐ณ ๐ฅ๐ฆ๐ฎ๐ฐ๐ฏ๐ด๐ต๐ณ๐ข๐ต๐ช๐ฐ๐ฏ ๐ฑ๐ถ๐ณ๐ฑ๐ฐ๐ด๐ฆ๐ดโ ๐ป๐พ ๐๐๐ผ๐
๐๐ฝ๐พ๐ฝ (๐๐๐๐๐๐
๐บ๐๐พ๐ฝ) ๐๐ ๐ฏโ.
๐๐ป๐ณ๐ฒ๐ฟ๐ฒ๐ป๐ฐ๐ฒ ๐ฟ๐๐น๐ฒ (๐๐ฅ๐๐๐-๐๐๐ก๐๐๐๐๐๐ก๐๐ก๐๐๐): ๐ซ๐พ๐ ๐๐๐๐๐๐๐๐๐-๐๐ข๐๐ ๐๐ฅ๐๐๐-๐๐๐ก๐๐๐๐๐๐ก๐๐ก๐๐๐ ๐ฝ๐พ๐ฟ๐๐๐พ๐ฝ ๐บ๐ โ(๐, ๐ โข ๐)โ ๐ป๐พ ๐๐๐ผ๐
๐๐ฝ๐พ๐ฝ ๐บ๐๐ฝ ๐ผ๐๐๐๐๐ฝ๐พ๐๐พ๐ฝ ๐๐บ๐
๐๐ฝ ๐๐ ๐ฏโ.
๐ฃ๐ฟ๐ผ๐ฝ๐ผ๐๐ถ๐๐ถ๐ผ๐ป (๐ฏโ.๐โ): ((๐โ โน ๐โ) โจ (๐โ โน ๐โ)). ๐ฃ๐ฟ๐ผ๐ผ๐ณ: โ๐๐ถ๐ฎ๐ฎ๐บ ๐ข๐น๐ช๐ฐ๐ฎ ๐ง๐ฐ๐ณ ๐ฅ๐ฆ๐ฎ๐ฐ๐ฏ๐ด๐ต๐ณ๐ข๐ต๐ช๐ฐ๐ฏ ๐ฑ๐ถ๐ณ๐ฑ๐ฐ๐ด๐ฆ๐ดโ ๐๐ ๐๐๐๐๐๐
๐บ๐๐พ๐ฝ ๐ป๐ ๐ฎ๐
๐ถ๐ผ๐บ (๐ดโ). ((๐โ โน ๐โ) โจ (๐โ โน ๐โ)) ๐๐ ๐บ ๐๐๐๐๐๐๐๐๐๐๐๐บ๐
๐ฟ๐๐๐๐๐
๐บ ๐๐๐๐พ๐๐๐๐พ๐๐พ๐ฝ ๐ฟ๐๐๐ ๐๐๐บ๐ ๐บ๐๐๐๐. ๐ณ๐๐พ๐๐พ๐ฟ๐๐๐พ, ๐ป๐ ๐๐๐พ ๐๐ฅ๐๐๐-๐๐๐ก๐๐๐๐๐๐ก๐๐ก๐๐๐ ๐๐๐ฟ๐พ๐๐พ๐๐ผ๐พ ๐๐๐
๐พ: (๐, ๐ โข ๐), ๐๐ ๐ฟ๐๐
๐
๐๐๐ ๐๐๐บ๐ ((๐โ โน ๐โ) โจ (๐โ โน ๐โ)). โ
๐ฃ๐ฟ๐ผ๐ฝ๐ผ๐๐ถ๐๐ถ๐ผ๐ป (๐ฏโ.๐โ): ยฌ((๐โ โน ๐โ)). ๐ฃ๐ฟ๐ผ๐ผ๐ณ: โ๐๐ถ๐ฎ๐ฎ๐บ ๐ข๐น๐ช๐ฐ๐ฎ ๐ง๐ฐ๐ณ ๐ฅ๐ฆ๐ฎ๐ฐ๐ฏ๐ด๐ต๐ณ๐ข๐ต๐ช๐ฐ๐ฏ ๐ฑ๐ถ๐ณ๐ฑ๐ฐ๐ด๐ฆ๐ดโ ๐๐ ๐๐๐๐๐๐
๐บ๐๐พ๐ฝ ๐ป๐ ๐ฎ๐
๐ถ๐ผ๐บ (๐ดโ). ยฌ((๐โ โน ๐โ)) ๐๐ ๐บ ๐๐๐๐๐๐๐๐๐๐๐๐บ๐
๐ฟ๐๐๐๐๐
๐บ ๐๐๐๐พ๐๐๐๐พ๐๐พ๐ฝ ๐ฟ๐๐๐ ๐๐๐บ๐ ๐บ๐๐๐๐. ๐ณ๐๐พ๐๐พ๐ฟ๐๐๐พ, ๐ป๐ ๐๐๐พ ๐๐ฅ๐๐๐-๐๐๐ก๐๐๐๐๐๐ก๐๐ก๐๐๐ ๐๐๐ฟ๐พ๐๐พ๐๐ผ๐พ ๐๐๐
๐พ: (๐, ๐ โข ๐), ๐๐ ๐ฟ๐๐
๐
๐๐๐ ๐๐๐บ๐ ยฌ((๐โ โน ๐โ)). โ
๐๐ป๐ณ๐ฒ๐ฟ๐ฒ๐ป๐ฐ๐ฒ ๐ฟ๐๐น๐ฒ (๐๐๐ ๐๐ข๐๐๐ก๐๐ฃ๐-๐ ๐ฆ๐๐๐๐๐๐ ๐-2): ๐ซ๐พ๐ ๐๐๐๐๐๐๐๐๐-๐๐ข๐๐ ๐๐๐ ๐๐ข๐๐๐ก๐๐ฃ๐-๐ ๐ฆ๐๐๐๐๐๐ ๐-2 ๐ฝ๐พ๐ฟ๐๐๐พ๐ฝ ๐บ๐ โ((๐โ โจ ๐โ), ยฌ(๐โ) โข ๐โ)โ ๐ป๐พ ๐๐๐ผ๐
๐๐ฝ๐พ๐ฝ ๐บ๐๐ฝ ๐ผ๐๐๐๐๐ฝ๐พ๐๐พ๐ฝ ๐๐บ๐
๐๐ฝ ๐๐ ๐ฏโ.
๐ฃ๐ฟ๐ผ๐ฝ๐ผ๐๐ถ๐๐ถ๐ผ๐ป (๐ฏโ.๐โ) - The proposition of interest: (๐โ โน ๐โ). ๐ฃ๐ฟ๐ผ๐ผ๐ณ: ((๐โ โน ๐โ) โจ (๐โ โน ๐โ)), ๐๐ฟ ๐๐๐พ ๐ฟ๐๐๐ (๐โ โจ ๐โ), ๐ฟ๐๐
๐
๐๐๐ ๐ฟ๐๐๐ ๐ฝ๐ฟ๐ผ๐ฝ. (๐โ). ๐โ, ๐๐ฟ ๐๐๐พ ๐ฟ๐๐๐ ยฌ(๐โ), ๐๐ ๐๐๐๐พ๐. ๐ณ๐๐พ๐๐พ๐ฟ๐๐๐พ, ๐ป๐ ๐๐๐พ ๐๐๐ ๐๐ข๐๐๐ก๐๐ฃ๐-๐ ๐ฆ๐๐๐๐๐๐ ๐-2 ๐๐๐ฟ๐พ๐๐พ๐๐ผ๐พ ๐๐๐
๐พ: ((๐โ โจ ๐โ), ยฌ(๐โ) โข ๐โ), ๐๐ ๐ฟ๐๐
๐
๐๐๐ ๐๐๐บ๐ (๐โ โน ๐โ). โ
import punctilious as pu
# Create a universe-of-discourse with basic objects for the sake of this example.
u = pu.UniverseOfDiscourse(echo=True)
o1 = u.o.declare()
o2 = u.o.declare()
o3 = u.o.declare()
o4 = u.o.declare()
axiom = u.a.declare(natural_language='Dummy axiom for demonstration purposes')
# Elaborate a dummy theory with a set of propositions necessary for our demonstration
t1 = u.t(echo=True)
theory_axiom = t1.include_axiom(a=axiom)
phi1 = t1.i.axiom_interpretation.infer_formula_statement(a=theory_axiom,
p=(o1 | u.r.implies | o3) | u.r.lor | (o1 | u.r.implies | o4), lock=False)
phi2 = t1.i.axiom_interpretation.infer_formula_statement(a=theory_axiom,
p=u.r.lnot((o1 | u.r.implies | o4)), lock=True)
# And finally, use the conjunction-introduction inference-rule:
proposition_of_interest = t1.i.disjunctive_syllogism_2.infer_formula_statement(p_or_q=phi1,
not_q=phi2, subtitle='The proposition of interest')
Let "U31" be a universe-of-discourse.
Let "T1" be a theory-derivation in U31.
Axiom (T1.A1): Let axiom A1 "Dummy axiom for demonstration purposes" be included (postulated) in T1.
Inference rule (axiom-interpretation): Let inference-rule axiom-interpretation defined as "(A, P |- P)" be included and considered valid in T1.
Proposition (T1.P1): ((o1 ==> o3) or (o1 ==> o4)). Proof: "Dummy axiom for demonstration purposes" is postulated by axiom (A1). ((o1 ==> o3) or (o1 ==> o4)) is a propositional formula interpreted from that axiom. Therefore, by the axiom-interpretation inference rule: (A, P |- P), it follows that ((o1 ==> o3) or (o1 ==> o4)). QED
Proposition (T1.P2): not((o1 ==> o4)). Proof: "Dummy axiom for demonstration purposes" is postulated by axiom (A1). not((o1 ==> o4)) is a propositional formula interpreted from that axiom. Therefore, by the axiom-interpretation inference rule: (A, P |- P), it follows that not((o1 ==> o4)). QED
Inference rule (disjunctive-syllogism-2): Let inference-rule disjunctive-syllogism-2 defined as "((P1 or Q1), not(P1) |- Q1)" be included and considered valid in T1.
Proposition (T1.P3) - The proposition of interest: (o1 ==> o3). Proof: ((o1 ==> o3) or (o1 ==> o4)), of the form (P1 or Q1), follows from prop. (P1). P2, of the form not(P1), is given. Therefore, by the disjunctive-syllogism-2 inference rule: ((P1 or Q1), not(P1) |- Q1), it follows that (o1 ==> o3). QED
Will be provided in a future version.
Will be provided in a future version.