You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.2 KiB

2 years ago
  1. \newcommand{\ws}[1]{\phantom{#1}}
  2. \newcommand{\event}{\ensuremath{F}}
  3. \newcommand{\glob}{\ensuremath{G}}
  4. \newcommand{\nex}{\ensuremath{X}}
  5. \newcommand{\unt}{\ensuremath{U}}
  6. \newcommand{\release}{\ensuremath{R}}
  7. \newcommand{\wrelease}{\ensuremath{W}}
  8. \newenvironment{ltltabular}[1]
  9. {\begin{tabular}{ |l|*{#1}{c|} } \hline}
  10. {\end{tabular}}
  11. \ExplSyntaxOn
  12. \NewDocumentCommand{\ltlrow}{m} {
  13. \seq_set_split:Nnn \ltl_row {|} { #1 }
  14. \seq_use:Nn \ltl_row { & }
  15. \\
  16. \hline
  17. }
  18. \seq_new:N \ltl_row % allocate a sequence
  19. \ExplSyntaxOff
  20. \ExplSyntaxOn
  21. \NewDocumentCommand{\ltlSteps}{+m +m} {
  22. \int_set:Nn \l_end {#1}
  23. \int_set:Nn \l_iter {0}
  24. \int_do_until:nNnn {\l_iter} = {\l_end} {
  25. \seq_put_right:Nx \ltl_steps { \int_use:N \l_iter}
  26. \int_incr:N \l_iter
  27. }
  28. \seq_put_right:Nn \ltl_steps { \multicolumn{#2}{c|}{ $\omega$ } }
  29. \seq_put_left:Nn \ltl_steps { Step }
  30. \seq_use:Nn \ltl_steps { & }
  31. \\
  32. \hline
  33. }
  34. \int_new:N \l_end
  35. \int_new:N \l_iter
  36. \seq_new:N \ltl_steps % allocate a sequence
  37. \ExplSyntaxOff
  38. \newcommand{\ltlTrace}[2]{
  39. \def\VARIABLE{#1}%
  40. \VARIABLE & \ltlrow{#2}
  41. }
  42. \newcommand{\ltlFormula}[2]{
  43. \def\FORMULA{#1}%
  44. \FORMULA & \ltlrow{#2}
  45. }