id stringlengths 51 121 | text stringlengths 95 248k | task stringclasses 7
values | phase stringclasses 1
value | generator stringclasses 5
values | group_id stringlengths 16 16 | prompt_chars int64 0 0 | n_tokens int64 39 120k | text_sha256 stringlengths 64 64 | meta stringlengths 86 145 |
|---|---|---|---|---|---|---|---|---|---|
c/01-foundations.mathematics.asymptotic-analysis/focused-sample/sample.c | // file: c/01-foundations.mathematics.asymptotic-analysis/focused-sample/sample.c
#include "sample.h"
#include <limits.h>
/* GCC's integer extension is scratch storage, never a public ABI type. */
__extension__ typedef unsigned __int128 Wide;
_Static_assert(SIZE_MAX <= UINT64_MAX, "coefficient extent needs at most 64 b... | source | stable | codex | 358c01e678baf788 | 0 | 758 | 40e3db25a61a8e968f4c2c903660d966bcf02efa9392353e57b75f8eccd41934 | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
c/01-foundations.mathematics.asymptotic-analysis/focused-sample/sample.h | // file: c/01-foundations.mathematics.asymptotic-analysis/focused-sample/sample.h
#ifndef SYNTH_COUNTS_H
#define SYNTH_COUNTS_H
#include <stddef.h>
#include <stdint.h>
typedef enum {
COUNT_OK,
COUNT_INVALID_ARGUMENT,
COUNT_ZERO_POLYNOMIAL,
COUNT_NONPOSITIVE_LEADING,
COUNT_OVERFLOW
} CountStatus;
/* ... | source | stable | codex | 358c01e678baf788 | 0 | 295 | ee9a4f8c9932506f751307f21727789a281c35fb4ba0efa23d63cc80ca8cf341 | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
c/01-foundations.mathematics.asymptotic-analysis/focused-sample/tests/test_sample.c | // file: c/01-foundations.mathematics.asymptotic-analysis/focused-sample/tests/test_sample.c
#include "../sample.h"
#include <assert.h>
#include <limits.h>
#include <stdio.h>
__extension__ typedef unsigned __int128 Wide;
static void literal_three_loops(void) {
for (uint64_t n = 0; n <= 96; ++n) {
uint64_t l... | test | stable | codex | 358c01e678baf788 | 0 | 1,978 | e3cc045504d032cce3ed704b4c3e19d3678b8f48c891529f509c5e27c883e3f7 | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
c/01-foundations.mathematics.asymptotic-analysis/textbook-walkthrough/walkthrough.md | <!-- file: c/01-foundations.mathematics.asymptotic-analysis/textbook-walkthrough/walkthrough.md -->
# From visits to a universal polynomial bound
A visit count answers a finite combinatorial question. An eventual certificate answers a quantified question about every sufficiently large input. We will derive both withou... | walkthrough | stable | codex | 358c01e678baf788 | 0 | 2,774 | 3841d17954ab29d5cf2cea30780dff300b9e284557de40a47f9c74c5162a2f04 | {"artifact_kind": "textbook-walkthrough", "lang": "c", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
python/01-foundations.mathematics.asymptotic-analysis/focused-sample/README.md | <!-- file: python/01-foundations.mathematics.asymptotic-analysis/focused-sample/README.md -->
# Exact counts before growth classes
Run from this directory with Python 3.11 or newer:
```sh
python3 sample.py
python3 -m unittest discover -s tests -v
```
`linear_visits` and `doubling_visits` introduce exact counts; `tri... | readme | stable | codex | 66ea0d63c908ab10 | 0 | 325 | 8aef06b3ba78f29340c4f1fe9a2ac602913a7691037263c812be806010043000 | {"artifact_kind": "focused-sample", "lang": "python", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
python/01-foundations.mathematics.asymptotic-analysis/focused-sample/sample.py | # file: python/01-foundations.mathematics.asymptotic-analysis/focused-sample/sample.py
"""Exact operation counts and derived eventual polynomial growth bounds."""
from __future__ import annotations
from dataclasses import dataclass
from fractions import Fraction
def nonnegative_integer(value: int) -> int:
if ty... | source | stable | codex | 66ea0d63c908ab10 | 0 | 723 | e06fdf61ac95268aa334985060c9fa352690b4d0e250e836da6bf64877dce9a8 | {"artifact_kind": "focused-sample", "lang": "python", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
python/01-foundations.mathematics.asymptotic-analysis/focused-sample/tests/test_sample.py | # file: python/01-foundations.mathematics.asymptotic-analysis/focused-sample/tests/test_sample.py
"""Independently derived loop oracles and certificate boundary checks."""
from __future__ import annotations
import unittest
from fractions import Fraction
from sample import (
certify_growth,
doubling_visits,
... | test | stable | codex | 66ea0d63c908ab10 | 0 | 889 | 23152834dfe504406aedcb7b21d9fcaa6324398d62a3931275db0a3bdc694aa5 | {"artifact_kind": "focused-sample", "lang": "python", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
python/01-foundations.mathematics.asymptotic-analysis/textbook-walkthrough/README.md | <!-- file: python/01-foundations.mathematics.asymptotic-analysis/textbook-walkthrough/README.md -->
# Asymptotic-analysis walkthrough
Read [the staged explanation](walkthrough.md). The adjacent program and tests are exact versioned copies of our accepted Python component; every Python snippet is checked against that s... | readme | stable | codex | 66ea0d63c908ab10 | 0 | 90 | 479416db8c39a5350affc386e9a00c7a70bb78afd0f2caa564f9a464b826599d | {"artifact_kind": "textbook-walkthrough", "lang": "python", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
python/01-foundations.mathematics.asymptotic-analysis/textbook-walkthrough/walkthrough.md | <!-- file: python/01-foundations.mathematics.asymptotic-analysis/textbook-walkthrough/walkthrough.md -->
# From loop visits to an eventual bound
This walkthrough builds an executable argument in three stages: exact visits, a paired sum, and a polynomial growth certificate. Its snippets are exact excerpts from the adja... | walkthrough | stable | codex | 66ea0d63c908ab10 | 0 | 1,657 | 81228d2a6352ab97bbd3d4b57ff6afe8f9f5f9cfa8d3e474f9b338dd127ad499 | {"artifact_kind": "textbook-walkthrough", "lang": "python", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
rust/01-foundations.mathematics.asymptotic-analysis/focused-sample/Cargo.toml | # file: rust/01-foundations.mathematics.asymptotic-analysis/focused-sample/Cargo.toml
[package]
name = "asymptotic-counts"
version = "0.1.0"
edition = "2024"
publish = false
[dependencies]
| manifest | stable | codex | 6c0b8c5b0519ef2b | 0 | 78 | b55daccb5668a39fbfc224e4dfb176e7ed34330f2b8fd62b4be578a677db8116 | {"artifact_kind": "focused-sample", "lang": "rust", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
rust/01-foundations.mathematics.asymptotic-analysis/focused-sample/rust-toolchain.toml | # file: rust/01-foundations.mathematics.asymptotic-analysis/focused-sample/rust-toolchain.toml
[toolchain]
channel = "nightly-2026-07-12"
profile = "minimal"
components = ["rustfmt", "clippy"]
| manifest | stable | codex | 6c0b8c5b0519ef2b | 0 | 79 | 23bc9044ffeccad39f4a9c7286daa96ece0fc8b89cdc7c5921d99a8b645a9d1a | {"artifact_kind": "focused-sample", "lang": "rust", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
rust/01-foundations.mathematics.asymptotic-analysis/focused-sample/src/lib.rs | // file: rust/01-foundations.mathematics.asymptotic-analysis/focused-sample/src/lib.rs
//! Exact bounded operation counts and positive-leading polynomial certificates.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum CountError {
ZeroPolynomial,
NonpositiveLeading,
ArithmeticOverflow,
}
#[derive(Debu... | source | stable | codex | 6c0b8c5b0519ef2b | 0 | 2,152 | 7a60a9a953e5e46793319264e1ab3ab73be00c868855d1957e0d439b5830717e | {"artifact_kind": "focused-sample", "lang": "rust", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
rust/01-foundations.mathematics.asymptotic-analysis/focused-sample/src/main.rs | // file: rust/01-foundations.mathematics.asymptotic-analysis/focused-sample/src/main.rs
use asymptotic_counts::{certify_growth, doubling_visits, linear_visits, triangular_visits};
fn main() {
let certificate = certify_growth(&[-9, 3, 2]).expect("fixed coefficients fit");
println!("certificate: {certificate:?}"... | source | stable | codex | 6c0b8c5b0519ef2b | 0 | 153 | 6ed96c5ca04c695a6eeca2a89b8fe1b533157904886f0cd4c7d7d76f3e7d1768 | {"artifact_kind": "focused-sample", "lang": "rust", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
typescript/01-foundations.mathematics.asymptotic-analysis/focused-sample/README.md | <!-- file: typescript/01-foundations.mathematics.asymptotic-analysis/focused-sample/README.md -->
# Exact operation counts with TypeScript bigint
The beginner counts validate nonnegative bigint lengths; doubling counts binary digits in n−1. The intermediate triangular count uses exact bigint multiplication and integer... | readme | stable | codex | 60931b9fe0d64f7c | 0 | 498 | 4c98dd59f1bafc5a94962c045cac8bc9e479bec3a6c2a2c93bc826cad82ea885 | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
typescript/01-foundations.mathematics.asymptotic-analysis/focused-sample/package.json | file: typescript/01-foundations.mathematics.asymptotic-analysis/focused-sample/package.json
{
"name": "original-asymptotic-counts",
"private": true,
"version": "0.1.0",
"type": "module"
}
| manifest | stable | codex | 60931b9fe0d64f7c | 0 | 75 | 90a69c09ceb185d5332fa8fe2c5d4a498d4737c002b46ebeb7dc5ae2c04e78ca | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
typescript/01-foundations.mathematics.asymptotic-analysis/focused-sample/sample.ts | // file: typescript/01-foundations.mathematics.asymptotic-analysis/focused-sample/sample.ts
/** Exact counts and eventual bounds using explicit bigint inputs. */
function nonnegativeInteger(n: bigint): bigint {
if (typeof n !== "bigint") throw new TypeError("a bigint length is required");
if (n < 0n) throw new Rang... | source | stable | codex | 60931b9fe0d64f7c | 0 | 759 | 6b98cc6289bb3871769057b8ca5e2d1ad9732b4af2b8afe500add7a5781cd183 | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
typescript/01-foundations.mathematics.asymptotic-analysis/focused-sample/tsconfig.json | file: typescript/01-foundations.mathematics.asymptotic-analysis/focused-sample/tsconfig.json
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"noEmit": tru... | manifest | stable | codex | 60931b9fe0d64f7c | 0 | 171 | 3483e50228c647a3005fa2d2c74957754f50a6245c6651821b358f920fea41e7 | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
typescript/01-foundations.mathematics.asymptotic-analysis/focused-sample/tests/test_sample.ts | // file: typescript/01-foundations.mathematics.asymptotic-analysis/focused-sample/tests/test_sample.ts
import assert from "node:assert/strict";
import { test } from "node:test";
import {
certifyGrowth,
doublingVisits,
linearVisits,
polynomialValue,
triangularVisits,
} from "../sample.js";
test("literal loops... | test | stable | codex | 60931b9fe0d64f7c | 0 | 1,025 | 46d9db6e75df791d7928be65c579f227b5577d3170a92dbbc7ae8cb2cf5db82d | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
typescript/01-foundations.mathematics.asymptotic-analysis/textbook-walkthrough/README.md | <!-- file: typescript/01-foundations.mathematics.asymptotic-analysis/textbook-walkthrough/README.md -->
# TypeScript asymptotic-analysis walkthrough
Read [the original staged explanation](walkthrough.md). The implementation and tests are versioned copies of our accepted TypeScript sample. Eight excerpts match checked ... | readme | stable | codex | 60931b9fe0d64f7c | 0 | 95 | 54870b2a102ba31c87477573d45bc474d03c0cd02c15c2cd3687e22591a19d65 | {"artifact_kind": "textbook-walkthrough", "lang": "typescript", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
typescript/01-foundations.mathematics.asymptotic-analysis/textbook-walkthrough/walkthrough.md | <!-- file: typescript/01-foundations.mathematics.asymptotic-analysis/textbook-walkthrough/walkthrough.md -->
# Exact discrete counts at a JavaScript boundary
We build exact loop counts and an eventual polynomial bound using TypeScript with bigint arithmetic. The executable code is a versioned copy of our accepted focu... | walkthrough | stable | codex | 60931b9fe0d64f7c | 0 | 2,066 | 9345f78a1aad9d9df1ca427794723a9dadc35f314458219a3bb1dc2bf6c3dadf | {"artifact_kind": "textbook-walkthrough", "lang": "typescript", "topic": "01-foundations.mathematics.asymptotic-analysis"} |
c/01-foundations.mathematics.binomial-coefficients/focused-sample/README.md | <!-- file: c/01-foundations.mathematics.binomial-coefficients/focused-sample/README.md -->
# Binomial coefficients in checked C17 arithmetic
This sample implements the [original contract](../../../../../docs/specifications/binomial-coefficients.md) at three levels:
- Beginner: an exact truncated Pascal row, updated r... | readme | stable | codex | e08fb29206cb6b23 | 0 | 652 | f565790caa591bccdc2b147619e44769a532dddeaabe48c99aa5aff5cee68afd | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.binomial-coefficients"} |
c/01-foundations.mathematics.binomial-coefficients/focused-sample/sample.c | // file: c/01-foundations.mathematics.binomial-coefficients/focused-sample/sample.c
#include "sample.h"
#include <stdlib.h>
static uint32_t shorter_column(uint32_t n, uint32_t k) { return k < n - k ? k : n - k; }
static uint64_t add_residues(uint64_t a, uint64_t b, uint64_t modulus) {
return a >= modulus - b ? a ... | source | stable | codex | e08fb29206cb6b23 | 0 | 1,225 | cfbb00c65772bf22e90286565c85241f276e7a45f483b6a9f5ac465ec5136156 | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.binomial-coefficients"} |
c/01-foundations.mathematics.binomial-coefficients/focused-sample/sample.h | // file: c/01-foundations.mathematics.binomial-coefficients/focused-sample/sample.h
#ifndef SYNTH_BINOMIAL_H
#define SYNTH_BINOMIAL_H
#include <stddef.h>
#include <stdint.h>
typedef enum {
CHOOSE_OK,
CHOOSE_INVALID_ARGUMENT,
CHOOSE_RESOURCE_LIMIT,
CHOOSE_ALLOCATION_FAILURE,
CHOOSE_OVERFLOW,
CHO... | source | stable | codex | e08fb29206cb6b23 | 0 | 406 | 0f4305cd0ce3f630e20863c7431359a190f466e7c344a5300b44d87652a4a620 | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.binomial-coefficients"} |
c/01-foundations.mathematics.binomial-coefficients/focused-sample/tests/test_sample.c | // file: c/01-foundations.mathematics.binomial-coefficients/focused-sample/tests/test_sample.c
#include "../sample.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
static uint64_t subset_count(unsigned n, unsigned k) {
uint64_t total = 0;
for (unsigned mask = 0; mask < (1u << n); ++mask) {
... | test | stable | codex | e08fb29206cb6b23 | 0 | 47,967 | 561d3e22a926c78b34d9c18f48187bc8c052bdabbd0f58eacafceab901d49b37 | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.binomial-coefficients"} |
c/01-foundations.mathematics.binomial-coefficients/textbook-walkthrough/walkthrough.md | <!-- file: c/01-foundations.mathematics.binomial-coefficients/textbook-walkthrough/walkthrough.md -->
# Choose a subset, then choose the arithmetic
A binomial coefficient counts k-element subsets of n positions. This walkthrough develops an exact Pascal recurrence, a modular recurrence, and a product with cancelled de... | walkthrough | stable | codex | e08fb29206cb6b23 | 0 | 2,697 | 198ed755ce7e6cbad8d133a2b4cd9223d1fdda773a93b7797df6e68332c5ef28 | {"artifact_kind": "textbook-walkthrough", "lang": "c", "topic": "01-foundations.mathematics.binomial-coefficients"} |
python/01-foundations.mathematics.binomial-coefficients/focused-sample/README.md | <!-- file: python/01-foundations.mathematics.binomial-coefficients/focused-sample/README.md -->
# Exact Python binomial coefficients
Run `python3 sample.py` and `python3 -m unittest discover -s tests -v` from this directory. The queue additionally enforces Ruff lint/format and ty using the repository lockfile.
The [s... | readme | stable | codex | d0eff3ab5079c9e1 | 0 | 372 | 5270a8d22e9fded756baabbf074c12033894299fba1d3df7e6f77ab17cbea8a0 | {"artifact_kind": "focused-sample", "lang": "python", "topic": "01-foundations.mathematics.binomial-coefficients"} |
python/01-foundations.mathematics.binomial-coefficients/focused-sample/sample.py | # file: python/01-foundations.mathematics.binomial-coefficients/focused-sample/sample.py
"""Original exact Pascal, modular Pascal and cancelled-product binomial models."""
from __future__ import annotations
LIMIT = 4096
class ResourceLimitError(ValueError):
"""The requested traversal exceeds the declared educat... | source | stable | codex | d0eff3ab5079c9e1 | 0 | 720 | 77e79eee47e132a2751bc81a2c5f25e40eb17d10a05a3b5690a7e30d40c5e2f1 | {"artifact_kind": "focused-sample", "lang": "python", "topic": "01-foundations.mathematics.binomial-coefficients"} |
python/01-foundations.mathematics.binomial-coefficients/focused-sample/tests/test_sample.py | # file: python/01-foundations.mathematics.binomial-coefficients/focused-sample/tests/test_sample.py
"""Subset enumeration and exact integer identities as independent oracles."""
from __future__ import annotations
import unittest
from sample import ResourceLimitError, choose_cancelled, choose_modulo, choose_pascal
... | test | stable | codex | d0eff3ab5079c9e1 | 0 | 1,100 | 35477ef63233be36b3fe75ab63a450ff46486210f3eca55bdad4e3c54948fd45 | {"artifact_kind": "focused-sample", "lang": "python", "topic": "01-foundations.mathematics.binomial-coefficients"} |
python/01-foundations.mathematics.binomial-coefficients/textbook-walkthrough/README.md | <!-- file: python/01-foundations.mathematics.binomial-coefficients/textbook-walkthrough/README.md -->
# Python binomial-coefficients walkthrough
Read [the original explanation](walkthrough.md). The program and fixtures are versioned copies of the accepted Python sample. Six excerpts match executable source; the text d... | readme | stable | codex | d0eff3ab5079c9e1 | 0 | 85 | 85a14a658dc1640ca11a38dcdbe4d44ffa51778b72e0f32a43f7a897b3f1118a | {"artifact_kind": "textbook-walkthrough", "lang": "python", "topic": "01-foundations.mathematics.binomial-coefficients"} |
python/01-foundations.mathematics.binomial-coefficients/textbook-walkthrough/walkthrough.md | <!-- file: python/01-foundations.mathematics.binomial-coefficients/textbook-walkthrough/walkthrough.md -->
# Binomial coefficients without hiding the mechanism
A binomial coefficient counts k-element subsets of n positions. We implement this quantity three ways: a descending Pascal row, a modular row, and a cancelled ... | walkthrough | stable | codex | d0eff3ab5079c9e1 | 0 | 1,927 | 067f3f379a5c29608807fee09c79dce68c08af97854d5093fb7edb57394b531e | {"artifact_kind": "textbook-walkthrough", "lang": "python", "topic": "01-foundations.mathematics.binomial-coefficients"} |
rust/01-foundations.mathematics.binomial-coefficients/focused-sample/Cargo.toml | # file: rust/01-foundations.mathematics.binomial-coefficients/focused-sample/Cargo.toml
[package]
name = "original-binomial-models"
version = "0.1.0"
edition = "2024"
publish = false
[dependencies]
| manifest | stable | codex | c51ce3309daad3ff | 0 | 77 | 5db76690f38f60ddbe5c4692491d8ec60716922e9b00235a16fb2ee679823e79 | {"artifact_kind": "focused-sample", "lang": "rust", "topic": "01-foundations.mathematics.binomial-coefficients"} |
rust/01-foundations.mathematics.binomial-coefficients/focused-sample/derivation.md | <!-- file: rust/01-foundations.mathematics.binomial-coefficients/focused-sample/derivation.md -->
## Mathematical derivations
A k-selection is a subset of n distinguishable positions with exactly k members. For k>n there are none. For k=0 there is just the empty set, and for k=n there is just the whole set. Taking com... | prose | stable | codex | c51ce3309daad3ff | 0 | 1,434 | fdd20990b664555ffa8229230612e0e80b705b9991351008e5ed84c351f277f0 | {"artifact_kind": "focused-sample", "lang": "rust", "topic": "01-foundations.mathematics.binomial-coefficients"} |
rust/01-foundations.mathematics.binomial-coefficients/focused-sample/src/lib.rs | // file: rust/01-foundations.mathematics.binomial-coefficients/focused-sample/src/lib.rs
//! Independent exact and modular Pascal rows and a cancelled binomial product.
const LIMIT: u32 = 4096;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ChooseError {
InvalidModulus,
ResourceLimit,
AllocationFai... | source | stable | codex | c51ce3309daad3ff | 0 | 3,467 | a78a7fdbb06bf204e8314d6d2e452961f10942e3d66d0be7bf9c2a71680903f1 | {"artifact_kind": "focused-sample", "lang": "rust", "topic": "01-foundations.mathematics.binomial-coefficients"} |
rust/01-foundations.mathematics.binomial-coefficients/focused-sample/src/main.rs | // file: rust/01-foundations.mathematics.binomial-coefficients/focused-sample/src/main.rs
use original_binomial_models::{choose_cancelled, choose_modulo, choose_pascal};
fn main() {
println!("C(8,3): {:?}", choose_pascal(8, 3));
println!("C(8,3) mod 12: {:?}", choose_modulo(8, 3, 12));
println!("C(67,33): ... | source | stable | codex | c51ce3309daad3ff | 0 | 152 | 47384508254cd65911ce6058c3b56ae507077486812ff90f48622fc7fd65f10e | {"artifact_kind": "focused-sample", "lang": "rust", "topic": "01-foundations.mathematics.binomial-coefficients"} |
typescript/01-foundations.mathematics.binomial-coefficients/focused-sample/README.md | <!-- file: typescript/01-foundations.mathematics.binomial-coefficients/focused-sample/README.md -->
# Exact bigint binomial models
This sample implements the [shared contract](../../../../../docs/specifications/binomial-coefficients.md) directly: descending Pascal updates, modular Pascal for every positive bigint modu... | readme | stable | codex | 41963743a4c216a4 | 0 | 432 | 56717bd873b496e44dc2503b5f5707611b6ade744b6a90aabf5d5cad6a44b187 | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.binomial-coefficients"} |
typescript/01-foundations.mathematics.binomial-coefficients/focused-sample/package.json | file: typescript/01-foundations.mathematics.binomial-coefficients/focused-sample/package.json
{
"name": "original-binomial-models",
"private": true,
"version": "0.1.0",
"type": "module"
}
| manifest | stable | codex | 41963743a4c216a4 | 0 | 72 | 20db4be5818368cd1adc22bfa33e94b1ddeec1b8bbdea2d72b8ca964096c6351 | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.binomial-coefficients"} |
typescript/01-foundations.mathematics.binomial-coefficients/focused-sample/sample.ts | // file: typescript/01-foundations.mathematics.binomial-coefficients/focused-sample/sample.ts
/** Exact independent Pascal, modular Pascal, and cancelled binomial models. */
const LIMIT = 4096n;
export class ResourceLimitError extends RangeError {}
function nonnegative(value: bigint): bigint {
if (typeof value !== ... | source | stable | codex | 41963743a4c216a4 | 0 | 812 | f7a7392f501b2012c34181fdaf5c09660796b58b12e7dd379b53885fd03feb48 | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.binomial-coefficients"} |
typescript/01-foundations.mathematics.binomial-coefficients/focused-sample/tests/test_sample.ts | // file: typescript/01-foundations.mathematics.binomial-coefficients/focused-sample/tests/test_sample.ts
import assert from "node:assert/strict";
import { test } from "node:test";
import {
ResourceLimitError,
chooseCancelled,
chooseModulo,
choosePascal,
} from "../sample.js";
test("exhaustive small subsets ind... | test | stable | codex | 41963743a4c216a4 | 0 | 1,357 | cd512bf2b1872ca0fa1bdb36a72dfe2dde4fdb84c53741237887f74f3f8e9e5f | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.binomial-coefficients"} |
typescript/01-foundations.mathematics.binomial-coefficients/textbook-walkthrough/README.md | <!-- file: typescript/01-foundations.mathematics.binomial-coefficients/textbook-walkthrough/README.md -->
# TypeScript binomial-coefficients walkthrough
Read [the original explanation](walkthrough.md). The program and tests are versioned copies of the accepted sample. Seven excerpts match source; the text develops run... | readme | stable | codex | 41963743a4c216a4 | 0 | 86 | 63db8b9ad04c8d2e6d6d873364d6ee3af9522979222452a7b7b89aadafc4adfa | {"artifact_kind": "textbook-walkthrough", "lang": "typescript", "topic": "01-foundations.mathematics.binomial-coefficients"} |
c/01-foundations.mathematics.combinatorics/focused-sample/sample.c | // file: c/01-foundations.mathematics.combinatorics/focused-sample/sample.c
#include "sample.h"
#define COMB_LIMIT 64u
CombStatus word_count(const uint32_t *radices, size_t length, uint64_t *out) {
if (out == NULL || (length != 0 && radices == NULL))
return COMB_INVALID;
if (length > COMB_LIMIT)
... | source | stable | codex | 5ced1db5ec127e24 | 0 | 1,835 | ba5a1ad842ac5537419c6bd42150955d58e0ce7089d66be306d41e5374a1d7a1 | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.combinatorics"} |
c/01-foundations.mathematics.combinatorics/focused-sample/sample.h | // file: c/01-foundations.mathematics.combinatorics/focused-sample/sample.h
#ifndef SYNTH_COMBINATORICS_H
#define SYNTH_COMBINATORICS_H
#include <stddef.h>
#include <stdint.h>
typedef enum { COMB_OK, COMB_INVALID, COMB_RESOURCE_LIMIT, COMB_OVERFLOW } CombStatus;
CombStatus word_count(const uint32_t *radices, size_t le... | source | stable | codex | 5ced1db5ec127e24 | 0 | 316 | da8ca8d92d5551d3e29df423fc009ebe21e43678bc6d83b2b4fdecd3c553cd43 | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.combinatorics"} |
c/01-foundations.mathematics.combinatorics/focused-sample/tests/test_sample.c | // file: c/01-foundations.mathematics.combinatorics/focused-sample/tests/test_sample.c
#include "../sample.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
static void products_and_tuples(void) {
const uint32_t radices[] = {2, 3, 2};
uint64_t count = 0;
assert(word_count(radi... | test | stable | codex | 5ced1db5ec127e24 | 0 | 3,908 | bd7ecebd49d96750640b02d866b30e505f08961deaadc96fe0fceb12e61d41d8 | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.combinatorics"} |
c/01-foundations.mathematics.combinatorics/textbook-walkthrough/walkthrough.md | <!-- file: c/01-foundations.mathematics.combinatorics/textbook-walkthrough/walkthrough.md -->
# Index a finite space by its remaining choices
This walkthrough progresses from product counts to tuple indexing and permutation indexing. It follows our [original contract](../../../../../docs/specifications/combinatorics.m... | walkthrough | stable | codex | 5ced1db5ec127e24 | 0 | 4,132 | 8402fd01c56f2c99d88089368296da70479f9b6919b0b037d5df85c875548b66 | {"artifact_kind": "textbook-walkthrough", "lang": "c", "topic": "01-foundations.mathematics.combinatorics"} |
python/01-foundations.mathematics.combinatorics/focused-sample/README.md | <!-- file: python/01-foundations.mathematics.combinatorics/focused-sample/README.md -->
# Exact finite-space indexing in Python
Run `python3 sample.py` and `python3 -m unittest discover -s tests -v` here. The queue also enforces Ruff lint/format and ty with locked tools. The [original contract](../../../../../docs/spe... | readme | stable | codex | ab95949030da2ba5 | 0 | 463 | 11bfd1685c821c4b4d83c8c41cb7b5d757018917d7a580c6d8d05555cfa21e18 | {"artifact_kind": "focused-sample", "lang": "python", "topic": "01-foundations.mathematics.combinatorics"} |
python/01-foundations.mathematics.combinatorics/focused-sample/sample.py | # file: python/01-foundations.mathematics.combinatorics/focused-sample/sample.py
"""Original finite-product and permutation indexing models with exact integers."""
from __future__ import annotations
LIMIT = 64
class ResourceLimitError(ValueError):
"""A dimension or permutation length exceeds the declared educat... | source | stable | codex | ab95949030da2ba5 | 0 | 1,205 | 88bf44ff64f893697e79114605e004592c1e0e3f880aa7b35ad519d11198b8dc | {"artifact_kind": "focused-sample", "lang": "python", "topic": "01-foundations.mathematics.combinatorics"} |
python/01-foundations.mathematics.combinatorics/focused-sample/tests/test_sample.py | # file: python/01-foundations.mathematics.combinatorics/focused-sample/tests/test_sample.py
"""Independent lexicographic enumeration verifies order as well as bijections."""
from __future__ import annotations
import unittest
from collections.abc import Iterator
from typing import cast
from sample import (
Resour... | test | stable | codex | ab95949030da2ba5 | 0 | 1,389 | c856f4e86f5bbafba92904abb10b4187fdcb1b4192e1ff641c14a7405b9c6bff | {"artifact_kind": "focused-sample", "lang": "python", "topic": "01-foundations.mathematics.combinatorics"} |
python/01-foundations.mathematics.combinatorics/textbook-walkthrough/README.md | <!-- file: python/01-foundations.mathematics.combinatorics/textbook-walkthrough/README.md -->
# Python combinatorics walkthrough
Read [the original explanation](walkthrough.md). The module and fixtures are versioned copies of the accepted Python sample. Ten excerpts match source; the text develops immutable boundaries... | readme | stable | codex | ab95949030da2ba5 | 0 | 90 | dc2486a6c5b42483ef9a653e5a96034428e2cc87d7837f089fa14f9a466b514d | {"artifact_kind": "textbook-walkthrough", "lang": "python", "topic": "01-foundations.mathematics.combinatorics"} |
python/01-foundations.mathematics.combinatorics/textbook-walkthrough/walkthrough.md | <!-- file: python/01-foundations.mathematics.combinatorics/textbook-walkthrough/walkthrough.md -->
# Give each finite choice a reproducible ordinal
This walkthrough derives product counts, mixed-radix tuple indices, and factorial-block permutation indices from our [original contract](../../../../../docs/specifications... | walkthrough | stable | codex | ab95949030da2ba5 | 0 | 2,630 | afc3c39035ba6471a96e85b759a8528c18a65d83dace47c2c99c09daea596823 | {"artifact_kind": "textbook-walkthrough", "lang": "python", "topic": "01-foundations.mathematics.combinatorics"} |
rust/01-foundations.mathematics.combinatorics/focused-sample/Cargo.toml | # file: rust/01-foundations.mathematics.combinatorics/focused-sample/Cargo.toml
[package]
name = "original-finite-space-indices"
version = "0.1.0"
edition = "2024"
publish = false
[dependencies]
| manifest | stable | codex | 92cc693acf7526fa | 0 | 78 | 53ec5cc493bb8593a6abee7863ca9c3bd5bdfcedd9820bf7dc83430a752d9e4b | {"artifact_kind": "focused-sample", "lang": "rust", "topic": "01-foundations.mathematics.combinatorics"} |
rust/01-foundations.mathematics.combinatorics/focused-sample/src/lib.rs | // file: rust/01-foundations.mathematics.combinatorics/focused-sample/src/lib.rs
//! Original bounded finite-product and permutation indexing mechanisms.
const LIMIT: usize = 64;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum CombError {
Shape,
EmptySpace,
Digit,
Ordinal,
Duplicate,
Posi... | source | stable | codex | 92cc693acf7526fa | 0 | 4,589 | 22692be67b4af76d5213f36819fdfe59c8afba44486059f107f9bbaa04f7ad78 | {"artifact_kind": "focused-sample", "lang": "rust", "topic": "01-foundations.mathematics.combinatorics"} |
rust/01-foundations.mathematics.combinatorics/focused-sample/src/main.rs | // file: rust/01-foundations.mathematics.combinatorics/focused-sample/src/main.rs
use original_finite_space_indices::{permutation_unrank, word_unrank};
fn main() {
let mut word = [0; 3];
word_unrank(&[2, 3, 2], 11, &mut word).expect("fixed valid ordinal");
let mut permutation = [0; 4];
permutation_unra... | source | stable | codex | 92cc693acf7526fa | 0 | 156 | 732099f04ab8b1e1a9f2d1b1802546459c76755b4058d2152a17c9ec31eee9a0 | {"artifact_kind": "focused-sample", "lang": "rust", "topic": "01-foundations.mathematics.combinatorics"} |
rust/01-foundations.mathematics.combinatorics/textbook-walkthrough/walkthrough.md | <!-- file: rust/01-foundations.mathematics.combinatorics/textbook-walkthrough/walkthrough.md -->
# From a finite choice space to its ordinal
We want each finite choice sequence to have one address, with earlier sequences receiving smaller addresses. This chapter follows the repository combinatorics contract through th... | walkthrough | stable | codex | 92cc693acf7526fa | 0 | 3,952 | a6ed5c45212e2307b2f16eda390103f361342b917332b1c02ad05ef4a97676ca | {"artifact_kind": "textbook-walkthrough", "lang": "rust", "topic": "01-foundations.mathematics.combinatorics"} |
typescript/01-foundations.mathematics.combinatorics/focused-sample/README.md | <!-- file: typescript/01-foundations.mathematics.combinatorics/focused-sample/README.md -->
# Exact finite-space indices with bigint
The [original contract](../../../../../docs/specifications/combinatorics.md) defines product counts, mixed-radix tuple indices, and factorial/Fenwick permutation indices. Radices, digits... | readme | stable | codex | 492f673b255f4d97 | 0 | 511 | 47bb568aca622db3ec2dd6163064171b3c560b69040b70851293bfc7790cc17c | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.combinatorics"} |
typescript/01-foundations.mathematics.combinatorics/focused-sample/package.json | file: typescript/01-foundations.mathematics.combinatorics/focused-sample/package.json
{
"name": "original-finite-space-indices",
"private": true,
"version": "0.1.0",
"type": "module"
}
| manifest | stable | codex | 492f673b255f4d97 | 0 | 73 | 121c3e35cb638a048d07c9788aab788d433448dc013b1db957557bf95d013513 | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.combinatorics"} |
typescript/01-foundations.mathematics.combinatorics/focused-sample/sample.ts | // file: typescript/01-foundations.mathematics.combinatorics/focused-sample/sample.ts
/** Original exact product-space and permutation indexing models. */
const LIMIT = 64;
export class ResourceLimitError extends RangeError {}
function arrayRequired(value: unknown): void {
if (!Array.isArray(value)) throw new TypeEr... | source | stable | codex | 492f673b255f4d97 | 0 | 1,581 | 3dd77bd2919535fa89ebf0b7c4797d4d4388a40865af81e149a84b7700edbc62 | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.combinatorics"} |
typescript/01-foundations.mathematics.combinatorics/focused-sample/tests/test_sample.ts | // file: typescript/01-foundations.mathematics.combinatorics/focused-sample/tests/test_sample.ts
import assert from "node:assert/strict";
import { test } from "node:test";
import {
ResourceLimitError,
wordCount,
wordRank,
wordUnrank,
permutationCount,
permutationRank,
permutationUnrank,
} from "../sample.... | test | stable | codex | 492f673b255f4d97 | 0 | 1,507 | e68ebf7fbdd86a3d031ef97071833f66eaefa9dcb3f74154e9707502cc858a91 | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.combinatorics"} |
typescript/01-foundations.mathematics.combinatorics/textbook-walkthrough/README.md | <!-- file: typescript/01-foundations.mathematics.combinatorics/textbook-walkthrough/README.md -->
# TypeScript combinatorics walkthrough
Read [the original explanation](walkthrough.md). The module and fixtures are versioned copies of the accepted sample. Twelve excerpts match source; the text derives exact cardinaliti... | readme | stable | codex | 492f673b255f4d97 | 0 | 91 | dfed17ba2971b5fb2e9861ddc185c0442049623b1c7bb24ab717c05a9045ea04 | {"artifact_kind": "textbook-walkthrough", "lang": "typescript", "topic": "01-foundations.mathematics.combinatorics"} |
typescript/01-foundations.mathematics.combinatorics/textbook-walkthrough/walkthrough.md | <!-- file: typescript/01-foundations.mathematics.combinatorics/textbook-walkthrough/walkthrough.md -->
# Finite-space indexing across bigint and bounded indices
This walkthrough derives product counts, mixed-radix tuple indices, and factorial/Fenwick permutation indices under our [original contract](../../../../../doc... | walkthrough | stable | codex | 492f673b255f4d97 | 0 | 3,082 | c400fc2620b641b9805f851faf93d5350bd53e948a786a7fe35a097619f4e4c4 | {"artifact_kind": "textbook-walkthrough", "lang": "typescript", "topic": "01-foundations.mathematics.combinatorics"} |
c/01-foundations.mathematics.functions-and-orders/focused-sample/README.md | <!-- file: c/01-foundations.mathematics.functions-and-orders/focused-sample/README.md -->
# Finite functions and orders in bounded C17
The [original contract](../../../../../docs/specifications/functions-and-orders.md) defines three stages: classify total indexed functions, compose/invert them, and analyze finite orde... | readme | stable | codex | 42c445da44ad2b57 | 0 | 763 | 89f36e1f48000770c5ac09c46ceea07acbd4ccdec354d400f13fec4e2427f9a6 | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.functions-and-orders"} |
c/01-foundations.mathematics.functions-and-orders/focused-sample/sample.c | // file: c/01-foundations.mathematics.functions-and-orders/focused-sample/sample.c
#include "sample.h"
#include <stddef.h>
#define FINITE_LIMIT 32u
static uint32_t universe(uint32_t n) { return n == 32 ? UINT32_MAX : (UINT32_C(1) << n) - 1; }
static uint32_t bit(uint32_t i) { return UINT32_C(1) << i; }
FiniteStatus f... | source | stable | codex | 42c445da44ad2b57 | 0 | 1,839 | 820adc6c40d8f58eaee8c19518e2fd2ca544d14dd4e1ee24b678756e729b72f5 | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.functions-and-orders"} |
c/01-foundations.mathematics.functions-and-orders/focused-sample/sample.h | // file: c/01-foundations.mathematics.functions-and-orders/focused-sample/sample.h
#ifndef SYNTH_FUNCTIONS_ORDERS_H
#define SYNTH_FUNCTIONS_ORDERS_H
#include <stdbool.h>
#include <stdint.h>
typedef enum {
FINITE_OK,
FINITE_INVALID,
FINITE_RESOURCE_LIMIT,
FINITE_INVARIANT_FAILURE
} FiniteStatus;
typedef... | source | stable | codex | 42c445da44ad2b57 | 0 | 414 | 55f0dad8531be771b742b49ff89fb5294113c3319d9e11994552eb0dc543e1a0 | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.functions-and-orders"} |
c/01-foundations.mathematics.functions-and-orders/focused-sample/tests/test_sample.c | // file: c/01-foundations.mathematics.functions-and-orders/focused-sample/tests/test_sample.c
#include "../sample.h"
#include <assert.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
static void classify_functions(void) {
FunctionFlags flags;
assert(function_analyze(NULL, 0, 0, &flags) == FINITE_O... | test | stable | codex | 42c445da44ad2b57 | 0 | 4,228 | 0c9ad3491cdffb02540ff23e27078ea8896e4e8c7d60f54101735c07f19d3d5c | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.functions-and-orders"} |
c/01-foundations.mathematics.functions-and-orders/textbook-walkthrough/walkthrough.md | <!-- file: c/01-foundations.mathematics.functions-and-orders/textbook-walkthrough/walkthrough.md -->
# Turn finite definitions into checked operations
This walkthrough develops finite-function properties, composition/inversion, and partial-order operations under our [original contract](../../../../../docs/specificatio... | walkthrough | stable | codex | 42c445da44ad2b57 | 0 | 3,874 | 2bab25024c9dc403c74f8e7aa9c3fe48fc406335e3fe1ab096de9346ec7c1594 | {"artifact_kind": "textbook-walkthrough", "lang": "c", "topic": "01-foundations.mathematics.functions-and-orders"} |
python/01-foundations.mathematics.functions-and-orders/focused-sample/README.md | <!-- file: python/01-foundations.mathematics.functions-and-orders/focused-sample/README.md -->
# Immutable finite functions and orders in Python
Run `python3 sample.py` and `python3 -m unittest discover -s tests -v` here. The queue additionally enforces Ruff lint/format and ty. The [original contract](../../../../../d... | readme | stable | codex | 9fd663bd60ba95df | 0 | 490 | f850301eecd320aacc25378c335f01130a11e553b6ceefed1a803278ff36e9a8 | {"artifact_kind": "focused-sample", "lang": "python", "topic": "01-foundations.mathematics.functions-and-orders"} |
python/01-foundations.mathematics.functions-and-orders/focused-sample/sample.py | # file: python/01-foundations.mathematics.functions-and-orders/focused-sample/sample.py
"""Original finite-map and bitset-order models with explicit bounded domains."""
from __future__ import annotations
from dataclasses import dataclass
LIMIT = 32
class ResourceLimitError(ValueError):
"""The declared finite-s... | source | stable | codex | 9fd663bd60ba95df | 0 | 1,250 | 4fd20f5b7e5420917ef1b7dc9faa09927f5cbe92f87344fbfc76278d59773738 | {"artifact_kind": "focused-sample", "lang": "python", "topic": "01-foundations.mathematics.functions-and-orders"} |
python/01-foundations.mathematics.functions-and-orders/focused-sample/tests/test_sample.py | # file: python/01-foundations.mathematics.functions-and-orders/focused-sample/tests/test_sample.py
"""Scalar Boolean and brute-force permutation oracles for finite order models."""
from __future__ import annotations
import unittest
from itertools import permutations
from typing import cast
from sample import (
F... | test | stable | codex | 9fd663bd60ba95df | 0 | 1,709 | 6684275d6f756e9d813d85056dc2c229d1a92d5dc8ab1d965168e78f05ea2533 | {"artifact_kind": "focused-sample", "lang": "python", "topic": "01-foundations.mathematics.functions-and-orders"} |
python/01-foundations.mathematics.functions-and-orders/textbook-walkthrough/README.md | <!-- file: python/01-foundations.mathematics.functions-and-orders/textbook-walkthrough/README.md -->
# Python functions-and-orders walkthrough
Read [the original explanation](walkthrough.md). The module and fixtures are versioned copies of the accepted sample. Ten excerpts match source; the text derives immutable fini... | readme | stable | codex | 9fd663bd60ba95df | 0 | 89 | 7600a43aa212f5d513ce31c35680bfd7c0d529b7fe31b42e86f86e8189c52e17 | {"artifact_kind": "textbook-walkthrough", "lang": "python", "topic": "01-foundations.mathematics.functions-and-orders"} |
python/01-foundations.mathematics.functions-and-orders/textbook-walkthrough/walkthrough.md | <!-- file: python/01-foundations.mathematics.functions-and-orders/textbook-walkthrough/walkthrough.md -->
# Build finite functions and orders from their definitions
This walkthrough develops function properties and finite-order operations under our [original contract](../../../../../docs/specifications/functions-and-o... | walkthrough | stable | codex | 9fd663bd60ba95df | 0 | 2,492 | 17053eb1775e30d6b9f5db1e07ceade7c26342e3dbec3b2ef11615a04adaf7ae | {"artifact_kind": "textbook-walkthrough", "lang": "python", "topic": "01-foundations.mathematics.functions-and-orders"} |
rust/01-foundations.mathematics.functions-and-orders/focused-sample/Cargo.toml | # file: rust/01-foundations.mathematics.functions-and-orders/focused-sample/Cargo.toml
[package]
name = "original-finite-functions-orders"
version = "0.1.0"
edition = "2024"
publish = false
[dependencies]
| manifest | stable | codex | 951f99033b7519e7 | 0 | 80 | 3983e7250aa23d83052f60ccd5437643fa4594d786649675b922d3051c3384f5 | {"artifact_kind": "focused-sample", "lang": "rust", "topic": "01-foundations.mathematics.functions-and-orders"} |
rust/01-foundations.mathematics.functions-and-orders/focused-sample/src/lib.rs | // file: rust/01-foundations.mathematics.functions-and-orders/focused-sample/src/lib.rs
//! Independently authored bounded finite maps and bitset partial orders.
const LIMIT: usize = 32;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum FiniteError {
Invalid,
ResourceLimit,
InvariantFailure,
}
#[derive... | source | stable | codex | 951f99033b7519e7 | 0 | 4,746 | abf30f6c888a4c135b2f3235c625f09e62002fc2ec20923909c23f4d8159c0fa | {"artifact_kind": "focused-sample", "lang": "rust", "topic": "01-foundations.mathematics.functions-and-orders"} |
rust/01-foundations.mathematics.functions-and-orders/focused-sample/src/main.rs | // file: rust/01-foundations.mathematics.functions-and-orders/focused-sample/src/main.rs
use original_finite_functions_orders::{
function_analyze, order_analyze, order_covers, order_extension,
};
fn main() {
let diamond = [15, 10, 12, 8];
let mut covers = [0; 4];
let mut extension = [0; 4];
order_c... | source | stable | codex | 951f99033b7519e7 | 0 | 220 | a3630325351663f0a1a5869cd9c35a849a2d5937448fe27b0a523579a38c2a61 | {"artifact_kind": "focused-sample", "lang": "rust", "topic": "01-foundations.mathematics.functions-and-orders"} |
typescript/01-foundations.mathematics.functions-and-orders/focused-sample/README.md | <!-- file: typescript/01-foundations.mathematics.functions-and-orders/focused-sample/README.md -->
# Finite maps and bigint orders in TypeScript
The [original contract](../../../../../docs/specifications/functions-and-orders.md) covers function classification/composition/inversion and finite partial-order analysis/cov... | readme | stable | codex | 36affcd0ef40dd8f | 0 | 461 | 3f184bf5c6676904097770e15ab0937921063f462c117ea9e0514bd183778d90 | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.functions-and-orders"} |
typescript/01-foundations.mathematics.functions-and-orders/focused-sample/package.json | file: typescript/01-foundations.mathematics.functions-and-orders/focused-sample/package.json
{
"name": "original-finite-functions-orders",
"private": true,
"version": "0.1.0",
"type": "module"
}
| manifest | stable | codex | 36affcd0ef40dd8f | 0 | 75 | b8d103076972ce053ba01cdaee93b03cdc8f9c04228e37b603b27857c886d00e | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.functions-and-orders"} |
typescript/01-foundations.mathematics.functions-and-orders/focused-sample/sample.ts | // file: typescript/01-foundations.mathematics.functions-and-orders/focused-sample/sample.ts
/** Original finite-function and bigint relation models with bounded universes. */
const LIMIT = 32;
export class ResourceLimitError extends RangeError {}
function arrayRequired(value: unknown): void {
if (!Array.isArray(val... | source | stable | codex | 36affcd0ef40dd8f | 0 | 1,615 | d01351edff7ddfbec48f43be4ba5a3196c68cf87e0f9d2406cb7054e786d858b | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.functions-and-orders"} |
typescript/01-foundations.mathematics.functions-and-orders/focused-sample/tests/test_sample.ts | // file: typescript/01-foundations.mathematics.functions-and-orders/focused-sample/tests/test_sample.ts
import assert from "node:assert/strict";
import { test } from "node:test";
import {
ResourceLimitError,
functionAnalyze,
functionCompose,
functionInverse,
orderAnalyze,
orderCovers,
orderExtension,
} fr... | test | stable | codex | 36affcd0ef40dd8f | 0 | 2,083 | ec36e6403b7d82db2713f1121d72f7c60ad072c6fcd108cdb6234141a6623c0e | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.functions-and-orders"} |
typescript/01-foundations.mathematics.functions-and-orders/textbook-walkthrough/README.md | <!-- file: typescript/01-foundations.mathematics.functions-and-orders/textbook-walkthrough/README.md -->
# TypeScript functions-and-orders walkthrough
Read [the original explanation](walkthrough.md). The module and fixtures are versioned copies of the accepted sample. Ten excerpts match source; the text derives checke... | readme | stable | codex | 36affcd0ef40dd8f | 0 | 89 | 7e2995a7fbf6466772f12e434d2f1bec47191bc4184adeee1d963922f4d1e1f9 | {"artifact_kind": "textbook-walkthrough", "lang": "typescript", "topic": "01-foundations.mathematics.functions-and-orders"} |
typescript/01-foundations.mathematics.functions-and-orders/textbook-walkthrough/walkthrough.md | <!-- file: typescript/01-foundations.mathematics.functions-and-orders/textbook-walkthrough/walkthrough.md -->
# Finite definitions with runtime boundaries and exact rows
This walkthrough explains finite-map classification/composition/inversion and finite-order operations under our [original contract](../../../../../do... | walkthrough | stable | codex | 36affcd0ef40dd8f | 0 | 2,974 | 7a7746af36a03d52df9c46715846ab40559077196bf16e997cbc34ff1562ef93 | {"artifact_kind": "textbook-walkthrough", "lang": "typescript", "topic": "01-foundations.mathematics.functions-and-orders"} |
c/01-foundations.mathematics.generating-functions/focused-sample/README.md | <!-- file: c/01-foundations.mathematics.generating-functions/focused-sample/README.md -->
# Checked integer formal series in C17
The [original contract](../../../../../docs/specifications/generating-functions.md) defines coefficient addition/shifts, direct truncated convolution, and unit-constant quotient recurrences.... | readme | stable | codex | 32c479f282828fff | 0 | 673 | 55d04904d96a855a4eaae243c6c05a38b9210b403760b4d60bbfffd7ebf985da | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.generating-functions"} |
c/01-foundations.mathematics.generating-functions/focused-sample/sample.c | // file: c/01-foundations.mathematics.generating-functions/focused-sample/sample.c
#include "sample.h"
#include <limits.h>
#define GF_LIMIT 64u
static GFStatus arguments(const int64_t *a, size_t alen, const int64_t *b, size_t blen,
size_t precision, const int64_t *out) {
if ((alen != 0 &&... | source | stable | codex | 32c479f282828fff | 0 | 1,600 | 882c5c19b13d9eec116cd30dc7d2a3ee45d7da91cf95cf79a54c6f6bbc15aa5b | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.generating-functions"} |
c/01-foundations.mathematics.generating-functions/focused-sample/sample.h | // file: c/01-foundations.mathematics.generating-functions/focused-sample/sample.h
#ifndef SYNTH_FORMAL_SERIES_H
#define SYNTH_FORMAL_SERIES_H
#include <stddef.h>
#include <stdint.h>
typedef enum { GF_OK, GF_INVALID, GF_RESOURCE_LIMIT, GF_NONUNIT, GF_OVERFLOW } GFStatus;
GFStatus gf_add(const int64_t *a, size_t alen, ... | source | stable | codex | 32c479f282828fff | 0 | 327 | 14f1c221e1db6471454534f6d9fb5799f2aa5092ab59139c747735cdac73d94d | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.generating-functions"} |
c/01-foundations.mathematics.generating-functions/focused-sample/tests/test_sample.c | // file: c/01-foundations.mathematics.generating-functions/focused-sample/tests/test_sample.c
#include "../sample.h"
#include <assert.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
static void sums_shifts_and_signed_products(void) {
const int64_t a[] = {2, -3, 4}, b[] = {-1, 5};
int64_t output[5... | test | stable | codex | 32c479f282828fff | 0 | 6,430 | de5551f9ee733189568d020b2f70fd137744bf124c6605a11392475d2976a0ed | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.generating-functions"} |
c/01-foundations.mathematics.generating-functions/textbook-walkthrough/walkthrough.md | <!-- file: c/01-foundations.mathematics.generating-functions/textbook-walkthrough/walkthrough.md -->
# Building integer formal-series prefixes in C
Treat a coefficient buffer as a polynomial: element i multiplies x^i. A request for N coefficients retains degrees 0 through N−1. This representation is enough for algebra... | walkthrough | stable | codex | 32c479f282828fff | 0 | 4,702 | bdf112297a238bd750bda97d4f5eac18fd2e7265de3f463843c91b78d9b782c8 | {"artifact_kind": "textbook-walkthrough", "lang": "c", "topic": "01-foundations.mathematics.generating-functions"} |
python/01-foundations.mathematics.generating-functions/focused-sample/README.md | <!-- file: python/01-foundations.mathematics.generating-functions/focused-sample/README.md -->
# Integer generating-function prefixes
Begin with `add` and `shift`, then implement direct convolution in `multiply`. Finally, `quotient` solves each coefficient using already computed lower coefficients. All operations retu... | readme | stable | codex | 97aae4a3971b4624 | 0 | 314 | e3e31ab513442efc0e02f66a983021ea38274f6bf8f7a7afe197d7c88249fe66 | {"artifact_kind": "focused-sample", "lang": "python", "topic": "01-foundations.mathematics.generating-functions"} |
python/01-foundations.mathematics.generating-functions/focused-sample/sample.py | # file: python/01-foundations.mathematics.generating-functions/focused-sample/sample.py
"""Exact, bounded prefixes of integer formal power series."""
LIMIT = 64
def _natural(value: int) -> None:
if type(value) is not int or value < 0:
raise ValueError("expected a nonnegative integer")
def _series(value... | source | stable | codex | 97aae4a3971b4624 | 0 | 705 | 51e46e1fa8139bf6c6b6bfc89c555f0bf1a0fdb82bc4b2f07c9f6f3331556531 | {"artifact_kind": "focused-sample", "lang": "python", "topic": "01-foundations.mathematics.generating-functions"} |
python/01-foundations.mathematics.generating-functions/focused-sample/tests/test_sample.py | # file: python/01-foundations.mathematics.generating-functions/focused-sample/tests/test_sample.py
"""Original enumerative, algebraic, and input-boundary fixtures."""
import unittest
from typing import cast
from sample import add, multiply, quotient, shift
def tilings(length: int) -> int:
if length == 0:
... | test | stable | codex | 97aae4a3971b4624 | 0 | 941 | 41168d58aec5a3c41f3cb536d6ee7b2a29c339021985fd259355d77d7376fa04 | {"artifact_kind": "focused-sample", "lang": "python", "topic": "01-foundations.mathematics.generating-functions"} |
python/01-foundations.mathematics.generating-functions/textbook-walkthrough/README.md | <!-- file: python/01-foundations.mathematics.generating-functions/textbook-walkthrough/README.md -->
# Python generating-functions walkthrough
Read walkthrough.md for an eight-snippet progression from addition/shifts through convolution to unit-denominator division. Each excerpt matches supplied runnable code. Run tes... | readme | stable | codex | 97aae4a3971b4624 | 0 | 110 | f2d5d57796a6b5f442c0a5e08b8cdbd3d10062c417be9be8a4272c020a602513 | {"artifact_kind": "textbook-walkthrough", "lang": "python", "topic": "01-foundations.mathematics.generating-functions"} |
python/01-foundations.mathematics.generating-functions/textbook-walkthrough/walkthrough.md | <!-- file: python/01-foundations.mathematics.generating-functions/textbook-walkthrough/walkthrough.md -->
# Deriving formal generating-function operations in Python
Begin with a representation rather than a symbolic algebra engine. A tuple (a₀,a₁,…) stores coefficients of powers 1,x,x²,… . Its finite length describes ... | walkthrough | stable | codex | 97aae4a3971b4624 | 0 | 2,593 | d06667c88c708fc12517bd749d34282aac19e4f0ef8954818326386603599cfc | {"artifact_kind": "textbook-walkthrough", "lang": "python", "topic": "01-foundations.mathematics.generating-functions"} |
rust/01-foundations.mathematics.generating-functions/focused-sample/Cargo.toml | # file: rust/01-foundations.mathematics.generating-functions/focused-sample/Cargo.toml
[package]
name = "original-series-prefixes"
version = "0.1.0"
edition = "2024"
publish = false
[dependencies]
| manifest | stable | codex | 7fdf43fe86797395 | 0 | 77 | 80b24f2453114697add02c208e550f98023e5b406b2980e3418c381de92bd63c | {"artifact_kind": "focused-sample", "lang": "rust", "topic": "01-foundations.mathematics.generating-functions"} |
rust/01-foundations.mathematics.generating-functions/focused-sample/README.md | <!-- file: rust/01-foundations.mathematics.generating-functions/focused-sample/README.md -->
# Checked formal-series prefixes
Beginner operations add zero-extended coefficients and shift by a power of x. Intermediate multiplication computes direct truncated convolution. Expert division solves each new coefficient from... | readme | stable | codex | 7fdf43fe86797395 | 0 | 387 | 5c2b16f86eeca1ff11dda12f4e2b0686a20ab61e4d2d44d3d5c5a732f8eacb66 | {"artifact_kind": "focused-sample", "lang": "rust", "topic": "01-foundations.mathematics.generating-functions"} |
rust/01-foundations.mathematics.generating-functions/focused-sample/src/lib.rs | // file: rust/01-foundations.mathematics.generating-functions/focused-sample/src/lib.rs
//! Checked integer formal-series prefixes, with transactional output writes.
pub const LIMIT: usize = 64;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Error {
ResourceLimit,
Nonunit,
Overflow,
}
fn arguments... | source | stable | codex | 7fdf43fe86797395 | 0 | 3,635 | 6d9d1849a798dafbd1dd9f08e5a5e544563df9e5b7d2d838ddf1e2b668198227 | {"artifact_kind": "focused-sample", "lang": "rust", "topic": "01-foundations.mathematics.generating-functions"} |
rust/01-foundations.mathematics.generating-functions/textbook-walkthrough/README.md | <!-- file: rust/01-foundations.mathematics.generating-functions/textbook-walkthrough/README.md -->
# Checked formal-series prefixes
Beginner operations add zero-extended coefficients and shift by a power of x. Intermediate multiplication computes direct truncated convolution. Expert division solves each new coefficien... | readme | stable | codex | 7fdf43fe86797395 | 0 | 402 | 6744c09dfc5e6be5369df34d619653a9f5b69b639935f0463b5939fe2d5af4fd | {"artifact_kind": "textbook-walkthrough", "lang": "rust", "topic": "01-foundations.mathematics.generating-functions"} |
rust/01-foundations.mathematics.generating-functions/textbook-walkthrough/walkthrough.md | <!-- file: rust/01-foundations.mathematics.generating-functions/textbook-walkthrough/walkthrough.md -->
# Formal-series prefixes with checked Rust arithmetic
Represent A(x) by a slice of coefficients: a[i] multiplies x^i, and coefficients beyond the slice are zero. An empty slice represents zero. The output slice leng... | walkthrough | stable | codex | 7fdf43fe86797395 | 0 | 3,291 | c317243fc845f9d8ac953e372c5c3c35ad50cf904d0544dea186962f720f84dc | {"artifact_kind": "textbook-walkthrough", "lang": "rust", "topic": "01-foundations.mathematics.generating-functions"} |
typescript/01-foundations.mathematics.generating-functions/focused-sample/README.md | <!-- file: typescript/01-foundations.mathematics.generating-functions/focused-sample/README.md -->
# Exact formal-series prefixes
Progress from coefficient addition and shifts, through direct truncated convolution, to division by a denominator whose constant is +1n or -1n. Output has exactly the requested precision. E... | readme | stable | codex | 8f1ee1fef55a541a | 0 | 341 | 5df6ad202e93aa884f8646a4c704d15fe4d7b4793d33d68aaf1c1ba49d97b4a3 | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.generating-functions"} |
typescript/01-foundations.mathematics.generating-functions/focused-sample/package.json | file: typescript/01-foundations.mathematics.generating-functions/focused-sample/package.json
{
"name": "original-series-prefixes",
"private": true,
"version": "0.1.0",
"type": "module"
}
| manifest | stable | codex | 8f1ee1fef55a541a | 0 | 72 | 126637b0b44c25650389d895fe0e746ce84754a83bf810fb80088f6d5d047d7b | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.generating-functions"} |
typescript/01-foundations.mathematics.generating-functions/focused-sample/sample.ts | // file: typescript/01-foundations.mathematics.generating-functions/focused-sample/sample.ts
/** Exact integer formal series, represented by dense coefficient arrays. */
export const LIMIT = 64;
function arrayRequired(value: unknown): void {
if (!Array.isArray(value))
throw new TypeError("coefficients must be an... | source | stable | codex | 8f1ee1fef55a541a | 0 | 846 | 4e7fe0058dbf25f2921f6801095755c32f848757b0e867e148e57c7574123753 | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.generating-functions"} |
typescript/01-foundations.mathematics.generating-functions/focused-sample/tests/test_sample.ts | // file: typescript/01-foundations.mathematics.generating-functions/focused-sample/tests/test_sample.ts
import assert from "node:assert/strict";
import { test } from "node:test";
import { add, shift, multiply, quotient } from "../sample.js";
function tilings(n: number): bigint {
return n === 0 ? 1n : tilings(n - 1) ... | test | stable | codex | 8f1ee1fef55a541a | 0 | 1,157 | 2e48a83191f8895bc617038adc879ea44c154eff0a857115e95cb4b51b28652a | {"artifact_kind": "focused-sample", "lang": "typescript", "topic": "01-foundations.mathematics.generating-functions"} |
typescript/01-foundations.mathematics.generating-functions/textbook-walkthrough/README.md | <!-- file: typescript/01-foundations.mathematics.generating-functions/textbook-walkthrough/README.md -->
# TypeScript generating-functions walkthrough
Read walkthrough.md for eight exact excerpts progressing from addition/shifts through convolution to unit quotient recurrences. Supplied code and five tests reuse our a... | readme | stable | codex | 8f1ee1fef55a541a | 0 | 110 | 135890dc6364e5aafefc6178efd6473d9db33e3af61876b730706da521361a92 | {"artifact_kind": "textbook-walkthrough", "lang": "typescript", "topic": "01-foundations.mathematics.generating-functions"} |
typescript/01-foundations.mathematics.generating-functions/textbook-walkthrough/walkthrough.md | <!-- file: typescript/01-foundations.mathematics.generating-functions/textbook-walkthrough/walkthrough.md -->
# Exact formal-series coefficients in TypeScript
A dense array stores a polynomial by degree: element i is the coefficient of x^i, and its omitted tail is zero. The output precision N selects degrees zero thro... | walkthrough | stable | codex | 8f1ee1fef55a541a | 0 | 2,551 | bcd4f4b61fc814fa435027b9a8d3fdeb9f8ede53433d7016d52414815f3636ad | {"artifact_kind": "textbook-walkthrough", "lang": "typescript", "topic": "01-foundations.mathematics.generating-functions"} |
c/01-foundations.mathematics.graph-theory/focused-sample/README.md | <!-- file: c/01-foundations.mathematics.graph-theory/focused-sample/README.md -->
# Directed graph facts in C
Beginner: degree and edge counts. Intermediate: FIFO shortest distances with deterministic predecessor witnesses. Expert: reflexive bitset reachability and canonical strongly connected components.
Rows encode... | readme | stable | codex | ce808633466784ca | 0 | 586 | 01b4f6e4f742100e717cb14222a6b336eff60fa72cc0f5b8737d3fec1d21b523 | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.graph-theory"} |
c/01-foundations.mathematics.graph-theory/focused-sample/sample.c | // file: c/01-foundations.mathematics.graph-theory/focused-sample/sample.c
#include "sample.h"
#define GRAPH_LIMIT 32u
static GraphStatus validate(const uint32_t *rows, size_t n) {
if (n > GRAPH_LIMIT)
return GRAPH_RESOURCE_LIMIT;
if (n != 0 && rows == NULL)
return GRAPH_INVALID;
const uint3... | source | stable | codex | ce808633466784ca | 0 | 1,481 | 550b52f92aa0f989bbecdb94843699300f865270ecee4d158f330187627c815c | {"artifact_kind": "focused-sample", "lang": "c", "topic": "01-foundations.mathematics.graph-theory"} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.