verimath 0.0.0-stage → 0.1.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.
- package/LICENSE +202 -0
- package/README.md +15 -2
- package/THIRD-PARTY-NOTICES.txt +1902 -0
- package/package.json +23 -4
- package/verimath.d.ts +50 -0
- package/verimath.js +345 -0
- package/verimath_bg.wasm +0 -0
- package/verimath_bg.wasm.d.ts +16 -0
package/package.json
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "verimath",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Exact mathematical answer grading in Node.js",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/hsreika/VeriMath.git",
|
|
8
|
+
"directory": "bindings-node"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://hsreika.github.io/VeriMath/docs/node.html",
|
|
11
|
+
"files": [
|
|
12
|
+
"verimath.js",
|
|
13
|
+
"verimath.d.ts",
|
|
14
|
+
"verimath_bg.wasm",
|
|
15
|
+
"verimath_bg.wasm.d.ts",
|
|
16
|
+
"THIRD-PARTY-NOTICES.txt"
|
|
17
|
+
],
|
|
18
|
+
"type": "commonjs",
|
|
19
|
+
"main": "./verimath.js",
|
|
20
|
+
"types": "./verimath.d.ts",
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=22"
|
|
23
|
+
},
|
|
24
|
+
"license": "Apache-2.0"
|
|
25
|
+
}
|
package/verimath.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export type Extraction = "strict" | "completion" | "final_line" | "gsm8k";
|
|
5
|
+
export type AnswerType = "auto" | "count" | "interval" | "mixed_number" | "ratio" | "tuple" | "set";
|
|
6
|
+
export type VerifierOptions = { extraction?: Extraction } & (
|
|
7
|
+
| { choices: string; variable?: never; answerType?: never; unit?: never; absTol?: never; requireUnit?: false }
|
|
8
|
+
| { variable?: string; answerType?: AnswerType; choices?: never; unit?: never; absTol?: never; requireUnit?: false }
|
|
9
|
+
| { unit: string; absTol?: string; requireUnit?: boolean; answerType?: "auto" | "mixed_number"; choices?: never; variable?: never }
|
|
10
|
+
| { absTol: string; unit?: never; requireUnit?: false; answerType?: "auto" | "mixed_number"; choices?: never; variable?: never }
|
|
11
|
+
);
|
|
12
|
+
export type Verdict = (
|
|
13
|
+
| { status: "equivalent"; equivalent: true }
|
|
14
|
+
| { status: "not_equivalent"; equivalent: false }
|
|
15
|
+
| { status: "inconclusive" | "parse_failure" | "unsupported_expression" | "resource_limit_exceeded"
|
|
16
|
+
| "timeout" | "cancelled" | "internal_execution_failure"; equivalent: null }
|
|
17
|
+
) & {
|
|
18
|
+
message: string;
|
|
19
|
+
side: "expected" | "actual" | null;
|
|
20
|
+
/** Zero-based UTF-8 byte offset in the original operand. */
|
|
21
|
+
offset: number | null;
|
|
22
|
+
witness: string | null;
|
|
23
|
+
};
|
|
24
|
+
export type Grade = (expected: string, actual: string) => Verdict;
|
|
25
|
+
export type MembershipWitness = {
|
|
26
|
+
variable: string;
|
|
27
|
+
/** Exact reduced rational, such as "-1/5". */
|
|
28
|
+
value: string;
|
|
29
|
+
} & ({ in_expected: true; in_actual: false } | { in_expected: false; in_actual: true });
|
|
30
|
+
export type Inspection =
|
|
31
|
+
| (Extract<Verdict, { equivalent: false }> & { counterexample: MembershipWitness | null })
|
|
32
|
+
| (Exclude<Verdict, { equivalent: false }> & { counterexample: null });
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Validate a question's grading rules once and reuse the returned function.
|
|
38
|
+
*/
|
|
39
|
+
export function createVerifier(options?: VerifierOptions): Grade;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Grade with the supplied rules and return an exact counterexample when the
|
|
43
|
+
* engine can distinguish two real solution sets by a rational point.
|
|
44
|
+
*/
|
|
45
|
+
export function inspect(expected: string, actual: string, options?: VerifierOptions): Inspection;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Compare an answer key and a submission. Ungraded answers have equivalent = null.
|
|
49
|
+
*/
|
|
50
|
+
export function verify(expected: string, actual: string, extraction?: Extraction): Verdict;
|
package/verimath.js
ADDED
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
/* @ts-self-types="./verimath.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Validate a question's grading rules once and reuse the returned function.
|
|
5
|
+
* @param {VerifierOptions} [options]
|
|
6
|
+
* @returns {Grade}
|
|
7
|
+
*/
|
|
8
|
+
function createVerifier(options) {
|
|
9
|
+
const ret = wasm.createVerifier(options);
|
|
10
|
+
if (ret[2]) {
|
|
11
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
12
|
+
}
|
|
13
|
+
return takeFromExternrefTable0(ret[0]);
|
|
14
|
+
}
|
|
15
|
+
exports.createVerifier = createVerifier;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Grade with the supplied rules and return an exact counterexample when the
|
|
19
|
+
* engine can distinguish two real solution sets by a rational point.
|
|
20
|
+
* @param {string} expected
|
|
21
|
+
* @param {string} actual
|
|
22
|
+
* @param {VerifierOptions} [options]
|
|
23
|
+
* @returns {Inspection}
|
|
24
|
+
*/
|
|
25
|
+
function inspect(expected, actual, options) {
|
|
26
|
+
const ret = wasm.inspect(expected, actual, options);
|
|
27
|
+
if (ret[2]) {
|
|
28
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
29
|
+
}
|
|
30
|
+
return takeFromExternrefTable0(ret[0]);
|
|
31
|
+
}
|
|
32
|
+
exports.inspect = inspect;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Compare an answer key and a submission. Ungraded answers have equivalent = null.
|
|
36
|
+
* @param {string} expected
|
|
37
|
+
* @param {string} actual
|
|
38
|
+
* @param {Extraction} [extraction]
|
|
39
|
+
* @returns {Verdict}
|
|
40
|
+
*/
|
|
41
|
+
function verify(expected, actual, extraction) {
|
|
42
|
+
const ret = wasm.verify(expected, actual, extraction);
|
|
43
|
+
if (ret[2]) {
|
|
44
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
45
|
+
}
|
|
46
|
+
return takeFromExternrefTable0(ret[0]);
|
|
47
|
+
}
|
|
48
|
+
exports.verify = verify;
|
|
49
|
+
function __wbg_get_imports() {
|
|
50
|
+
const import0 = {
|
|
51
|
+
__proto__: null,
|
|
52
|
+
__wbg_Error_208446807d0d1e30: function(arg0, arg1) {
|
|
53
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
54
|
+
return ret;
|
|
55
|
+
},
|
|
56
|
+
__wbg___wbindgen_boolean_get_4f1baf9a00be3c74: function(arg0) {
|
|
57
|
+
const v = arg0;
|
|
58
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
59
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
60
|
+
},
|
|
61
|
+
__wbg___wbindgen_is_null_c22311b1cc228e3a: function(arg0) {
|
|
62
|
+
const ret = arg0 === null;
|
|
63
|
+
return ret;
|
|
64
|
+
},
|
|
65
|
+
__wbg___wbindgen_is_object_8b968c3ab8e96595: function(arg0) {
|
|
66
|
+
const val = arg0;
|
|
67
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
68
|
+
return ret;
|
|
69
|
+
},
|
|
70
|
+
__wbg___wbindgen_is_string_fc456fee5d3317de: function(arg0) {
|
|
71
|
+
const ret = typeof(arg0) === 'string';
|
|
72
|
+
return ret;
|
|
73
|
+
},
|
|
74
|
+
__wbg___wbindgen_is_undefined_be5b34249ff1fc15: function(arg0) {
|
|
75
|
+
const ret = arg0 === undefined;
|
|
76
|
+
return ret;
|
|
77
|
+
},
|
|
78
|
+
__wbg___wbindgen_string_get_7ce8eee7fd327545: function(arg0, arg1) {
|
|
79
|
+
const obj = arg1;
|
|
80
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
81
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
82
|
+
var len1 = WASM_VECTOR_LEN;
|
|
83
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
84
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
85
|
+
},
|
|
86
|
+
__wbg___wbindgen_throw_4c88d8bf264fd984: function(arg0, arg1) {
|
|
87
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
88
|
+
},
|
|
89
|
+
__wbg_fromCodePoint_84793ae8d520c4b9: function() { return handleError(function (arg0) {
|
|
90
|
+
const ret = String.fromCodePoint(arg0 >>> 0);
|
|
91
|
+
return ret;
|
|
92
|
+
}, arguments); },
|
|
93
|
+
__wbg_getPrototypeOf_8fbf04523e13de29: function() { return handleError(function (arg0) {
|
|
94
|
+
const ret = Reflect.getPrototypeOf(arg0);
|
|
95
|
+
return ret;
|
|
96
|
+
}, arguments); },
|
|
97
|
+
__wbg_get_2080c49015e35254: function() { return handleError(function (arg0, arg1) {
|
|
98
|
+
const ret = Reflect.get(arg0, arg1);
|
|
99
|
+
return ret;
|
|
100
|
+
}, arguments); },
|
|
101
|
+
__wbg_get_unchecked_e6325ad374eff861: function(arg0, arg1) {
|
|
102
|
+
const ret = arg0[arg1 >>> 0];
|
|
103
|
+
return ret;
|
|
104
|
+
},
|
|
105
|
+
__wbg_isWellFormed_9e12b0337ba4dfeb: function(arg0) {
|
|
106
|
+
const ret = arg0.isWellFormed();
|
|
107
|
+
return ret;
|
|
108
|
+
},
|
|
109
|
+
__wbg_length_b03a0fabb109b1e9: function(arg0) {
|
|
110
|
+
const ret = arg0.length;
|
|
111
|
+
return ret;
|
|
112
|
+
},
|
|
113
|
+
__wbg_length_e83e819f48c774e4: function(arg0) {
|
|
114
|
+
const ret = arg0.length;
|
|
115
|
+
return ret;
|
|
116
|
+
},
|
|
117
|
+
__wbg_new_4416a2fe2fac9c65: function(arg0, arg1) {
|
|
118
|
+
const ret = new TypeError(getStringFromWasm0(arg0, arg1));
|
|
119
|
+
return ret;
|
|
120
|
+
},
|
|
121
|
+
__wbg_new_7075786089b89c5e: function() {
|
|
122
|
+
const ret = new Map();
|
|
123
|
+
return ret;
|
|
124
|
+
},
|
|
125
|
+
__wbg_new_cd4348290afae586: function() {
|
|
126
|
+
const ret = new Object();
|
|
127
|
+
return ret;
|
|
128
|
+
},
|
|
129
|
+
__wbg_now_e7c6795a7f81e10f: function(arg0) {
|
|
130
|
+
const ret = arg0.now();
|
|
131
|
+
return ret;
|
|
132
|
+
},
|
|
133
|
+
__wbg_ownKeys_c9890d5405932253: function() { return handleError(function (arg0) {
|
|
134
|
+
const ret = Reflect.ownKeys(arg0);
|
|
135
|
+
return ret;
|
|
136
|
+
}, arguments); },
|
|
137
|
+
__wbg_performance_7e4e4494fdc9d07a: function(arg0) {
|
|
138
|
+
const ret = arg0.performance;
|
|
139
|
+
return ret;
|
|
140
|
+
},
|
|
141
|
+
__wbg_set_8282f7e0d2d01336: function(arg0, arg1, arg2) {
|
|
142
|
+
const ret = arg0.set(arg1, arg2);
|
|
143
|
+
return ret;
|
|
144
|
+
},
|
|
145
|
+
__wbg_set_e4b9a833d288759a: function(arg0, arg1, arg2) {
|
|
146
|
+
arg0[arg1] = arg2;
|
|
147
|
+
},
|
|
148
|
+
__wbg_static_accessor_GLOBAL_THIS_003ee833af9699fc: function() {
|
|
149
|
+
const ret = typeof globalThis === 'undefined' ? undefined : globalThis;
|
|
150
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
151
|
+
},
|
|
152
|
+
__wbg_static_accessor_GLOBAL_e4293fb22cbe77da: function() {
|
|
153
|
+
const ret = typeof global === 'undefined' ? undefined : global;
|
|
154
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
155
|
+
},
|
|
156
|
+
__wbg_static_accessor_SELF_53bb20457401453d: function() {
|
|
157
|
+
const ret = typeof self === 'undefined' ? undefined : self;
|
|
158
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
159
|
+
},
|
|
160
|
+
__wbg_static_accessor_WINDOW_b5e0810bfecb7feb: function() {
|
|
161
|
+
const ret = typeof window === 'undefined' ? undefined : window;
|
|
162
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
163
|
+
},
|
|
164
|
+
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
165
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref, Externref], shim_idx: 1, ret: Result(Externref), inner_ret: Some(Result(Externref)) }, mutable: false }) -> Externref`.
|
|
166
|
+
const ret = makeClosure(arg0, arg1, wasm_bindgen_5250fd6ed7aeca90___convert__closures_____invoke___wasm_bindgen_5250fd6ed7aeca90___JsValue__wasm_bindgen_5250fd6ed7aeca90___JsValue__core_6a51abefd5362b2___result__Result_wasm_bindgen_5250fd6ed7aeca90___JsValue__wasm_bindgen_5250fd6ed7aeca90___JsValue___true_);
|
|
167
|
+
return ret;
|
|
168
|
+
},
|
|
169
|
+
__wbindgen_generic_0000000000000002: function(arg0) {
|
|
170
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
171
|
+
const ret = arg0;
|
|
172
|
+
return ret;
|
|
173
|
+
},
|
|
174
|
+
__wbindgen_generic_0000000000000003: function(arg0, arg1) {
|
|
175
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
176
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
177
|
+
return ret;
|
|
178
|
+
},
|
|
179
|
+
__wbindgen_generic_0000000000000004: function(arg0) {
|
|
180
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
181
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
182
|
+
return ret;
|
|
183
|
+
},
|
|
184
|
+
__wbindgen_init_externref_table: function() {
|
|
185
|
+
const table = wasm.__wbindgen_externrefs;
|
|
186
|
+
table.set(0, undefined);
|
|
187
|
+
table.set(1024, undefined);
|
|
188
|
+
table.set(1025, null);
|
|
189
|
+
table.set(1026, true);
|
|
190
|
+
table.set(1027, false);
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
return {
|
|
194
|
+
__proto__: null,
|
|
195
|
+
"./verimath_bg.js": import0,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function wasm_bindgen_5250fd6ed7aeca90___convert__closures_____invoke___wasm_bindgen_5250fd6ed7aeca90___JsValue__wasm_bindgen_5250fd6ed7aeca90___JsValue__core_6a51abefd5362b2___result__Result_wasm_bindgen_5250fd6ed7aeca90___JsValue__wasm_bindgen_5250fd6ed7aeca90___JsValue___true_(arg0, arg1, arg2, arg3) {
|
|
200
|
+
const ret = wasm.wasm_bindgen_5250fd6ed7aeca90___convert__closures_____invoke___wasm_bindgen_5250fd6ed7aeca90___JsValue__wasm_bindgen_5250fd6ed7aeca90___JsValue__core_6a51abefd5362b2___result__Result_wasm_bindgen_5250fd6ed7aeca90___JsValue__wasm_bindgen_5250fd6ed7aeca90___JsValue___true_(arg0, arg1, arg2, arg3);
|
|
201
|
+
if (ret[2]) {
|
|
202
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
203
|
+
}
|
|
204
|
+
return takeFromExternrefTable0(ret[0]);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function addToExternrefTable0(obj) {
|
|
208
|
+
const idx = wasm.__externref_table_alloc();
|
|
209
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
210
|
+
return idx;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
214
|
+
? { register: () => {}, unregister: () => {} }
|
|
215
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
|
|
216
|
+
|
|
217
|
+
let cachedDataViewMemory0 = null;
|
|
218
|
+
function getDataViewMemory0() {
|
|
219
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
220
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
221
|
+
}
|
|
222
|
+
return cachedDataViewMemory0;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function getStringFromWasm0(ptr, len) {
|
|
226
|
+
ptr = ptr >>> 0;
|
|
227
|
+
return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
let cachedUint8ArrayMemory0 = null;
|
|
231
|
+
function getUint8ArrayMemory0() {
|
|
232
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
233
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
234
|
+
}
|
|
235
|
+
return cachedUint8ArrayMemory0;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function handleError(f, args) {
|
|
239
|
+
try {
|
|
240
|
+
return f.apply(this, args);
|
|
241
|
+
} catch (e) {
|
|
242
|
+
const idx = addToExternrefTable0(e);
|
|
243
|
+
wasm.__wbindgen_exn_store(idx);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function isLikeNone(x) {
|
|
248
|
+
return x === undefined || x === null;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
function makeClosure(arg0, arg1, f) {
|
|
252
|
+
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
253
|
+
const real = (...args) => {
|
|
254
|
+
|
|
255
|
+
// First up with a closure we increment the internal reference
|
|
256
|
+
// count. This ensures that the Rust closure environment won't
|
|
257
|
+
// be deallocated while we're invoking it.
|
|
258
|
+
state.cnt++;
|
|
259
|
+
try {
|
|
260
|
+
return f(state.a, state.b, ...args);
|
|
261
|
+
} finally {
|
|
262
|
+
real._wbg_cb_unref();
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
real._wbg_cb_unref = () => {
|
|
266
|
+
if (--state.cnt === 0) {
|
|
267
|
+
wasm.__wbindgen_destroy_closure(state.a, state.b);
|
|
268
|
+
state.a = 0;
|
|
269
|
+
CLOSURE_DTORS.unregister(state);
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
273
|
+
return real;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
277
|
+
if (realloc === undefined) {
|
|
278
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
279
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
280
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
281
|
+
WASM_VECTOR_LEN = buf.length;
|
|
282
|
+
return ptr;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
let len = arg.length;
|
|
286
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
287
|
+
|
|
288
|
+
const mem = getUint8ArrayMemory0();
|
|
289
|
+
|
|
290
|
+
let offset = 0;
|
|
291
|
+
|
|
292
|
+
for (; offset < len; offset++) {
|
|
293
|
+
const code = arg.charCodeAt(offset);
|
|
294
|
+
if (code > 0x7F) break;
|
|
295
|
+
mem[ptr + offset] = code;
|
|
296
|
+
}
|
|
297
|
+
if (offset !== len) {
|
|
298
|
+
if (offset !== 0) {
|
|
299
|
+
arg = arg.slice(offset);
|
|
300
|
+
}
|
|
301
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
302
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
303
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
304
|
+
|
|
305
|
+
offset += ret.written;
|
|
306
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
WASM_VECTOR_LEN = offset;
|
|
310
|
+
return ptr;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
function takeFromExternrefTable0(idx) {
|
|
314
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
315
|
+
wasm.__externref_table_dealloc(idx);
|
|
316
|
+
return value;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
320
|
+
cachedTextDecoder.decode();
|
|
321
|
+
function decodeText(bytes) {
|
|
322
|
+
return cachedTextDecoder.decode(bytes);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
const cachedTextEncoder = new TextEncoder();
|
|
326
|
+
|
|
327
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
328
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
329
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
330
|
+
view.set(buf);
|
|
331
|
+
return {
|
|
332
|
+
read: arg.length,
|
|
333
|
+
written: buf.length
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
let WASM_VECTOR_LEN = 0;
|
|
339
|
+
|
|
340
|
+
const wasmPath = `${__dirname}/verimath_bg.wasm`;
|
|
341
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
342
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
343
|
+
let wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
|
|
344
|
+
let wasm = wasmInstance.exports;
|
|
345
|
+
wasm.__wbindgen_start();
|
package/verimath_bg.wasm
ADDED
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const createVerifier: (a: any) => [number, number, number];
|
|
5
|
+
export const inspect: (a: any, b: any, c: any) => [number, number, number];
|
|
6
|
+
export const verify: (a: any, b: any, c: any) => [number, number, number];
|
|
7
|
+
export const wasm_bindgen_5250fd6ed7aeca90___convert__closures_____invoke___wasm_bindgen_5250fd6ed7aeca90___JsValue__wasm_bindgen_5250fd6ed7aeca90___JsValue__core_6a51abefd5362b2___result__Result_wasm_bindgen_5250fd6ed7aeca90___JsValue__wasm_bindgen_5250fd6ed7aeca90___JsValue___true_: (a: number, b: number, c: any, d: any) => [number, number, number];
|
|
8
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
9
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
10
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
11
|
+
export const __wbindgen_exn_store: (a: number) => void;
|
|
12
|
+
export const __externref_table_alloc: () => number;
|
|
13
|
+
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
14
|
+
export const __wbindgen_destroy_closure: (a: number, b: number) => void;
|
|
15
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
16
|
+
export const __wbindgen_start: () => void;
|