Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

alloy

/alloy

Formalnie weryfikuje niezmienniki strukturalne komponentu w Alloy i zapisuje wynik jako dowód w metamodelu, gdy ryzyko leży w modelach danych i relacjach.

Licencja
MIT
Ostatnia zmiana repozytorium
12.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 12.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Formalnie weryfikuje niezmienniki strukturalne komponentu w Alloy i zapisuje wynik jako dowód w metamodelu, gdy ryzyko leży w modelach danych i relacjach.

Oryginalny opis (EN)

Formally verify a capability's structural invariants with Alloy and record the result as metamodel Evidence. Use when the constitution's formal verification assessment flags a component whose risk lies in data models, relations, references, permissions or configuration rather than interleaving (prefer the tla skill for concurrency and protocols).

Jak działa

  1. Inputs
  2. Steps
  3. Evidence
  4. Prompt
Sekcje z nagłówków SKILL.md, w oryginale · 46 linii, 310 słów
Podgląd SKILL.md
---
name: alloy
description: Formally verify a capability's structural invariants with Alloy and record the result as metamodel Evidence. Use when the constitution's formal verification assessment flags a component whose risk lies in data models, relations, references, permissions or configuration rather than interleaving (prefer the tla skill for concurrency and protocols).
---

# Alloy Formal Verification

Rules: [constitution § Formal Verification](../../../CONSTITUTION.md#formal-verification). Format: [`spec.md`](../../../spec.md) §§ 4, 8.

## Inputs

- Target capability: `preconditions`, `postconditions`, `invariants`, `failure_modes`.
- Requirement(s) to verify, with `criteria`.
- Entities and relations owned by the component.

## Steps

1. **Model**: one module per capability, e.g. [`Inventory.als`](../../../examples/greenfield/Inventory.als) (metamodel example: [`metamodel.als`](../../../reference-implementation/metamodel.als)).
   - `sig`s and fields: only entities and relations named by the contract.
   - `fact`s: structural rules the system enforces; never encode properties under check as facts.
   - One `pred` per operation over pre/post state (`s, s'` or Alloy 6 `var` fields); guard with `preconditions`; model `failure_modes` as explicit outcomes.
2. **Properties**: one `assert` per contract clause, named after it.
   - `invariants` → `assert StockNeverNegative { all s: State | s.stock >= 0 }`.
   - `postconditions` → `assert ReservePost { all s, s': State, q: Int | reserve[s, s', q] => s'.stock = minus[s.stock, q] }`.
   - One `run` per operation to show it is satisfiable (guards against vacuous checks).
3. **Scope**: e.g. `check StockNeverNegative for 5 but 4 Int`; small, explicit scopes and bitwidth; record them as assumptions.
4. **Check**: `java -jar org.alloytools.alloy.dist.jar exec Inventory.als`.
5. **Review**: confirm the model corresponds to the contract and implementation; on counterexample, fix spec or design, never silently weaken the assertion or add a fact to hide it.

## Evidence

```yaml
evidence:
  - id: ev-reserve-alloy
    requirement_id: req-reserve
    requirement_version: "1.0"
    method: model-check
    bounds: { scope: 5 }
    passed: true
    provenance: alloy::Inventory.als
```

- `provenance` identifies the model; keep scopes, bitwidth, solver, Alloy version, assumptions and output with it ([`spec.md` § 8](../../../spec.md#8-verification)).
- A bounded `check` is a `model-check` (`bounds` required, e.g. the scope), not an unbounded proof (`method: proof`).
- Contract changes invalidate the evidence; rerun after `--impact <capability>`.

## Prompt

"Write an Alloy model of `<capability>` from its contract; one named `assert` per invariant/postcondition and a `run` per operation; give scopes and list assumptions."

Wersje

RepozytoriumWynikLicencja
Ta strona · ktjn/system-specification100MIT
grafana/skills100Apache-2.0

Migawka bazy z 13.11.2026 · wersja paczki e9b1853ac03d (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100tla
    Sprawdza formalnie niezmienniki komponentu w TLA+ i TLC, a wynik zapisuje jako dowód w metamodelu.
  • 100quint
    Weryfikuje niezmienniki komponentu modelem Quint: sprawdzenie typów, symulację i ograniczone sprawdzanie modelu, z zapisem dowodu.
  • 90create-formal-verification-skill
    Generuje lokalny skill, który formalnie weryfikuje kod tam, gdzie błąd kosztuje najwięcej, a testy sięgają najmniej, w dowolnym języku.
  • 85writing-tla-plus-specs
    Pisze specyfikacje TLA+ lub Alloy do sprawdzenia modelowego protokołu lub algorytmu współbieżnego i czyta ślady z TLC lub Apalache.
  • 90writing-tla-plus-specs
    Pomaga pisać sprawdzane modelowo specyfikacje TLA+ lub Alloy dla protokołów, algorytmów współbieżnych i projektów oraz czytać ślady TLC i Apalache.
  • 100formal-verification
    Wspiera weryfikację formalną: modele projektowe w TLA+, Alloy, P i Quint, dowodzenie kodu względem kontraktów w Dafny, Verus, SPARK, Frama-C, Lean i Rocq, model checking oraz kontrprzykłady.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.