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
7 SymbiYosys formal verification scripts + 67 properties in hdl/formal/.
from sc_neurocore.verification import TemporalPropertyChecker
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
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 | |
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
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
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
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
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
15 16 17 18 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 | |
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
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 | |
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
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |