Giter Club home page Giter Club logo

Comments (3)

rfindler avatar rfindler commented on September 28, 2024

from redex.

o6po5fcs avatar o6po5fcs commented on September 28, 2024

Alright, thank you for the quick response! I had hoped to (as much as possible) make the figures easy to reproduce in code, but in this specific instance it is probably much faster to edit the pdf in Adobe Illustrator to reposition the rules.

For my part the issue can be closed, but I will keep it open for now in case the horizontal-bar-spacing thing is something someone wants to address.

from redex.

rfindler avatar rfindler commented on September 28, 2024

The disadvantage to using adobe is that you'll have to redo that work when the rules change and it can be easy to forget to do. If you're using scribble to write the document itself, you can just drop picts in anywhere (eg in a figure) and then building the paper will always just use the latest version of the redex code. Here's how you can eliminate the blank space between the clauses, for example.

#lang racket
(require redex pict)
(define-language L
  (e ::= (e e) (λ (x) e) x)
  (x ::= variable-not-otherwise-mentioned))

(define-judgment-form L
  #:mode (fv I O)
  #:contract (fv e (x ...))

  [(fv e_1 (x_1 ...)) (fv e_2 (x_2 ...))
   ------------------------------- "app"
   (fv (e_1 e_2) (x_1 ... x_2 ...))]

  [------------------------------- "var"
   (fv x (x))]

  [(fv e (x_2 ...))
   ------------------------------- "lam"
   (fv (λ (x_1) e) (rm (x_2 ...) x_1))])

(define-metafunction L
  rm : (x ...) x -> (x ...)
  [(rm () x) ()]
  [(rm (x_1 x_2 ...) x_1) (rm (x_2 ...) x_1)]
  [(rm (x_1 x_2 ...) x_3)
   (x_1 x_4 ...)
   (where (x_4 ...) (rm (x_2 ...) x_3))])

(define (render-fv-case name)
  (parameterize ([judgment-form-cases
                  (list name)])
    (render-judgment-form fv)))

(render-judgment-form fv)

(vc-append
 (render-fv-case "app")
 (render-fv-case "var")
 (render-fv-case "lam"))

from redex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.