File size: 2,692 Bytes
56de343
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
#!/usr/bin/env python3
"""claims.py — All 16 registered validity claims"""

from engine import Claim

# Topology claims (5)
TOPOLOGY_CLAIMS = [
    Claim(
        type="topology",
        spec="topology_preservation",
        evidence=["kernel", "topology", "state"]
    ),
    Claim(
        type="topology",
        spec="reachability",
        evidence=["graph", "start", "goal"]
    ),
    Claim(
        type="topology",
        spec="floating_ports",
        evidence=["circuit", "connections"]
    ),
    Claim(
        type="topology",
        spec="conduction_soundness",
        evidence=["voltage_levels", "transitions"]
    ),
    Claim(
        type="topology",
        spec="cycle_detection",
        evidence=["graph_edges", "visited"]
    ),
]

# Numeric claims (4)
NUMERIC_CLAIMS = [
    Claim(
        type="numeric",
        spec="feasibility_bounds",
        evidence=["cpu", "memory", "latency"]
    ),
    Claim(
        type="numeric",
        spec="resource_conservation",
        evidence=["allocated", "used", "freed"]
    ),
    Claim(
        type="numeric",
        spec="timing_constraints",
        evidence=["start_time", "end_time", "deadline"]
    ),
    Claim(
        type="numeric",
        spec="bitwidth_overflow",
        evidence=["operands", "bitwidth", "result"]
    ),
]

# Stack machine claims (7)
STACK_MACHINE_CLAIMS = [
    Claim(
        type="stack_machine",
        spec="stack_depth_bound",
        evidence=["instructions", "max_depth"]
    ),
    Claim(
        type="stack_machine",
        spec="frame_integrity",
        evidence=["frames", "pointers"]
    ),
    Claim(
        type="stack_machine",
        spec="return_address_validity",
        evidence=["return_stack", "code_pointers"]
    ),
    Claim(
        type="stack_machine",
        spec="variable_initialization",
        evidence=["variables", "init_sites"]
    ),
    Claim(
        type="stack_machine",
        spec="no_use_after_free",
        evidence=["allocation", "deallocation", "access"]
    ),
    Claim(
        type="stack_machine",
        spec="no_buffer_overflow",
        evidence=["buffers", "accesses", "bounds"]
    ),
    Claim(
        type="stack_machine",
        spec="type_safety",
        evidence=["instructions", "operands", "types"]
    ),
]

ALL_CLAIMS = TOPOLOGY_CLAIMS + NUMERIC_CLAIMS + STACK_MACHINE_CLAIMS

def get_claims_by_type(claim_type: str):
    """Get all claims of a specific type"""
    return [c for c in ALL_CLAIMS if c.type == claim_type]

def get_all_claims():
    """Get all 16 claims"""
    return ALL_CLAIMS