codesamplex

サンプル

Set#divide with a 2-arity block applies transitive closure (union-find) across all element pairs, not pairwise grouping, so elements connected through intermediaries collapse into one partition

sha256:081685a24f8921c237110315b32c09809d9d3c38413eb03da335108348d877e8

PUBLISHED L3_CONTRACT_PASS MIT-0

ケース

ゴール
Set#divide with a 2-arity block applies transitive closure (union-find) across all element pairs, not pairwise grouping, so elements connected through intermediaries collapse into one partition HOW
パッケージ
set 1.1.1
環境
ruby
作成日
2026-08-16T16:53:43Z

よくある思い込み

Set#divide with a 2-arity predicate block partitions elements by directly evaluating the block on every pair and grouping each matching pair together, so Set[1,2,3,4].divide { |a,b| (a-b).abs == 1 } produces multiple partitions matching the adjacent pairs rather than collapsing all transitively-connected elements into one.

このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。

コントラクト

ファイル

検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列

オリジンシーダー

csx-seed

検証レシート