lawspec 0.27.0 → 0.29.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +124 -1
  2. package/bin/lawspec.mjs +39 -14
  3. package/build.json +139 -121
  4. package/builtin-data-names.mjs +4 -4
  5. package/core.wasm +2 -2
  6. package/core_jsffi.js +5 -5
  7. package/examples/native-payments/elixir/lib/payments_domain.ex +1 -1
  8. package/examples/native-payments/erlang/src/payments_domain.erl +1 -1
  9. package/examples/rc1/bit-codec.lawspec +6 -6
  10. package/examples/rc1/native-payments.lawspec +6 -6
  11. package/examples/rc1/nesting/rrr.lawspec +2 -2
  12. package/examples/rc1/nesting/rru.lawspec +4 -4
  13. package/examples/rc1/nesting/rur.lawspec +4 -4
  14. package/examples/rc1/nesting/ruu.lawspec +5 -5
  15. package/examples/rc1/nesting/urr.lawspec +4 -4
  16. package/examples/rc1/nesting/uru.lawspec +5 -5
  17. package/examples/rc1/nesting/uur.lawspec +5 -5
  18. package/examples/rc1/nesting/uuu.lawspec +6 -6
  19. package/examples/rc1/recursive-records.lawspec +5 -5
  20. package/examples/rc1/refund-policy.lawspec +4 -0
  21. package/examples/specs/builtins.lawspec +2 -2
  22. package/examples/specs/collections.lawspec +8 -8
  23. package/examples/specs/composition.lawspec +10 -10
  24. package/examples/specs/contracts.lawspec +2 -2
  25. package/examples/specs/crypto.lawspec +2 -2
  26. package/examples/specs/flow_stack.lawspec +4 -4
  27. package/examples/specs/generation.lawspec +2 -2
  28. package/examples/specs/list_contracts.lawspec +3 -3
  29. package/examples/specs/lists.lawspec +6 -6
  30. package/examples/specs/matching.lawspec +8 -8
  31. package/examples/specs/payments.lawspec +5 -5
  32. package/examples/specs/records.lawspec +4 -4
  33. package/examples/specs/refinements.lawspec +4 -0
  34. package/examples/specs/resources.lawspec +5 -5
  35. package/examples/specs/sequences.lawspec +1 -1
  36. package/examples/specs/sum_refinements.lawspec +11 -11
  37. package/index.d.ts +159 -4
  38. package/package.json +1 -1
  39. package/proof.d.ts +57 -12
  40. package/proof.mjs +277 -13
@@ -47,22 +47,22 @@ end law
47
47
 
48
48
  law "|Maybe preserves nested absence| is
49
49
  definition : for all (x :: Maybe (Maybe Bool)) => echoMaybe x = x end for all end definition
50
- example "|outer absence| : x = Nothing expect echoMaybe x = Nothing end example
51
- example "|inner absence| : x = Just Nothing expect echoMaybe x = Just Nothing end example
52
- example "|present| : x = Just (Just true) expect echoMaybe x = Just (Just true) end example
50
+ example "|outer absence| : x = Absent expect echoMaybe x = Absent end example
51
+ example "|inner absence| : x = Present Absent expect echoMaybe x = Present Absent end example
52
+ example "|present| : x = Present (Present true) expect echoMaybe x = Present (Present true) end example
53
53
  end law
54
54
 
55
55
  law "|Either preserves branches| is
56
56
  definition : for all (x :: Either (List Int32) (Maybe Bool)) => echoEither x = x end for all end definition
57
57
  example "|left list| : x = Left [3, 1, 3] expect echoEither x = Left [3, 1, 3] end example
58
- example "|right absence| : x = Right Nothing expect echoEither x = Right Nothing end example
58
+ example "|right absence| : x = Right Absent expect echoEither x = Right Absent end example
59
59
  end law
60
60
 
61
61
  law "|nested raw values survive| is
