Fix issue with restrict return values

Previously, if f = TruthTable, then f.restrict(...) would always return
a TruthTable. Now it is may also return a value in {0, 1}.

For example,
>>> f = TruthTable([a, b, c], "00010111")
>>> f.restrict({a: 0, b: 0, c: 1})
0