Objects/Documentation
syllogismes12.py
I provide this item to inspect or reproduce the check AT.R8.
Download ↓"""Check a bounded proof graph with three rule schemas taken from Metamath set.mm."""
from itertools import product
import json
def run():
# Each pair denotes implication. The four assumptions of this task are explicit.
given={('A','T'),('T','B'),('B','C'),('B','D')}
rules=[]
def trans(a,b,c):
ab=(a,b);bc=(b,c);ac=(a,c);lift=(a,bc)
rules.extend([('syl',(ab,bc),ac),('a1i',(bc,),lift),('mpd',(ab,lift),ac)])
trans('A','T','B');trans('A','B','C');trans('A','B','D')
def value(f,bits):
if isinstance(f,str):return bits[f]
u,v=f;return not value(u,bits) or value(v,bits)
for schema,inputs,output in rules: