Skip to content

Verification

Formal and functional verification utilities for SNN designs.

  • Temporal property checking: verify that SNN outputs satisfy temporal logic specifications
  • Equivalence checking: verify Python simulation matches Verilog RTL bit-for-bit
  • Coverage metrics: track which neuron states and transitions have been exercised

Formal SNN Verification Standard

Python
from sc_neurocore.verification import (
    SNNVerificationEvidence,
    VerificationClaimStatus,
    VerificationEvidenceKind,
    VerificationLevel,
    assess_snn_verification_standard,
)

report = assess_snn_verification_standard(
    [
        SNNVerificationEvidence(
            evidence_id="temporal",
            level=VerificationLevel.TEMPORAL_PROPERTIES,
            kind=VerificationEvidenceKind.TEMPORAL_RESULT,
            status=VerificationClaimStatus.PASS,
            description="bounded temporal properties",
        ),
    ]
)
assert not report.passed  # external formal proof and other mandatory evidence are missing

The publication-grade profile requires bounded temporal evidence, interval probability/state bounds, implementation-equivalence evidence, and an external formal proof log. Missing evidence is reported explicitly; the standard does not claim unbounded semantic correctness without a passing external proof artefact.

sc_neurocore.verification

sc_neurocore.verification -- Tier: research (experimental / research).

FormalVerifier

Interval arithmetic checker for stochastic probability bounds and energy safety constraints. Not an SMT solver.

Source code in src/sc_neurocore/verification/formal_proofs.py
Python
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
class FormalVerifier:
    """
    Interval arithmetic checker for stochastic probability bounds and
    energy safety constraints. Not an SMT solver.
    """

    @staticmethod
    def verify_probability_bounds(input_interval: Interval, weight_interval: Interval) -> bool:
        """
        Prove that Output Probability is always in [0, 1].
        Logic: Out = Input * Weight (AND gate)
        """
        # Logic: P(A & B) = P(A) * P(B) assuming independence
        out = input_interval * weight_interval

        is_safe = out.min_val >= 0.0 and out.max_val <= 1.0
        logger.info(
            "Verification: Input %s * Weight %s -> Output %s", input_interval, weight_interval, out
        )
        logger.info("Property (0 <= p <= 1): %s", "HELD" if is_safe else "VIOLATED")
        return is_safe

    @staticmethod
    def verify_energy_safety(energy: float, cost: float) -> bool:
        """
        Prove that operation will not consume more energy than available.
        """
        # Symbolic check
        # Precondition: Energy >= Cost
        # Postcondition: NewEnergy >= 0
        if energy >= cost:
            new_e = energy - cost
            logger.info("Verification: %s - %s = %s >= 0. HELD.", energy, cost, new_e)
            return True
        else:
            logger.warning("Verification: %s < %s. VIOLATED (Halt).", energy, cost)
            return False

verify_probability_bounds(input_interval, weight_interval) staticmethod

Prove that Output Probability is always in [0, 1]. Logic: Out = Input * Weight (AND gate)

Source code in src/sc_neurocore/verification/formal_proofs.py
Python
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
@staticmethod
def verify_probability_bounds(input_interval: Interval, weight_interval: Interval) -> bool:
    """
    Prove that Output Probability is always in [0, 1].
    Logic: Out = Input * Weight (AND gate)
    """
    # Logic: P(A & B) = P(A) * P(B) assuming independence
    out = input_interval * weight_interval

    is_safe = out.min_val >= 0.0 and out.max_val <= 1.0
    logger.info(
        "Verification: Input %s * Weight %s -> Output %s", input_interval, weight_interval, out
    )
    logger.info("Property (0 <= p <= 1): %s", "HELD" if is_safe else "VIOLATED")
    return is_safe

verify_energy_safety(energy, cost) staticmethod

Prove that operation will not consume more energy than available.

Source code in src/sc_neurocore/verification/formal_proofs.py
Python
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@staticmethod
def verify_energy_safety(energy: float, cost: float) -> bool:
    """
    Prove that operation will not consume more energy than available.
    """
    # Symbolic check
    # Precondition: Energy >= Cost
    # Postcondition: NewEnergy >= 0
    if energy >= cost:
        new_e = energy - cost
        logger.info("Verification: %s - %s = %s >= 0. HELD.", energy, cost, new_e)
        return True
    else:
        logger.warning("Verification: %s < %s. VIOLATED (Halt).", energy, cost)
        return False

