This is a wrapper for a dictionary of cells. Can be compared with another DictCell.
Unlike the other primitive structures, a DictCell cannot be coerced into something else.
| Parameters: | from_dict (dict) – Optional parameter specifying initial dictionary, where the value of each (key,value) pair must be a Cell. Defaults to an empty dictionary. |
|---|
Allows the ‘in’ operator to work for checking if a particular key (or keypath) is inside the dictionary.
| Parameters: | key_or_keypath – A single key or a path of keys in the form of a list |
|---|---|
| Returns: | bool |
Returns the value at the end of keypath (or None) keypath is a list of keys, e.g., [“key”, “subkey”, “subsubkey”]
| Parameters: | keypath (list) – A list of keys representing a path through nested dictionaries |
|---|---|
| Returns: | value associated with final key in keypath |
Whether all of self’s keys (and values) are in (and within) other’s
| Parameters: | other (DictCell) – A DictCell to check |
|---|---|
| Returns: | bool |
Whether the target of the other belief state is strictly more general than the caller belief state
| Parameters: | other (DictCell) – A DictCell to check |
|---|---|
| Returns: | bool |
Returns True if the two DictCells are unmergeable, i.e. if the two DictCells share a key, but the Cells associated with those keys are unMergeable.
| Parameters: | other (DictCell) – DictCell to check |
|---|---|
| Returns: | bool |
| Raises: | Exception |
Two DictCells are equal when they share ALL Keys, and all of their is_equal() methods return True. This ensures substructure equality.
| Parameters: | other (DictCell) – DictCell to compare |
|---|---|
| Returns: | bool |
Merges two complex structures (by recursively merging their parts). Missing-parts do not trigger contradictions.
| Parameters: | other (DictCell) – DictCell to merge |
|---|---|
| Returns: | DictCell |
| Raises: | Exception, Contradiction |