Skip to content

Commit ce6d7b6

Browse files
authored
Merge pull request #147 from Jij-Inc/kory33/fix-binary-sum-typechecking
Add bugfix (unreleased) notes for binary-sum typing issue
2 parents 04b6211 + f0b90ee commit ce6d7b6

4 files changed

Lines changed: 16 additions & 0 deletions

File tree

docs/en/releases/unreleased.ipynb

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/ja/releases/unreleased.ipynb

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

markdowns/en/releases/unreleased.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ compiler = jm.Compiler.from_problem(problem, instance_data)
267267
instance = compiler.eval_problem(problem, constraint_detection=True)
268268
```
269269

270+
### Fixed a bug where the sum of binary `{0, 1}` expressions had type Binary instead of Natural
271+
272+
We fixed a bug where an expression that `sum`s another expression of binary type (`{0, 1}`) was typed as `Binary` instead of `Natural`. For example, the sum $\sum_i x_i$ of binary variables $x_0, x_1, \ldots$ can take values of $2$ or more, so the result type had to be `Natural` instead of `Binary`.
273+
270274
## Other Changes
271275

272276
- Relaxed version bounds to allow installation on any Python 3 version from Python 3.11 onwards.

markdowns/ja/releases/unreleased.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ compiler = jm.Compiler.from_problem(problem, instance_data)
260260
instance = compiler.eval_problem(problem, constraint_detection=True)
261261
```
262262

263+
### バイナリ`{0, 1}`型の式の総和が自然数型ではなくバイナリ型になっていた問題を修正
264+
265+
バイナリ型(`{0, 1}`)の式を `sum` で総和した式の型が `Natural` ではなく `Binary` になってしまっていた問題を修正しました。たとえば、バイナリ変数 $x_0, x_1, \ldots$ の総和 $\sum_i x_i$ は $0$ や $1$ だけでなく $2$ 以上の値も取りうるため、結果の型は `Binary` ではなく `Natural` であるべきです。
266+
263267
## その他の変更
264268

265269
- バージョン条件を緩和し、Python 3.11 以降の任意の Python 3 でのインストールを許容しました。

0 commit comments

Comments
 (0)