CodeSafetyVerifier dataclass

AST blocklist screen for auto-generated code.

Walks the AST and rejects code containing known-dangerous patterns: filesystem mutation, process spawning, network access, code execution, and unrestricted imports.

Limitations: this is a static blocklist, not a sandbox. It catches common dangerous patterns but cannot prevent all malicious code. Obfuscated calls (getattr chains, importlib indirection) may bypass it. Do not use as a security boundary without additional sandboxing.

Source code in src/sc_neurocore/verification/safety.py
Python
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
@dataclass
class CodeSafetyVerifier:
    """AST blocklist screen for auto-generated code.

    Walks the AST and rejects code containing known-dangerous patterns:
    filesystem mutation, process spawning, network access, code execution,
    and unrestricted imports.

    Limitations: this is a static blocklist, not a sandbox. It catches
    common dangerous patterns but cannot prevent all malicious code.
    Obfuscated calls (getattr chains, importlib indirection) may bypass it.
    Do not use as a security boundary without additional sandboxing.
    """

    _BLOCKED_ATTRS = frozenset(
        {
            # Process
            "system",
            "popen",
            "spawn",
            "spawnl",
            "spawnle",
            "kill",
            "fork",
            # Filesystem mutation
            "rmtree",
            "unlink",
            "remove",
            "rmdir",
            "rename",
            "truncate",
            "makedirs",
            # Network
            "urlopen",
            "urlretrieve",
            # Subprocess
            "Popen",
            "call",
            "check_call",
            "check_output",
            "run",
            # Reflection (write)
            "setattr",
            "delattr",
        }
    )

    _BLOCKED_BUILTINS = frozenset(
        {
            "exec",
            "eval",
            "compile",
            "__import__",
            "breakpoint",
        }
    )

    _BLOCKED_IMPORTS = frozenset(
        {
            "subprocess",
            "shutil",
            "socket",
            "http",
            "urllib",
            "requests",
            "importlib",
            "ctypes",
            "signal",
            "multiprocessing",
        }
    )

    def verify_code_safety(self, source_code: str) -> bool:
        """Static analysis of source code for dangerous patterns.

        Returns True if no blocked patterns found, False otherwise.
        """
        try:
            tree = ast.parse(source_code)
        except SyntaxError:
            logger.error("Safety Violation: Syntax Error in generated code.")
            return False

        for node in ast.walk(tree):
            if isinstance(node, ast.Call):
                if isinstance(node.func, ast.Attribute):
                    if node.func.attr in self._BLOCKED_ATTRS:
                        logger.warning(
                            "Safety Violation: blocked call '%s'.",
                            node.func.attr,
                        )
                        return False
                elif isinstance(node.func, ast.Name):
                    if node.func.id in self._BLOCKED_BUILTINS:
                        logger.warning(
                            "Safety Violation: blocked builtin '%s'.",
                            node.func.id,
                        )
                        return False

            if isinstance(node, (ast.Import, ast.ImportFrom)):
                names = []
                if isinstance(node, ast.Import):
                    names = [alias.name.split(".")[0] for alias in node.names]
                elif node.module:
                    names = [node.module.split(".")[0]]
                for name in names:
                    if name in self._BLOCKED_IMPORTS:
                        logger.warning(
                            "Safety Violation: blocked import '%s'.",
                            name,
                        )
                        return False

        return True

    def verify_logic_invariant(self, func: Any, input_sample: Any, expected_condition: Any) -> bool:
        """Dynamic verification: run func and check output against condition."""
        try:
            res = func(input_sample)
            if expected_condition(res):
                return True
            else:
                logger.error(
                    "Safety Violation: Logic invariant failed. Output %s invalid.",
                    res,
                )
                return False
        except Exception as e:
            logger.error("Safety Violation: Runtime Error - %s", e)
            return False

verify_code_safety(source_code)

Static analysis of source code for dangerous patterns.

Returns True if no blocked patterns found, False otherwise.