62
62
  definition : for all (xs :: List (Maybe (Either CodeUnit16 Bytes))) => echoNested xs = xs end for all end definition
63
63
  example "|surrogate and octets| :
64
- xs = [Nothing, Just (Left codeUnit16(55296)), Just (Right bytes([0, 255]))]
65
- expect echoNested xs = [Nothing, Just (Left codeUnit16(55296)), Just (Right bytes([0, 255]))]
64
+ xs = [Absent, Present (Left codeUnit16(55296)), Present (Right bytes([0, 255]))]
65
+ expect echoNested xs = [Absent, Present (Left codeUnit16(55296)), Present (Right bytes([0, 255]))]
66
66
  end example
67
67
  end law
68
68
  end unit
@@ -15,10 +15,10 @@ law "|nested Maybe patterns preserve each absence state| is
15
15
  definition :
16
16
  for all (value :: Maybe (Maybe Bool)) =>
17
17
  (first matching case of value :
18
- when Nothing then Nothing
19
- when Just inner then Just (first matching case of inner :
20
- when Nothing then Nothing
21
- when Just payload then Just payload
18
+ when Absent then Absent
19
+ when Present inner then Present (first matching case of inner :
20
+ when Absent then Absent
21
+ when Present payload then Present payload
22
22
  end case)
23
23
  end case) = value end for all
24
24
  end definition
@@ -39,11 +39,11 @@ law "|matching can provide a default value| is
39
39
  definition :
40
40
  for all (value :: Maybe Int8) =>
41
41
  ((first matching case of value :
42
- when Nothing then 0
43
- when Just payload then payload
42
+ when Absent then 0
43
+ when Present payload then payload
44
44
  end case) :: Int8) = ((first matching case of value :
45
- when Just payload then payload
46
- when Nothing then 0
45
+ when Present payload then payload
46
+ when Absent then 0
47
47
  end case) :: Int8) end for all
48
48
  end definition
49
49
  end law
@@ -67,11 +67,11 @@ law "|archives preserve order duplicates and absence| is
67
67
  expect archive payments = []
68
68
  end example
69
69
  example "|missing is different from a declined payment| :
70
- payments = [Nothing, Just (Declined ""), Just (Paid (Money record{ amount = 0.1 , currency = USD})),
71
- Just (Paid (Money record{ amount = 0.1 , currency = USD}))]
72
- expect archive payments = [Nothing, Just (Declined ""),
73
- Just (Paid (Money record{ amount = 0.1 , currency = USD})),
74
- Just (Paid (Money record{ amount = 0.1 , currency = USD}))]
70
+ payments = [Absent, Present (Declined ""), Present (Paid (Money record{ amount = 0.1 , currency = USD})),
71
+ Present (Paid (Money record{ amount = 0.1 , currency = USD}))]
72
+ expect archive payments = [Absent, Present (Declined ""),
73
+ Present (Paid (Money record{ amount = 0.1 , currency = USD})),
74
+ Present (Paid (Money record{ amount = 0.1 , currency = USD}))]
75
75
  end example
76
76
  end law
77
77
  end unit
@@ -89,12 +89,12 @@ end law
89
89
 
90
90
  -- A literal takes its type from where it is used: 0 is an Int64 here.
91
91
  function opening (a :: Maybe Account) -> Int64 is
92
- let start = (first matching case of a : when Nothing then 0 when Just account then account.balance end case) in
92
+ let start = (first matching case of a : when Absent then 0 when Present account then account.balance end case) in
93
93
  if start < 0 then 0 else start end if end let
94
94
  end function
95
95
 
96
96
  law "|an absent account opens at zero| is
97
- definition : opening Nothing = 0 end definition
97
+ definition : opening Absent = 0 end definition
98
98
  end law
99
99
 
100
100
  -- Recursion on an integer that moves toward a bound is total.
@@ -164,10 +164,10 @@ law "|a top up stops at the top| is
164
164
  end definition
165
165
  end law
166
166
 
167
- law "|a total that overflows is Nothing| is
167
+ law "|a total that overflows is Absent| is
168
168
  definition :
169
169
  for all (a :: Int32) (b :: Int32) =>
170
- total a b = (if a + b > Int32.max || a + b < Int32.min then Nothing else Just (prelude.Int32 (a + b)) end if) end for all
170
+ total a b = (if a + b > Int32.max || a + b < Int32.min then Absent else Present (prelude.Int32 (a + b)) end if) end for all
171
171
  end definition
172
172
  end law
173
173
 
@@ -42,6 +42,10 @@ law "|bounded input| is
42
42
  example "|middle| : x = 2 expect positive x = 2 end example
43
43
  end law
44
44
 
45
+ laws for positive are
46
+ partial because "the laws check positive only from 1 to 3"
47
+ end laws
48
+
45
49
  law "|large integer| is
46
50
  definition : for all (x :: UInt64) => preserve x = x end for all end definition
47
51
  example "|maximum UInt64| : x = 18446744073709551615 expect preserve x = 18446744073709551615 end example
@@ -24,7 +24,7 @@ end resource
24
24
 
25
25
  law "|a stored value can be read back| for store :: Store is
26
26
  definition :
27
- for all (k :: Int32) (v :: Int32) => put store k v = unitValue and get store k = Just v end for all
27
+ for all (k :: Int32) (v :: Int32) => put store k v = unitValue and get store k = Present v end for all
28
28
  end definition
29
29
  example "|the store is open while the case runs| :
30
30
  k = 1
@@ -51,13 +51,13 @@ greeting :: Unit -> Maybe Int32
51
51
  law "|a note reads back| for dir :: TemporaryDirectory is
52
52
  definition :
53
53
  for all (n :: Int32) =>
54
- writeNote (directoryPath dir) n = unitValue and readNote (directoryPath dir) = Just n end for all
54
+ writeNote (directoryPath dir) n = unitValue and readNote (directoryPath dir) = Present n end for all
55
55
  end definition
56
56
  end law
57
57
 
58
58
  law "|a new directory has no note| for dir :: TemporaryDirectory is
59
59
  definition :
60
- readNote (directoryPath dir) = Nothing
60
+ readNote (directoryPath dir) = Absent
61
61
  end definition
62
62
  end law
63
63
 
@@ -69,13 +69,13 @@ end law
69
69
 
70
70
  law "|the greeting is the one set| for saved :: SavedEnvironment is
71
71
  definition :
72
- for all (n :: Int32) => setGreeting n = unitValue and greeting unitValue = Just n end for all
72
+ for all (n :: Int32) => setGreeting n = unitValue and greeting unitValue = Present n end for all
73
73
  end definition
74
74
  end law
75
75
 
76
76
  law "|the environment is restored after each case| for saved :: SavedEnvironment is
77
77
  definition :
78
- greeting unitValue = Nothing
78
+ greeting unitValue = Absent
79
79
  end definition
80
80
  end law
81
81
 
@@ -73,7 +73,7 @@ end law
73
73
 
74
74
  law "|at reads the item an index names| is
75
75
  definition :
76
- for all (x :: Int32) (xs :: List Int32) => prelude.at 0 (Cons x xs) = Just x and prelude.at (prelude.length xs + 1) (Cons x xs) = Nothing end for all
76
+ for all (x :: Int32) (xs :: List Int32) => prelude.at 0 (Cons x xs) = Present x and prelude.at (prelude.length xs + 1) (Cons x xs) = Absent end for all
77
77
  end definition
78
78
  end law
79
79
 
@@ -2,10 +2,10 @@ unit example.sum_refinements
2
2
 
3
3
  law "|positive Maybe payloads| is
4
4
  definition : for all (x :: Maybe (value :: Int8 where value > 0)) =>
5
- (first matching case of x : when Nothing then true when Just payload then payload >= 1 end case) = true end for all
5
+ (first matching case of x : when Absent then true when Present payload then payload >= 1 end case) = true end for all
6
6
  end definition
7
- example "|absent| : x = Nothing expect x = Nothing end example
8
- example "|present| : x = Just 1 expect x = Just 1 end example
7
+ example "|absent| : x = Absent expect x = Absent end example
8
+ example "|present| : x = Present 1 expect x = Present 1 end example
9
9
  end law
10
10
 
11
11
  law "|selected Either payload| is
@@ -19,13 +19,13 @@ end law
19
19
 
20
20
  law "|nested Maybe states| is
21
21
  definition : for all (x :: Maybe (Maybe (value :: Bool where value))) =>
22
- (first matching case of x : when Nothing then true when Just inner then
23
- first matching case of inner : when Nothing then true when Just payload then payload end case
22
+ (first matching case of x : when Absent then true when Present inner then
23
+ first matching case of inner : when Absent then true when Present payload then payload end case
24
24
  end case) = true end for all
25
25
  end definition
26
- example "|outer absent| : x = Nothing expect x = Nothing end example
27
- example "|inner absent| : x = Just Nothing expect x = Just Nothing end example
28
- example "|present| : x = Just (Just true) expect x = Just (Just true) end example
26
+ example "|outer absent| : x = Absent expect x = Absent end example
27
+ example "|inner absent| : x = Present Absent expect x = Present Absent end example
28
+ example "|present| : x = Present (Present true) expect x = Present (Present true) end example
29
29
  end law
30
30
 
31
31
  law "|finite Either variants| is
@@ -38,13 +38,13 @@ end law
38
38
  law "|dependent payload keeps outer binding| is
39
39
  definition : for all (lawspecElement :: Int8)
40
40
  (x :: Maybe (value :: Int8 where value > lawspecElement)) =>
41
- (first matching case of x : when Nothing then true when Just payload then payload - lawspecElement >= 1 end case) = true end for all
41
+ (first matching case of x : when Absent then true when Present payload then payload - lawspecElement >= 1 end case) = true end for all
42
42
  end definition
43
43
  example "|maximum prefix has absent continuation| :
44
- lawspecElement = 127 x = Nothing expect x = Nothing
44
+ lawspecElement = 127 x = Absent expect x = Absent
45
45
  end example
46
46
  example "|present continuation| :
47
- lawspecElement = 0 x = Just 1 expect x = Just 1
47
+ lawspecElement = 0 x = Present 1 expect x = Present 1
48
48
  end example
49
49
  end law
50
50
  end unit
package/index.d.ts CHANGED
@@ -430,13 +430,16 @@ export type DischargeStatus =
430
430
  'known-failing' |
431
431
  'flaky' |
432
432
  'skipped' |
433
+ 'pending' |
433
434
  'proved' |
434
435
  'exhaustively-checked' |
435
436
  'property-tested' |
436
437
  'measured' |
437
438
  'runtime-checked' |
438
439
  'default-handler' |
439
- 'assumed';
440
+ 'assumed' |
441
+ 'exempted' |
442
+ 'refuted';
440
443
 
441
444
  export interface ObligationEvidence {
442
445
  owner: string;
@@ -445,6 +448,7 @@ export interface ObligationEvidence {
445
448
  status: DischargeStatus;
446
449
  reason: string;
447
450
  claim: Expr | null;
451
+ exemption?: Exemption;
448
452
  environment?: string;
449
453
  environmentRun?: AttestedRun;
450
454
  against?: AttestedDependency[];
@@ -537,6 +541,86 @@ export interface CheckRequest {
537
541
  packages?: Package[];
538
542
  cacheDirectory?: string;
539
543
  attestation?: unknown;
544
+ proofCounterexamples?: ProofCounterexample[];
545
+ analysisResults?: AnalysisResult[];
546
+ projectVersion?: string;
547
+ now?: string;
548
+ modelResults?: ModelResult[];
549
+ }
550
+
551
+ export interface ModelResult {
552
+ fingerprint: string;
553
+ outcome: string;
554
+ values: string;
555
+ invariant: string;
556
+ }
557
+
558
+ export interface ModelTaskRow {
559
+ owner: string;
560
+ declaration: string;
561
+ tasks: ModelTask[];
562
+ }
563
+
564
+ export interface ModelTask {
565
+ fingerprint: string;
566
+ kind: string;
567
+ script: string;
568
+ inputs: string[];
569
+ }
570
+
571
+ export interface Exemption {
572
+ reason: string;
573
+ until: string | null;
574
+ expired: boolean;
575
+ law: string | null;
576
+ }
577
+
578
+ export interface AnalysisResult {
579
+ fingerprint: string;
580
+ outcome: string;
581
+ values: string;
582
+ }
583
+
584
+ export type AnalysisStage = 'completeness' | 'overlap' | 'conflict' | 'vacuity';
585
+
586
+ export type AnalysisTaskRow =
587
+ {
588
+ owner: string;
589
+ declaration: string;
590
+ stage: AnalysisStage;
591
+ status: 'ready';
592
+ tasks: AnalysisTask[];
593
+ } |
594
+ {
595
+ owner: string;
596
+ declaration: string;
597
+ stage: AnalysisStage;
598
+ status: 'unsupported';
599
+ reason: string;
600
+ };
601
+
602
+ export interface AnalysisTask {
603
+ fingerprint: string;
604
+ encoding: 'lawspec-smtlib-v2';
605
+ script: string;
606
+ inputs: string[];
607
+ }
608
+
609
+ export interface AnalysisCheck {
610
+ owner: string;
611
+ declaration: string;
612
+ stage: AnalysisStage;
613
+ fingerprint: string;
614
+ status: AnalysisCheckStatus;
615
+ reason: string;
616
+ check: AnalysisCheckStatus;
617
+ }
618
+
619
+ export type AnalysisCheckStatus =
620
+ 'proved' | 'refuted' | 'exempted' | 'incomplete';
621
+
622
+ export interface FormatRequest extends CheckRequest {
623
+ compile?: boolean;
540
624
  }
541
625
 
542
626
  export interface GenerationRequest extends CheckRequest {
@@ -548,7 +632,7 @@ export interface GenerationRequest extends CheckRequest {
548
632
 
549
633
  export type ProofTask =
550
634
  {
551
- encoding: 'lawspec-smtlib-v1';
635
+ encoding: 'lawspec-smtlib-v1' | 'lawspec-smtlib-v2';
552
636
  owner: string;
553
637
  declaration: string;
554
638
  at: Location;
@@ -558,9 +642,14 @@ export type ProofTask =
558
642
  script: string;
559
643
  taskFingerprint: string;
560
644
  trust: string;
645
+ counterexample?: CounterexampleQuery;
646
+ counterexampleUnsupported?: string;
647
+ recursion?: Recursion;
648
+ alternative?: AlternativeTask;
649
+ induction?: InductionPlan;
561
650
  } |
562
651
  {
563
- encoding: 'lawspec-smtlib-v1';
652
+ encoding: 'lawspec-smtlib-v1' | 'lawspec-smtlib-v2';
564
653
  owner: string;
565
654
  declaration: string;
566
655
  at: Location;
@@ -570,6 +659,66 @@ export type ProofTask =
570
659
  reason: string;
571
660
  };
572
661
 
662
+ export interface AlternativeTask {
663
+ recursion: Recursion;
664
+ script: string;
665
+ taskFingerprint: string;
666
+ }
667
+
668
+ export type InductionPlan =
669
+ {
670
+ on: string;
671
+ asked: boolean;
672
+ using: string[];
673
+ status: 'ready';
674
+ cases: InductionCase[];
675
+ } |
676
+ {
677
+ on: string;
678
+ asked: boolean;
679
+ using: string[];
680
+ status: 'unsupported';
681
+ reason: string;
682
+ };
683
+
684
+ export interface InductionCase {
685
+ case: string;
686
+ script: string;
687
+ recursion: Recursion;
688
+ taskFingerprint: string;
689
+ inputs: string[];
690
+ alternative?: AlternativeTask;
691
+ }
692
+
693
+ export type Recursion =
694
+ {encoding: 'guarded-axioms'; fuel: number;} | {encoding: 'define-fun-rec';};
695
+
696
+ export type ProofCounterexample =
697
+ {
698
+ owner: string;
699
+ declaration: string;
700
+ taskFingerprint: string;
701
+ values: string;
702
+ };
703
+
704
+ export type CounterexampleQuery =
705
+ {
706
+ encoding: 'lawspec-smtlib-v2';
707
+ script: string;
708
+ fingerprint: string;
709
+ inputs: {name: string; binder: string}[];
710
+ };
711
+
712
+ export type CounterexampleCheck =
713
+ {
714
+ owner?: string;
715
+ declaration?: string;
716
+ taskFingerprint?: string;
717
+ status: 'refuted' | 'model-not-confirmed' | 'incomplete';
718
+ reason: string;
719
+ inputs?: {name: string; value: string}[];
720
+ };
721
+
573
722
  export type NativeSeed = number | string;
574
723
 
575
724
  export type NativeFreshness =
@@ -729,6 +878,12 @@ export interface Result {
729
878
  formattedSources?: Source[];
730
879
  tests?: NativeTestEntry[];
731
880
  proofTasks?: ProofTask[];
881
+ analysisTasks?: AnalysisTaskRow[];
882
+ analysisEvidence?: ObligationEvidence[];
883
+ analysisChecks?: AnalysisCheck[];
884
+ modelTasks?: ModelTaskRow[];
885
+ modelEvidence?: ObligationEvidence[];
886
+ counterexampleChecks?: CounterexampleCheck[];
732
887
  evidence?: ObligationEvidence[];
733
888
  attestation?: AttestationView;
734
889
  packages?: PackageView[];
@@ -784,7 +939,7 @@ export type ScalarValue =
784
939
  {type: 'Nullable' | 'Optional'; value: ScalarValue | null;};
785
940
 
786
941
  export interface Compiler {
787
- format(input: CheckRequest): Promise<Result>;
942
+ format(input: FormatRequest): Promise<Result>;
788
943
  check(input: CheckRequest): Promise<Result>;
789
944
  expand(input: CheckRequest): Promise<Result>;
790
945
  proofTasks(input: CheckRequest): Promise<Result>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lawspec",
3
- "version": "0.27.0",
3
+ "version": "0.29.0",
4
4
  "description": "State the law once. Check it everywhere.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/proof.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // Generated from templates/npm/proof.d.ts by lawspec-dev generate. Do not edit.
2
- import type {CheckRequest,Compiler,Location,Result} from './index.d.ts';
2
+ import type {CheckRequest,Compiler,Location,Recursion,Result} from './index.d.ts';
3
3
 
4
4
  export interface Z3Options {
5
5
  binary?: string;
@@ -9,19 +9,10 @@ export interface Z3Options {
9
9
  seed?: number;
10
10
  maxOutputBytes?: number;
11
11
  }
12
- export interface SolverEvidence {
13
- owner: string;
14
- declaration: string;
15
- at: Location;
16
- encoding: 'lawspec-smtlib-v1';
17
- machineBits: 32 | 64;
18
- programFingerprint: string;
19
- taskFingerprint?: string;
20
- status: 'proved' | 'incomplete' | 'unsupported';
12
+ /** How a solver run went: shared by law and law-set evidence. */
13
+ interface SolverRun {
21
14
  outcome: 'unsat' | 'sat' | 'unknown' | 'timeout' | 'resource-limit' | 'out-of-memory' | 'unavailable' | 'failed' | 'unsupported';
22
15
  reason: string;
23
- model?: string;
24
- modelValidated?: false;
25
16
  stdout?: string;
26
17
  stderr?: string;
27
18
  elapsedMs?: number;
@@ -31,5 +22,59 @@ export interface SolverEvidence {
31
22
  prover?: {name:'z3'; version:string; binary:string; binaryFingerprint:string; fingerprint:string; arguments:string[]};
32
23
  configuration?: Required<Z3Options>;
33
24
  }
25
+ /** A law's proof task, run by Z3. */
26
+ export interface LawSolverEvidence extends SolverRun {
27
+ kind?: undefined;
28
+ owner: string;
29
+ declaration: string;
30
+ at: Location;
31
+ encoding: 'lawspec-smtlib-v1' | 'lawspec-smtlib-v2';
32
+ machineBits: 32 | 64;
33
+ programFingerprint: string;
34
+ taskFingerprint?: string;
35
+ status: 'proved' | 'refuted' | 'incomplete' | 'unsupported';
36
+ model?: string;
37
+ modelValidated?: boolean;
38
+ counterexample?: {inputs:{name:string;value:string}[]; values:string; fingerprint:string; runFingerprint:string;
39
+ check:'refuted'|'model-not-confirmed'|'incomplete'};
40
+ /** For a law over recursive definitions: the encoding of the run reported,
41
+ and each encoding tried, in order. */
42
+ recursion?: Recursion;
43
+ attempts?: {recursion:Recursion; taskFingerprint:string; outcome:SolverRun['outcome']; runFingerprint?:string; elapsedMs?:number}[];
44
+ /** Induction on an input: the cited laws, and each case's receipt. */
45
+ induction?: {on:string; using:string[]; asked?:boolean; cases:{case:string; outcome?:SolverRun['outcome']; recursion?:Recursion;
46
+ taskFingerprint?:string; runFingerprint?:string; values?:string; reason?:string;
47
+ attempts?:{recursion:Recursion; taskFingerprint:string; outcome:SolverRun['outcome']; runFingerprint?:string; elapsedMs?:number}[]}[]};
48
+ }
49
+ /** A law-set check's task (completeness, overlap, conflict or vacuity).
50
+ status is the task's own result; check is its row's. */
51
+ export interface AnalysisSolverEvidence extends SolverRun {
52
+ kind: 'analysis';
53
+ owner: string;
54
+ declaration: string;
55
+ stage: 'completeness' | 'overlap' | 'conflict' | 'vacuity';
56
+ encoding: 'lawspec-smtlib-v2';
57
+ taskFingerprint?: string;
58
+ status: 'proved' | 'refuted' | 'exempted' | 'incomplete' | 'unsupported';
59
+ check?: 'proved' | 'refuted' | 'exempted' | 'incomplete';
60
+ model?: undefined;
61
+ modelValidated?: undefined;
62
+ counterexample?: undefined;
63
+ }
64
+ /** A model law's task: induction, Spacer, an invariant re-check or the
65
+ bounded run search; the law's own row says what they settled. */
66
+ export interface ModelSolverEvidence extends SolverRun {
67
+ kind: 'model';
68
+ owner: string;
69
+ declaration: string;
70
+ task: string;
71
+ taskFingerprint: string;
72
+ encoding: 'lawspec-smtlib-v2';
73
+ status: 'proved' | 'incomplete';
74
+ model?: undefined;
75
+ modelValidated?: undefined;
76
+ counterexample?: undefined;
77
+ }
78
+ export type SolverEvidence = LawSolverEvidence | AnalysisSolverEvidence | ModelSolverEvidence;
34
79
  export function proofTaskFingerprint(task: {encoding:string;programFingerprint:string;machineBits:number;owner:string;declaration:string;script:string}):string;
35
80
  export function proveWithZ3(compiler:Compiler,request:CheckRequest,options?:Z3Options):Promise<Result & {solverEvidence:SolverEvidence[]}>;