kibi-core 0.24.0 → 0.26.1
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/package.json +1 -1
- package/schema/validation.pl +3 -1
- package/src/certificate_check.pl +38 -4
- package/src/certificates.pl +10 -2
- package/src/claim_obligations.pl +356 -28
- package/src/code_certificates.pl +239 -4
- package/src/kb.pl +49 -2
- package/src/model_check.pl +728 -0
- package/src/requirement_proof.pl +10 -3
- package/src/rule_registry.pl +1 -1
package/src/requirement_proof.pl
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
:- use_module('logic_ir.pl', [logic_rule_safety/2]).
|
|
28
28
|
:- use_module('code_certificates.pl', [code_certificate_check/2, code_certificate_digest/2]).
|
|
29
29
|
:- use_module('claim_obligations.pl', [claim_obligation/3, obligation_equal/2]).
|
|
30
|
+
:- use_module('model_check.pl', [model_check_obligation/4]).
|
|
30
31
|
|
|
31
32
|
proof_version('kibi.requirement-proof.v5').
|
|
32
33
|
|
|
@@ -1009,7 +1010,7 @@ valid_receipt_version_fields('kibi.proof-receipt.v1', _Receipt).
|
|
|
1009
1010
|
valid_receipt_version_fields('kibi.proof-receipt.v2', Receipt) :-
|
|
1010
1011
|
inventory_entry_field(Receipt, kind, RawKind),
|
|
1011
1012
|
normalize_receipt_atom(RawKind, Kind),
|
|
1012
|
-
memberchk(Kind, [e2e, example, property, exhaustive, typecheck, arithmetic, smt]),
|
|
1013
|
+
memberchk(Kind, [e2e, example, property, exhaustive, typecheck, arithmetic, smt, rule, state_machine, regex, source]),
|
|
1013
1014
|
inventory_entry_field(Receipt, evidence_level, RawLevel),
|
|
1014
1015
|
normalize_receipt_atom(RawLevel, Level),
|
|
1015
1016
|
memberchk(Level, [proved, tested]),
|
|
@@ -1019,7 +1020,7 @@ valid_receipt_version_fields('kibi.proof-receipt.v2', Receipt) :-
|
|
|
1019
1020
|
; true
|
|
1020
1021
|
),
|
|
1021
1022
|
( Level == proved
|
|
1022
|
-
-> memberchk(Kind, [exhaustive, typecheck, arithmetic, smt]),
|
|
1023
|
+
-> memberchk(Kind, [exhaustive, typecheck, arithmetic, smt, rule, state_machine, regex, source]),
|
|
1023
1024
|
inventory_entry_field(Receipt, outcome, RawOutcome),
|
|
1024
1025
|
normalize_receipt_atom(RawOutcome, passed),
|
|
1025
1026
|
inventory_entry_field(Receipt, certificate, _),
|
|
@@ -1996,7 +1997,7 @@ claim_entry(ReqId, ProofStatus, IntentLevel, BoundTests, InventoryEntry, Entry)
|
|
|
1996
1997
|
sort(Bindings0, Bindings),
|
|
1997
1998
|
include(binding_is(rejected), Bindings, RejectedBindings),
|
|
1998
1999
|
maplist(binding_rejection(Key), RejectedBindings, Rejections),
|
|
1999
|
-
( member(B, Bindings), get_dict(binding, B, derived), get_dict(scope, B,
|
|
2000
|
+
( member(B, Bindings), get_dict(binding, B, derived), \+ get_dict(scope, B, intent)
|
|
2000
2001
|
-> Level = proved
|
|
2001
2002
|
; Level = tested
|
|
2002
2003
|
),
|
|
@@ -2097,6 +2098,12 @@ certificate_obligation_problem(arithmetic, Evidence, Obligation, Problem) :-
|
|
|
2097
2098
|
; Problem = 'the certificate\'s claim is not the fact\'s constraint'
|
|
2098
2099
|
).
|
|
2099
2100
|
|
|
2101
|
+
certificate_obligation_problem(Kind, Evidence, Obligation, Problem) :-
|
|
2102
|
+
memberchk(Kind, [rule, state_machine, source]),
|
|
2103
|
+
get_dict(certificate, Evidence, Certificate),
|
|
2104
|
+
model_check_obligation(Kind, Obligation, Certificate, problem(Problem0)),
|
|
2105
|
+
atom_string(Problem, Problem0).
|
|
2106
|
+
|
|
2100
2107
|
%% claim_summary(+ClaimEvidence, -Summary, -UnprovedClaims)
|
|
2101
2108
|
claim_summary(ClaimEvidence, Summary, Unproved) :-
|
|
2102
2109
|
include(applicable_claim, ClaimEvidence, Applicable),
|
package/src/rule_registry.pl
CHANGED
|
@@ -318,4 +318,4 @@ rule_description('policy-markers', 'When a plugin activated for kibi.check-polic
|
|
|
318
318
|
rule_description('kb-consistency', 'The facts current requirements name must hold together, jointly and not only pairwise: every property context needs a value that satisfies all its facts, every atom and decision key one truth value, and stored rules a stratification. Each finding is a contradiction certificate (an irreducible core, two disagreeing facts or a negation cycle) re-verified by the independent checker, or a certificate that checker rejects').
|
|
319
319
|
rule_description('kb-consistency-unresolved', 'Advisory: a property context, atom or decision key whose facts the consistency checker cannot compare (mixed value types or units, an unsupported operator or polarity, or a contradiction whose validity windows never overlap); it never counts as consistent').
|
|
320
320
|
rule_description('evidence-floor', 'Every current requirement\'s computed evidence level (proved, tested, asserted, unverified) must reach its floor: required_evidence when set, otherwise tested for a firm requirement and no floor for any other. Receipts that are only older than the code count as pending re-proof and pass, unless kibi check runs with --fresh-evidence, which also needs a clean proof snapshot').
|
|
321
|
-
rule_description('proof-contract-claims', 'From schema 12, every certificate-kind proof contract (exhaustive, typecheck, arithmetic, smt) must name the claims it proves in proves, and each named claim must be a modeled claim of a current requirement the test reaches through its scenarios, grounded by a fact that proof kind can express or attest').
|
|
321
|
+
rule_description('proof-contract-claims', 'From schema 12, every certificate-kind proof contract (exhaustive, typecheck, arithmetic, smt, rule, state_machine, regex) must name the claims it proves in proves, and each named claim must be a modeled claim of a current requirement the test reaches through its scenarios, grounded by a fact that proof kind can express or attest').
|