Source code in src/sc_neurocore/verification/safety.py
Python
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
def verify_code_safety(self, source_code: str) -> bool:
    """Static analysis of source code for dangerous patterns.

    Returns True if no blocked patterns found, False otherwise.
    """
    try:
        tree = ast.parse(source_code)
    except SyntaxError:
        logger.error("Safety Violation: Syntax Error in generated code.")
        return False

    for node in ast.walk(tree):
        if isinstance(node, ast.Call):
            if isinstance(node.func, ast.Attribute):
                if node.func.attr in self._BLOCKED_ATTRS:
                    logger.warning(
                        "Safety Violation: blocked call '%s'.",
                        node.func.attr,
                    )
                    return False
            elif isinstance(node.func, ast.Name):
                if node.func.id in self._BLOCKED_BUILTINS:
                    logger.warning(
                        "Safety Violation: blocked builtin '%s'.",
                        node.func.id,
                    )
                    return False

        if isinstance(node, (ast.Import, ast.ImportFrom)):
            names = []
            if isinstance(node, ast.Import):
                names = [alias.name.split(".")[0] for alias in node.names]
            elif node.module:
                names = [node.module.split(".")[0]]
            for name in names:
                if name in self._BLOCKED_IMPORTS:
                    logger.warning(
                        "Safety Violation: blocked import '%s'.",
                        name,
                    )
                    return False

    return True

verify_logic_invariant(func, input_sample, expected_condition)

Dynamic verification: run func and check output against condition.

Source code in src/sc_neurocore/verification/safety.py
Python
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
def verify_logic_invariant(self, func: Any, input_sample: Any, expected_condition: Any) -> bool:
    """Dynamic verification: run func and check output against condition."""
    try:
        res = func(input_sample)
        if expected_condition(res):
            return True
        else:
            logger.error(
                "Safety Violation: Logic invariant failed. Output %s invalid.",
                res,
            )
            return False
    except Exception as e:
        logger.error("Safety Violation: Runtime Error - %s", e)
        return False

SNNVerificationConformanceReport dataclass

Conformance report for a profile and evidence set.

Source code in src/sc_neurocore/verification/snn_standard.py
Python
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
@dataclass(frozen=True)
class SNNVerificationConformanceReport:
    """Conformance report for a profile and evidence set."""

    schema_version: str
    profile: SNNVerificationStandardProfile
    requirement_results: tuple[SNNVerificationRequirementResult, ...]
    evidence: tuple[SNNVerificationEvidence, ...] = field(default_factory=tuple)

    @property
    def passed(self) -> bool:
        """Whether all mandatory requirements passed."""
        return all(
            result.status == VerificationClaimStatus.PASS
            for result in self.requirement_results
            if result.requirement.mandatory
        )

    @property
    def missing_mandatory(self) -> tuple[str, ...]:
        """Mandatory requirement ids with missing evidence."""
        return tuple(
            result.requirement.requirement_id
            for result in self.requirement_results
            if result.requirement.mandatory and result.status == VerificationClaimStatus.MISSING
        )

    @property
    def failed_mandatory(self) -> tuple[str, ...]:
        """Mandatory requirement ids with failing evidence."""
        return tuple(
            result.requirement.requirement_id
            for result in self.requirement_results
            if result.requirement.mandatory and result.status == VerificationClaimStatus.FAIL
        )

    @property
    def mandatory_coverage(self) -> float:
        """Coverage ratio for mandatory requirements."""
        mandatory = [item for item in self.requirement_results if item.requirement.mandatory]
        if not mandatory:
            return 1.0
        covered = sum(item.status == VerificationClaimStatus.PASS for item in mandatory)
        return covered / len(mandatory)

    def to_dict(self) -> dict[str, Any]:
        """Return a JSON-ready conformance report."""
        return {
            "schema_version": self.schema_version,
            "passed": self.passed,
            "mandatory_coverage": self.mandatory_coverage,
            "missing_mandatory": list(self.missing_mandatory),
            "failed_mandatory": list(self.failed_mandatory),
            "profile": self.profile.to_dict(),
            "requirement_results": [item.to_dict() for item in self.requirement_results],
            "evidence": [item.to_dict() for item in self.evidence],
        }

passed property

Whether all mandatory requirements passed.

missing_mandatory property

Mandatory requirement ids with missing evidence.

failed_mandatory property

Mandatory requirement ids with failing evidence.

mandatory_coverage property

Coverage ratio for mandatory requirements.

to_dict()

Return a JSON-ready conformance report.

