neurolang.datalog.instance module¶
- class neurolang.datalog.instance.FrozenInstance(elements=None)¶
Bases:
object
Methods
copy
is_empty
- copy()¶
- is_empty()¶
- class neurolang.datalog.instance.FrozenMapInstance(elements=None)¶
Bases:
FrozenInstance
,Mapping
Methods
get
(k[,d])items
()keys
()values
()as_map
as_set
copy
is_empty
- as_map()¶
- as_set()¶
- items() a set-like object providing a view on D's items ¶
- values() an object providing a view on D's values ¶
- class neurolang.datalog.instance.FrozenSetInstance(elements=None)¶
Bases:
FrozenInstance
,Set
Methods
isdisjoint
(other)Return True if two sets have a null intersection.
as_map
as_set
copy
is_empty
- as_map()¶
- as_set()¶
- class neurolang.datalog.instance.Instance(elements=None)¶
Bases:
FrozenInstance
Methods
copy
is_empty
- copy()¶
- class neurolang.datalog.instance.MapInstance(elements=None)¶
Bases:
Instance
,FrozenMapInstance
,MutableMapping
Methods
clear
()get
(k[,d])items
()keys
()pop
(k[,d])If key is not found, d is returned if given, otherwise KeyError is raised.
popitem
()as a 2-tuple; but raise KeyError if D is empty.
setdefault
(k[,d])update
([E, ]**F)If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
values
()as_map
as_set
copy
is_empty
- as_map()¶
- as_set()¶
- class neurolang.datalog.instance.SetInstance(elements=None)¶
Bases:
Instance
,FrozenSetInstance
,MutableSet
Methods
add
(value)Add an element.
clear
()This is slow (creates N new iterators!) but effective.
discard
(value)Remove an element.
isdisjoint
(other)Return True if two sets have a null intersection.
pop
()Return the popped value.
remove
(value)Remove an element.
as_map
as_set
copy
is_empty
- add(value)¶
Add an element.
- as_map()¶
- as_set()¶
- discard(value)¶
Remove an element. Do not raise an exception if absent.