IF Commons GitHub

referenceCase

concept

A case with inputs and the value a calculation must give for them, found by hand or from a source that is trusted, with how close it must be: what a calculation is held to

Model proof. Written in commons/data/models/proof/mod.ts:89. Identified by referenceCaseId.

Governance: attributes

calculationtextrequired

The calculation it is for

Becomes the column calculation of reference_case.

Written at commons/data/models/proof/mod.ts:93

descriptiontextrequired

What the case shows

Becomes the column description of reference_case.

Written at commons/data/models/proof/mod.ts:94

expectedtextrequired

The value it must give, as a number

Becomes the column expected of reference_case.

Written at commons/data/models/proof/mod.ts:96

inputstextrequired

The inputs, as JSON

Becomes the column inputs of reference_case.

Written at commons/data/models/proof/mod.ts:95

referenceCaseIdidentifierrequired

What identifies the case

Becomes the column reference_case_id of reference_case.

Written at commons/data/models/proof/mod.ts:92

sourcetextrequired

Where the value comes from

Becomes the column source of reference_case.

Written at commons/data/models/proof/mod.ts:98

tolerancetextrequired

How far it may be from the value, as a number: 0 for exact

Becomes the column tolerance of reference_case.

Written at commons/data/models/proof/mod.ts:97

Logical: the table

Projects to the table reference_case with the primary key reference_case_id.

ColumnTypeNullRoleFrom
calculationtextfalseattributereferenceCase.calculation
descriptiontextfalseattributereferenceCase.description
expectedtextfalseattributereferenceCase.expected
inputstextfalseattributereferenceCase.inputs
reference_case_idtextfalseattributereferenceCase.referenceCaseId
sourcetextfalseattributereferenceCase.source
tolerancetextfalseattributereferenceCase.tolerance

Physical: SQL

CREATE TABLE IF NOT EXISTS "reference_case" (
    "reference_case_id" VARCHAR NOT NULL PRIMARY KEY,
    "calculation" VARCHAR NOT NULL,
    "description" VARCHAR NOT NULL,
    "inputs" VARCHAR NOT NULL,
    "expected" VARCHAR NOT NULL,
    "tolerance" VARCHAR NOT NULL,
    "source" VARCHAR NOT NULL
);

Physical: the typed table

Read and written from TypeScript with the types the model gives: import { referenceCase } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/proof.auto.ts: do not edit.

import { from } from "@intellectual-frontiers/data/sql/typed";
import { referenceCase } from "@intellectual-frontiers/data/sql/typed/models";

const rows = await from(referenceCase).select((s) => ({ referenceCaseId: s.referenceCase.referenceCaseId, calculation: s.referenceCase.calculation })).run(runner);

Titles, headings, exports, tables, columns and requirements. Esc closes.