Skip to content

Commit 71f0292

Browse files
Merge pull request #2532 from ninioArtillero/architecture-graph
mermaid graph of LH (specs) architecture
2 parents 80a7e56 + 0baa182 commit 71f0292

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,3 +331,51 @@ that can be tested with `./scripts/test/test_plugin.sh`.
331331
[processTargetModule]: liquidhaskell-boot/src/Language/Haskell/Liquid/GHC/Interface.hs#L483
332332
[processModule]: liquidhaskell-boot/src/Language/Haskell/Liquid/GHC/Plugin.hs#L509
333333

334+
# Module Verification Process
335+
336+
The following graph summarizes the verification process of a module by showing
337+
its specification life cycle.
338+
See [Specs.hs](./liquidhaskell-boot/src/Language/Haskell/Liquid/Types/Specs.hs)
339+
for detailed documentation on the specification stages.
340+
There are many moving parts hidden within each graph link,
341+
but some places worth noticing here are
342+
[Liquid.hs](./liquidhaskell-boot/src/Language/Haskell/Liquid/Liquid.hs)
343+
—which implements constraint generation— and
344+
[SpecFinder.hs](./liquidhaskell-boot/src/Language/Haskell/Liquid/Liquid.hs)
345+
—that deals with the gathering of dependencies and `LHAssumptions`—.
346+
347+
```mermaid
348+
flowchart LR
349+
subgraph Liquid Haskell
350+
351+
subgraph Inputs
352+
direction TB
353+
LiftedDeps[
354+
Dependencies of A
355+
LifttedSpecs
356+
]
357+
CoreBinds[CoreBinds]
358+
Bare[BarseSpec]
359+
end
360+
361+
subgraph Outputs
362+
direction TB
363+
T[TargetSpec] --> Constraints[Verification
364+
Constraints]
365+
L[LiftedSpec]
366+
end
367+
368+
Inputs --> Outputs
369+
370+
end
371+
372+
A>DepsOfA_LHAssumptions] --> LiftedDeps
373+
Deps>DepsOfA.hi] --> LiftedDeps
374+
Mod(A.hs) --> CoreBinds & Bare
375+
Constraints -->|checked by| fixpoint([liquid-fixpoint])
376+
L ---> |if verified:
377+
serialize| File>A.hi]
378+
```
379+
380+
Reference:
381+
[Implementing a GHC Plugin for Liquid Haskell](https://well-typed.com/blog/2020/08/implementing-a-ghc-plugin-for-liquid-haskell/).

0 commit comments

Comments
 (0)