Skip to content

Examples

Max Krieger edited this page Apr 23, 2019 · 34 revisions

Here are the main example program pairs that should work together: (written in this format so they can be copied as arguments)

Simpler examples

  • One subset relationship: runpenrose sub/twosets.sub sty/venn.sty set-theory-domain/setTheory.dsl

  • Two points, one with computed location: runpenrose sub/twopoints.sub sty/twopoints.sty set-theory-domain/setTheory.dsl

  • Point in set relationship: runpenrose sub/venn_comp_pt.sub sty/venn_comp_simple.sty set-theory-domain/setTheory.dsl

  • Sets with each pair linked: runpenrose sub/threesets.sub sty/test-local.sty set-theory-domain/setTheory.dsl

Note that there are six arrows: one between each pair of sets.

  • Optimized fields and properties: (here the padding and radii are optimized to lie within ranges) runpenrose sub/threesets.sub sty/test-optimized.sty set-theory-domain/setTheory.dsl

More complex examples

  • Subset relationships in Venn diagram style: runpenrose sub/tree.sub sty/venn.sty set-theory-domain/setTheory.dsl

  • Subset relationships in tree diagram style: runpenrose sub/tree.sub sty/tree.sty set-theory-domain/setTheory.dsl

Without the same-y-coordinate objective, we get a radial layout:

With the same-y-coordinate objective, we get a linear layout: (takes much longer to converge)

  • Continuous map in set theory style: runpenrose sub/continuousmap.sub sty/continuousmap.sty set-theory-domain/setTheory.dsl

The first few samples have trouble converging:

On the fourth or fifth resample, we get a nicely converged diagram:

  • Surjection in Cartesian style: runpenrose sub/cart-test.sub sty/cart-test-pt.sty set-theory-domain/setTheory.dsl

  • Surjection in Cartesian style with special point: runpenrose sub/cart-test-pt.sub sty/cart-test-pt.sty set-theory-domain /setTheory.dsl

  • Nicer computed surjection (using Map type only): runpenrose sub/surjection_computed.sub sty/surjection_computed.sty set-theory-domain/setTheory.dsl

Libraries

In general, we want to build up Style libraries that work for domains and are not tied to particular Substance programs. So far we have two examples for set theory.

  • Any set theory programs should work with venn.sty or tree.sty.

In progress

  • Upcoming linear algebra diagrams

Currently not working

  • None!

Deprecated

Pending a port using Alloy:

  • Surjection in abstract style: runpenrose sub/surjection.sub sty/surjection-abstract.sty set-theory-domain/setTheory.dsl
    • NOTE: Due to optimization parameters, this example might converge prematurely. Drag the geometries around with Autostep on to break out of local minima and get better results.

  • Bijection in set theory style: runpenrose sub/bijection.sub sty/bijection.sty set-theory-domain/setTheory.dsl

  • Function composition in set theory style: runpenrose sub/composition.sub sty/composition.sty (slow to optimize)

  • Surjection in set theory style: runpenrose sub/surjection.sub sty/surjection.sty set-theory-domain/setTheory.dsl

  • Injection in set theory style: runpenrose sub/injection.sub sty/injection.sty set-theory-domain/setTheory.dsl

Pending the addition of Surjection(f), Bijection(f), Injection(f) predicates:

  • Computed bijection: runpenrose sub/bijection_computed.sub sty/bijection_computed.sty set-theory-domain/setTheory.dsl

image

  • Computed injection: runpenrose sub/injection_computed.sub sty/injection_computed.sty set-theory-domain/setTheory.dsl

image

Clone this wiki locally