feat(spatial): 诱饵隐藏家族 area.sup2d / dof.c6d,与新的 unknown 语义对齐
单调规则之后,隐藏家族变成"永远 unknown",于是"看到隐藏就弃权"成了完美答案, 反而不区分任何能力。新增两个族:诱饵块 H 自己藏在视野外、悬挂在地面上而从不悬挂 在目标上,可见结构仍能证明目标成立 —— 同族内因此既有可判也有不可判。 同时把 check_insufficient 改到新语义:unknown 不再意味着"手上那个全状态给出相反 答案",而是"观测没有裁决它且确有内容被隐藏"。
This commit is contained in:
1 parent
813be2906b
commit
c3748c36c7
2 files changed
+46
-11
No files matched your search
+30
-4
@@ -31,12 +31,14 @@ FAMILIES = {
|
||||
"area.sup2h": {"domain": "stability", "n_blocks": 2, "hidden": 1},
|
||||
"area.free": {"domain": "stability", "n_blocks": 2, "hidden": 0, "free": 1},
|
||||
"area.sup3h": {"domain": "stability", "n_blocks": 3, "hidden": 1},
|
||||
"area.sup2d": {"domain": "stability", "n_blocks": 2, "hidden": 0, "notch": 1},
|
||||
"dof.c6": {"domain": "freedom", "n_cons": 6, "hidden": 0},
|
||||
"dof.c6r": {"domain": "freedom", "n_cons": 7, "hidden": 0},
|
||||
"dof.c6h": {"domain": "freedom", "n_cons": 6, "hidden": 1},
|
||||
# the pure sub-skill: no intervention at all, so the answer is exactly "are
|
||||
# all six axes covered". If this family cannot be learned, the edit families
|
||||
# are not the problem -- the set readout is.
|
||||
"dof.c6d": {"domain": "freedom", "n_cons": 6, "hidden": 0, "notch": 1},
|
||||
"dof.set": {"domain": "freedom", "n_cons": 6, "hidden": 0, "no_edit": 1},
|
||||
}
|
||||
|
||||
@@ -127,7 +129,7 @@ def _build_connection(rng, n_paths: int, hidden: int):
|
||||
# stability: stacked blocks, optional hidden pedestal
|
||||
|
||||
|
||||
def _build_stability(rng, n_blocks: int, hidden: int, free: int = 0):
|
||||
def _build_stability(rng, n_blocks: int, hidden: int, free: int = 0, notch: int = 0):
|
||||
if free:
|
||||
# the minimal pair against area.sup2h: here T has exactly one contact and
|
||||
# that contact leads to a block which itself hangs in the air. Nothing
|
||||
@@ -178,6 +180,17 @@ def _build_stability(rng, n_blocks: int, hidden: int, free: int = 0):
|
||||
vis_edges.discard(e.eid)
|
||||
vis_ents.discard("P")
|
||||
|
||||
if notch:
|
||||
# a decoy that is *itself* withheld, hanging off the ground and never off
|
||||
# the target: the visible structure still proves the target stands. This
|
||||
# is the case that makes "something is hidden" and "I cannot tell" two
|
||||
# different facts inside one family. Without it every hidden family is
|
||||
# all-unknown and keying on the hidden flag is a perfect answer.
|
||||
ents.append(Entity("H", "block", attrs={"box": [80, 70, -16, 100, 90, 0]}))
|
||||
edges.append(Edge("kHG", "contact", "H", "G"))
|
||||
vis_edges.discard("kHG")
|
||||
vis_ents.discard("H")
|
||||
|
||||
# the target is T on purpose: it survives every legal edit except the one
|
||||
# that removes P, so "removed something" no longer implies "answer false"
|
||||
query = Query(kind="stability", a="T")
|
||||
@@ -188,6 +201,11 @@ def _build_stability(rng, n_blocks: int, hidden: int, free: int = 0):
|
||||
query.edit = {"op": "remove_entity", "entity": "P"} # collapses
|
||||
elif r < 0.75:
|
||||
query.edit = {"op": "remove_entity", "entity": harmless} # no effect
|
||||
elif notch:
|
||||
# removing P takes the only visible proof away; the hidden decoy cannot
|
||||
# stand in for it, so the verdict becomes unknown rather than false
|
||||
if r < 0.5:
|
||||
query.edit = {"op": "remove_entity", "entity": "P"}
|
||||
return ents, edges, query, vis_edges, vis_ents, layers, ["front", "iso"], {"length": "mm", "per_unit": 1}
|
||||
|
||||
|
||||
@@ -195,7 +213,7 @@ def _build_stability(rng, n_blocks: int, hidden: int, free: int = 0):
|
||||
# freedom: constraint sets, optionally redundant on one axis
|
||||
|
||||
|
||||
def _build_freedom(rng, n_cons: int, hidden: int, no_edit: int = 0):
|
||||
def _build_freedom(rng, n_cons: int, hidden: int, no_edit: int = 0, notch: int = 0):
|
||||
# the axes are drawn, so a family spans both verdicts with the same entity
|
||||
# count: six mates that cover every axis lock the part, six that cover five
|
||||
# do not, and the difference is invisible from the shape of the scene
|
||||
@@ -223,6 +241,14 @@ def _build_freedom(rng, n_cons: int, hidden: int, no_edit: int = 0):
|
||||
if hidden:
|
||||
visible.discard("k5") # one mate lives in the part definition
|
||||
vis_ents.discard("F5")
|
||||
if notch:
|
||||
# a redundant mate kept outside the view: it dangles on the part, but the
|
||||
# visible mates already cover every axis, so the proof stands
|
||||
ents.append(Entity(f"F{n_cons}", "ground", attrs={"x": 0, "y": 0, "z": 0}))
|
||||
edges.append(Edge(f"k{n_cons}", "constraint", "P", f"F{n_cons}",
|
||||
attrs={"axis": rng.choice(list(DOF_AXES))}))
|
||||
visible.discard(f"k{n_cons}")
|
||||
vis_ents.discard(f"F{n_cons}")
|
||||
|
||||
query = Query(kind="freedom", a="P")
|
||||
if no_edit:
|
||||
@@ -238,9 +264,9 @@ def _build_freedom(rng, n_cons: int, hidden: int, no_edit: int = 0):
|
||||
_BUILDERS = {
|
||||
"connection": lambda rng, spec: _build_connection(rng, spec["n_paths"], spec["hidden"]),
|
||||
"stability": lambda rng, spec: _build_stability(rng, spec["n_blocks"], spec["hidden"],
|
||||
spec.get("free", 0)),
|
||||
spec.get("free", 0), spec.get("notch", 0)),
|
||||
"freedom": lambda rng, spec: _build_freedom(rng, spec["n_cons"], spec["hidden"],
|
||||
spec.get("no_edit", 0)),
|
||||
spec.get("no_edit", 0), spec.get("notch", 0)),
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user