Source code in src/sc_neurocore/verification/snn_standard.py
Python
207
208
209
210
211
212
213
214
215
216
217
218
def to_dict(self) -> dict[str, Any]:
    """Return a JSON-ready conformance report."""
    return {
        "schema_version": self.schema_version,
        "passed": self.passed,
        "mandatory_coverage": self.mandatory_coverage,
        "missing_mandatory": list(self.missing_mandatory),
        "failed_mandatory": list(self.failed_mandatory),
        "profile": self.profile.to_dict(),
        "requirement_results": [item.to_dict() for item in self.requirement_results],
        "evidence": [item.to_dict() for item in self.evidence],
    }

SNNVerificationEvidence dataclass

One evidence item used in a formal SNN verification claim.

Source code in src/sc_neurocore/verification/snn_standard.py
Python
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@dataclass(frozen=True)
class SNNVerificationEvidence:
    """One evidence item used in a formal SNN verification claim."""

    evidence_id: str
    kind: VerificationEvidenceKind
    level: VerificationLevel
    status: VerificationClaimStatus
    description: str
    artefact: str = ""
    digest: str = ""

    def __post_init__(self) -> None:
        if not self.evidence_id:
            raise ValueError("evidence_id must be non-empty")
        if not self.description:
            raise ValueError("description must be non-empty")

    def to_dict(self) -> dict[str, Any]:
        """Return a JSON-ready evidence record."""
        return {
            "evidence_id": self.evidence_id,
            "kind": self.kind.value,
            "level": self.level.value,
            "status": self.status.value,
            "description": self.description,
            "artefact": self.artefact,
            "digest": self.digest,
        }

to_dict()

Return a JSON-ready evidence record.

Source code in src/sc_neurocore/verification/snn_standard.py
Python
77
78
79
80
81
82
83
84
85
86
87
def to_dict(self) -> dict[str, Any]:
    """Return a JSON-ready evidence record."""
    return {
        "evidence_id": self.evidence_id,
        "kind": self.kind.value,
        "level": self.level.value,
        "status": self.status.value,
        "description": self.description,
        "artefact": self.artefact,
        "digest": self.digest,
    }

SNNVerificationRequirement dataclass

One mandatory or optional requirement in a standard profile.

Source code in src/sc_neurocore/verification/snn_standard.py
Python
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
@dataclass(frozen=True)
class SNNVerificationRequirement:
    """One mandatory or optional requirement in a standard profile."""

    requirement_id: str
    level: VerificationLevel
    accepted_kinds: tuple[VerificationEvidenceKind, ...]
    description: str
    mandatory: bool = True

    def __post_init__(self) -> None:
        if not self.requirement_id:
            raise ValueError("requirement_id must be non-empty")
        if not self.accepted_kinds:
            raise ValueError("accepted_kinds must not be empty")
        if not self.description:
            raise ValueError("description must be non-empty")

    def to_dict(self) -> dict[str, Any]:
        """Return a JSON-ready requirement."""
        return {
            "requirement_id": self.requirement_id,
            "level": self.level.value,
            "accepted_kinds": [kind.value for kind in self.accepted_kinds],
            "description": self.description,
            "mandatory": self.mandatory,
        }

to_dict()

Return a JSON-ready requirement.

Source code in src/sc_neurocore/verification/snn_standard.py
Python
108
109
110
111
112
113
114
115
116
def to_dict(self) -> dict[str, Any]:
    """Return a JSON-ready requirement."""
    return {
        "requirement_id": self.requirement_id,
        "level": self.level.value,
        "accepted_kinds": [kind.value for kind in self.accepted_kinds],
        "description": self.description,
        "mandatory": self.mandatory,
    }

SNNVerificationRequirementResult dataclass

Evaluation of one profile requirement.

Source code in src/sc_neurocore/verification/snn_standard.py
Python
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
@dataclass(frozen=True)
class SNNVerificationRequirementResult:
    """Evaluation of one profile requirement."""

    requirement: SNNVerificationRequirement
    status: VerificationClaimStatus
    matched_evidence_ids: tuple[str, ...] = ()

    def to_dict(self) -> dict[str, Any]:
        """Return a JSON-ready requirement result."""
        return {
            "requirement": self.requirement.to_dict(),
            "status": self.status.value,
            "matched_evidence_ids": list(self.matched_evidence_ids),
        }

to_dict()

Return a JSON-ready requirement result.

Source code in src/sc_neurocore/verification/snn_standard.py
Python
153
154
155
156
157
158
159
def to_dict(self) -> dict[str, Any]:
    """Return a JSON-ready requirement result."""
    return {
        "requirement": self.requirement.to_dict(),
        "status": self.status.value,
        "matched_evidence_ids": list(self.matched_evidence_ids),
    }

