def p_entry_typed_def(p): 'entry : priv KW_DEF IDENT params COLON expr DEF expr DOT' p[0] = [ sig.Symbol(p[3], term.mk_pies(p[4], p[6]), p[1], sig.Staticity.DEFINABLE), sig.Rule(None, [], term.Const(p[3]), term.mk_lams(p[4], p[8])) ]
def p_entry_thm(p): 'entry : KW_THM IDENT params COLON expr DEF expr DOT' p[0] = [ sig.Symbol(p[2], term.mk_pies(p[3], p[5]), sig.Scope.PUBLIC, sig.Staticity.DEFINABLE), sig.Rule(None, [], term.Const(p[2]), term.mk_lams(p[3], p[7])) ]
def p_qualid_id(p): 'qualid : IDENT' if p[1] in dbs: p[0] = term.DB(p[1], len(dbs) - dbs.index(p[1]) - 1) elif p[1] in pat['vars']: p[0] = term.MVar(p[1]) else: p[0] = term.Const(p[1])
def p_qualid_qual(p): 'qualid : QIDENT' p[0] = term.Const(p[1])
def mkident(p): print(f"Ident: {p} in {dbs}") if p in dbs: return term.DB(p, len(dbs) - dbs.index(p) - 1) else: return term.Const(p)