Skip to content

Example diagrams

Sam Estep edited this page May 13, 2022 · 20 revisions

These are all the currently working program triples for our new system. (These are mostly taken from the first sample, though some may not look exactly like the image since they are from old versions of the system.)

A registry of all examples can be found in our repository at packages/examples/src/registry.json.

NOTE: If you're wondering why there are so few examples, it's because we recently did a big port of the system from Haskell to Typescript, deprecating all the examples shown in the SIGGRAPH '20 paper. The paths to reproduce those diagrams are archived here. Be warned that they no longer are guaranteed to work on the most recent version of the master branch, though most of them should be quite easy to port to Typescript!

  • Orthogonal vector example from paper: penrose linear-algebra-domain/twoVectorsPerp-unsugared.sub linear-algebra-domain/linear-algebra-paper-simple.sty linear-algebra-domain/linear-algebra.dsl

image

  • Two sets with labels: penrose set-theory-domain/twosets-simple.sub set-theory-domain/venn-small.sty set-theory-domain/setTheory.dsl

image

  • Nested: [currently broken due to NaNs] roger watch nested.sub venn.sty setTheory.dsl

https://www.dropbox.com/s/mjasajy55b6kozx/Screen%20Shot%202021-02-25%20at%208.12.26%20PM.png?dl=0

  • Big set example with circles: penrose set-theory-domain/tree.sub set-theory-domain/venn.sty set-theory-domain/setTheory.dsl

image

  • Big set example with tree:penrose set-theory-domain/tree.sub set-theory-domain/tree.sty set-theory-domain/setTheory.dsl

image

  • 3D set example: penrose set-theory-domain/tree.sub set-theory-domain/venn-3d.sty set-theory-domain/setTheory.dsl

image

  • Continuous map: penrose set-theory-domain/continuousmap.sub set-theory-domain/continuousmap.sty set-theory-domain/setTheory.dsl

image

  • Hyperbolic: penrose hyperbolic-domain/hyperbolic-example-unsugared.sub hyperbolic-domain/PoincareDisk.sty hyperbolic-domain/hyperbolic.dsl

image

  • Geometry (partial): penrose geometry-domain/pythagorean-theorem-unsugared.sub geometry-domain/euclidean.sty geometry-domain/geometry.dsl

image

  • Sets (optimizing thru computation): penrose set-theory-domain/multisets.sub set-theory-domain/venn-comp-test.sty set-theory-domain/setTheory.dsl

image

  • Cross-domain mesh-set example: penrose mesh-set-domain/DomainInterop-unsugared.sub mesh-set-domain/DomainInterop.sty mesh-set-domain/DomainInterop.dsl

image

  • Graphs: roger watch graph-domain/graph1.sub graph-domain/graph-theory.sty graph-domain/graph-theory.dsl

image

Molecules

Run: npx roger watch molecules/glutamine.sub molecules/molecules-basic.sty molecules/molecules.dsl

For more complicated example try molecules/caffeine.sub.

Alternative styles: molecules/molecules.sty molecules/molecules-elegant.sty

Logic gates

Run: npx roger watch logic-circuit-domain/half-adder.sub logic-circuit-domain/distinctive-shape.sty logic-circuit-domain/logic-gates.dsl

For more complicated example try logic-circuit-domain/full-adder.sub.

Disjoint tests

  • Disjoint rectangles, contained: roger watch graph-domain/small-graph.sub graph-domain/disjoint-rects.sty graph-domain/graph-theory.dsl

image

  • Disjoint rectangles, contained within a large canvas (1600x1200): roger watch graph-domain/small-graph.sub graph-domain/disjoint-rects-large-canvas.sty graph-domain/graph-theory.dsl

large canvas

  • Disjoint rectangles, contained within a small canvas (400x300): roger watch graph-domain/small-graph.sub graph-domain/disjoint-rects-small-canvas.sty graph-domain/graph-theory.dsl

small canvas

  • Disjoint rectangles and horizontal lines, contained: roger watch graph-domain/small-graph.sub graph-domain/disjoint-rect-line-horiz.sty graph-domain/graph-theory.dsl

image

  • Very basic monoidal categories: roger watch monoidal-category-domain/test.sub monoidal-category-domain/monoidal-test.sty monoidal-category-domain/monoidal-test.dsl

image

Clone this wiki locally