SNNVerificationStandard

Evaluate SNN verification evidence against a standard profile.

Source code in src/sc_neurocore/verification/snn_standard.py
Python
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
class SNNVerificationStandard:
    """Evaluate SNN verification evidence against a standard profile."""

    def __init__(self, profile: SNNVerificationStandardProfile | None = None) -> None:
        self.profile = profile or publication_grade_snn_standard_profile()

    def assess(
        self,
        evidence: Iterable[SNNVerificationEvidence],
    ) -> SNNVerificationConformanceReport:
        """Assess evidence against the configured profile."""
        evidence_items = tuple(evidence)
        results = tuple(
            self._assess_requirement(requirement, evidence_items)
            for requirement in self.profile.requirements
        )
        return SNNVerificationConformanceReport(
            schema_version=SCHEMA_VERSION,
            profile=self.profile,
            requirement_results=results,
            evidence=evidence_items,
        )

    @staticmethod
    def _assess_requirement(
        requirement: SNNVerificationRequirement,
        evidence_items: tuple[SNNVerificationEvidence, ...],
    ) -> SNNVerificationRequirementResult:
        matched = tuple(
            item
            for item in evidence_items
            if item.level == requirement.level and item.kind in requirement.accepted_kinds
        )
        if not matched:
            return SNNVerificationRequirementResult(
                requirement=requirement,
                status=VerificationClaimStatus.MISSING,
            )
        matched_ids = tuple(item.evidence_id for item in matched)
        if any(item.status == VerificationClaimStatus.FAIL for item in matched):
            return SNNVerificationRequirementResult(
                requirement=requirement,
                status=VerificationClaimStatus.FAIL,
                matched_evidence_ids=matched_ids,
            )
        if any(item.status == VerificationClaimStatus.PASS for item in matched):
            return SNNVerificationRequirementResult(
                requirement=requirement,
                status=VerificationClaimStatus.PASS,
                matched_evidence_ids=matched_ids,
            )
        return SNNVerificationRequirementResult(
            requirement=requirement,
            status=VerificationClaimStatus.MISSING,
            matched_evidence_ids=matched_ids,
        )

assess(evidence)

Assess evidence against the configured profile.

Source code in src/sc_neurocore/verification/snn_standard.py
Python
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
def assess(
    self,
    evidence: Iterable[SNNVerificationEvidence],
) -> SNNVerificationConformanceReport:
    """Assess evidence against the configured profile."""
    evidence_items = tuple(evidence)
    results = tuple(
        self._assess_requirement(requirement, evidence_items)
        for requirement in self.profile.requirements
    )
    return SNNVerificationConformanceReport(
        schema_version=SCHEMA_VERSION,
        profile=self.profile,
        requirement_results=results,
        evidence=evidence_items,
    )

SNNVerificationStandardProfile dataclass

Named set of requirements for a formal SNN verification claim.

Source code in src/sc_neurocore/verification/snn_standard.py
Python
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
@dataclass(frozen=True)
class SNNVerificationStandardProfile:
    """Named set of requirements for a formal SNN verification claim."""

    profile_id: str
    description: str
    requirements: tuple[SNNVerificationRequirement, ...]

    def __post_init__(self) -> None:
        if not self.profile_id:
            raise ValueError("profile_id must be non-empty")
        if not self.description:
            raise ValueError("description must be non-empty")
        ids = [requirement.requirement_id for requirement in self.requirements]
        if len(ids) != len(set(ids)):
            raise ValueError("requirement ids must be unique")

    def to_dict(self) -> dict[str, Any]:
        """Return a JSON-ready profile."""
        return {
            "profile_id": self.profile_id,
            "description": self.description,
            "requirements": [requirement.to_dict() for requirement in self.requirements],
        }

to_dict()

Return a JSON-ready profile.

Source code in src/sc_neurocore/verification/snn_standard.py
Python
136
137
138
139
140
141
142
def to_dict(self) -> dict[str, Any]:
    """Return a JSON-ready profile."""
    return {
        "profile_id": self.profile_id,
        "description": self.description,
        "requirements": [requirement.to_dict() for requirement in self.requirements],
    }

VerificationClaimStatus

Bases: Enum

Status of one evidence item or standard requirement.

