### Natural Deduction Proof Tree Example Source: https://github.com/pauladam94/curryst/blob/main/README.md An example demonstrating a natural deduction proof tree using Curryst. This snippet defines various rule constructors and then builds a complex proof structure. ```typst #let ax = rule.with(name: [ax]) #let and-el = rule.with(name: $and_e^ell$) #let and-er = rule.with(name: $and_e^r$) #let impl-i = rule.with(name: $scripts(->)_i$) #let impl-e = rule.with(name: $scripts(->)_e$) #let not-i = rule.with(name: $not_i$) #let not-e = rule.with(name: $not_e$) #prooftree( impl-i( not-i( not-e( impl-e( ax($Gamma tack p -> q$), and-el( ax($Gamma tack p and not q$), $Gamma tack p$, ), $Gamma tack q$, ), and-er( ax($Gamma tack p and not q$), $Gamma tack not q$, ), $ underbrace(p -> q, p and not q) tack bot $, ), $p -> q tack not (p and not q)$, ), $tack (p -> q) -> not (p and not q)$, ) ) ``` -------------------------------- ### Display a Proof Tree Source: https://github.com/pauladam94/curryst/blob/main/README.md Use the `prooftree` function to render a previously defined proof tree structure. ```typst #prooftree(tree) ``` -------------------------------- ### Construct Nested Proof Trees Source: https://github.com/pauladam94/curryst/blob/main/README.md Create complex proof trees by using a `rule` as a premise for another `rule`. This allows for hierarchical structuring of logical derivations. ```typst #prooftree( rule( name: $R$, rule( name: $A$, rule( $Pi_1$, $C_1 or L$, ), $C_1 or C_2 or L$, ), rule( $Pi_2$, $C_2 or overline(L)$, ), $C_1 or C_2 or C_3$, ) ) ``` -------------------------------- ### Run Curryst Tests Source: https://github.com/pauladam94/curryst/blob/main/tests/README.md Execute the Curryst test suite by compiling Typst files. This command overrides existing images to check for changes, indicating test success if no images are altered. ```bash $ typst compile tests.typ 'test-{p}.png' --root .. ``` -------------------------------- ### Typeset Multiple Rules with Curryst Source: https://github.com/pauladam94/curryst/blob/main/README.md Use this snippet to render multiple proof tree rules together. It defines rules for variable, abstraction, application, weakening, contraction, and exchange, then arranges them using `rule-set`. ```typ #let variable = prooftree( name: [Variable], $Gamma, x : A tack x : A$, ) #let abstraction = prooftree(rule( name: [Abstraction], $Gamma, x: A tack P : B$, $Gamma tack lambda x . P : A => B$, )) #let application = prooftree(rule( name: [Application], $Gamma tack P : A => B$, $Delta tack Q : B$, $Gamma, Delta tack P Q : B$, )) #let weakening = prooftree(rule( name: [Weakening], $Gamma tack P : B$, $Gamma, x : A tack P : B$, )) #let contraction = prooftree( label: [Contraction], $Gamma, x : A, y : A tack P : B$, $Gamma, z : A tack P[x, y <- z]: B$, ) #let exchange = prooftree( label: [Exchange], $Gamma, x : A, y: B, Delta tack P : B$, $Gamma, y : B, x: A, Delta tack P : B$, ) #align(center, rule-set( variable, abstraction, application, weakening, contraction, exchange )) ``` -------------------------------- ### Import Curryst Package Source: https://github.com/pauladam94/curryst/blob/main/README.md Import the latest version of the Curryst package to use its functions. ```typst #import "@preview/curryst:0.6.0": rule, prooftree, rule-set ``` -------------------------------- ### Define a Basic Proof Rule Source: https://github.com/pauladam94/curryst/blob/main/README.md Use the `rule` function to define a proof tree structure. The last argument is the conclusion, and preceding arguments are premises. Optional `name` and `label` can be provided. ```typst #let tree = rule( label: [Label], name: [Rule name], [Premise 1], [Premise 2], [Premise 3], [Conclusion], ) ``` -------------------------------- ### Implement Custom Rule Set Layout in Curryst Source: https://github.com/pauladam94/curryst/blob/main/README.md This function provides a basic implementation for laying out multiple rules with customizable column and row gutters. Modify this code for more complex layout requirements. ```typ #let rule-set(column-gutter: 3em, row-gutter: 3em, ..rules) = { set par(leading: row-gutter, spacing: row-gutter) for rules in rules.pos().split(linebreak()) { block(rules.map(box).join(h(column-gutter, weak: true))) } } ``` -------------------------------- ### Embed Proof Tree in Math Formula Source: https://github.com/pauladam94/curryst/blob/main/README.md Proof trees can be integrated within mathematical formulas using Typst's math mode. ```typst $ Pi quad = quad prooftree( rule( Pi_1, Pi_2, phi, ) ) $ ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.