timed-automata-analyzer 1.0.3 → 1.0.5
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 +1 -1
- package/README.md +1 -1
- package/package.json +1 -1
- package/timed_automata_analyzer.d.ts +5 -5
- package/timed_automata_analyzer_bg.js +30 -18
- package/timed_automata_analyzer_bg.wasm +0 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ In case you want to contribute to the tool or fork the repository, only few step
|
|
|
21
21
|
- As a first step, you need to install Rust.
|
|
22
22
|
See the [Rust website](https://www.rust-lang.org/tools/install) for information on how to do this.
|
|
23
23
|
- Additionally, you need to install _wasm-pack_ with `cargo install wasm-pack` for WebAssembly outputs.
|
|
24
|
-
- The WebAssembly binary (including glue code for JavaScript/TypeScript and an
|
|
24
|
+
- The WebAssembly binary (including glue code for JavaScript/TypeScript and an NPM package) is generated by running `wasm-pack build --target bundler` and published to the npm registry by running `wasm-pack publish`.
|
|
25
25
|
- This project includes an extensive test suite. Tests can be run with `cargo test`.
|
|
26
26
|
- For linting, this project uses the built-in linter of Rust as well as [Clippy](https://github.com/rust-lang/rust-clippy).
|
|
27
27
|
To run the linters, execute `cargo check` and `cargo clippy`, respectively.
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* locations.</li>
|
|
20
20
|
* </ul>
|
|
21
21
|
*/
|
|
22
|
-
export function findUnreachableLocations(ta: TimedAutomaton):
|
|
22
|
+
export function findUnreachableLocations(ta: TimedAutomaton): string[];
|
|
23
23
|
export enum ClockComparator {
|
|
24
24
|
LESSER = 0,
|
|
25
25
|
LEQ = 1,
|
|
@@ -36,17 +36,17 @@ export class Clock {
|
|
|
36
36
|
}
|
|
37
37
|
export class ClockConstraint {
|
|
38
38
|
free(): void;
|
|
39
|
-
constructor(clauses:
|
|
39
|
+
constructor(clauses: Clause[]);
|
|
40
40
|
}
|
|
41
41
|
export class Location {
|
|
42
42
|
free(): void;
|
|
43
|
-
constructor(name: string, is_initial: boolean, invariant?: ClockConstraint);
|
|
43
|
+
constructor(name: string, is_initial: boolean, invariant?: ClockConstraint | null);
|
|
44
44
|
}
|
|
45
45
|
export class Switch {
|
|
46
46
|
free(): void;
|
|
47
|
-
constructor(source: Location, guard: ClockConstraint | undefined, action: string, reset:
|
|
47
|
+
constructor(source: Location, guard: ClockConstraint | null | undefined, action: string, reset: Clock[], target: Location);
|
|
48
48
|
}
|
|
49
49
|
export class TimedAutomaton {
|
|
50
50
|
free(): void;
|
|
51
|
-
constructor(locations:
|
|
51
|
+
constructor(locations: Location[], clocks: Clock[], switches: Switch[]);
|
|
52
52
|
}
|
|
@@ -4,12 +4,6 @@ export function __wbg_set_wasm(val) {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
|
|
8
|
-
|
|
9
|
-
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
10
|
-
|
|
11
|
-
cachedTextDecoder.decode();
|
|
12
|
-
|
|
13
7
|
let cachedUint8ArrayMemory0 = null;
|
|
14
8
|
|
|
15
9
|
function getUint8ArrayMemory0() {
|
|
@@ -19,16 +13,34 @@ function getUint8ArrayMemory0() {
|
|
|
19
13
|
return cachedUint8ArrayMemory0;
|
|
20
14
|
}
|
|
21
15
|
|
|
16
|
+
const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
|
|
17
|
+
|
|
18
|
+
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
19
|
+
|
|
20
|
+
cachedTextDecoder.decode();
|
|
21
|
+
|
|
22
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
23
|
+
let numBytesDecoded = 0;
|
|
24
|
+
function decodeText(ptr, len) {
|
|
25
|
+
numBytesDecoded += len;
|
|
26
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
27
|
+
cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
28
|
+
cachedTextDecoder.decode();
|
|
29
|
+
numBytesDecoded = len;
|
|
30
|
+
}
|
|
31
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
32
|
+
}
|
|
33
|
+
|
|
22
34
|
function getStringFromWasm0(ptr, len) {
|
|
23
35
|
ptr = ptr >>> 0;
|
|
24
|
-
return
|
|
36
|
+
return decodeText(ptr, len);
|
|
25
37
|
}
|
|
26
38
|
|
|
27
39
|
let WASM_VECTOR_LEN = 0;
|
|
28
40
|
|
|
29
41
|
const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
|
|
30
42
|
|
|
31
|
-
|
|
43
|
+
const cachedTextEncoder = new lTextEncoder('utf-8');
|
|
32
44
|
|
|
33
45
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
34
46
|
? function (arg, view) {
|
|
@@ -105,9 +117,9 @@ function addToExternrefTable0(obj) {
|
|
|
105
117
|
|
|
106
118
|
function passArrayJsValueToWasm0(array, malloc) {
|
|
107
119
|
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
108
|
-
const mem = getDataViewMemory0();
|
|
109
120
|
for (let i = 0; i < array.length; i++) {
|
|
110
|
-
|
|
121
|
+
const add = addToExternrefTable0(array[i]);
|
|
122
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
111
123
|
}
|
|
112
124
|
WASM_VECTOR_LEN = array.length;
|
|
113
125
|
return ptr;
|
|
@@ -146,7 +158,7 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
146
158
|
* locations.</li>
|
|
147
159
|
* </ul>
|
|
148
160
|
* @param {TimedAutomaton} ta
|
|
149
|
-
* @returns {
|
|
161
|
+
* @returns {string[]}
|
|
150
162
|
*/
|
|
151
163
|
export function findUnreachableLocations(ta) {
|
|
152
164
|
_assertClass(ta, TimedAutomaton);
|
|
@@ -260,7 +272,7 @@ export class ClockConstraint {
|
|
|
260
272
|
wasm.__wbg_clockconstraint_free(ptr, 0);
|
|
261
273
|
}
|
|
262
274
|
/**
|
|
263
|
-
* @param {
|
|
275
|
+
* @param {Clause[]} clauses
|
|
264
276
|
*/
|
|
265
277
|
constructor(clauses) {
|
|
266
278
|
const ptr0 = passArrayJsValueToWasm0(clauses, wasm.__wbindgen_malloc);
|
|
@@ -299,7 +311,7 @@ export class Location {
|
|
|
299
311
|
/**
|
|
300
312
|
* @param {string} name
|
|
301
313
|
* @param {boolean} is_initial
|
|
302
|
-
* @param {ClockConstraint |
|
|
314
|
+
* @param {ClockConstraint | null} [invariant]
|
|
303
315
|
*/
|
|
304
316
|
constructor(name, is_initial, invariant) {
|
|
305
317
|
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -342,9 +354,9 @@ export class Switch {
|
|
|
342
354
|
}
|
|
343
355
|
/**
|
|
344
356
|
* @param {Location} source
|
|
345
|
-
* @param {ClockConstraint | undefined} guard
|
|
357
|
+
* @param {ClockConstraint | null | undefined} guard
|
|
346
358
|
* @param {string} action
|
|
347
|
-
* @param {
|
|
359
|
+
* @param {Clock[]} reset
|
|
348
360
|
* @param {Location} target
|
|
349
361
|
*/
|
|
350
362
|
constructor(source, guard, action, reset, target) {
|
|
@@ -384,9 +396,9 @@ export class TimedAutomaton {
|
|
|
384
396
|
wasm.__wbg_timedautomaton_free(ptr, 0);
|
|
385
397
|
}
|
|
386
398
|
/**
|
|
387
|
-
* @param {
|
|
388
|
-
* @param {
|
|
389
|
-
* @param {
|
|
399
|
+
* @param {Location[]} locations
|
|
400
|
+
* @param {Clock[]} clocks
|
|
401
|
+
* @param {Switch[]} switches
|
|
390
402
|
*/
|
|
391
403
|
constructor(locations, clocks, switches) {
|
|
392
404
|
const ptr0 = passArrayJsValueToWasm0(locations, wasm.__wbindgen_malloc);
|
|
Binary file
|