Skip to content

Commit a5cb50f

Browse files
committed
default NamedTuple arguments
1 parent b070de9 commit a5cb50f

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

aiger/aig.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ def _is_const_true(node):
6767

6868

6969
class AIG(NamedTuple):
70-
inputs: FrozenSet[str] # TODO: use internal names to make relabels fast.
71-
node_map: FrozenSet[Tuple[str, Node]]
72-
latch_map: FrozenSet[Tuple[str, Node]]
73-
latch2init: FrozenSet[Tuple[str, Node]]
74-
comments: Tuple[str]
70+
inputs: FrozenSet[str] = frozenset()
71+
node_map: FrozenSet[Tuple[str, Node]] = frozenset()
72+
latch_map: FrozenSet[Tuple[str, Node]] = frozenset()
73+
latch2init: FrozenSet[Tuple[str, Node]] = frozenset()
74+
comments: Tuple[str] = ()
7575

7676
def __repr__(self):
7777
return repr(self._to_aag())

aiger/common.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ def and_gate(inputs, output=None):
3232

3333
return aig.AIG(
3434
inputs=frozenset(inputs),
35-
latch_map=frozenset(),
36-
latch2init=frozenset(),
3735
node_map=frozenset(((output, _map_tree(inputs, f=_and)), )),
3836
comments=(' and '.join(inputs), ))
3937

@@ -61,8 +59,6 @@ def parity_gate(inputs, output=None):
6159

6260
return aig.AIG(
6361
inputs=frozenset(inputs),
64-
latch_map=frozenset(),
65-
latch2init=frozenset(),
6662
node_map=frozenset(((output, _map_tree(inputs, f=_xor)), )),
6763
comments=(' xor '.join(inputs), ))
6864

@@ -73,14 +69,12 @@ def identity(inputs, outputs=None):
7369

7470
return aig.AIG(
7571
inputs=frozenset(inputs),
76-
latch_map=frozenset(),
77-
latch2init=frozenset(),
7872
node_map=frozenset(zip(outputs, map(aig.Input, inputs))),
7973
comments=('identity', ))
8074

8175

8276
def empty():
83-
return identity([])
77+
return aig.AIG()
8478

8579

8680
def _inverted_input(name):
@@ -95,8 +89,6 @@ def bit_flipper(inputs, outputs=None):
9589

9690
return aig.AIG(
9791
inputs=frozenset(inputs),
98-
latch_map=frozenset(),
99-
latch2init=frozenset(),
10092
node_map=frozenset(zip(outputs, map(_inverted_input, inputs))),
10193
comments=('~', ))
10294

@@ -107,19 +99,13 @@ def _const(val):
10799

108100
def source(outputs):
109101
return aig.AIG(
110-
inputs=frozenset(),
111-
latch_map=frozenset(),
112-
latch2init=frozenset(),
113102
node_map=frozenset((k, _const(v)) for k, v in outputs.items()),
114103
comments=('source', ))
115104

116105

117106
def sink(inputs):
118107
return aig.AIG(
119108
inputs=frozenset(inputs),
120-
latch_map=frozenset(),
121-
latch2init=frozenset(),
122-
node_map=frozenset(),
123109
comments=('sink', ))
124110

125111

@@ -132,8 +118,6 @@ def tee_output(name, renames):
132118

133119
return aig.AIG(
134120
inputs=frozenset(outputs),
135-
latch_map=frozenset(),
136-
latch2init=frozenset(),
137121
node_map=frozenset.union(*starmap(tee_output, outputs.items())),
138122
comments=('T', ))
139123

0 commit comments

Comments
 (0)