Skip to content

Commit

Permalink
Fully remove the assembled predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
cgokmen committed Mar 12, 2024
1 parent a799b95 commit c0f746e
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 53 deletions.
1 change: 0 additions & 1 deletion bddl/activity_definitions/domain_omnigibson.bddl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
(insource ?obj1 ?obj2)
(inroom ?obj1 ?obj2)
(broken ?obj1)
(assembled ?obj1)
(grasped ?obj1 ?obj2)
)
)
3 changes: 0 additions & 3 deletions bddl/bddl_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,6 @@ def check_synset_predicate_alignment(atom, syns_to_props):
if pred == "on_fire":
assert "nonSubstance" in syns_to_props[objects[0]], f"Inapplicable on_fire: {atom}"
assert "flammable" in syns_to_props[objects[0]], f"Inapplicable on_fire: {atom}"
if pred == "assembled":
assert "rigidBody" in syns_to_props[objects[0]], f"Inapplicable assembled: {atom}"
assert "assembleable" in syns_to_props[objects[0]], f"Inapplicable assembled: {atom}"
if pred == "broken":
assert "rigidBody" in syns_to_props[objects[0]], f"Inapplicable broken: {atom}"
assert "breakable" in syns_to_props[objects[0]], f"Inapplicable broken: {atom}"
Expand Down
2 changes: 1 addition & 1 deletion bddl/data_generation/get_syn_prop_annots_canonical.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"soakable": None,
"wetable": "wet",
"flammable": "on_fire",
"assembleable": "assembled",
"assembleable": None,
"heatable" : "hot",
"boilable": "boiling",
"meltable" : "melted",
Expand Down
20 changes: 0 additions & 20 deletions bddl/generated_data/synsets_to_descriptors.json
Original file line number Diff line number Diff line change
Expand Up @@ -25552,10 +25552,6 @@
]
],
"cabinet.n.01": [
[
"assembled",
"assembled"
],
[
"disinfected",
"disinfected"
Expand Down Expand Up @@ -35186,10 +35182,6 @@
]
],
"clothesline.n.01": [
[
"assembled",
"assembled"
],
[
"disinfected",
"disinfected"
Expand Down Expand Up @@ -47360,10 +47352,6 @@
]
],
"desk.n.01": [
[
"assembled",
"assembled"
],
[
"disinfected",
"disinfected"
Expand Down Expand Up @@ -127086,10 +127074,6 @@
]
],
"shelf.n.01": [
[
"assembled",
"assembled"
],
[
"disinfected",
"disinfected"
Expand Down Expand Up @@ -144292,10 +144276,6 @@
]
],
"trampoline.n.01": [
[
"assembled",
"assembled"
],
[
"disinfected",
"disinfected"
Expand Down
2 changes: 1 addition & 1 deletion bddl/knowledge_base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ def uses_physical_substance(self):
return any("physicalSubstance" in synset.property_names for synset in self.synsets)

def uses_attachment(self):
return any(pred.name in ['assembled', 'attached'] for pred in self.uses_predicates)
return any(pred.name == 'attached' for pred in self.uses_predicates)

def uses_cloth(self):
return any(pred.name in ['folded', 'draped', 'unfolded'] for pred in self.uses_predicates)
Expand Down
27 changes: 0 additions & 27 deletions bddl/trivial_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def get_predicate_class(self, predicate_name):
"draped": TrivialDrapedPredicate,
"insource": TrivialInsourcePredicate,
"broken": TrivialBrokenPredicate,
"assembled": TrivialAssembledPredicate,
"grasped": TrivialGraspedPredicate,
}
return PREDICATE_MAPPING[predicate_name]
Expand All @@ -61,7 +60,6 @@ def __init__(self):
self.real = set()
self.broken = set()
self.closed = set()
self.assembled = set()
# Binaries - populated with 2-tuples of string names
self.saturated = set()
self.covered = set()
Expand Down Expand Up @@ -92,7 +90,6 @@ def create_predicate_to_setters(self):
"on_fire": self.set_on_fire,
"empty": self.set_empty,
"broken": self.set_broken,
"assembled": self.set_assembled,
"closed": self.set_closed,
"future": self.set_future,
"real": self.set_real,
Expand Down Expand Up @@ -249,16 +246,6 @@ def set_broken(self, objs, is_broken):
def get_broken(self, objs):
return tuple(obj.name for obj in objs) in self.broken

def set_assembled(self, objs, is_assembled):
assert len(objs) == 1, f"`objs` has len other than 1: {objs}"
if is_assembled:
self.assembled.add(objs)
else:
self.assembled.discard(objs)

def get_assembled(self, objs):
return tuple(obj.name for obj in objs) in self.assembled

def set_future(self, objs, is_future):
assert len(objs) == 1, f"`objs` has len other than 1: {objs}"
if is_future:
Expand Down Expand Up @@ -458,9 +445,6 @@ def get_empty(self):
def get_broken(self):
return self.simulator.get_broken((self,))

def get_assembled(self):
return self.simulator.get_assembled((self,))

def get_future(self):
return self.simulator.get_future((self,))

Expand Down Expand Up @@ -640,17 +624,6 @@ def _sample(self, obj1, binary_state):
pass


class TrivialAssembledPredicate(UnaryAtomicFormula):
STATE_NAME = "assembled"

def _evaluate(self, obj):
print(self.STATE_NAME, obj.name, obj.get_assembled())
return obj.get_assembled()

def _sample(self, obj1, binary_state):
pass


class TrivialFuturePredicate(UnaryAtomicFormula):
STATE_NAME = "future"

Expand Down

0 comments on commit c0f746e

Please sign in to comment.