def function_link_assns(p, call_site, tag): call_vis = (default_n_vc(p, call_site), p.node_tags[call_site][0]) return rep_graph.mk_function_link_hyps(p, call_vis, tag)
def get_unique_call_site(p, fname, tag): ns = [n for n in p.nodes if p.nodes[n].kind == "Call" if p.nodes[n].fname == fname if p.node_tags[n][0] == tag] if len(ns) == 1: [n] = ns return n else: return None def get_call_link_hyps(p, n, (from_tags, from_pair), (to_tags, to_pair)): n = find_actual_call_node(p, n) fname = p.nodes[n].fname assert fname == to_pair.funs["ASM"] vis = get_vis(p, n) hyps = rep_graph.mk_function_link_hyps(p, vis, to_tags["ASM"], adjust_eq_seq=adj_eq_seq_for_asm_fun_link(fname)) c_fname = to_pair.funs["C"] cn = get_unique_call_site(p, c_fname, from_tags["C"]) if cn != None: vis = get_vis(p, cn) hyps += rep_graph.mk_function_link_hyps(p, vis, to_tags["C"]) return hyps def refute_minimise_vis_hyps(rep, free_hyps, call_hyps, vis_pcs): def test(call_hyps, vis_pcs): hs = [h for grp in call_hyps for h in grp] + [h for (h, _) in vis_pcs] + free_hyps return rep.test_hyp_whyps(syntax.false_term, hs) if not test(call_hyps, vis_pcs):
def function_link_assns (p, call_site, tag): call_vis = (default_n_vc (p, call_site), p.node_tags[call_site][0]) return rep_graph.mk_function_link_hyps (p, call_vis, tag)
else: return None def get_call_link_hyps(p, n, (from_tags, from_pair), (to_tags, to_pair), focused_loops=None): n = find_actual_call_node(p, n) fname = p.nodes[n].fname assert fname == to_pair.funs['ASM'] vis = get_vis(p, n, focused_loops=focused_loops) hyps = rep_graph.mk_function_link_hyps( p, vis, to_tags['ASM'], adjust_eq_seq=adj_eq_seq_for_asm_fun_link(fname)) c_fname = to_pair.funs['C'] cn = get_unique_call_site(p, c_fname, from_tags['C']) if cn != None: vis = get_vis(p, cn, focused_loops=focused_loops) hyps += rep_graph.mk_function_link_hyps(p, vis, to_tags['C']) return hyps def refute_minimise_vis_hyps(rep, free_hyps, call_hyps, vis_pcs): def test(call_hyps, vis_pcs): hs = [h for grp in call_hyps for h in grp] + [h for (h, _) in vis_pcs] + free_hyps