본문으로 건너뛰기
cccskills
무료GitHub에 공개

specification-to-temporal-logic-generator

Translate natural-language requirements or structured specification documents into formal temporal logic properties (LTL, CTL, safety/liveness properties). Use when users need to formalize requirements for model checking, formal verification, or property specification. Handles embedded/real-time systems, hardware verification, concurrent systems, and reactive systems. Resolves ambiguities, asks clarifying questions when needed, and outputs machine-checkable formulas with explanations. Supports multiple output formats (SPIN, NuSMV, Uppaal, TLA+, Maude).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(7)

  • SKILL.md6.0 KB
  • references/ambiguity_resolution.md6.0 KB
  • references/ctl_patterns.md4.5 KB
  • references/ltl_patterns.md3.1 KB
  • references/tool_syntax.md5.6 KB
  • scripts/convert_format.py5.9 KB
  • scripts/validate_formula.py5.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Specification-to-Temporal-Logic Generator

Translate natural-language requirements into formal temporal logic properties for model checking and formal verification.

Workflow

1. Parse Input Requirements

Extract requirements from natural language text, structured documents, or semi-formal notations.

Identify key elements:

  • Events/Actions: What happens (e.g., "request", "response", "button_press")
  • States/Conditions: System states (e.g., "authenticated", "locked", "idle")
  • Temporal relationships: When things happen (e.g., "always", "eventually", "before")
  • Quantification: Scope (e.g., "every", "some", "at least once")

2. Identify Property Type

Classify requirements:

Safety (something bad never happens): Keywords "never", "always not", "must not" → G(!bad_event)

Liveness (something good eventually happens): Keywords "eventually", "will", "guaranteed" → F(good_event)

Response (if X then eventually Y): Keywords "whenever", "if...then", "leads to" → G(X -> F Y)

Precedence (X before Y): Keywords "before", "precedes", "only after" → (!Y) U X

Fairness (repeated opportunities): Keywords "infinitely often", "repeatedly" → G F X

3. Handle Ambiguities

When requirements are ambiguous:

Check common ambiguities: temporal scope, quantification, ordering, duration

Ask clarifying questions:

"The system responds to requests" could mean:
1. Every request eventually gets a response: G(request -> F response)
2. Some requests get responses: EF(request && response)
Which interpretation matches your intent?

State assumptions explicitly:

Formula: G(request -> F response)
Assumptions:
- "Every request" means all requests (universal quantification)
- "Responds" means eventually, with no time bound

See ambiguity_resolution.md for detailed patterns.

4. Select Appropriate Logic

Use LTL for single execution paths, "infinitely often" (G F), "eventually forever" (F G)

Use CTL for branching time, "on all paths" (A) vs "on some path" (E), reachability

5. Generate Formulas

Match to pattern: See ltl_patterns.md and ctl_patterns.md

Instantiate pattern:

Pattern: G(p -> F q)
Requirement: "Every request gets a response"
Formula: G(request -> F response)

Validate syntax:

python scripts/validate_formula.py "G(request -> F response)" LTL

Add explanations: Plain English, formal semantics, assumptions, counterexamples

6. Convert to Tool-Specific Syntax

Generate formulas for target tools using conversion script:

python scripts/convert_format.py "G(request -> F response)" LTL SPIN

See tool_syntax.md for complete syntax reference.

Output Format

For each requirement:

Requirement: [Original requirement]

Formula (LTL): [LTL formula]
Formula (CTL): [CTL formula, if applicable]

Property Type: [Safety/Liveness/Response/Precedence/Fairness]

Explanation:
- Plain English: [What it means]
- Formal Semantics: [Technical interpretation]
- Assumptions: [List of assumptions]
- Violation Example: [What would violate this]

Tool-Specific Syntax:
- SPIN: [Promela syntax]
- NuSMV: [NuSMV syntax]
- Uppaal: [Uppaal syntax]

Validation: [Result from validate_formula.py]

Examples

Safety Property

Requirement: "The system never enters a deadlock state"

Output:

Formula (LTL): G(!deadlock)
Formula (CTL): AG(!deadlock)
Property Type: Safety (Invariant)

