gdp-wired 0.55.1 → 0.56.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -0
- package/dist/core/agent-consult/cli.js +11 -0
- package/dist/core/agent-consult/worker.js +9 -0
- package/dist/core/c/reader.d.ts +74 -2
- package/dist/core/c/reader.js +3144 -121
- package/dist/core/c/safety.d.ts +98 -0
- package/dist/core/c/safety.js +642 -0
- package/dist/core/cli.d.ts +9 -0
- package/dist/core/cli.js +215 -8
- package/dist/core/extract-c.d.ts +8 -0
- package/dist/core/extract-c.js +114 -15
- package/dist/core/extract-check.js +124 -12
- package/dist/core/extract-go-check.js +6 -0
- package/dist/core/extract-go.d.ts +15 -1
- package/dist/core/extract-go.js +102 -4
- package/dist/core/extract-print.js +4 -2
- package/dist/core/extract-step.d.ts +22 -0
- package/dist/core/extract-step.js +261 -9
- package/dist/core/extract.d.ts +10 -0
- package/dist/core/extract.js +37 -3
- package/dist/core/law-answer.d.ts +1 -0
- package/dist/core/law-answer.js +23 -0
- package/dist/core/laws.js +3 -16
- package/dist/core/native-law.js +11 -3
- package/dist/interchange/cli.js +13 -0
- package/package.json +1 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { type Instances, type KInduction, type Tree } from '../../kernel/kernel.js';
|
|
2
|
+
import { type Rule } from '../dsl.js';
|
|
3
|
+
import type { GoRead, TT } from '../extract-go.js';
|
|
4
|
+
import * as I from '../extract-ir.js';
|
|
5
|
+
import { type Model } from '../extract-read.js';
|
|
6
|
+
import { type KindProof } from '../kind.js';
|
|
7
|
+
import { type Law, type Machine } from '../machine.js';
|
|
8
|
+
import { type CRead, type CSafetyMacroConfig } from './reader.js';
|
|
9
|
+
export type { CSafetyMacroConfig } from './reader.js';
|
|
10
|
+
export type CSafetyKind = 'bounds' | 'overflow' | 'division';
|
|
11
|
+
export type CSafetySite = {
|
|
12
|
+
where: string;
|
|
13
|
+
kind: CSafetyKind;
|
|
14
|
+
condition: I.B;
|
|
15
|
+
};
|
|
16
|
+
export type CSafetyStatus = 'proven' | 'broken' | 'unproven' | 'unchecked';
|
|
17
|
+
export type CSafetyRun = {
|
|
18
|
+
params: Record<string, number>;
|
|
19
|
+
trace: Record<string, unknown>[];
|
|
20
|
+
};
|
|
21
|
+
export type CSafetyReplay = {
|
|
22
|
+
built: boolean;
|
|
23
|
+
requests: string[];
|
|
24
|
+
reports: string[];
|
|
25
|
+
states: string[];
|
|
26
|
+
stderr: string;
|
|
27
|
+
matchedSite: boolean;
|
|
28
|
+
};
|
|
29
|
+
export type CSafetyIssue = {
|
|
30
|
+
where: string;
|
|
31
|
+
kind: CSafetyKind;
|
|
32
|
+
status: CSafetyStatus;
|
|
33
|
+
replay?: CSafetyReplay;
|
|
34
|
+
why?: string;
|
|
35
|
+
};
|
|
36
|
+
export type CSafetyResult = {
|
|
37
|
+
status: CSafetyStatus;
|
|
38
|
+
issues: CSafetyIssue[];
|
|
39
|
+
assumptions: readonly string[];
|
|
40
|
+
coveredFunctions: readonly string[];
|
|
41
|
+
coveredHelpers?: readonly string[];
|
|
42
|
+
uncheckedFunctions?: readonly string[];
|
|
43
|
+
macroConfig?: CSafetyMacroConfig;
|
|
44
|
+
};
|
|
45
|
+
export type CSafetyProofBundle = {
|
|
46
|
+
kind: 'usual';
|
|
47
|
+
machine: Machine;
|
|
48
|
+
laws: Law[];
|
|
49
|
+
proof: {
|
|
50
|
+
instances: Record<string, Instances>;
|
|
51
|
+
trees: Record<string, Tree>;
|
|
52
|
+
};
|
|
53
|
+
} | {
|
|
54
|
+
kind: 'kind';
|
|
55
|
+
machine: Machine;
|
|
56
|
+
assumed: Law[];
|
|
57
|
+
kl: KInduction;
|
|
58
|
+
kproof: KindProof;
|
|
59
|
+
};
|
|
60
|
+
export type CSafetyArtifact = {
|
|
61
|
+
rule: Rule;
|
|
62
|
+
machine: Machine;
|
|
63
|
+
source: string;
|
|
64
|
+
baseLaws: Law[];
|
|
65
|
+
targetLaws: Law[];
|
|
66
|
+
jointProof?: CSafetyProofBundle;
|
|
67
|
+
siteProofs: (CSafetyProofBundle | undefined)[];
|
|
68
|
+
};
|
|
69
|
+
export declare const cSafetyArtifactOf: (result: CSafetyResult) => CSafetyArtifact | undefined;
|
|
70
|
+
export declare const uncheckedCSafety: (issues?: CSafetyIssue[], coverage?: {
|
|
71
|
+
coveredFunctions?: readonly string[];
|
|
72
|
+
coveredHelpers?: readonly string[];
|
|
73
|
+
uncheckedFunctions?: readonly string[];
|
|
74
|
+
macroConfig?: CSafetyMacroConfig;
|
|
75
|
+
}) => CSafetyResult;
|
|
76
|
+
export declare function monitorCSafety(m: Model, sites: readonly CSafetySite[], domain: I.B): {
|
|
77
|
+
model: Model;
|
|
78
|
+
alarmLaws: string[];
|
|
79
|
+
alarmNames: (string | undefined)[];
|
|
80
|
+
};
|
|
81
|
+
export declare function verifyCSafetyProof(machine: Machine, targets: readonly Law[], bundle: CSafetyProofBundle | undefined): boolean;
|
|
82
|
+
export declare function replaySafety(o: {
|
|
83
|
+
flags: string[];
|
|
84
|
+
harness: string;
|
|
85
|
+
clang?: string;
|
|
86
|
+
strictFlex?: string[];
|
|
87
|
+
methods: GoRead['methods'];
|
|
88
|
+
choices: string[];
|
|
89
|
+
ctor: string[];
|
|
90
|
+
ttab: TT[];
|
|
91
|
+
}, run: CSafetyRun, site?: {
|
|
92
|
+
where: string;
|
|
93
|
+
kind: CSafetyKind;
|
|
94
|
+
}): CSafetyReplay;
|
|
95
|
+
export declare function analyzeCSafety(read: GoRead, c: CRead, sites: readonly CSafetySite[], domains: Record<string, 'nat' | 'int'>, opts?: {
|
|
96
|
+
replay?: (run: CSafetyRun, site: CSafetySite) => CSafetyReplay;
|
|
97
|
+
searchMs?: number;
|
|
98
|
+
}): CSafetyResult;
|