timed-automata-analyzer 1.0.2 → 1.0.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Luthium
3
+ Copyright (c) 2024 - 2025 Luthium
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "luth1um"
6
6
  ],
7
7
  "description": "An analyzer for Timed Automata written in Rust",
8
- "version": "1.0.2",
8
+ "version": "1.0.4",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
@@ -18,10 +18,8 @@
18
18
  * <li>All location names used as source and target of switches are also contained in the set of
19
19
  * locations.</li>
20
20
  * </ul>
21
- * @param {TimedAutomaton} ta
22
- * @returns {(string)[]}
23
21
  */
24
- export function findUnreachableLocations(ta: TimedAutomaton): (string)[];
22
+ export function findUnreachableLocations(ta: TimedAutomaton): string[];
25
23
  export enum ClockComparator {
26
24
  LESSER = 0,
27
25
  LEQ = 1,
@@ -30,53 +28,25 @@ export enum ClockComparator {
30
28
  }
31
29
  export class Clause {
32
30
  free(): void;
33
- /**
34
- * @param {Clock} lhs
35
- * @param {ClockComparator} op
36
- * @param {number} rhs
37
- */
38
31
  constructor(lhs: Clock, op: ClockComparator, rhs: number);
39
32
  }
40
33
  export class Clock {
41
34
  free(): void;
42
- /**
43
- * @param {string} name
44
- */
45
35
  constructor(name: string);
46
36
  }
47
37
  export class ClockConstraint {
48
38
  free(): void;
49
- /**
50
- * @param {(Clause)[]} clauses
51
- */
52
- constructor(clauses: (Clause)[]);
39
+ constructor(clauses: Clause[]);
53
40
  }
54
41
  export class Location {
55
42
  free(): void;
56
- /**
57
- * @param {string} name
58
- * @param {boolean} is_initial
59
- * @param {ClockConstraint | undefined} [invariant]
60
- */
61
- constructor(name: string, is_initial: boolean, invariant?: ClockConstraint);
43
+ constructor(name: string, is_initial: boolean, invariant?: ClockConstraint | null);
62
44
  }
63
45
  export class Switch {
64
46
  free(): void;
65
- /**
66
- * @param {Location} source
67
- * @param {ClockConstraint | undefined} guard
68
- * @param {string} action
69
- * @param {(Clock)[]} reset
70
- * @param {Location} target
71
- */
72
- constructor(source: Location, guard: ClockConstraint | undefined, action: string, reset: (Clock)[], target: Location);
47
+ constructor(source: Location, guard: ClockConstraint | null | undefined, action: string, reset: Clock[], target: Location);
73
48
  }
74
49
  export class TimedAutomaton {
75
50
  free(): void;
76
- /**
77
- * @param {(Location)[]} locations
78
- * @param {(Clock)[]} clocks
79
- * @param {(Switch)[]} switches
80
- */
81
- constructor(locations: (Location)[], clocks: (Clock)[], switches: (Switch)[]);
51
+ constructor(locations: Location[], clocks: Clock[], switches: Switch[]);
82
52
  }
@@ -86,7 +86,6 @@ function _assertClass(instance, klass) {
86
86
  if (!(instance instanceof klass)) {
87
87
  throw new Error(`expected instance of ${klass.name}`);
88
88
  }
89
- return instance.ptr;
90
89
  }
91
90
 
92
91
  let cachedDataViewMemory0 = null;
@@ -106,9 +105,9 @@ function addToExternrefTable0(obj) {
106
105
 
107
106
  function passArrayJsValueToWasm0(array, malloc) {
108
107
  const ptr = malloc(array.length * 4, 4) >>> 0;
109
- const mem = getDataViewMemory0();
110
108
  for (let i = 0; i < array.length; i++) {
111
- mem.setUint32(ptr + 4 * i, addToExternrefTable0(array[i]), true);
109
+ const add = addToExternrefTable0(array[i]);
110
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
112
111
  }
113
112
  WASM_VECTOR_LEN = array.length;
114
113
  return ptr;
@@ -147,7 +146,7 @@ function getArrayJsValueFromWasm0(ptr, len) {
147
146
  * locations.</li>
148
147
  * </ul>
149
148
  * @param {TimedAutomaton} ta
150
- * @returns {(string)[]}
149
+ * @returns {string[]}
151
150
  */
152
151
  export function findUnreachableLocations(ta) {
153
152
  _assertClass(ta, TimedAutomaton);
@@ -158,7 +157,15 @@ export function findUnreachableLocations(ta) {
158
157
  return v2;
159
158
  }
160
159
 
161
- export const ClockComparator = Object.freeze({ LESSER:0,"0":"LESSER",LEQ:1,"1":"LEQ",GEQ:2,"2":"GEQ",GREATER:3,"3":"GREATER", });
160
+ /**
161
+ * @enum {0 | 1 | 2 | 3}
162
+ */
163
+ export const ClockComparator = Object.freeze({
164
+ LESSER: 0, "0": "LESSER",
165
+ LEQ: 1, "1": "LEQ",
166
+ GEQ: 2, "2": "GEQ",
167
+ GREATER: 3, "3": "GREATER",
168
+ });
162
169
 
163
170
  const ClauseFinalization = (typeof FinalizationRegistry === 'undefined')
164
171
  ? { register: () => {}, unregister: () => {} }
@@ -253,7 +260,7 @@ export class ClockConstraint {
253
260
  wasm.__wbg_clockconstraint_free(ptr, 0);
254
261
  }
255
262
  /**
256
- * @param {(Clause)[]} clauses
263
+ * @param {Clause[]} clauses
257
264
  */
258
265
  constructor(clauses) {
259
266
  const ptr0 = passArrayJsValueToWasm0(clauses, wasm.__wbindgen_malloc);
@@ -292,7 +299,7 @@ export class Location {
292
299
  /**
293
300
  * @param {string} name
294
301
  * @param {boolean} is_initial
295
- * @param {ClockConstraint | undefined} [invariant]
302
+ * @param {ClockConstraint | null} [invariant]
296
303
  */
297
304
  constructor(name, is_initial, invariant) {
298
305
  const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -335,9 +342,9 @@ export class Switch {
335
342
  }
336
343
  /**
337
344
  * @param {Location} source
338
- * @param {ClockConstraint | undefined} guard
345
+ * @param {ClockConstraint | null | undefined} guard
339
346
  * @param {string} action
340
- * @param {(Clock)[]} reset
347
+ * @param {Clock[]} reset
341
348
  * @param {Location} target
342
349
  */
343
350
  constructor(source, guard, action, reset, target) {
@@ -377,9 +384,9 @@ export class TimedAutomaton {
377
384
  wasm.__wbg_timedautomaton_free(ptr, 0);
378
385
  }
379
386
  /**
380
- * @param {(Location)[]} locations
381
- * @param {(Clock)[]} clocks
382
- * @param {(Switch)[]} switches
387
+ * @param {Location[]} locations
388
+ * @param {Clock[]} clocks
389
+ * @param {Switch[]} switches
383
390
  */
384
391
  constructor(locations, clocks, switches) {
385
392
  const ptr0 = passArrayJsValueToWasm0(locations, wasm.__wbindgen_malloc);
@@ -395,18 +402,13 @@ export class TimedAutomaton {
395
402
  }
396
403
  }
397
404
 
398
- export function __wbg_clock_unwrap(arg0) {
399
- const ret = Clock.__unwrap(arg0);
400
- return ret;
401
- };
402
-
403
405
  export function __wbg_clause_unwrap(arg0) {
404
406
  const ret = Clause.__unwrap(arg0);
405
407
  return ret;
406
408
  };
407
409
 
408
- export function __wbg_switch_unwrap(arg0) {
409
- const ret = Switch.__unwrap(arg0);
410
+ export function __wbg_clock_unwrap(arg0) {
411
+ const ret = Clock.__unwrap(arg0);
410
412
  return ret;
411
413
  };
412
414
 
@@ -415,15 +417,11 @@ export function __wbg_location_unwrap(arg0) {
415
417
  return ret;
416
418
  };
417
419
 
418
- export function __wbindgen_string_new(arg0, arg1) {
419
- const ret = getStringFromWasm0(arg0, arg1);
420
+ export function __wbg_switch_unwrap(arg0) {
421
+ const ret = Switch.__unwrap(arg0);
420
422
  return ret;
421
423
  };
422
424
 
423
- export function __wbindgen_throw(arg0, arg1) {
424
- throw new Error(getStringFromWasm0(arg0, arg1));
425
- };
426
-
427
425
  export function __wbindgen_init_externref_table() {
428
426
  const table = wasm.__wbindgen_export_0;
429
427
  const offset = table.grow(4);
@@ -435,3 +433,12 @@ export function __wbindgen_init_externref_table() {
435
433
  ;
436
434
  };
437
435
 
436
+ export function __wbindgen_string_new(arg0, arg1) {
437
+ const ret = getStringFromWasm0(arg0, arg1);
438
+ return ret;
439
+ };
440
+
441
+ export function __wbindgen_throw(arg0, arg1) {
442
+ throw new Error(getStringFromWasm0(arg0, arg1));
443
+ };
444
+
Binary file