verifications.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package fsm
  2. // IsComplete verifies that every pair or states has a defined transition.
  3. //
  4. // Complexity: O(V) if the Matrix is the default map implementation.
  5. func IsComplete[SK, EK comparable, EV any](Matrix[SK, EK, EV]) bool {
  6. panic("not implemented")
  7. }
  8. // InCompleteWithoutSelfLoops verifies that every pair of different states has a defined transition,
  9. // but no same-state transition exists.
  10. func InCompleteWithoutSelfLoops[SK, EK comparable, EV any]() bool {
  11. panic("not implemented")
  12. }
  13. // IsReachable verifies that s2 is reachable from s1.
  14. func IsReachable[SK, EK comparable, EV any](s1, s2 State[SK, EK, EV]) bool {
  15. panic("not implemented")
  16. }
  17. // IsAccessible verifies that every state except initial is reachable from the initial state.
  18. func IsAccessible[SK, EK comparable, EV any]() bool {
  19. panic("not implemented")
  20. }
  21. // IsCoAccessible verifies that final state is reachable from any state except final.
  22. func IsCoAccessible[SK, EK comparable, EV any]() bool {
  23. panic("not implemented")
  24. }
  25. // IsTrimmed verifies that the matrix verifies both IsAccessible and IsCoAccessible.
  26. func IsTrimmed[SK, EK comparable, EV any]() bool {
  27. panic("not implemented")
  28. }
  29. // IsStronglyConnected verifies that every state is reachable from every other.
  30. //
  31. // Minimal Complexity O(V+E) using DFS (Tarjan or Kosaraju)
  32. func IsStronglyConnected[SK, EK comparable, EV any]() bool {
  33. panic("not implemented")
  34. }
  35. // IsFSMContextCancellable verifies that the context on a FSM is set to a context
  36. // that includes a cancelCtx.
  37. //
  38. // WARNING: this assumes that all context stacked above it implement the context.stringer interface
  39. // and respect the unofficial context package naming convention for implementations of that interface.
  40. // All types in stdlib context do, but customer context implementations might not.
  41. func IsFSMContextCancellable[SK, EK comparable, EV any](FSM[SK, EK, EV]) bool {
  42. panic("not implemented")
  43. }