variable-substitution (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 variable-substitution 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.variable_substitution.infer_statement(...)
Sample code๏
Code output๏
๐ซ๐พ๐ โ๐ฐโโโ ๐ป๐พ ๐บ ๐ข๐๐๐ฃ๐๐๐ ๐-๐๐-๐๐๐ ๐๐๐ข๐๐ ๐.
๐ซ๐พ๐ โ๐ฏโโ ๐ป๐พ ๐บ ๐กโ๐๐๐๐ฆ-๐๐๐๐๐ฃ๐๐ก๐๐๐ ๐๐ ๐ฐโโ.
๐๐
๐ถ๐ผ๐บ (๐ฏโ.๐ด): ๐ซ๐พ๐ ๐๐ฅ๐๐๐ ๐ โ๐๐ถ๐ฎ๐ฎ๐บ ๐ข๐น๐ช๐ฐ๐ฎ ๐ต๐ฐ ๐ฆ๐ด๐ต๐ข๐ฃ๐ญ๐ช๐ด๐ฉ ๐ด๐ฐ๐ฎ๐ฆ ๐จ๐ณ๐ฐ๐ถ๐ฏ๐ฅ ๐ฑ๐ณ๐ฐ๐ฑ๐ฐ๐ด๐ช๐ต๐ช๐ฐ๐ฏ๐ด.โ ๐ป๐พ ๐๐๐ผ๐
๐๐ฝ๐พ๐ฝ (๐๐๐๐๐๐
๐บ๐๐พ๐ฝ) ๐๐ ๐ฏโ.
๐๐ป๐ณ๐ฒ๐ฟ๐ฒ๐ป๐ฐ๐ฒ ๐ฟ๐๐น๐ฒ (๐๐ฅ๐๐๐-๐๐๐ก๐๐๐๐๐๐ก๐๐ก๐๐๐): ๐ซ๐พ๐ ๐๐๐๐๐๐๐๐๐-๐๐ข๐๐ ๐๐ฅ๐๐๐-๐๐๐ก๐๐๐๐๐๐ก๐๐ก๐๐๐ ๐ฝ๐พ๐ฟ๐๐๐พ๐ฝ ๐บ๐ โ(๐, ๐ โข ๐)โ ๐ป๐พ ๐๐๐ผ๐
๐๐ฝ๐พ๐ฝ ๐บ๐๐ฝ ๐ผ๐๐๐๐๐ฝ๐พ๐๐พ๐ฝ ๐๐บ๐
๐๐ฝ ๐๐ ๐ฏโ.
๐ฃ๐ฟ๐ผ๐ฝ๐ผ๐๐ถ๐๐ถ๐ผ๐ป (๐ฏโ.๐): ๐(๐, ๐). ๐ฃ๐ฟ๐ผ๐ผ๐ณ: โ๐๐ถ๐ฎ๐ฎ๐บ ๐ข๐น๐ช๐ฐ๐ฎ ๐ต๐ฐ ๐ฆ๐ด๐ต๐ข๐ฃ๐ญ๐ช๐ด๐ฉ ๐ด๐ฐ๐ฎ๐ฆ ๐จ๐ณ๐ฐ๐ถ๐ฏ๐ฅ ๐ฑ๐ณ๐ฐ๐ฑ๐ฐ๐ด๐ช๐ต๐ช๐ฐ๐ฏ๐ด.โ ๐๐ ๐๐๐๐๐๐
๐บ๐๐พ๐ฝ ๐ป๐ ๐ฎ๐
๐ถ๐ผ๐บ (๐ด). ๐(๐, ๐) ๐๐ ๐บ ๐๐๐๐๐๐๐๐๐๐๐๐บ๐
๐ฟ๐๐๐๐๐
๐บ ๐๐๐๐พ๐๐๐๐พ๐๐พ๐ฝ ๐ฟ๐๐๐ ๐๐๐บ๐ ๐บ๐๐๐๐. ๐ณ๐๐พ๐๐พ๐ฟ๐๐๐พ, ๐ป๐ ๐๐๐พ ๐๐ฅ๐๐๐-๐๐๐ก๐๐๐๐๐๐ก๐๐ก๐๐๐ ๐๐๐ฟ๐พ๐๐พ๐๐ผ๐พ ๐๐๐
๐พ: (๐, ๐ โข ๐), ๐๐ ๐ฟ๐๐
๐
๐๐๐ ๐๐๐บ๐ ๐(๐, ๐). โ
๐ฃ๐ฟ๐ผ๐ฝ๐ผ๐๐ถ๐๐ถ๐ผ๐ป (๐ฏโ.๐): (๐(๐ฑ, ๐ฒ) โน ๐(๐ฒ, ๐ฑ)). ๐ฃ๐ฟ๐ผ๐ผ๐ณ: โ๐๐ถ๐ฎ๐ฎ๐บ ๐ข๐น๐ช๐ฐ๐ฎ ๐ต๐ฐ ๐ฆ๐ด๐ต๐ข๐ฃ๐ญ๐ช๐ด๐ฉ ๐ด๐ฐ๐ฎ๐ฆ ๐จ๐ณ๐ฐ๐ถ๐ฏ๐ฅ ๐ฑ๐ณ๐ฐ๐ฑ๐ฐ๐ด๐ช๐ต๐ช๐ฐ๐ฏ๐ด.โ ๐๐ ๐๐๐๐๐๐
๐บ๐๐พ๐ฝ ๐ป๐ ๐ฎ๐
๐ถ๐ผ๐บ (๐ด). (๐(๐ฑ, ๐ฒ) โน ๐(๐ฒ, ๐ฑ)) ๐๐ ๐บ ๐๐๐๐๐๐๐๐๐๐๐๐บ๐
๐ฟ๐๐๐๐๐
๐บ ๐๐๐๐พ๐๐๐๐พ๐๐พ๐ฝ ๐ฟ๐๐๐ ๐๐๐บ๐ ๐บ๐๐๐๐. ๐ณ๐๐พ๐๐พ๐ฟ๐๐๐พ, ๐ป๐ ๐๐๐พ ๐๐ฅ๐๐๐-๐๐๐ก๐๐๐๐๐๐ก๐๐ก๐๐๐ ๐๐๐ฟ๐พ๐๐พ๐๐ผ๐พ ๐๐๐
๐พ: (๐, ๐ โข ๐), ๐๐ ๐ฟ๐๐
๐
๐๐๐ ๐๐๐บ๐ (๐(๐ฑ, ๐ฒ) โน ๐(๐ฒ, ๐ฑ)). โ
๐๐ป๐ณ๐ฒ๐ฟ๐ฒ๐ป๐ฐ๐ฒ ๐ฟ๐๐น๐ฒ (๐ฃ๐๐๐๐๐๐๐-๐ ๐ข๐๐ ๐ก๐๐ก๐ข๐ก๐๐๐): ๐ซ๐พ๐ ๐๐๐๐๐๐๐๐๐-๐๐ข๐๐ ๐ฃ๐๐๐๐๐๐๐-๐ ๐ข๐๐ ๐ก๐๐ก๐ข๐ก๐๐๐ ๐ฝ๐พ๐ฟ๐๐๐พ๐ฝ ๐บ๐ โ(๐, ๐ โข ๐)โ ๐ป๐พ ๐๐๐ผ๐
๐๐ฝ๐พ๐ฝ ๐บ๐๐ฝ ๐ผ๐๐๐๐๐ฝ๐พ๐๐พ๐ฝ ๐๐บ๐
๐๐ฝ ๐๐ ๐ฏโ.
๐ฃ๐ฟ๐ผ๐ฝ๐ผ๐๐ถ๐๐ถ๐ผ๐ป (๐ฏโ.๐): (๐(๐, ๐) โน ๐(๐, ๐)). ๐ฃ๐ฟ๐ผ๐ผ๐ณ: (๐(๐ฑ, ๐ฒ) โน ๐(๐ฒ, ๐ฑ)) ๐ฟ๐๐
๐
๐๐๐ ๐ฟ๐๐๐ ๐ฝ๐ฟ๐ผ๐ฝ. (๐). ๐ซ๐พ๐ ๐ฑ = ๐, ๐ฒ = ๐. ๐ณ๐๐พ๐๐พ๐ฟ๐๐๐พ, ๐ป๐ ๐๐๐พ ๐ฃ๐๐๐๐๐๐๐-๐ ๐ข๐๐ ๐ก๐๐ก๐ข๐ก๐๐๐ ๐๐๐ฟ๐พ๐๐พ๐๐ผ๐พ ๐๐๐
๐พ: (๐, ๐ โข ๐), ๐๐ ๐ฟ๐๐
๐
๐๐๐ ๐๐๐บ๐ (๐(๐, ๐) โน ๐(๐, ๐)). โ
import punctilious as pu
# Create a universe-of-discourse with basic objects for the sake of this example.
u = pu.create_universe_of_discourse(echo=True)
a1 = u.a.declare(natural_language='Dummy axiom to establish some ground propositions.')
o1 = u.o.declare()
o2 = u.o.declare()
o3 = u.o.declare()
f = u.r.declare(arity=2, symbol='f', signal_proposition=True)
t1 = u.t(echo=True)
# Elaborate a dummy theory with a set of propositions necessary for our demonstration
a = t1.include_axiom(a=a1)
t1.i.axiom_interpretation.infer_formula_statement(a=a, p=f(o1, o2), lock=False)
with u.with_variable('x') as x, u.with_variable('y') as y:
implication = t1.i.axiom_interpretation.infer_formula_statement(a=a,
p=f(x, y) | u.r.implies | f(y, x), lock=True)
t1.stabilize()
proposition_of_interest = t1.i.variable_substitution.infer_formula_statement(p=implication,
phi=u.r.tupl(o1, o2))
Let "U77" be a universe-of-discourse.
Let "T1" be a theory-derivation in U77.
Axiom (T1.A): Let axiom A "Dummy axiom to establish some ground propositions." 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.P): f(o, o). Proof: "Dummy axiom to establish some ground propositions." is postulated by axiom (A). f(o, o) is a propositional formula interpreted from that axiom. Therefore, by the axiom-interpretation inference rule: (A, P |- P), it follows that f(o, o). QED
Proposition (T1.P): (f(x, y) ==> f(y, x)). Proof: "Dummy axiom to establish some ground propositions." is postulated by axiom (A). (f(x, y) ==> f(y, x)) is a propositional formula interpreted from that axiom. Therefore, by the axiom-interpretation inference rule: (A, P |- P), it follows that (f(x, y) ==> f(y, x)). QED
Inference rule (variable-substitution): Let inference-rule variable-substitution defined as "(P, O |- Q)" be included and considered valid in T1.
Proposition (T1.P): (f(o, o) ==> f(o, o)). Proof: (f(x, y) ==> f(y, x)) follows from prop. (P). Let x = o, y = o. Therefore, by the variable-substitution inference rule: (P, O |- Q), it follows that (f(o, o) ==> f(o, o)). QED
Will be provided in a future version.
Will be provided in a future version.