MCPcopy Create free account
hub / github.com/google-deepmind/alphageometry / cache_match

Function cache_match

dd.py:810–824  ·  view source on GitHub ↗

Cache throughout one single BFS level.

(
    graph: gh.Graph,
)

Source from the content-addressed store, hash-verified

808
809
810def cache_match(
811 graph: gh.Graph,
812) -> Callable[str, list[tuple[gm.Point, ...]]]:
813 """Cache throughout one single BFS level."""
814 cache = {}
815
816 def match_fn(name: str) -> list[tuple[gm.Point, ...]]:
817 if name in cache:
818 return cache[name]
819
820 result = list(match_all(name, graph))
821 cache[name] = result
822 return result
823
824 return match_fn
825
826
827def try_to_map(

Callers 2

match_one_theoremFunction · 0.85
match_all_theoremsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected