فهرست مقاله
وجودِ یک مرحلهٔ تأیید در نقشهٔ گردشِ کار، کافی نیست تا همهٔ مسیرها از آن عبور کنند. شاید شاخهای آن مرحله را دور بزند، یا یک تأیید برای دو اقدام مصرف شود. در این درس، همین پرسش را روی گرافی کوچک و ساختگی بررسی میکنیم: آیا مسیری به اقدامِ بدون تأییدِ مصرفنشده میرسد؟ خروجی، شاهدِ نقض در مدل است؛ هیچ تماس، صوت، هویتِ واقعی، مجوز یا اقدامِ بیرونی اجرا نمیشود.
۱. شرطِ تأیید را به خاصیتِ یک گردشِ کار تبدیل کنیم

چهار برچسبِ ورودی داریم: step برای گامِ عادی، confirm برای اعطای یک اعتبارِ فرضی، reset برای پاککردنِ آن و action برای اقدامی که اعتبار میخواهد. این نامها فقط قراردادِ مدلاند. برنامه نمیفهمد انسانی واقعاً «بله» گفته، چه چیزی را تأیید کرده یا اصلاً اجازهٔ آن کار را داشته است. نسبتدادنِ چنین معناهایی به برچسب، دادهای خارج از این آزمایش میخواهد.
در بخشِ کاملِ CTL در راهنمای NuSMV 2.1، بررسیِ یک خاصیت روی مدل از دیدنِ چند اجرای نمونه جداست؛ مسیرِ نقض میتواند نشان دهد شرط کجا شکسته است. ما مفسرِ CTL یا NuSMV را اجرا نمیکنیم. خاصیتِ سادهٔ خودمان این است که هیچ ورودیِ قابلدسترسی به گرهٔ action، بدون اعتبار نباشد.
این پرسش دربارهٔ همهٔ شاخههای گرافِ دادهشده است. یک مسیرِ درست، نبودِ مسیرِ نادرست را ثابت نمیکند. از طرفِ دیگر، پیداشدنِ شاهد فقط همین گراف و همین قاعده را رد میکند؛ از آن دربارهٔ محصول، تماسِ واقعی یا امنیتِ استقرار نتیجه نمیگیریم. مسیرها نیز احتمال و مدت ندارند؛ شمارِ یالها نه ثانیه است و نه احتمالِ رفتارِ تماسگیرنده.
در درسِ نامزدهای دفترچه و تأییدِ صریح، یک نامزدِ یکتا پیش از ساختنِ برچسبِ مسیر تأیید میشد. اینجا نام و نامزد نداریم؛ میپرسیم ساختارِ یک گردشِ کارِ فرضی، راهی برای دورزدن یا مصرفِ دوبارهٔ اعتبار باقی گذاشته است یا نه. این دو آزمایش مسئولیتهای متفاوتی دارند.
۲. حالت، گره بهعلاوهٔ اعتبارِ مصرفنشده است

حالت را جفتِ شمارهٔ گره و اعتبارِ پیش از ورود میگیریم. آغاز همیشه اعتبارِ False دارد، ولی خودِ گرهٔ آغاز هم پردازش میشود. ورود به confirm مقدارِ بعدی را True میکند؛ reset آن را False میکند. action ابتدا مقدارِ پیشین را میسنجد و در صورتِ داشتنِ اعتبار، آن را برای جانشینها مصرف میکند. گامِ عادی تغییری نمیدهد.
نمونهٔ دستی فقط دو گره دارد: صفر confirm و یک action است. یالِ صفر به یک و خودحلقهٔ یک را میدهیم. نخستین ورود به یک اعتبار دارد و آن را مصرف میکند؛ ورودِ دوم ندارد. بنابراین شاهد، تاپلِ صفر، یک، یک است و دو یال دارد. تکرارِ شمارهٔ گره در شاهد خطا نیست؛ دو ورود به یک با اعتبارهای متفاوت، دو حالتِ متفاوتاند.
اگر فقط شمارهٔ گره را در مجموعهٔ دیدهشده نگه داریم، ممکن است ورودِ تأییدشده زودتر برسد و ورودِ بدون تأییدِ بعدی حذف شود. شاهدِ ششگرهیِ کد دقیقاً همین دام را میسنجد: گرهٔ سه از یک مسیر با اعتبار و از مسیرِ دیگری بدون آن دیده میشود. هر دو باید بررسی شوند؛ خاطرهٔ ورودِ اول جای اطلاعاتِ مسیرِ دوم را نمیگیرد.
این اعتبار شمارنده نیست: دو confirm پیاپی، دو اعتبار ذخیره نمیکنند؛ مقدار همچنان True است. همچنین اعتبار به شناسهٔ درخواست، محتوا یا شخص متصل نیست و مهلتِ زمانی ندارد. برای مسئلهای که این اطلاعات مهماند، این جفتِ حالت کافی نیست. افزودنِ عنوانِ «تأیید» به مدلِ ناقص، کمبودِ اطلاعات را جبران نمیکند.
۳. کوتاهترین مسیرِ نقض را با صف پیدا کنیم

صف از حالتِ آغاز شروع میشود. هر بار نخستین حالت را برمیداریم، برچسبِ گره را بررسی میکنیم و حالتهای جانشینِ تازه را به انتهای صف میگذاریم. مستنداتِ deque در Python 3.14.8، append و popleft و رفتارِ maxlen را توضیح میدهد. صفِ ما maxlen ندارد؛ حذفِ بیخبرِ حالتِ منتظر، استدلالِ بررسیِ همهٔ مسیرها را خراب میکند.
پیمایشِ عرضی، حالتها را به ترتیبِ تعدادِ یال از آغاز بررسی میکند. جانشینها را با شماره مرتب میکنیم و والدِ اولین کشف را نگه میداریم. در نتیجه، میان شاهدهای همطول، کوچکترین تاپلِ شناسهها انتخاب میشود. این ترتیب، قراردادِ بازتولیدِ خروجی است؛ کوچکتر بودنِ شناسه، اولویتِ کسبوکار یا اهمیتِ اقدام نیست.
در شاهدِ دستیِ دیگر، شاخهٔ شروعشده با گرهٔ یک، پس از سه یال به نقض میرسد؛ شاخهٔ گرهٔ سه، پس از دو یال. خروجی صفر، سه، دو است، هرچند شاخهٔ یک از نظرِ شناسه زودتر میآید. «کوتاهترین» را نباید با اولین مسیری که یک پیمایشِ عمقی پیدا میکند یا با کمزمانترین اجرای واقعی یکی گرفت.
برای N گره، حداکثر دو برابرِ N حالتِ جفتی داریم. اگر نقض قابلدسترسی باشد، کوتاهترین راه به آن حالت، جفتِ تکراری ندارد؛ حذفِ بخشِ حلقهای راهِ کوتاهتری میدهد. پس شاهدی با حداکثر دو برابرِ N منهای یک یال کافی است. خودِ الگوریتم افقِ دلخواه ندارد؛ تا کشفِ نقض یا خالیشدنِ صف ادامه میدهد.
۴. کدِ کامل را با شمارشِ مستقلِ مسیرها بسنجیم

فایل workflow_confirmation_audit.py تنها کتابخانهٔ استاندارد میخواهد. ورودی، تاپلِ دقیقِ یک تا شش برچسب و تاپلِ همطول از سطرهای همسایه است. مقصدها و آغاز، int دقیق و داخلِ دامنهاند؛ bool، زیرکلاس، مقصدِ تکراری و برچسبِ ناشناخته رد میشوند. گرافِ خالی پذیرفته نیست. سقفِ شش انتخابِ آموزشیِ ماست و محدودیتِ الگوریتم یا استاندارد نیست.
تمامِ سطرها پیش از جستوجو اعتبارسنجی میشوند، حتی اگر گرهٔ آغاز خودش نقض باشد و سطرِ معیوب هیچگاه پیموده نشود. تولیدکننده نیز بیآنکه مصرف شود رد میشود. نسخهٔ واقعیِ پایتون در خروجی ثبت میشود و فایل، JSON را با UTF-8 و پایانخطِ LF مینویسد. کدِ کامل و خروجیِ همان اجرا در ادامه قرار میگیرند.
"""Finite supplied workflow safety audit; no real confirmation or external action.
Entry labels implement an authored one-use credit contract. Nodes are not
identities, permissions, real callers or observations from an IVR system.
"""
from collections import deque
from itertools import product, permutations
import json
import platform
import sys
NODE_CAP = 6
KINDS = ('step', 'confirm', 'reset', 'action')
def checked_graph(kinds, adjacency, start):
if type(kinds) is not tuple:
raise TypeError('kinds must be an exact tuple')
n = len(kinds)
if not 1 <= n <= NODE_CAP:
raise ValueError('own node count must be 1..6')
for kind in kinds:
if type(kind) is not str:
raise TypeError('kind must be an exact str')
if kind not in KINDS:
raise ValueError('unknown kind')
if type(adjacency) is not tuple:
raise TypeError('adjacency must be an exact tuple')
if len(adjacency) != n:
raise ValueError('one adjacency row per node required')
for row in adjacency:
if type(row) is not tuple:
raise TypeError('adjacency row must be an exact tuple')
if len(row) > n:
raise ValueError('own row length cannot exceed node count')
for target in row:
if type(target) is not int:
raise TypeError('target must be an exact int excluding bool')
if not 0 <= target < n:
raise ValueError('target outside graph')
if len(set(row)) != len(row):
raise ValueError('duplicate target')
if type(start) is not int:
raise TypeError('start must be an exact int excluding bool')
if not 0 <= start < n:
raise ValueError('start outside graph')
return tuple(tuple(sorted(row)) for row in adjacency)
def audit_workflow(kinds, adjacency, start=0):
"""Find a shortest violation, or exhaust the finite product graph.
Queue state means (node, credit BEFORE entry). Initial credit is False.
Action checks credit before consuming it. Confirm grants, reset clears.
Sorted neighbors and first discovery determine lexicographic witness ties.
"""
outgoing = checked_graph(kinds, adjacency, start)
initial = (start, False)
queue = deque([initial]) # No maxlen: never silently discard pending states.
parent = {initial: None}
dequeued = 0
def report(witness):
return {'safe_in_supplied_model': witness is None,
'witness': witness,
'reachability_exhausted': witness is None,
'states_discovered': tuple(sorted(parent)),
'states_dequeued': dequeued,
'product_state_cap': 2 * len(kinds)}
while queue:
state = queue.popleft()
node, credit = state
dequeued += 1
kind = kinds[node]
if kind == 'action' and not credit:
path = []
previous = state
while previous is not None:
path.append(previous[0])
previous = parent[previous]
return report(tuple(reversed(path)))
following_credit = True if kind == 'confirm' else False if kind in ('reset', 'action') else credit
for target in outgoing[node]:
following = (target, following_credit)
if following not in parent:
parent[following] = state
queue.append(following)
return report(None)
def complete_walk_oracle(kinds, adjacency, start):
"""Trusted-fixture oracle: enumerate raw walks, no main/validator/queue calls.
For an action at the last node, inspect the positions of earlier grants
and revocations in the whole prefix. Enumeration is by length then by
lexicographic node tuple. The first bad prefix is globally shortest.
A reachable bad product state has a simple product path of <=2*N-1 edges.
"""
n = len(kinds)
tested_sequences = 0
for edges in range(2 * n):
for suffix in product(range(n), repeat=edges):
path = (start,) + suffix
tested_sequences += 1
if any(v not in adjacency[u] for u, v in zip(path, path[1:])):
continue
if kinds[path[-1]] != 'action':
continue
prefix = path[:-1]
grant = max((i for i, node in enumerate(prefix) if kinds[node] == 'confirm'), default=-1)
revoke = max((i for i, node in enumerate(prefix) if kinds[node] in ('action', 'reset')), default=-1)
if grant <= revoke:
return path, tested_sequences
return None, tested_sequences
def raises(error, call):
try:
call()
except error:
return True
return False
def self_check():
safe_kinds = ('step', 'confirm', 'action')
safe_adj = ((1,), (2,), ())
safe = audit_workflow(safe_kinds, safe_adj)
repeated = audit_workflow(('confirm', 'action'), ((1,), (1,)))
reset = audit_workflow(('confirm', 'reset', 'action'), ((1,), (2,), ()))
initial_bad = audit_workflow(('action',), ((),))
initial_confirm = audit_workflow(('confirm',), ((0,),))
shortest_kinds = ('step', 'step', 'action', 'step', 'step', 'action')
shortest_adj = ((1, 3), (4,), (), (2,), (5,), ())
shortest = audit_workflow(shortest_kinds, shortest_adj)
tie_kinds = ('step', 'step', 'step', 'action')
tie_adj = ((2, 1), (3,), (3,), ())
tie = audit_workflow(tie_kinds, tie_adj)
history_kinds = ('step', 'confirm', 'step', 'step', 'step', 'action')
history_adj = ((2, 1), (3,), (4,), (5,), (3,), ())
history = audit_workflow(history_kinds, history_adj)
closed = audit_workflow(('confirm', 'step'), ((1,), (0,)))
unreachable = audit_workflow(('step', 'action'), ((0,), ()))
checks = {}
checks['manual_confirmed_terminal_action_has_no_violation'] = (
safe['safe_in_supplied_model'] is True and safe['witness'] is None
and safe['reachability_exhausted'] is True
and safe['states_discovered'] == ((0, False), (1, False), (2, True)))
checks['one_use_credit_is_consumed_before_repeated_action'] = (
repeated['witness'] == (0, 1, 1) and not repeated['safe_in_supplied_model']
and not repeated['reachability_exhausted'])
checks['reset_revokes_prior_confirmation'] = reset['witness'] == (0, 1, 2)
checks['initial_action_is_zero_edge_violation'] = (
initial_bad['witness'] == (0,) and initial_bad['states_dequeued'] == 1)
checks['initial_confirmation_grants_at_entry_not_before_it'] = (
initial_confirm['safe_in_supplied_model'] is True
and initial_confirm['states_discovered'] == ((0, False), (0, True)))
checks['shortest_violation_beats_lexicographically_earlier_longer_branch'] = (
shortest['witness'] == (0, 3, 2))
checks['equal_length_witness_is_lexicographic_and_adjacency_order_independent'] = (
tie['witness'] == (0, 1, 3)
and all(audit_workflow(tie_kinds, (order, (3,), (3,), ())) == tie
for order in permutations((1, 2))))
checks['same_node_under_two_history_bits_must_be_explored'] = (
history['witness'] == (0, 2, 4, 3, 5)
and (3, False) in history['states_discovered']
and (3, True) in history['states_discovered'])
checks['closed_cycle_exhausts_finite_product_states'] = (
closed['safe_in_supplied_model'] is True and closed['reachability_exhausted']
and closed['states_dequeued'] == 3
and len(closed['states_discovered']) == 3 <= closed['product_state_cap'] == 4)
checks['unreachable_action_and_no_action_cycle_do_not_claim_progress'] = (
unreachable['safe_in_supplied_model'] is True
and unreachable['states_discovered'] == ((0, False),)
and audit_workflow(('step',), ((0,),))['safe_in_supplied_model'] is True)
models = cases = oracle_sequences = 0
oracle_ok = True
bounds_ok = True
profiles = [(n, tuple(product(KINDS, repeat=n))) for n in (1, 2)]
profiles.append((3, (('step', 'confirm', 'action'),
('confirm', 'action', 'reset'),
('step', 'action', 'action'))))
for n, label_profiles in profiles:
possible = tuple(product(range(n), repeat=2))
for kinds in label_profiles:
for flags in product((False, True), repeat=n * n):
adjacency = tuple(tuple(v for (u, v), on in zip(possible, flags) if on and u == node)
for node in range(n))
models += 1
for start in range(n):
expected, sequences = complete_walk_oracle(kinds, adjacency, start)
observed = audit_workflow(kinds, adjacency, start)
oracle_ok &= observed['witness'] == expected
oracle_ok &= observed['safe_in_supplied_model'] is (expected is None)
bounds_ok &= (observed['states_dequeued'] <= len(observed['states_discovered']) <= 2 * n)
if expected is not None:
bounds_ok &= len(expected) - 1 <= 2 * n - 1
cases += 1
oracle_sequences += sequences
checks['independent_complete_walk_finite_family_ONE_group'] = bool(
oracle_ok and bounds_ok and models == 1800 and cases == 5128)
class TupleChild(tuple):
def __len__(self):
raise AssertionError('subclass hook must not run')
class IntChild(int):
pass
class StrChild(str):
pass
def never_consume():
raise AssertionError('generator must not be consumed')
yield 'step'
invalid = [
(TypeError, (['step'], ((),), 0)),
(TypeError, (TupleChild(('step',)), ((),), 0)),
(ValueError, ((), (), 0)),
(ValueError, (('step',) * 7, ((),) * 7, 0)),
(TypeError, ((True,), ((),), 0)),
(TypeError, ((StrChild('step'),), ((),), 0)),
(ValueError, (('unknown',), ((),), 0)),
(ValueError, (('STEP',), ((),), 0)),
(TypeError, (('step',), [()], 0)),
(ValueError, (('step',), (), 0)),
(TypeError, (('step',), ([],), 0)),
(TypeError, (('step',), (TupleChild(()),), 0)),
(ValueError, (('step',), ((0, 0),), 0)),
(TypeError, (('step',), ((True,),), 0)),
(TypeError, (('step',), ((IntChild(0),),), 0)),
(TypeError, (('step',), ((0.0,),), 0)),
(ValueError, (('step',), ((1,),), 0)),
(ValueError, (('step',), ((-1,),), 0)),
(ValueError, (('step', 'step'), ((1, 1), ()), 0)),
(TypeError, (('step',), ((),), True)),
(TypeError, (('step',), ((),), IntChild(0))),
(TypeError, (('step',), ((),), 0.0)),
(ValueError, (('step',), ((),), -1)),
(ValueError, (('step',), ((),), 1)),
]
checks['strict_types_shapes_ranges_and_own_caps_ONE_group'] = all(
raises(error, lambda values=values: audit_workflow(*values)) for error, values in invalid)
checks['entire_graph_validated_before_early_result_and_generators_not_consumed'] = (
raises(ValueError, lambda: audit_workflow(('action', 'step'), ((), (2,)), 0))
and raises(TypeError, lambda: audit_workflow(never_consume(), ((),), 0))
and raises(TypeError, lambda: audit_workflow(('step',), never_consume(), 0))
and raises(TypeError, lambda: audit_workflow(('step',), (never_consume(),), 0)))
changed = audit_workflow(history_kinds, history_adj)
changed['witness'] = ()
def mutate_trace():
repeated['witness'][0] = 99
checks['fresh_reports_immutable_witnesses_and_inputs_preserved'] = (
audit_workflow(history_kinds, history_adj) == history and changed != history
and history_adj == ((2, 1), (3,), (4,), (5,), (3,), ())
and safe_kinds == ('step', 'confirm', 'action') and safe_adj == ((1,), (2,), ())
and raises(TypeError, mutate_trace))
assert len(checks) == 14 and all(type(value) is bool and value for value in checks.values()), checks
return {'python_version': platform.python_version(), 'implementation': platform.python_implementation(),
'dependencies': 'standard library only',
'contract': {'nodes': 'exact tuple1..6', 'entry_labels': KINDS,
'credit': 'initialFalse; confirm grants; reset clears; action requires then consumes',
'state': 'node plus credit BEFORE entry',
'witness_order': 'fewest directed edges, then lexicographic node IDs',
'no_violation_is_not': 'liveness, real confirmation, authentication, authorization or security guarantee'},
'manual_confirmed_terminal': safe, 'manual_repeated_action': repeated,
'manual_reset': reset, 'manual_initial_action': initial_bad,
'manual_shortest_not_first_branch': shortest, 'manual_lexicographic_tie': tie,
'manual_two_histories_same_node': history, 'manual_closed_cycle': closed,
'independent_oracle_models_in_ONE_group': models,
'independent_oracle_cases_in_ONE_group': cases,
'independent_raw_sequences_examined_inside_that_family': oracle_sequences,
'invalid_inputs_inside_ONE_group': len(invalid),
'unique_executed_checks': len(checks), 'checks': checks,
'real_calls_speech_authentication_action_NuSMV_or_network_executed': False}
if __name__ == '__main__':
sys.stdout.buffer.write((json.dumps(self_check(), ensure_ascii=True,
indent=2, allow_nan=False) + '\n').encode('utf-8'))
مرجعِ مستقل از صف، والدها و تابعِ گذارِ اصلی استفاده نمیکند. دنبالههای شمارهٔ گره را به ترتیبِ طول میشمارد، وجودِ همهٔ یالها را از ورودیِ خام میسنجد و جایگاهِ آخرین confirm را با آخرین reset یا action پیشین مقایسه میکند. این محاسبهٔ تاریخچه، به همان قاعدهٔ تألیفی وفادار است، ولی ساختمانِ جستوجوی اصلی را تکرار نمیکند.
خانوادهٔ مرجع همهٔ برچسبگذاریها و گرافهای یک و دوگرهی، همراه با سه برچسبگذاریِ مشخص برای همهٔ گرافهای سهگرهی را پوشش میدهد. با همهٔ آغازها، ۵۱۲۸ مقایسه فقط یک گروه است. شاهدهای دستی، ترتیبِ تساوی، چرخه، ورودیِ نامعتبر و استقلالِ گزارشها گروههای مکملاند؛ برنامه چهارده گروهِ بولیِ نامدار دارد و تعدادِ مسیرها گروهِ اضافی محسوب نمیشود.
{
"python_version": "3.14.5",
"implementation": "CPython",
"dependencies": "standard library only",
"contract": {
"nodes": "exact tuple1..6",
"entry_labels": [
"step",
"confirm",
"reset",
"action"
],
"credit": "initialFalse; confirm grants; reset clears; action requires then consumes",
"state": "node plus credit BEFORE entry",
"witness_order": "fewest directed edges, then lexicographic node IDs",
"no_violation_is_not": "liveness, real confirmation, authentication, authorization or security guarantee"
},
"manual_confirmed_terminal": {
"safe_in_supplied_model": true,
"witness": null,
"reachability_exhausted": true,
"states_discovered": [
[
0,
false
],
[
1,
false
],
[
2,
true
]
],
"states_dequeued": 3,
"product_state_cap": 6
},
"manual_repeated_action": {
"safe_in_supplied_model": false,
"witness": [
0,
1,
1
],
"reachability_exhausted": false,
"states_discovered": [
[
0,
false
],
[
1,
false
],
[
1,
true
]
],
"states_dequeued": 3,
"product_state_cap": 4
},
"manual_reset": {
"safe_in_supplied_model": false,
"witness": [
0,
1,
2
],
"reachability_exhausted": false,
"states_discovered": [
[
0,
false
],
[
1,
true
],
[
2,
false
]
],
"states_dequeued": 3,
"product_state_cap": 6
},
"manual_initial_action": {
"safe_in_supplied_model": false,
"witness": [
0
],
"reachability_exhausted": false,
"states_discovered": [
[
0,
false
]
],
"states_dequeued": 1,
"product_state_cap": 2
},
"manual_shortest_not_first_branch": {
"safe_in_supplied_model": false,
"witness": [
0,
3,
2
],
"reachability_exhausted": false,
"states_discovered": [
[
0,
false
],
[
1,
false
],
[
2,
false
],
[
3,
false
],
[
4,
false
],
[
5,
false
]
],
"states_dequeued": 5,
"product_state_cap": 12
},
"manual_lexicographic_tie": {
"safe_in_supplied_model": false,
"witness": [
0,
1,
3
],
"reachability_exhausted": false,
"states_discovered": [
[
0,
false
],
[
1,
false
],
[
2,
false
],
[
3,
false
]
],
"states_dequeued": 4,
"product_state_cap": 8
},
"manual_two_histories_same_node": {
"safe_in_supplied_model": false,
"witness": [
0,
2,
4,
3,
5
],
"reachability_exhausted": false,
"states_discovered": [
[
0,
false
],
[
1,
false
],
[
2,
false
],
[
3,
false
],
[
3,
true
],
[
4,
false
],
[
5,
false
],
[
5,
true
]
],
"states_dequeued": 8,
"product_state_cap": 12
},
"manual_closed_cycle": {
"safe_in_supplied_model": true,
"witness": null,
"reachability_exhausted": true,
"states_discovered": [
[
0,
false
],
[
0,
true
],
[
1,
true
]
],
"states_dequeued": 3,
"product_state_cap": 4
},
"independent_oracle_models_in_ONE_group": 1800,
"independent_oracle_cases_in_ONE_group": 5128,
"independent_raw_sequences_examined_inside_that_family": 438658,
"invalid_inputs_inside_ONE_group": 24,
"unique_executed_checks": 14,
"checks": {
"manual_confirmed_terminal_action_has_no_violation": true,
"one_use_credit_is_consumed_before_repeated_action": true,
"reset_revokes_prior_confirmation": true,
"initial_action_is_zero_edge_violation": true,
"initial_confirmation_grants_at_entry_not_before_it": true,
"shortest_violation_beats_lexicographically_earlier_longer_branch": true,
"equal_length_witness_is_lexicographic_and_adjacency_order_independent": true,
"same_node_under_two_history_bits_must_be_explored": true,
"closed_cycle_exhausts_finite_product_states": true,
"unreachable_action_and_no_action_cycle_do_not_claim_progress": true,
"independent_complete_walk_finite_family_ONE_group": true,
"strict_types_shapes_ranges_and_own_caps_ONE_group": true,
"entire_graph_validated_before_early_result_and_generators_not_consumed": true,
"fresh_reports_immutable_witnesses_and_inputs_preserved": true
},
"real_calls_speech_authentication_action_NuSMV_or_network_executed": false
}
در درسِ بازپخشِ درخواستِ ابزار، هویتِ درخواست و نتیجهٔ ثبتشده بررسی میشد. اعتبارِ مصرفشوندهٔ اینجا جای کلیدِ درخواست، ذخیرهٔ پایدار یا اجرای دقیقاً یکباره را نمیگیرد. پیدا نکردنِ نقض در یک گراف، مسئلهٔ تکرارِ اقدامِ بیرونی پس از خرابی یا فراخوانیِ دوباره را حل نکرده است.
۵. چهار پرسش دربارهٔ تأیید، چرخه و معنای نتیجه

پرسش اول: اگر action خودِ آغاز باشد، شاهد چند یال دارد؟ پاسخ: صفر؛ اعتبارِ آغاز False است و خودِ گره پردازش میشود. خروجی تاپلِ تکعضویِ شمارهٔ آغاز است، نه مسیرِ تهی. حذفِ بررسیِ آغاز، این نقض را از قلم میاندازد.
پرسش دوم: آیا مسیرِ confirm، action، action معتبر است؟ پاسخ: ورودِ اول به action معتبر و ورودِ دوم نقض است؛ اولی اعتبار را مصرف کرده است. اگر میانشان confirm تازهای قرار دهیم، اعتبار دوباره اعطا میشود. صرفِ وجودِ یک confirm در جایی از گذشته کافی نیست.
پرسش سوم: گرافی که فقط در step حلقه میزند، پذیرفته میشود؟ پاسخ: از نظرِ نبودِ اقدامِ بدون اعتبار، بله؛ action قابلدسترسی ندارد. این نتیجه تضمینِ پیشرفت نیست. برنامه نه پایانِ مکالمه را اثبات میکند و نه اجرای نهاییِ یک اقدام را؛ خاصیتِ ایمنی را با خاصیتِ زندهبودن مخلوط نمیکنیم.
پرسش چهارم: وقتی شاهد پیدا شد، فهرستِ حالتهای کشفشده تمامِ دسترسی را نشان میدهد؟ پاسخ: لزوماً نه؛ برنامه با همان شاهد متوقف میشود و reachability_exhausted برابرِ False است. تنها وقتی صف کامل خالی شود، این پرچم True میشود. شمارندههای کشف و برداشت هم دو رویدادِ متفاوتاند.
منابع در ۲۹ مهر ۱۴۰۵ خوانده شدند. شمارهٔ راهنمای NuSMV، نسخهٔ مستنداتِ پایتون و نسخهٔ اجرای ثبتشده جدا هستند؛ تاریخِ دقیقِ انتشارِ این صفحهها معلوم نیست و دسترسیِ تازه خبرِ انتشار نیست. این تمرین، بازبینیِ محدودِ یک مدلِ صریح است. کاملبودنِ گراف، درستبودنِ برچسبها و پیوندِ آنها با رفتارِ واقعی باید در مسئلهٔ واقعی جدا بررسی شوند.
منابع و مطالعهٔ بیشتر
- راهنمای NuSMV2.1؛ خاصیتِ مدل، مسیرِ نقض و مرزِ ایمنی
- Python3.14؛ صفِ deque، append و popleft و maxlen
بررسی منابع: ۲۹ مهر ۱۴۰۵. تحلیلها و پیشنهادهای اجرایی، جمعبندی نویسندهاند.

