gdp-wired 0.18.0 → 0.20.0

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.
@@ -6,7 +6,9 @@ export declare const self: {
6
6
  };
7
7
  export declare const natural: "nat";
8
8
  export declare const boolean: "bool";
9
- type FieldSort = 'nat' | 'self';
9
+ export type FieldSort = 'nat' | {
10
+ data: string;
11
+ };
10
12
  export type Sort = 'nat' | 'bool' | Data;
11
13
  export type Ctor = {
12
14
  name: string;
@@ -51,6 +53,12 @@ export type X = {
51
53
  binds: string[];
52
54
  body: X;
53
55
  }[];
56
+ } | {
57
+ op: 'natmatch';
58
+ of: X;
59
+ zero: X;
60
+ pred: string;
61
+ succ: X;
54
62
  } | {
55
63
  op: 'apply';
56
64
  param: string;
@@ -90,6 +98,12 @@ export declare class Nat {
90
98
  atLeast(b: NatLike): Bool;
91
99
  eq(b: NatLike): Bool;
92
100
  ne(b: NatLike): Bool;
101
+ match(cases: {
102
+ zero: () => Nat | Bool | Val | number;
103
+ succ: (f: {
104
+ pred: Nat;
105
+ }) => Nat | Bool | Val | number;
106
+ }): any;
93
107
  }
94
108
  export type NatLike = Nat | number;
95
109
  export declare class Bool {
@@ -114,20 +128,33 @@ export declare class Val {
114
128
  }
115
129
  export declare const wrap: (s: Sort, x: X) => Nat | Bool | Val;
116
130
  export declare function when<T extends Nat | Val | Bool | number>(c: Bool, a: T, b: T): T extends number ? Nat : T;
131
+ export declare const dataNamed: (name: string) => Data;
132
+ export declare const fieldSort: (f: {
133
+ sort: FieldSort;
134
+ }) => Sort;
135
+ export declare const inGroup: (d: Data, f: {
136
+ sort: FieldSort;
137
+ }) => boolean;
117
138
  export declare class Data {
118
139
  readonly name: string;
140
+ readonly group: string[];
119
141
  readonly ctors: Ctor[];
120
- constructor(name: string, decl: Record<string, Record<string, typeof self | 'nat' | {
121
- nat: true;
122
- }>>);
142
+ readonly seq: number;
143
+ constructor(name: string, decl: Record<string, Record<string, FieldSort>>, group?: string[]);
123
144
  index(ctor: string): number;
124
145
  get nullary(): number;
125
146
  make(ctor: string, ...args: (Val | NatLike)[]): Val;
147
+ ctorHeight(c: Ctor): number;
148
+ get height(): number;
126
149
  }
150
+ export declare function weakOrder(ds: Data[]): Map<string, number>;
127
151
  type Decl = Record<string, Record<string, unknown>>;
128
152
  export declare function data<const D extends Decl>(name: string, decl: D): Data & {
129
153
  [c in keyof D]: keyof D[c] extends never ? Val : (...args: (Val | NatLike)[]) => Val;
130
154
  };
155
+ export declare function mutual<const G extends Record<string, Decl>>(decls: G): {
156
+ [n in keyof G]: Data & Record<string, any>;
157
+ };
131
158
  export type Fn = {
132
159
  name: string;
133
160
  params: {
@@ -136,7 +163,8 @@ export type Fn = {
136
163
  }[];
137
164
  ret: Sort;
138
165
  body: () => X;
139
- decreases?: number;
166
+ readonly decreases?: number;
167
+ readonly ring: string[];
140
168
  paramFns: string[];
141
169
  };
142
170
  export type Callable = ((...args: (Val | NatLike | Bool)[]) => any) & {
@@ -247,9 +275,37 @@ export type Options = {
247
275
  patience?: number;
248
276
  };
249
277
  export declare function refute(l: DataLaw, n?: number, seed?: number): Record<string, string> | undefined;
278
+ type SchemeUse = {
279
+ subst: Record<string, E>;
280
+ guard: C;
281
+ member?: number;
282
+ };
283
+ type Scheme = {
284
+ name: string;
285
+ on?: {
286
+ v: string;
287
+ d: Data | 'nat';
288
+ };
289
+ uses: SchemeUse[];
290
+ companions?: Companion[];
291
+ };
292
+ type Companion = {
293
+ law: DataLaw;
294
+ on: {
295
+ v: string;
296
+ d: Data;
297
+ };
298
+ uses: SchemeUse[];
299
+ };
300
+ export declare const schemesOf: (p: Program, l: DataLaw) => Scheme[];
250
301
  export declare const attemptMs: {
251
302
  ms: number;
252
303
  };
304
+ export declare const lemmaCaps: {
305
+ perLemma: number;
306
+ total: number;
307
+ perCase: number;
308
+ };
253
309
  export declare function conjectures(p: Program, l: DataLaw, max?: number, maxSize?: number): DataLaw[];
254
310
  export declare const showX: (x: X) => string;
255
311
  export declare const showY: (y: Y) => string;