Skip to content

Instantly share code, notes, and snippets.

@okram
Created November 27, 2019 11:48
Show Gist options
  • Save okram/b2c82dc9e720b9b122b1b7324d167057 to your computer and use it in GitHub Desktop.
Save okram/b2c82dc9e720b9b122b1b7324d167057 to your computer and use it in GitHub Desktop.
/*
The [explain] instruction builds a pretty-printable table of the
incoming object's instruction sequence's domains and ranges.
Every object has a "maps from" (<=) instruction sequence.
Instances are mapped from [id]. (i.e. no instructions needed to create it).
*/
~/software/mm-adt/vm/java bin/mmadt.sh
_____ _______
/\ | __ |__ __|
_ __ ___ _ __ ___ _____ / \ | | | | | |
| '_ ` _ \| '_ ` _ |_____/ /\ \| | | | | |
| | | | | | | | | | | / ____ \ |__| | | |
|_| |_| |_|_| |_| |_| /_/ \_\____/ |_|
mm-adt.org
mmlang> int => [plus,2][is,[mult,5][gt,12]][lt,31][is,true][explain]
bool{?} <= [plus,2][is,bool <= [mult,5][gt,12]][lt,31][is,true]
instruction domain range
-------------------------------------------------
[plus,2] int -> int
[is,bool <= [mult,5][gt,12]] int -> int{?}
[mult,5] int -> int
[gt,12] int -> bool
[lt,31] int{?} -> bool{?}
[is,true] bool{?} -> bool{?}
==>bool{?} <= [plus,2][is,bool <= [mult,5][gt,12]][lt,31][is,true]
mmlang>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment