-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Current NFA construction overestimates spectral radius for simple patterns like a+ or [0-9]+, marking them unsafe. This update will:
- Detect simple vs nested loops correctly
- Adjust spectral radius calculation
- Apply DFA minimization to improve accuracy
⚠️ Impact:
Breaking change: patterns previously considered unsafe may now be safe. Users relying on old radius values might see different results.
⚙️ Proposed Implementation:
- Implement cycle detection for simple loops
- Modify spectral radius computation
- Apply DFA minimization after NFA construction
📝 Examples:
check("a+") // before: unsafe, now: safe ✅
check("(a+)+") // remains unsafe