Source code in src/sc_neurocore/verification/snn_standard.py
Python
50
51
52
53
54
55
56
class VerificationClaimStatus(Enum):
    """Status of one evidence item or standard requirement."""

    # Verification outcome label, not a credential.
    PASS = "pass"  # nosec B105
    FAIL = "fail"
    MISSING = "missing"

VerificationEvidenceKind

Bases: Enum

Kinds of evidence accepted by the standard.

Source code in src/sc_neurocore/verification/snn_standard.py
Python
38
39
40
41
42
43
44
45
46
47
class VerificationEvidenceKind(Enum):
    """Kinds of evidence accepted by the standard."""

    TEMPORAL_RESULT = "temporal_result"
    INTERVAL_BOUND = "interval_bound"
    FORMAL_TOOL_LOG = "formal_tool_log"
    HDL_ASSERTION = "hdl_assertion"
    EQUIVALENCE_TEST = "equivalence_test"
    TRACE = "trace"
    SAFETY_CASE = "safety_case"

VerificationLevel

Bases: Enum

Evidence levels for SNN verification claims.

Source code in src/sc_neurocore/verification/snn_standard.py
Python
28
29
30
31
32
33
34
35
class VerificationLevel(Enum):
    """Evidence levels for SNN verification claims."""

    BOUNDED_SIMULATION = "bounded_simulation"
    INTERVAL_PROOF = "interval_proof"
    TEMPORAL_PROPERTIES = "temporal_properties"
    IMPLEMENTATION_EQUIVALENCE = "implementation_equivalence"
    EXTERNAL_FORMAL_PROOF = "external_formal_proof"

assess_snn_verification_standard(evidence, profile=None)

Assess evidence against the default or supplied SNN verification profile.

Source code in src/sc_neurocore/verification/snn_standard.py
Python
330
331
332
333
334
335
def assess_snn_verification_standard(
    evidence: Iterable[SNNVerificationEvidence],
    profile: SNNVerificationStandardProfile | None = None,
) -> SNNVerificationConformanceReport:
    """Assess evidence against the default or supplied SNN verification profile."""
    return SNNVerificationStandard(profile).assess(evidence)

publication_grade_snn_standard_profile()

Return the default formal SNN verification standard profile.

Source code in src/sc_neurocore/verification/snn_standard.py
Python
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
def publication_grade_snn_standard_profile() -> SNNVerificationStandardProfile:
    """Return the default formal SNN verification standard profile."""
    return SNNVerificationStandardProfile(
        profile_id="publication-grade-snn-v1",
        description=(
            "Minimum evidence profile for a scientifically defensible SNN verification claim: "
            "bounded temporal properties, interval bounds, implementation equivalence, and "
            "external formal proof evidence."
        ),
        requirements=(
            SNNVerificationRequirement(
                requirement_id="bounded_temporal_properties",
                level=VerificationLevel.TEMPORAL_PROPERTIES,
                accepted_kinds=(
                    VerificationEvidenceKind.TEMPORAL_RESULT,
                    VerificationEvidenceKind.TRACE,
                ),
                description="Temporal safety/liveness properties evaluated over declared bounds.",
            ),
            SNNVerificationRequirement(
                requirement_id="probability_interval_bounds",
                level=VerificationLevel.INTERVAL_PROOF,
                accepted_kinds=(VerificationEvidenceKind.INTERVAL_BOUND,),
                description="Interval arithmetic or equivalent proof of probability/state bounds.",
            ),
            SNNVerificationRequirement(
                requirement_id="implementation_equivalence",
                level=VerificationLevel.IMPLEMENTATION_EQUIVALENCE,
                accepted_kinds=(
                    VerificationEvidenceKind.EQUIVALENCE_TEST,
                    VerificationEvidenceKind.HDL_ASSERTION,
                ),
                description="Evidence that reference model and deployable implementation agree.",
            ),
            SNNVerificationRequirement(
                requirement_id="external_formal_proof",
                level=VerificationLevel.EXTERNAL_FORMAL_PROOF,
                accepted_kinds=(VerificationEvidenceKind.FORMAL_TOOL_LOG,),
                description="External prover/model-checker log for the stated formal boundary.",
            ),
            SNNVerificationRequirement(
                requirement_id="safety_case_traceability",
                level=VerificationLevel.BOUNDED_SIMULATION,
                accepted_kinds=(VerificationEvidenceKind.SAFETY_CASE,),
                description="Human-readable safety case tying assumptions, bounds, and artefacts.",
                mandatory=False,
            ),
        ),
    )