CtrlK
BlogDocsLog inGet started
Tessl Logo

specification-to-temporal-logic-generator

Translates specifications into temporal logic formulas (LTL, CTL, or TLA) by matching the specification's shape to the right logic and operators. Use when formalizing requirements for any model checker, when choosing between LTL and CTL for a property, or when the user has a temporal claim and doesn't know which operators express it.

Install with Tessl CLI

npx tessl i github:santosomar/general-secure-coding-agent-skills --skill specification-to-temporal-logic-generator
What are skills?

100

Quality

100%

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SKILL.md
Review
Evals

Specification → Temporal Logic Generator

Three logics, one job: saying precisely what "always" and "eventually" mean. The choice of logic is mostly dictated by your checker; the choice of formula is the craft.

Which logic?

LogicTime modelCheckerWhen it's the right fit
LTLLinear — one futureSpin, NuSMV, most"On every execution, X eventually holds"
CTLBranching — many futuresNuSMV, nuXmv"There exists an execution where..." / "on all branches..."
TLALinear + actionsTLC, TLAPSDistributed systems; → requirement-to-tlaplus-property-generator

LTL vs CTL: LTL quantifies over paths implicitly (every path). CTL quantifies explicitly (A = all paths, E = some path). The formula AG EF reset ("from any state, it's possible to reach reset") is CTL-only — LTL can't say "possible."

Operator cheat sheet

EnglishLTLCTLIntuition
Always PG PAG PP holds in every state (of every path)
Eventually PF PAF P / EF PP holds in some future state
Next PX PAX P / EX PP holds in the very next state
P until QP U QA[P U Q]P keeps holding until Q does (and Q does happen)
P weak-until QP W QP until Q, OR P forever (Q optional)
Infinitely often PG F PAG AF PP keeps recurring
Eventually always PF G PAF AG PP stabilizes — becomes permanently true
It's possible to reach PEF PCTL-only. Some path reaches P.
P is always reachableAG EF PCTL-only. From anywhere, P is still possible.

Pattern → formula

Spec patternFormulaLogic
"P is an invariant"G PLTL
"Every request gets a response"G (req → F resp)LTL
"P never happens before Q"¬P W QLTL
"Between Q and R, P always holds"G (Q → (P W R))LTL
"The system can always be reset"AG EF resetCTL
"There's no deadlock"AG EX trueCTL
"Once P, always P" (stable)G (P → G P)LTL
"P and Q alternate"G (P → X(¬P U Q)) ∧ G (Q → X(¬Q U P))LTL

Worked example

Spec: "After a successful login, the session token remains valid until logout or timeout, and it must become invalid immediately after either."

Decompose:

  • "After login" → scope starts at login_ok
  • "remains valid until" → U (strong until — one of the terminators must happen)
  • "logout or timeout" → logout ∨ timeout
  • "immediately after" → X (next state)

LTL:

G ( login_ok →
    ( valid U (logout ∨ timeout) )         -- valid until one fires
    ∧
    ( (logout ∨ timeout) → X ¬valid )      -- and then immediately invalid
  )

Caveat: The second conjunct is subtle — it says "whenever logout/timeout is true, next state is invalid." But that's global, not scoped to this session. If logout can happen without a preceding login, the formula is too strong. Tighter:

G ( login_ok →
    ( valid ∧ ¬logout ∧ ¬timeout ) U ( (logout ∨ timeout) ∧ X ¬valid )
  )

Now the "and then invalid" is part of the Until's right-hand side — it only applies to this session's termination.

The vacuity check

After writing a formula, ask: is it trivially true?

  • G (false → P) is always true — false never holds.
  • G (req → F resp) — if req never occurs in the model, this passes. Meaningless.
  • F P — if P is true in the initial state, this says nothing about the future.

Run the checker with a "witness" property too: F req should be satisfiable, confirming req actually happens.

Do not

  • Do not use LTL for "it's possible that." LTL can only say "on all paths" — possibility needs CTL's E.
  • Do not confuse G F P with F G P. "Infinitely often" ≠ "eventually always." A blinking light satisfies G F on but not F G on.
  • Do not use U when you mean W. P U Q requires Q to eventually hold. If Q might never happen and that's okay, use W (weak until).
  • Do not nest more than 3 temporal operators without a sanity check. Deep nesting is where formulas go wrong — unfold on a small trace by hand.

Output format

## Spec (as given)
<verbatim>

## Logic
<LTL | CTL | TLA> — <why this logic>

## Formula
<temporal logic>

## Decomposition
<english phrase> ↦ <sub-formula>

## Vacuity check
<witness property that should also hold — confirms the antecedent fires>
Repository
santosomar/general-secure-coding-agent-skills
Last updated
Created

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.