A Typst package for typesetting proof trees.
You can import the latest version of this package with:
#import "@preview/curryst:0.3.0": rule, proof-tree
To display a proof tree, you first need to create a tree, using the rule
function. Its first argument is the conclusion, and the other positional arguments are the premises. It also accepts a name
for the rule name, displayed on the right of the bar, as well as a label
, displayed on the left of the bar.
#let tree = rule(
label: [Label],
name: [Rule name],
[Conclusion],
[Premise 1],
[Premise 2],
[Premise 3]
)
Then, you can display the tree with the proof-tree
function:
#proof-tree(tree)
In this case, we get the following result:
Proof trees can be part of mathematical formulas:
Consider the following tree:
$
Pi quad = quad #proof-tree(
rule(
$phi$,
$Pi_1$,
$Pi_2$,
)
)
$
$Pi$ constitutes a derivation of $phi$.
You can specify a rule as the premises of a rule in order to create a tree:
#proof-tree(
rule(
name: $R$,
$C_1 or C_2 or C_3$,
rule(
name: $A$,
$C_1 or C_2 or L$,
rule(
$C_1 or L$,
$Pi_1$,
),
),
rule(
$C_2 or overline(L)$,
$Pi_2$,
),
)
)
As an example, here is a natural deduction proof tree generated with Curryst:
The proof-tree
function accepts multiple named arguments that let you customize the tree:
prem-min-spacing
title-inset
stroke
horizontal-spacing
min-bar-height
For more information, please refer to the documentation in curryst.typ
.