An exact whole power with a huge exponent hangs evaluation: 2^(10^9), 2^(3^20)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 32/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 活発
- 技術スタック
- csharp
- 領域
- performance
調査の方向性
Start by reproducing the two expressions through ToEntity().Evaled and trace the Number.Pow/BinaryIntPow path described in the issue. Review the quantifier witness-search path and related issue #1338, then establish the chosen behavior for oversized exact powers and confirm that witness searches remain bounded without silently losing exactness.
索引モデルが issue の本文から書いたものです。
説明
"2^(10^9)".ToEntity().Evaled and "2^(3^20)".ToEntity().Evaled do not return (killed at 60 s each; 2^(3^12) returns in 1 s). The result of the first is a 10⁹-bit integer (125 MB) and of the second a 3.5·10⁹-bit one; Number.Pow's BinaryIntPow builds them by squaring in EInteger, and the last squarings are Toom-4 multiplications of numbers hundreds of megabytes long. Measured on 8fcfaf42 (a branch of 345914f6); the code path is unchanged since long before.
Found through a quantifier: forall n in ZZ* : 3^(n + 1) divides 2^(3^n) + 1 (Sullivan and Mackey's Prob 5.7.13) hangs because a witness search evaluates the body at n = 20 or so, where 2^(3^n) is the second number above. Any consumer that evaluates a tower at a large argument hits the same.
What the answer should be is the decision to make, and it belongs with #1338's numerics: an exact power whose result would exceed some size — say 2²⁴ bits, which is 2 MB and a fraction of a second — is either (a) left as written (2^(10^9) evaluates to itself, the way an unsolved statement stays a statement), or (b) refused with an exception naming the limit, or (c) evaluated approximately as Real at the working precision, which is what a decimal calculator does and loses exactness silently. (a) is the honest one under not answering is legitimate; answering wrongly is not, and it composes: a witness search that gets an unevaluated power back moves on. Until then, a quantifier's witness search should skip a sample it cannot evaluate in bounded time, which is the narrower fix I would take first.
Part of #1409.
🤖 Generated with Claude Code
- 主要言語
- C#
- スター
- 831
- フォーク
- 79
- 平均マージ
- 2時間 22分
- マージ済み PR(30日)
- 507
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ASC-Community/AngouriMath のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
ASC-Community/AngouriMath#1807 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
ASC-Community/AngouriMath#1692 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
ASC-Community/AngouriMath#1690 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
ASC-Community/AngouriMath#1689 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
ASC-Community/AngouriMath#1684 ·
メンテナーはふだん 1 日以内に返信
ASC-Community/AngouriMath の issue をすべて見る
似ている issue
-
area:jobads-cv BE mvp P2
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
klasolsson81/jobbliggaren#2099 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
0 - Backlog Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
BrighterCommand/Brighter#4581 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
Esri/calcite-dotnet-toolkit#30 · リアクション 1 件 ·
-
kind:docs simplification size:S status:todo
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
elsa-workflows/elsa-foundation#2604 ·
メンテナーはふだん 1 日以内に返信