# Petri Nets

> A conceptual representation of concurrent flow as places holding tokens and transitions that consume and produce them, which can be analyzed for deadlock.

Record: `architecture:petri-nets`
Kind: model
Layer: [Atomic Boundary](https://banes-lab.com/records/layer/atomic-boundary.md)
Severity: contextual
Scope: concurrency, workflow, verification
Canonical: https://banes-lab.com/ontology#architecture-petri-nets

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Controlled Side Effects](https://banes-lab.com/records/architecture/controlled-side-effects.md).

## Repair

- Refactored by: Model concurrent flow as a Petri net and analyze reachability
- Detected by: deadlocks or lost tokens found only at runtime
- Violated by: concurrent resource flows coordinated by hand-reasoned lock ordering
- Measured by: unreachable or deadlock-prone markings
- Enforced by: concurrency model review

## Requires

- [Places and Transitions](https://banes-lab.com/records/lexicon/places-and-transitions.md)

## Reinforces

- [Concurrency Correctness](https://banes-lab.com/records/lexicon/concurrency-correctness.md)
- [Deadlock Freedom](https://banes-lab.com/records/lexicon/deadlock-freedom.md)

## Enables

- [Concurrent-Flow Modeling](https://banes-lab.com/records/lexicon/concurrent-flow-modeling.md)
- [Reachability and Deadlock Analysis](https://banes-lab.com/records/lexicon/reachability-and-deadlock-analysis.md)

## Conflicts with

- [Ad-Hoc Lock Ordering](https://banes-lab.com/records/lexicon/ad-hoc-lock-ordering.md)

## In tension with

- [Modeling Overhead](https://banes-lab.com/records/lexicon/modeling-overhead.md)

## Tensions

- [Petri Nets / Modeling Overhead](https://banes-lab.com/records/tension/modeling-overhead-petri-nets.md)

## Contracts

- [Petri Nets](https://banes-lab.com/records/algorithms/petri-nets.md)

## Severity

- [contextual](https://banes-lab.com/records/vocabulary/severity-contextual.md)

## Category

- [Transactions / State / Concurrency](https://banes-lab.com/records/architecture-category/transactions-state-concurrency.md)

## Linked from

- [Transactions / State / Concurrency](https://banes-lab.com/ontology/lexicon/lexicon-category-transactions-state-concurrency.md)
- [Architecture](https://banes-lab.com/ontology/algorithms/algorithms-domain-architecture.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The resolutions](https://banes-lab.com/ontology/schema/the-resolutions.md)
