unicode-logic-kit 0.31.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- unicode_logic_kit/__init__.py +385 -0
- unicode_logic_kit/__main__.py +520 -0
- unicode_logic_kit/_deadline.py +219 -0
- unicode_logic_kit/ace/__init__.py +126 -0
- unicode_logic_kit/ace/_align.py +135 -0
- unicode_logic_kit/ace/chem_lexicon.py +128 -0
- unicode_logic_kit/ace/drs_reader.py +570 -0
- unicode_logic_kit/ace/mapping.py +666 -0
- unicode_logic_kit/ace/reverse_modal.py +138 -0
- unicode_logic_kit/ace/runner.py +551 -0
- unicode_logic_kit/ace/translate.py +452 -0
- unicode_logic_kit/ace/verbalize.py +1070 -0
- unicode_logic_kit/api.py +1284 -0
- unicode_logic_kit/atp/__init__.py +177 -0
- unicode_logic_kit/atp/_ascii_names.py +113 -0
- unicode_logic_kit/atp/_html.py +72 -0
- unicode_logic_kit/atp/_substructural_input.py +228 -0
- unicode_logic_kit/atp/_tff_problem.py +715 -0
- unicode_logic_kit/atp/_tptp_problem.py +1111 -0
- unicode_logic_kit/atp/_writer_support.py +289 -0
- unicode_logic_kit/atp/clingo_backend.py +1180 -0
- unicode_logic_kit/atp/cvc5_backend.py +1385 -0
- unicode_logic_kit/atp/eprover_backend.py +732 -0
- unicode_logic_kit/atp/finite_domain.py +1055 -0
- unicode_logic_kit/atp/fitch.py +1547 -0
- unicode_logic_kit/atp/fitch_search.py +551 -0
- unicode_logic_kit/atp/hets_backend.py +339 -0
- unicode_logic_kit/atp/hybrid_down.py +120 -0
- unicode_logic_kit/atp/incremental.py +250 -0
- unicode_logic_kit/atp/kripke_enum.py +741 -0
- unicode_logic_kit/atp/lambek.py +436 -0
- unicode_logic_kit/atp/leo3_backend.py +332 -0
- unicode_logic_kit/atp/linear.py +738 -0
- unicode_logic_kit/atp/lj.py +705 -0
- unicode_logic_kit/atp/logic_backends.py +566 -0
- unicode_logic_kit/atp/ltl_tableau.py +1084 -0
- unicode_logic_kit/atp/minizinc_backend.py +1402 -0
- unicode_logic_kit/atp/modal_tableau.py +1382 -0
- unicode_logic_kit/atp/nanocop_backend.py +410 -0
- unicode_logic_kit/atp/portfolio.py +489 -0
- unicode_logic_kit/atp/protocol.py +1803 -0
- unicode_logic_kit/atp/prover9_entailment.py +1153 -0
- unicode_logic_kit/atp/resolution.py +1376 -0
- unicode_logic_kit/atp/resolution_check.py +1114 -0
- unicode_logic_kit/atp/sequent.py +1050 -0
- unicode_logic_kit/atp/tableau.py +921 -0
- unicode_logic_kit/atp/tableau_check.py +543 -0
- unicode_logic_kit/atp/tptp_ncl.py +811 -0
- unicode_logic_kit/atp/tptp_tff.py +1546 -0
- unicode_logic_kit/atp/tstp.py +1333 -0
- unicode_logic_kit/atp/tstp_check.py +1096 -0
- unicode_logic_kit/atp/twee_backend.py +236 -0
- unicode_logic_kit/atp/twee_check.py +711 -0
- unicode_logic_kit/atp/twee_entailment.py +953 -0
- unicode_logic_kit/atp/vampire_entailment.py +540 -0
- unicode_logic_kit/atp/z3_arith.py +470 -0
- unicode_logic_kit/atp/z3_equivalence.py +36 -0
- unicode_logic_kit/atp/z3_fuzzy.py +362 -0
- unicode_logic_kit/atp/z3_input.py +500 -0
- unicode_logic_kit/atp/z3_models.py +208 -0
- unicode_logic_kit/chem/__init__.py +88 -0
- unicode_logic_kit/chem/_naming.py +284 -0
- unicode_logic_kit/chem/cache.py +185 -0
- unicode_logic_kit/chem/interop.py +244 -0
- unicode_logic_kit/chem/mol.py +525 -0
- unicode_logic_kit/chem/signature.py +112 -0
- unicode_logic_kit/comorphism.py +497 -0
- unicode_logic_kit/dl/__init__.py +384 -0
- unicode_logic_kit/dl/classification.py +227 -0
- unicode_logic_kit/dl/concepts.py +632 -0
- unicode_logic_kit/dl/datatypes.py +818 -0
- unicode_logic_kit/dl/owl_functional.py +2433 -0
- unicode_logic_kit/dl/owl_manchester.py +1637 -0
- unicode_logic_kit/dl/owl_reasoner.py +790 -0
- unicode_logic_kit/dl/parser.py +391 -0
- unicode_logic_kit/dl/tableau.py +4048 -0
- unicode_logic_kit/dl/translate.py +2704 -0
- unicode_logic_kit/drt/__init__.py +94 -0
- unicode_logic_kit/drt/export.py +179 -0
- unicode_logic_kit/drt/nodes.py +506 -0
- unicode_logic_kit/drt/parser.py +965 -0
- unicode_logic_kit/drt/resolve.py +195 -0
- unicode_logic_kit/drt/reverse.py +175 -0
- unicode_logic_kit/eval/__init__.py +106 -0
- unicode_logic_kit/eval/batch.py +382 -0
- unicode_logic_kit/eval/canonical.py +663 -0
- unicode_logic_kit/eval/chem_batch.py +606 -0
- unicode_logic_kit/eval/converses.py +200 -0
- unicode_logic_kit/eval/datasets/__init__.py +136 -0
- unicode_logic_kit/eval/datasets/_base.py +263 -0
- unicode_logic_kit/eval/datasets/_proofwriter_proof.py +422 -0
- unicode_logic_kit/eval/datasets/c3po.py +678 -0
- unicode_logic_kit/eval/datasets/folio.py +158 -0
- unicode_logic_kit/eval/datasets/fracas.py +418 -0
- unicode_logic_kit/eval/datasets/groves.py +191 -0
- unicode_logic_kit/eval/datasets/logicbench.py +467 -0
- unicode_logic_kit/eval/datasets/logicnli.py +303 -0
- unicode_logic_kit/eval/datasets/malls.py +133 -0
- unicode_logic_kit/eval/datasets/pfolio.py +594 -0
- unicode_logic_kit/eval/datasets/pmb.py +242 -0
- unicode_logic_kit/eval/datasets/prontoqa.py +611 -0
- unicode_logic_kit/eval/datasets/proofwriter.py +1431 -0
- unicode_logic_kit/eval/datasets/proverqa.py +674 -0
- unicode_logic_kit/eval/datasets/willow.py +478 -0
- unicode_logic_kit/eval/equivalence.py +466 -0
- unicode_logic_kit/eval/exercise_gen.py +533 -0
- unicode_logic_kit/eval/explain.py +791 -0
- unicode_logic_kit/eval/generality.py +750 -0
- unicode_logic_kit/eval/metric_hf.py +458 -0
- unicode_logic_kit/eval/predicate_match.py +343 -0
- unicode_logic_kit/eval/theory_check.py +1170 -0
- unicode_logic_kit/eval/validate.py +306 -0
- unicode_logic_kit/fol/__init__.py +177 -0
- unicode_logic_kit/fol/_atom_keys.py +510 -0
- unicode_logic_kit/fol/_fol_nodes.py +3586 -0
- unicode_logic_kit/fol/_free_parameters.py +105 -0
- unicode_logic_kit/fol/_ho_nodes.py +448 -0
- unicode_logic_kit/fol/_hybrid_nodes.py +308 -0
- unicode_logic_kit/fol/_identifiers.py +1091 -0
- unicode_logic_kit/fol/_lambek_nodes.py +112 -0
- unicode_logic_kit/fol/_linear_nodes.py +352 -0
- unicode_logic_kit/fol/_modal_nodes.py +1467 -0
- unicode_logic_kit/fol/_msfl_nodes.py +2196 -0
- unicode_logic_kit/fol/_numeral_symbols.py +231 -0
- unicode_logic_kit/fol/_so_nodes.py +200 -0
- unicode_logic_kit/fol/_symbol_names.py +81 -0
- unicode_logic_kit/fol/_team_nodes.py +181 -0
- unicode_logic_kit/fol/_tptp_symbols.py +551 -0
- unicode_logic_kit/fol/_truth_constants.py +117 -0
- unicode_logic_kit/fol/casl_export.py +1135 -0
- unicode_logic_kit/fol/casl_import.py +929 -0
- unicode_logic_kit/fol/derivation.py +367 -0
- unicode_logic_kit/fol/dialect_detect.py +70 -0
- unicode_logic_kit/fol/dialect_repair.py +537 -0
- unicode_logic_kit/fol/frames.py +637 -0
- unicode_logic_kit/fol/grammars/terminals.lark +31 -0
- unicode_logic_kit/fol/lambda_tools.py +297 -0
- unicode_logic_kit/fol/latex_input.py +429 -0
- unicode_logic_kit/fol/modal_translation.py +944 -0
- unicode_logic_kit/fol/msflparser.py +1033 -0
- unicode_logic_kit/fol/naming.py +422 -0
- unicode_logic_kit/fol/nodes.py +241 -0
- unicode_logic_kit/fol/normalforms.py +492 -0
- unicode_logic_kit/fol/pal.py +287 -0
- unicode_logic_kit/fol/prolog_export.py +566 -0
- unicode_logic_kit/fol/prolog_input.py +505 -0
- unicode_logic_kit/fol/prover9_input.py +1325 -0
- unicode_logic_kit/fol/qml.py +1760 -0
- unicode_logic_kit/fol/qmltp_input.py +525 -0
- unicode_logic_kit/fol/sanitize.py +221 -0
- unicode_logic_kit/fol/serialize.py +79 -0
- unicode_logic_kit/fol/signature.py +1290 -0
- unicode_logic_kit/fol/simplify_check.py +544 -0
- unicode_logic_kit/fol/spans.py +594 -0
- unicode_logic_kit/fol/tptp_input.py +1503 -0
- unicode_logic_kit/fol/tptp_repair.py +941 -0
- unicode_logic_kit/fol/unification.py +157 -0
- unicode_logic_kit/fol/verbalize.py +263 -0
- unicode_logic_kit/hets/__init__.py +163 -0
- unicode_logic_kit/hets/bridge.py +142 -0
- unicode_logic_kit/hets/client.py +748 -0
- unicode_logic_kit/hets/docker.py +420 -0
- unicode_logic_kit/hets/dol.py +712 -0
- unicode_logic_kit/hets/haskell_json.py +355 -0
- unicode_logic_kit/hets/owl_backend.py +794 -0
- unicode_logic_kit/hets/owl_cli.py +598 -0
- unicode_logic_kit/hets/symbols.py +512 -0
- unicode_logic_kit/hol/__init__.py +140 -0
- unicode_logic_kit/hol/_ho_common.py +323 -0
- unicode_logic_kit/hol/_isabelle_binders.py +125 -0
- unicode_logic_kit/hol/classical.py +812 -0
- unicode_logic_kit/hol/deepshallow/__init__.py +45 -0
- unicode_logic_kit/hol/deepshallow/_common.py +177 -0
- unicode_logic_kit/hol/deepshallow/conditional.py +225 -0
- unicode_logic_kit/hol/deepshallow/intuitionistic.py +181 -0
- unicode_logic_kit/hol/deepshallow/modal.py +217 -0
- unicode_logic_kit/hol/deepshallow/qml.py +406 -0
- unicode_logic_kit/hol/deepshallow/relevant.py +206 -0
- unicode_logic_kit/hol/free.py +753 -0
- unicode_logic_kit/hol/goedel.py +336 -0
- unicode_logic_kit/hol/ho_modal.py +1743 -0
- unicode_logic_kit/hol/intuitionistic.py +403 -0
- unicode_logic_kit/hol/isabelle_conditional.py +593 -0
- unicode_logic_kit/hol/isabelle_modal.py +1908 -0
- unicode_logic_kit/hol/isabelle_relevant.py +412 -0
- unicode_logic_kit/hol/isabelle_runner.py +1147 -0
- unicode_logic_kit/hol/isabelle_substructural.py +884 -0
- unicode_logic_kit/hol/lean.py +1018 -0
- unicode_logic_kit/hol/manyvalued.py +921 -0
- unicode_logic_kit/hol/secondorder.py +687 -0
- unicode_logic_kit/hol/thf_modal.py +941 -0
- unicode_logic_kit/hol/thirdorder.py +397 -0
- unicode_logic_kit/ilp/__init__.py +89 -0
- unicode_logic_kit/ilp/readback.py +389 -0
- unicode_logic_kit/ilp/separation.py +153 -0
- unicode_logic_kit/ilp/task.py +730 -0
- unicode_logic_kit/logic.py +163 -0
- unicode_logic_kit/mcp/__init__.py +28 -0
- unicode_logic_kit/mcp/__main__.py +5 -0
- unicode_logic_kit/mcp/chem_tools.py +1031 -0
- unicode_logic_kit/mcp/server.py +2453 -0
- unicode_logic_kit/mcp/syntax_spec.py +681 -0
- unicode_logic_kit/prob/__init__.py +53 -0
- unicode_logic_kit/prob/_bdd.py +225 -0
- unicode_logic_kit/prob/_column_gen.py +668 -0
- unicode_logic_kit/prob/distribution.py +686 -0
- unicode_logic_kit/prob/nilsson.py +470 -0
- unicode_logic_kit/py.typed +0 -0
- unicode_logic_kit/semantics/__init__.py +137 -0
- unicode_logic_kit/semantics/_modal_reject.py +156 -0
- unicode_logic_kit/semantics/action_models.py +466 -0
- unicode_logic_kit/semantics/asp_models.py +1200 -0
- unicode_logic_kit/semantics/conditional.py +580 -0
- unicode_logic_kit/semantics/dynamic_epistemic.py +95 -0
- unicode_logic_kit/semantics/free_logic.py +913 -0
- unicode_logic_kit/semantics/fuzzy.py +384 -0
- unicode_logic_kit/semantics/fuzzy_kripke.py +442 -0
- unicode_logic_kit/semantics/intuitionistic.py +581 -0
- unicode_logic_kit/semantics/kripke.py +1139 -0
- unicode_logic_kit/semantics/manyvalued.py +580 -0
- unicode_logic_kit/semantics/matrix.py +342 -0
- unicode_logic_kit/semantics/model_eval.py +1135 -0
- unicode_logic_kit/semantics/modelfinder.py +1036 -0
- unicode_logic_kit/semantics/nonmonotonic.py +372 -0
- unicode_logic_kit/semantics/relevant.py +331 -0
- unicode_logic_kit/semantics/secondorder.py +657 -0
- unicode_logic_kit/semantics/structures.py +352 -0
- unicode_logic_kit/semantics/tarski.py +975 -0
- unicode_logic_kit/semantics/team.py +315 -0
- unicode_logic_kit/semantics/team_translation.py +416 -0
- unicode_logic_kit/semantics/thirdorder.py +358 -0
- unicode_logic_kit/semantics/tnorm.py +85 -0
- unicode_logic_kit/semantics/truthtable.py +201 -0
- unicode_logic_kit-0.31.0.dist-info/METADATA +333 -0
- unicode_logic_kit-0.31.0.dist-info/RECORD +237 -0
- unicode_logic_kit-0.31.0.dist-info/WHEEL +4 -0
- unicode_logic_kit-0.31.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"""Hets comorphisms as dynamic edges in the kit's translation registry.
|
|
2
|
+
|
|
3
|
+
The kit's :mod:`unicode_logic_kit.comorphism` registry is the OFFLINE core:
|
|
4
|
+
native, AST-to-AST edges (modal→fol, ALC→modal-K, …) that work with no
|
|
5
|
+
external process. This module adds the ONLINE extension: every comorphism a
|
|
6
|
+
running hets-server offers for CASL input (``GET /translations``) becomes a
|
|
7
|
+
registered :class:`~unicode_logic_kit.comorphism.Comorphism` edge named
|
|
8
|
+
``hets:<Name>`` — e.g. ``hets:CASL2SoftFOL``, or the composed
|
|
9
|
+
``hets:CASL2PCFOL:CASL2SoftFOL`` (Hets composes with ``:``).
|
|
10
|
+
|
|
11
|
+
Edge typing — TEXT to TEXT, deliberately
|
|
12
|
+
----------------------------------------
|
|
13
|
+
Native kit edges map kit ASTs. The Hets edges map **CASL specification
|
|
14
|
+
text** (as produced by :func:`unicode_logic_kit.fol.casl_export.to_casl_spec`)
|
|
15
|
+
to the **translated theory text** Hets renders (``GET
|
|
16
|
+
/theory?translation=<Name>&format=dol`` — e.g. SoftFOL/DFG syntax for
|
|
17
|
+
``CASL2SoftFOL``). The kit has no AST for SoftFOL, THF-as-Hets-prints-it,
|
|
18
|
+
etc., and pretending otherwise would mean parsing every target language.
|
|
19
|
+
The registry contract explicitly allows this ("the term type is whatever
|
|
20
|
+
the source logic's AST is"): for the source label ``"casl"`` that term type
|
|
21
|
+
is ``str``.
|
|
22
|
+
|
|
23
|
+
Edge labels: every edge runs from ``"casl"`` to the UNIQUE target label
|
|
24
|
+
``"hets:<Name>"``. Uniqueness is deliberate: deriving shared target labels
|
|
25
|
+
by parsing comorphism names (splitting on ``"2"``) would mis-label
|
|
26
|
+
``CASL2SoftFOLInduction`` and friends, and identical target labels would
|
|
27
|
+
invite BFS compositions through edges that are not actually composable.
|
|
28
|
+
Composition on the Hets side is already expressed by Hets itself via the
|
|
29
|
+
``:``-composed names in the discovery list.
|
|
30
|
+
|
|
31
|
+
Lifetime: an edge's ``apply`` closure talks to the server it was discovered
|
|
32
|
+
from on every call (fresh upload → ``/theory``). If that server goes away,
|
|
33
|
+
``apply`` raises ``RuntimeError`` — re-run :func:`register_hets_comorphisms`
|
|
34
|
+
against a live server to refresh. A refresh REPLACES the whole Hets edge
|
|
35
|
+
set: edges the new server still offers are re-bound to the new URL, and
|
|
36
|
+
edges it no longer offers are UNREGISTERED (via
|
|
37
|
+
``ComorphismRegistry.unregister``) — never left behind as stale closures
|
|
38
|
+
pointing at the old server (review-hardened).
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
from typing import List, Optional, Set
|
|
42
|
+
|
|
43
|
+
from ..comorphism import Comorphism, DEFAULT_REGISTRY, register_comorphism
|
|
44
|
+
from .client import HetsClient
|
|
45
|
+
from .docker import discover_hets_url
|
|
46
|
+
|
|
47
|
+
__all__ = ["register_hets_comorphisms", "HETS_EDGE_PREFIX"]
|
|
48
|
+
|
|
49
|
+
#: Prefix of every dynamically registered Hets edge name/target label.
|
|
50
|
+
HETS_EDGE_PREFIX = "hets:"
|
|
51
|
+
|
|
52
|
+
#: Edge names registered by the LAST register_hets_comorphisms call — the
|
|
53
|
+
#: set a refresh diffs against to unregister edges the new server dropped.
|
|
54
|
+
_CURRENTLY_REGISTERED: Set[str] = set()
|
|
55
|
+
|
|
56
|
+
#: Minimal CASL probe used only to make ``GET /translations`` answer for the
|
|
57
|
+
#: CASL logic (the endpoint is per-IRI, so SOME CASL file must exist first).
|
|
58
|
+
_PROBE_SPEC = """spec TranslationsProbe =
|
|
59
|
+
sort Thing
|
|
60
|
+
pred P : Thing
|
|
61
|
+
. forall x : Thing . P(x)
|
|
62
|
+
end
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _make_edge(name: str, url: str, timeout: float) -> Comorphism:
|
|
67
|
+
"""One ``casl -> hets:<name>`` edge whose apply calls the live server."""
|
|
68
|
+
|
|
69
|
+
def apply(spec_text: str) -> str:
|
|
70
|
+
client = HetsClient(url, timeout=timeout)
|
|
71
|
+
iri = client.upload(spec_text, "kit_translate.casl")
|
|
72
|
+
# /theory with a translation REQUIRES an explicit node (verified
|
|
73
|
+
# live: HTTP 500 "development graph node missing" otherwise), so
|
|
74
|
+
# resolve it from the uploaded file's development graph. One node
|
|
75
|
+
# is the shape to_casl_spec emits; anything else is ambiguous and
|
|
76
|
+
# refused rather than guessed.
|
|
77
|
+
dg_nodes = (client.dg(iri).get("DGraph") or {}).get("DGNode") or []
|
|
78
|
+
names = [n.get("name") for n in dg_nodes]
|
|
79
|
+
if len(names) != 1:
|
|
80
|
+
raise RuntimeError(
|
|
81
|
+
f"hets: comorphism edge {name!r} needs exactly one "
|
|
82
|
+
f"development-graph node to translate, found {names!r} — "
|
|
83
|
+
"translate single-spec CASL text (as to_casl_spec emits).")
|
|
84
|
+
return client.theory(iri, node=names[0], translation=name)
|
|
85
|
+
|
|
86
|
+
return Comorphism(
|
|
87
|
+
name=f"{HETS_EDGE_PREFIX}{name}",
|
|
88
|
+
source="casl",
|
|
89
|
+
target=f"{HETS_EDGE_PREFIX}{name}",
|
|
90
|
+
apply=apply,
|
|
91
|
+
lossy=False,
|
|
92
|
+
# UNDECLARED on purpose, which is what ``None`` means (see
|
|
93
|
+
# comorphism.GUARANTEES): what a Hets comorphism preserves is a
|
|
94
|
+
# property of THAT server's translation, and this kit has not
|
|
95
|
+
# verified it. Claiming "faithful" because Hets' own
|
|
96
|
+
# documentation says so would put a promise in the registry that
|
|
97
|
+
# nothing here checks, and weakest_guarantee would then hand it on
|
|
98
|
+
# to every composed path. A path through one of these edges reports
|
|
99
|
+
# guarantee=None, i.e. "ask the server's documentation".
|
|
100
|
+
guarantee=None,
|
|
101
|
+
note=(f"Hets comorphism {name} on a running hets-server ({url}); "
|
|
102
|
+
"input: CASL spec text (to_casl_spec), output: translated "
|
|
103
|
+
"theory text as Hets renders it (format=dol). What it "
|
|
104
|
+
"preserves is undeclared: this kit does not verify the "
|
|
105
|
+
"server's comorphisms."),
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def register_hets_comorphisms(*, url: Optional[str] = None,
|
|
110
|
+
timeout: float = 60.0) -> List[str]:
|
|
111
|
+
"""Discover a hets-server and register its CASL comorphisms as edges.
|
|
112
|
+
|
|
113
|
+
``url`` skips discovery (else ``$UFK_HETS_URL`` → ``localhost:8000``,
|
|
114
|
+
raising ``BackendUnavailable`` when nothing answers — never a silent
|
|
115
|
+
no-op). Returns the registered edge names, sorted. Idempotent AND
|
|
116
|
+
complete: re-registration rebinds every edge the new server offers
|
|
117
|
+
(``replace=True``) and UNREGISTERS every previously-registered Hets
|
|
118
|
+
edge the new server does not offer — the registry's Hets edge set
|
|
119
|
+
always mirrors exactly one server.
|
|
120
|
+
"""
|
|
121
|
+
global _CURRENTLY_REGISTERED
|
|
122
|
+
if url is None:
|
|
123
|
+
url, _ = discover_hets_url()
|
|
124
|
+
client = HetsClient(url, timeout=timeout)
|
|
125
|
+
iri = client.upload(_PROBE_SPEC, "kit_translations_probe.casl")
|
|
126
|
+
# translations() drops Hets' identity (empty-<li>) entry, so no edge
|
|
127
|
+
# named bare "hets:" is registered any more and no apply ever sends
|
|
128
|
+
# "translation=" to /theory. A refresh against a server that still
|
|
129
|
+
# reports that entry therefore UNREGISTERS the stale "hets:" edge via
|
|
130
|
+
# the _CURRENTLY_REGISTERED diff below. It also raises
|
|
131
|
+
# HetsNoTranslationsError rather than registering nothing at all, which
|
|
132
|
+
# matches this function's "never a silent no-op" contract.
|
|
133
|
+
names = client.translations(iri)
|
|
134
|
+
|
|
135
|
+
registered = []
|
|
136
|
+
for name in sorted(set(names)):
|
|
137
|
+
register_comorphism(_make_edge(name, url, timeout), replace=True)
|
|
138
|
+
registered.append(f"{HETS_EDGE_PREFIX}{name}")
|
|
139
|
+
for stale in _CURRENTLY_REGISTERED - set(registered):
|
|
140
|
+
DEFAULT_REGISTRY.unregister(stale)
|
|
141
|
+
_CURRENTLY_REGISTERED = set(registered)
|
|
142
|
+
return registered
|