Explanation:
- Plain English: The system never reaches a deadlock state
- Formal Semantics: At all time points, deadlock does not hold
- Assumptions: "deadlock" is a well-defined state predicate
- Violation: System reaches a state where no process can progress

Tool-Specific Syntax:
- SPIN: [] (!deadlock)
- NuSMV: SPEC AG(!deadlock)
- Uppaal: A[] not deadlock

Response Property

Requirement: "Whenever a button is pressed, the light turns on within 3 time units"

Output:

Formula (TCTL): G(button_press -> F[<=3] light_on)
Property Type: Bounded Response (Liveness)

Explanation:
- Plain English: Every button press is followed by light turning on within 3 time units
- Assumptions: Time is discrete, light can turn on multiple times
- Violation: Button pressed but light doesn't turn on within 3 time units

Tool-Specific Syntax:
- Uppaal: A[] (button_press imply A<> light_on[<=3])

Precedence Property

Requirement: "Users must authenticate before accessing the system"

Output:

Formula (LTL): (!access) U authenticated
Formula (CTL): A[(!access) U authenticated]
Property Type: Precedence (Safety)

Explanation:
- Plain English: No access occurs until authentication happens
- Assumptions: Authentication is one-time, access can occur multiple times after
- Violation: Access occurs before authentication

Tool-Specific Syntax:
- SPIN: ((!access) U authenticated)
- NuSMV: SPEC A[(!access) U authenticated]

Resources

scripts/

  • validate_formula.py - Validate temporal logic syntax (LTL, CTL, SPIN)
  • convert_format.py - Convert between tool formats (SPIN, NuSMV, Uppaal, TLA+, Maude)

references/

  • ltl_patterns.md - LTL property patterns and templates
  • ctl_patterns.md - CTL property patterns
  • ambiguity_resolution.md - Guidelines for handling ambiguous requirements
  • tool_syntax.md - Syntax for different model checkers

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Applies abstract interpretation using different abstract domains (intervals, octagons, polyhedra, sign, congruence) to statically analyze program variables and infer invariants, value ranges, and relationships. Use when analyzing program properties, inferring loop invariants, detecting potential errors, or understanding variable relationships through static analysis.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ArabelaTso/Skills-4-SE2582026년 8월 21일 업데이트

Uses abstract interpretation to automatically infer loop invariants, function preconditions, and postconditions for formal verification. Generates invariants that capture program behavior and support correctness proofs in Dafny, Isabelle, Coq, and other verification systems. Use when adding formal specifications to code, generating verification conditions, inferring contracts for functions, or discovering loop invariants for proofs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ArabelaTso/Skills-4-SE2582026년 8월 21일 업데이트

Performs abstract interpretation over source code to infer possible program states, variable ranges, and data properties without executing the program. Reports potential runtime errors including out-of-bounds accesses, null dereferences, type inconsistencies, division by zero, and integer overflows. Use when analyzing code for potential runtime errors, performing static analysis, checking safety properties, or verifying program behavior without execution.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ArabelaTso/Skills-4-SE2582026년 8월 21일 업데이트

Performs abstract interpretation to produce summarized execution traces and high-level program behavior representations. Highlights key control flow paths, variable relationships, loop invariants, function summaries, and potential runtime states using abstract domains (intervals, signs, nullness, etc.). Use when analyzing program behavior, understanding execution paths, computing loop invariants, tracking variable ranges, detecting potential runtime errors, or generating program summaries without concrete execution.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ArabelaTso/Skills-4-SE2582026년 8월 21일 업데이트

Create ACSL (ANSI/ISO C Specification Language) formal annotations for C/C++ programs. Use this skill when working with formal verification, adding function contracts (requires/ensures), loop invariants, assertions, memory safety annotations, or any ACSL specifications. Supports Frama-C verification and generates comprehensive formal specifications for C/C++ code.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ArabelaTso/Skills-4-SE2582026년 8월 21일 업데이트

CLI-based browser automation with persistent page state using ref-based element interaction. Use when users ask to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ArabelaTso/Skills-4-SE2582026년 8월 21일 업데이트

ArabelaTso의 스킬 모두 보기

이 스킬의 문제 신고