www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit bcced0995d440ea70b01c82643c8ef3458b81527
parent f500dfcb1a32acb7b7caea4941e2c7c07540417d
Author: Georges Dupéron <georges.duperon@gmail.com>
Date:   Thu, 26 Jan 2017 04:55:01 +0100

Extracted subtemplate from phc-graph

Diffstat:
D.gitignore | 8--------
D.travis.yml | 60------------------------------------------------------------
DGraph-notes-copy2.vue | 3887-------------------------------------------------------------------------------
DLICENSE.txt | 11-----------
DREADME.md | 3---
Dalpha-equivalence-normal-form.rkt | 80-------------------------------------------------------------------------------
Dbench001.rkt | 33---------------------------------
Ddispatch-union.rkt | 53-----------------------------------------------------
Dfeatures-and-implementation | 40----------------------------------------
Dfeatures-and-implementation2 | 143-------------------------------------------------------------------------------
Dfeatures-and-implementation3 | 100-------------------------------------------------------------------------------
Dflexible-with-utils.hl.rkt | 118-------------------------------------------------------------------------------
Dflexible-with.hl.rkt | 366-------------------------------------------------------------------------------
Dfree-identifier-tree-equal.rkt | 91-------------------------------------------------------------------------------
Dgraph-info.hl.rkt | 347-------------------------------------------------------------------------------
Dgraph-type.hl.rkt | 145-------------------------------------------------------------------------------
Dgraph.hl.rkt | 120-------------------------------------------------------------------------------
Dinfo.rkt | 32--------------------------------
Dinvariants-phantom.hl.rkt | 483-------------------------------------------------------------------------------
Dmain.rkt | 35-----------------------------------
Dnotations.rkt | 8--------
Dscribblings/phc-graph-implementation.scrbl | 20--------------------
Dscribblings/phc-graph.scrbl | 14--------------
Dtest/adt-pre-declarations.rkt | 17-----------------
Dtest/assumption-equivalent-types-same-type.rkt | 50--------------------------------------------------
Dtest/ck.rkt | 22----------------------
Dtest/invariant-phantom-tr-assumptions.rkt | 43-------------------------------------------
Dtest/invariant-phantom-tr-assumptions2.rkt | 70----------------------------------------------------------------------
Dtest/test-flexible-with.rkt | 80-------------------------------------------------------------------------------
Dtest/test-graph-type.rkt | 40----------------------------------------
Dtest/test-traversal-1.rkt | 102-------------------------------------------------------------------------------
Dtest/test-traversal-2.rkt | 114-------------------------------------------------------------------------------
Dtest/traversal-util.rkt | 23-----------------------
Dthoughts.rkt | 125-------------------------------------------------------------------------------
Dtimes.rkt.txt | 76----------------------------------------------------------------------------
Dtraversal.hl.rkt | 398-------------------------------------------------------------------------------
36 files changed, 0 insertions(+), 7357 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -1,7 +0,0 @@ -*~ -\#* -.\#* -.DS_Store -compiled/ -/doc/ -/.~*.vue -\ No newline at end of file diff --git a/.travis.yml b/.travis.yml @@ -1,60 +0,0 @@ -language: c - -# Based from: https://github.com/greghendershott/travis-racket - -# Optional: Remove to use Travis CI's older infrastructure. -sudo: false - -env: - global: - # Supply a global RACKET_DIR environment variable. This is where - # Racket will be installed. A good idea is to use ~/racket because - # that doesn't require sudo to install and is therefore compatible - # with Travis CI's newer container infrastructure. - - RACKET_DIR=~/racket - matrix: - # Supply at least one RACKET_VERSION environment variable. This is - # used by the install-racket.sh script (run at before_install, - # below) to select the version of Racket to download and install. - # - # Supply more than one RACKET_VERSION (as in the example below) to - # create a Travis-CI build matrix to test against multiple Racket - # versions. - #- RACKET_VERSION=6.0 - #- RACKET_VERSION=6.1 - #- RACKET_VERSION=6.1.1 - #- RACKET_VERSION=6.2 - #- RACKET_VERSION=6.3 - #- RACKET_VERSION=6.4 - #- RACKET_VERSION=6.5 - #- RACKET_VERSION=6.6 - #- RACKET_VERSION=6.7 - - RACKET_VERSION=HEAD - -matrix: - allow_failures: -# - env: RACKET_VERSION=HEAD - fast_finish: true - -before_install: -- git clone https://github.com/greghendershott/travis-racket.git ~/travis-racket -- cat ~/travis-racket/install-racket.sh | bash # pipe to bash not sh! -- export PATH="${RACKET_DIR}/bin:${PATH}" #install-racket.sh can't set for us - -install: - - raco pkg install -j 2 --deps search-auto - -before_script: - -# Here supply steps such as raco make, raco test, etc. You can run -# `raco pkg install --deps search-auto` to install any required -# packages without it getting stuck on a confirmation prompt. -script: - - raco test -p phc-graph - - raco setup --check-pkg-deps --no-zo --no-launcher --no-install --no-post-install --no-docs --pkgs phc-graph - - raco pkg install --deps search-auto doc-coverage - - raco doc-coverage phc-graph - -after_success: - - raco pkg install --deps search-auto cover cover-coveralls - - raco cover -b -f coveralls -d $TRAVIS_BUILD_DIR/coverage . diff --git a/Graph-notes-copy2.vue b/Graph-notes-copy2.vue @@ -1,3887 +0,0 @@ -<!-- Tufts VUE 3.3.0 concept-map (Graph-notes-copy2.vue) 2017-01-16 --> -<!-- Tufts VUE: http://vue.tufts.edu/ --> -<!-- Do Not Remove: VUE mapping @version(1.1) jar:file:/nix/store/z92y35qgs6g3cvvh0i4f14mg5n47zvvi-vue-3.3.0/share/vue/vue.jar!/tufts/vue/resources/lw_mapping_1_1.xml --> -<!-- Do Not Remove: Saved date Mon Jan 16 09:59:19 CET 2017 by georges on platform Linux 4.4.38 in JVM 1.8.0_122-04 --> -<!-- Do Not Remove: Saving version @(#)VUE: built October 8 2015 at 1724 by tomadm on Linux 2.6.32-504.23.4.el6.x86_64 i386 JVM 1.7.0_21-b11(bits=32) --> -<?xml version="1.0" encoding="US-ASCII"?> -<LW-MAP xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="none" ID="0" - label="Graph-notes-copy2.vue" created="1479309847604" x="0.0" - y="0.0" width="1.4E-45" height="1.4E-45" strokeWidth="0.0" autoSized="false"> - <resource referenceCreated="1484557159072" size="211457" - spec="/home/georges/phc/racket-packages/phc-graph/Graph-notes-copy2.vue" - type="1" xsi:type="URLResource"> - <title>Graph-notes-copy2.vue</title> - <property key="File" value="/home/georges/phc/racket-packages/phc-graph/Graph-notes-copy2.vue"/> - </resource> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#404040</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-14</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6af7c0a80026548592b8dffca40a</URIString> - <child ID="6" label="Graph" layerID="1" created="1479309863303" - x="1370.5449" y="544.5457" width="51.0" height="23.0" - strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6afcc0a80026548592b833e3a781</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="7" label="Auto-generation of mappings" layerID="1" - created="1479309887096" x="1577.3673" y="857.9207" width="203.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#8AEE95</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6afec0a80026548592b88abb8384</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="8" layerID="1" created="1479309887097" x="1405.9238" - y="567.04584" width="263.0647" height="291.37488" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6affc0a80026548592b80b4ee7cc</URIString> - <point1 x="1406.4238" y="567.54584"/> - <point2 x="1668.4885" y="857.9207"/> - <ID1 xsi:type="node">6</ID1> - <ID2 xsi:type="node">7</ID2> - </child> - <child ID="11" label="Structural equality" layerID="1" - created="1479309904736" x="1330.5449" y="934.30304" - width="129.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#8AEE95</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b03c0a80026548592b81914701e</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="12" layerID="1" created="1479309904738" x="1394.5743" - y="567.0625" width="1.9411621" height="367.75" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b04c0a80026548592b8c27d0837</URIString> - <point1 x="1396.0155" y="567.5625"/> - <point2 x="1395.0743" y="934.3125"/> - <ID1 xsi:type="node">6</ID1> - <ID2 xsi:type="node">11</ID2> - </child> - <child ID="13" label="Invariants" layerID="1" - created="1479309905789" x="876.0447" y="543.5457" width="75.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#8AEE95</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b05c0a80026548592b80343782b</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="14" layerID="1" created="1479309905791" x="950.5447" - y="554.6234" width="420.50024" height="1.8694458" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b06c0a80026548592b870fb7c6a</URIString> - <point1 x="1370.5449" y="555.99286"/> - <point2 x="951.0447" y="555.1234"/> - <ID1 xsi:type="node">6</ID1> - <ID2 xsi:type="node">13</ID2> - </child> - <child ID="15" label="Other" layerID="1" created="1479309906604" - x="1372.0449" y="409.30307" width="48.0" height="23.0" - strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b07c0a80026548592b8f5e19e10</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="16" layerID="1" created="1479309906606" x="1395.5449" - y="431.80304" width="1.0" height="113.242645" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b08c0a80026548592b840ee8fa0</URIString> - <point1 x="1396.0449" y="544.5457"/> - <point2 x="1396.0449" y="432.30307"/> - <ID1 xsi:type="node">6</ID1> - <ID2 xsi:type="node">15</ID2> - </child> - <child ID="17" label="Scope" layerID="1" created="1479309922342" - x="569.125" y="397.36423" width="52.0" height="23.0" - strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b09c0a80026548592b8217a1807</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="18" layerID="1" created="1479309922344" x="615.9132" - y="418.13733" width="273.0816" height="125.90839" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b09c0a80026548592b8dfab693e</URIString> - <point1 x="888.4948" y="543.5457"/> - <point2 x="616.4132" y="418.63733"/> - <ID1 xsi:type="node">13</ID1> - <ID2 xsi:type="node">17</ID2> - </child> - <child ID="19" label="Verification time" layerID="1" - created="1479309923132" x="543.125" y="529.5457" width="116.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b0ac0a80026548592b87ee8d14b</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="20" layerID="1" created="1479309923134" x="658.40515" - y="543.1349" width="218.1756" height="10.731995" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b11c0a80026548592b89f9e9272</URIString> - <point1 x="876.08075" y="553.3669"/> - <point2 x="658.90515" y="543.6349"/> - <ID1 xsi:type="node">13</ID1> - <ID2 xsi:type="node">19</ID2> - </child> - <child ID="21" label="Specification" layerID="1" - created="1479309923917" x="551.625" y="677.8775" width="94.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b12c0a80026548592b83be06baa</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="22" layerID="1" created="1479309923919" x="625.085" - y="566.0457" width="261.99976" height="112.33179" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b13c0a80026548592b8f03d2a45</URIString> - <point1 x="886.5848" y="566.5457"/> - <point2 x="625.585" y="677.8775"/> - <ID1 xsi:type="node">13</ID1> - <ID2 xsi:type="node">21</ID2> - </child> - <child ID="23" label="Coloring" layerID="1" created="1479309940842" - x="1278.5449" y="66.30307" width="65.0" height="23.0" - strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#8AEE95</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b14c0a80026548592b8bc35fbb9</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="24" layerID="1" created="1479309940844" x="1313.3948" - y="88.80322" width="80.30017" height="321.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b14c0a80026548592b87410806e</URIString> - <point1 x="1393.1951" y="409.30322"/> - <point2 x="1313.8949" y="89.30322"/> - <ID1 xsi:type="node">15</ID1> - <ID2 xsi:type="node">23</ID2> - </child> - <child ID="25" label="Coalesce nodes which are equal?" layerID="1" - created="1479310031080" x="1278.0449" y="1150.303" width="234.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dc1a307c0a80026548592b8c2af76c4</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="26" layerID="1" created="1479310031081" x="1394.5449" - y="956.803" width="1.0" height="193.99994" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dc1a307c0a80026548592b8a04c0bf0</URIString> - <point1 x="1395.0449" y="957.30304"/> - <point2 x="1395.0449" y="1150.303"/> - <ID1 xsi:type="node">11</ID1> - <ID2 xsi:type="node">25</ID2> - </child> - <child ID="27" label="Hash consing" layerID="1" - created="1479310041195" x="1197.1572" y="1236.7637" - width="100.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dc1a308c0a80026548592b8ff6b1596</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="29" - label="= deterministic finite automaton minimization&#xa;(when there are no unordered sets)" - layerID="1" created="1479310064475" x="1142.3567" y="1392.0576" - width="302.0" height="38.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dc1a309c0a80026548592b84e893214</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="33" label="=" layerID="1" created="1479310109124" - x="1388.7559" y="1278.0215" width="22.0" height="23.0" - strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dc1a30ac0a80026548592b8ea42a1af</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="34" layerID="1" created="1479310109126" x="1394.9691" - y="1172.8047" width="4.862549" height="105.71484" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dc1a30ac0a80026548592b87117f4c4</URIString> - <point1 x="1395.4691" y="1173.3047"/> - <point2 x="1399.3317" y="1278.0195"/> - <ID1 xsi:type="node">25</ID1> - <ID2 xsi:type="node">33</ID2> - </child> - <child ID="35" layerID="1" created="1479310112683" x="1309.4902" - y="1297.833" width="83.05139" height="94.72461" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dc1a30bc0a80026548592b83098fe4a</URIString> - <point1 x="1392.0416" y="1298.333"/> - <point2 x="1309.9902" y="1392.0576"/> - <ID1 xsi:type="node">33</ID1> - <ID2 xsi:type="node">29</ID2> - </child> - <child ID="36" - label="= nondeterministic finite automaton minimization&#xa;(when there are unordered sets)" - layerID="1" created="1479310130202" x="1468.7128" y="1390.0991" - width="327.0" height="38.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dc1a30bc0a80026548592b8e12add9f</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="37" layerID="1" created="1479310130203" x="1409.4954" - y="1294.2886" width="186.28186" height="96.310425" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dc1a30cc0a80026548592b879e5ac96</URIString> - <point1 x="1409.9952" y="1294.7887"/> - <point2 x="1595.2771" y="1390.0991"/> - <ID1 xsi:type="node">33</ID1> - <ID2 xsi:type="node">36</ID2> - </child> - <child ID="42" - label="Cache all calls to equal? and equal-hash-code and equal-secondary-hash-code while grouping nodes" - layerID="1" created="1479310644302" x="1518.7698" y="1259.8262" - width="681.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dc99799c0a80026548592b87d2d4299</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="44" - label="Allows fast comparison of nodes within the same graph" - layerID="1" created="1479310691911" x="1558.634" y="1206.3013" - width="373.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dcae10dc0a80026548592b847b6398e</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="68" label="Type policy" layerID="1" - created="1479311229819" x="76.39288" y="224.19116" width="82.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dd89bd2c0a80026548592b8d3f60760</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="90" label="Macro policy" layerID="1" - created="1479311433081" x="-708.9739" y="-78.299225" - width="92.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dd89bd4c0a80026548592b8697d13c4</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="103" label="/!\ May interfere with each other" - layerID="1" created="1479311599825" x="-744.9689" y="-214.25525" - width="221.0" height="23.0" strokeWidth="3.0" autoSized="true" xsi:type="node"> - <fillColor>#FEFEC9</fillColor> - <strokeColor>#EA2218</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dd89bd5c0a80026548592b8ddb5b6c7</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="105" label="May alter a mapping's inputs" layerID="1" - created="1479311627089" x="-453.56888" y="-124.67706" - width="198.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dd89bd6c0a80026548592b853276e56</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="106" layerID="1" created="1479311627089" x="-619.121" - y="-102.17706" width="188.57895" height="29.208061" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dd89bd6c0a80026548592b89262c338</URIString> - <point1 x="-618.621" y="-73.469"/> - <point2 x="-431.04202" y="-101.67706"/> - <ID1 xsi:type="node">90</ID1> - <ID2 xsi:type="node">105</ID2> - </child> - <child ID="107" - label="May wrap or check or alter a mapping's outputs" - layerID="1" created="1479311633861" x="-541.1206" y="-72.143234" - width="322.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dd89bd6c0a80026548592b8c817c8d9</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="108" layerID="1" created="1479311633863" x="-617.4739" - y="-66.298096" width="77.25604" height="2.6596298" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dd89bd6c0a80026548592b88ac312bd</URIString> - <point1 x="-616.9739" y="-65.79809"/> - <point2 x="-540.71783" y="-64.13846"/> - <ID1 xsi:type="node">90</ID1> - <ID2 xsi:type="node">107</ID2> - </child> - <child ID="109" label="Wrap with ann" layerID="1" - created="1479311725257" x="-139.36258" y="-92.783356" - width="102.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dda878ec0a80026548592b8416c8f4f</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="110" layerID="1" created="1479311725259" x="-226.62152" - y="-78.2051" width="88.17851" height="7.1673584" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dda878ec0a80026548592b8d9e1112c</URIString> - <point1 x="-226.1215" y="-71.53774"/> - <point2 x="-138.943" y="-77.7051"/> - <ID1 xsi:type="node">107</ID1> - <ID2 xsi:type="node">109</ID2> - </child> - <child ID="134" label="Enforcement on the transform or creation" - layerID="1" created="1479312135902" x="194.57953" y="695.1646" - width="284.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#000000</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44031c0a80026548592b83703e1b4</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="135" label=" " layerID="1" created="1479312135902" - x="68.89288" y="695.1646" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44031c0a80026548592b885daa51d</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="136" label=" " layerID="1" created="1479312135902" - x="-51.92047" y="695.1646" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44031c0a80026548592b88d7a52cf</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="137" label=" " layerID="1" created="1479312135902" - x="-178.92047" y="695.1646" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44031c0a80026548592b8fe262430</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="138" label=" " layerID="1" created="1479312135902" - x="-329.92047" y="694.3646" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44031c0a80026548592b8ba0f1bbc</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="139" label=" " layerID="1" created="1479312135902" - x="-493.5517" y="695.96466" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44032c0a80026548592b8ce56fcb8</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="140" label=" " layerID="1" created="1479312135902" - x="-862.1742" y="697.5647" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44032c0a80026548592b84c0668a9</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="142" label=" " layerID="1" created="1479312150155" - x="-993.41174" y="697.5647" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44032c0a80026548592b844ae0a4b</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="143" label="Invariants on the graph / node" layerID="1" - created="1479312150155" x="194.57953" y="656.1646" width="210.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#000000</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44032c0a80026548592b8746d8906</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="144" label=" " layerID="1" created="1479312150155" - x="68.89288" y="656.1646" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44032c0a80026548592b8eab64176</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="145" label=" " layerID="1" created="1479312150155" - x="-51.92047" y="656.1646" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44032c0a80026548592b8e2b0179a</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="146" label=" " layerID="1" created="1479312150155" - x="-178.92047" y="656.1646" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44032c0a80026548592b8f1e9514a</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="147" label=" " layerID="1" created="1479312150155" - x="-329.92047" y="655.3646" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44032c0a80026548592b8726ffcc1</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="148" label=" " layerID="1" created="1479312150155" - x="-493.5517" y="656.96466" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44033c0a80026548592b8ff3e3904</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="150" label=" " layerID="1" created="1479312155692" - x="-862.1742" y="658.5647" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44033c0a80026548592b8e43cd085</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="151" label=" " layerID="1" created="1479312155692" - x="-993.41174" y="658.5647" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44033c0a80026548592b80a95f30b</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="152" label="Compile-time" layerID="1" - created="1479312155692" x="194.57953" y="588.27094" width="97.0" - height="23.0" strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#000000</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44033c0a80026548592b8a738f623</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="153" label=" " layerID="1" created="1479312155692" - x="68.89288" y="588.27094" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44033c0a80026548592b840e9de75</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="154" label=" " layerID="1" created="1479312155692" - x="-51.92047" y="588.27094" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44033c0a80026548592b869523b7f</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="155" label=" " layerID="1" created="1479312155692" - x="-178.92047" y="588.27094" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44033c0a80026548592b80ecff1d4</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="156" label=" " layerID="1" created="1479312155692" - x="-329.92047" y="587.47095" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44033c0a80026548592b8868c3bd4</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="158" label=" " layerID="1" created="1479312155692" - x="-493.5517" y="589.071" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44033c0a80026548592b8f1f2c034</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="159" label=" " layerID="1" created="1479312155692" - x="-862.1742" y="590.671" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44033c0a80026548592b81f88086b</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="160" label=" " layerID="1" created="1479312155692" - x="-993.41174" y="590.671" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44034c0a80026548592b8a06db952</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="161" label="Run-time" layerID="1" created="1479312155692" - x="194.57953" y="549.27106" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#000000</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44034c0a80026548592b84247db44</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="162" label=" " layerID="1" created="1479312155692" - x="68.89288" y="549.27106" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44034c0a80026548592b80183cc60</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="163" label=" " layerID="1" created="1479312155692" - x="-51.92047" y="549.27106" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44034c0a80026548592b8a53213f5</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="164" label=" " layerID="1" created="1479312155692" - x="-178.92047" y="549.27106" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44034c0a80026548592b88fe1f15c</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="166" label=" " layerID="1" created="1479312165108" - x="-329.92047" y="548.47107" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44034c0a80026548592b804a1a9ba</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="167" label=" " layerID="1" created="1479312165108" - x="-493.5517" y="550.0711" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44034c0a80026548592b8ad21ad51</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="168" label=" " layerID="1" created="1479312165108" - x="-862.1742" y="551.67114" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44034c0a80026548592b8f7cab75e</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="169" label=" " layerID="1" created="1479312165108" - x="-993.41174" y="551.67114" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44035c0a80026548592b824a5ea38</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="170" label="Transformation" layerID="1" - created="1479312165108" x="194.57953" y="475.32404" - width="139.0" height="46.25" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#000000</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44035c0a80026548592b8fcd64fad</URIString> - <child ID="52" label="Like ->i" created="1479310857171" x="34.0" - y="23.0" width="59.0" height="23.0" strokeWidth="1.0" - autoSized="true" xsi:type="node"> - <fillColor>#FFC63B</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dcc935cc0a80026548592b89128dae1</URIString> - <shape xsi:type="rectangle"/> - </child> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="171" label=" " layerID="1" created="1479312165108" - x="68.89288" y="475.32404" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44035c0a80026548592b8414a595b</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="172" label=" " layerID="1" created="1479312165108" - x="-51.92047" y="475.32404" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44035c0a80026548592b8e07930e9</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="174" label=" " layerID="1" created="1479312165108" - x="-178.92047" y="475.32404" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44035c0a80026548592b861833437</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="175" label=" " layerID="1" created="1479312165108" - x="-329.92047" y="474.52405" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44035c0a80026548592b82804bc71</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="176" label=" " layerID="1" created="1479312165108" - x="-493.5517" y="476.12408" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44035c0a80026548592b80db43a99</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="177" label=" " layerID="1" created="1479312165108" - x="-862.1742" y="477.72412" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44035c0a80026548592b86a9bcf32</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="178" label=" " layerID="1" created="1479312165108" - x="-993.41174" y="477.72412" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44036c0a80026548592b82c6a1147</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="179" label="Output" layerID="1" created="1479312165108" - x="194.57953" y="436.72406" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#000000</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44036c0a80026548592b88c7132d7</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="180" label=" " layerID="1" created="1479312165108" - x="68.89288" y="436.72406" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44036c0a80026548592b82856a3fe</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="182" label=" " layerID="1" created="1479312165108" - x="-51.92047" y="436.72406" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44036c0a80026548592b8125e3add</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="183" label=" " layerID="1" created="1479312165108" - x="-178.92047" y="436.72406" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44036c0a80026548592b8242976ae</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="184" label=" " layerID="1" created="1479312165108" - x="-329.92047" y="435.92407" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44036c0a80026548592b8700f0c58</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="185" label=" " layerID="1" created="1479312165108" - x="-493.5517" y="437.5241" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44036c0a80026548592b888f9f0fc</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="186" label=" " layerID="1" created="1479312165108" - x="-862.1742" y="439.12415" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44036c0a80026548592b829d22ddb</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="187" label=" " layerID="1" created="1479312165108" - x="-993.41174" y="439.12415" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44036c0a80026548592b8fb44d733</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="188" label="Input" layerID="1" created="1479312165108" - x="194.57953" y="397.724" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#000000</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44036c0a80026548592b8010e8b83</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="190" label=" " layerID="1" created="1479312165108" - x="68.89288" y="397.724" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44037c0a80026548592b8b07192d1</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="191" label=" " layerID="1" created="1479312165108" - x="-51.92047" y="397.724" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44037c0a80026548592b85d8d2676</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="192" label=" " layerID="1" created="1479312165108" - x="-178.92047" y="397.724" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44037c0a80026548592b818309ef9</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="193" label=" " layerID="1" created="1479312165108" - x="-329.92047" y="396.924" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44037c0a80026548592b8ce547432</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="194" label=" " layerID="1" created="1479312165108" - x="-493.5517" y="398.52405" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44037c0a80026548592b8808f7487</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="195" label=" " layerID="1" created="1479312165108" - x="-862.1742" y="400.12408" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44037c0a80026548592b8f5b31808</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="196" label=" " layerID="1" created="1479312165108" - x="-993.41174" y="400.12408" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6de44037c0a80026548592b8b71cf339</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="211" label="No cycles in &#x3c4;" layerID="1" - created="1479312437302" x="67.89288" y="359.19955" width="99.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#000000</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6deb6c15c0a80026548592b8b3165e14</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="212" label="Nouveau N&#x153;ud" layerID="1" - created="1479312437302" x="-59.42047" y="359.19955" - width="112.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#000000</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6deb6c16c0a80026548592b8a5a2565a</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="213" label="Nouveau N&#x153;ud" layerID="1" - created="1479312437302" x="-186.42047" y="359.19955" - width="112.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#000000</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6deb6c16c0a80026548592b82772e2e6</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="214" label="no excess / missing&#xa;nodes" layerID="1" - created="1479312437302" x="-346.02045" y="341.59958" - width="139.0" height="38.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#000000</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6deb6c16c0a80026548592b844d9ed3a</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="215" label="Structural invariant" layerID="1" - created="1479312437302" x="-526.0517" y="273.2496" width="162.0" - height="107.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#000000</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6deb6c16c0a80026548592b8c110cac6</URIString> - <child ID="248" label="No cycles (a.** != a)" - created="1479315054444" x="34.0" y="23.0" width="145.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#000000</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e0db15543a6be970d2ffe259c8e4183</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="249" label="a.b.c = a" created="1479315069014" - x="34.0" y="43.25" width="112.78567" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#000000</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e0db15643a6be970d2ffe25e7c11d51</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="256" label="a &#x2208; a.b.c" created="1479315479126" - x="34.0" y="63.5" width="112.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e13f9e943a6be970d2ffe25a12d6061</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="537" label="a.c = count(a.b)" created="1483131981450" - x="34.0" y="83.75" width="118.0" height="23.0" - strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/518eb6ce534430712734d86a5ed52578</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="216" label="Fill in auto fields" layerID="1" - created="1479312437302" x="-885.6742" y="318.0996" width="144.0" - height="66.5" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#000000</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6deb6c16c0a80026548592b84cf1af9a</URIString> - <child ID="115" label="count(path)" created="1479311769963" - x="34.0" y="23.0" width="88.0" height="23.0" - strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dda878fc0a80026548592b8d8c09cc8</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="113" label="path" created="1479311761209" x="34.0" - y="43.25" width="41.0" height="23.0" strokeWidth="1.0" - autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dda878ec0a80026548592b8a59d8be9</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="217" label="Field types" layerID="1" - created="1479312437302" x="-985.41174" y="361.5996" width="81.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#000000</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6deb6c16c0a80026548592b8ef57e7b6</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="220" layerID="1" created="1479312977113" x="291.07953" - y="408.3908" width="278.54547" height="1.2836304" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6df4a0bec0a80026548592b8679982c0</URIString> - <point1 x="569.125" y="408.8908"/> - <point2 x="291.57953" y="409.17444"/> - <ID1 xsi:type="node">17</ID1> - <ID2 xsi:type="node">188</ID2> - </child> - <child ID="221" layerID="1" created="1479312980477" x="290.3051" - y="411.24005" width="279.59766" height="32.148132" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6df4a0bec0a80026548592b8c719c5c2</URIString> - <point1 x="569.4028" y="411.74005"/> - <point2 x="290.8051" y="442.88818"/> - <ID1 xsi:type="node">17</ID1> - <ID2 xsi:type="node">179</ID2> - </child> - <child ID="222" layerID="1" created="1479312983887" x="331.39423" - y="414.96667" width="239.83237" height="65.63089" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6df4a0bec0a80026548592b87ce595a9</URIString> - <point1 x="570.7266" y="415.46667"/> - <point2 x="331.89426" y="480.09756"/> - <ID1 xsi:type="node">17</ID1> - <ID2 xsi:type="node">170</ID2> - </child> - <child ID="223" layerID="1" created="1479312987068" x="290.84552" - y="543.7224" width="253.11792" height="14.889587" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6df4a0bec0a80026548592b83272ecb3</URIString> - <point1 x="543.46344" y="544.2224"/> - <point2 x="291.34552" y="558.112"/> - <ID1 xsi:type="node">19</ID1> - <ID2 xsi:type="node">161</ID2> - </child> - <child ID="224" layerID="1" created="1479312989934" x="288.8164" - y="549.4879" width="258.2881" height="43.1994" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6df4a0bec0a80026548592b847abd123</URIString> - <point1 x="546.6045" y="549.988"/> - <point2 x="289.3164" y="592.1874"/> - <ID1 xsi:type="node">19</ID1> - <ID2 xsi:type="node">152</ID2> - </child> - <child ID="225" layerID="1" created="1479312993421" x="401.89612" - y="674.6299" width="150.60938" height="11.862732" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6df4a0bfc0a80026548592b82421558c</URIString> - <point1 x="552.0055" y="685.9926"/> - <point2 x="402.39612" y="675.1299"/> - <ID1 xsi:type="node">21</ID1> - <ID2 xsi:type="node">143</ID2> - </child> - <child ID="226" layerID="1" created="1479312996582" x="474.3354" - y="691.95703" width="78.10855" height="6.086853" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6df4a0bfc0a80026548592b890a669f0</URIString> - <point1 x="551.9439" y="692.45703"/> - <point2 x="474.83536" y="697.5439"/> - <ID1 xsi:type="node">21</ID1> - <ID2 xsi:type="node">134</ID2> - </child> - <child ID="227" layerID="1" created="1479313097960" x="116.89288" - y="246.69118" width="1.0" height="113.00839" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>Arial-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6df4a0bfc0a80026548592b8ab3caf16</URIString> - <point1 x="117.39288" y="247.19116"/> - <point2 x="117.39288" y="359.19955"/> - <ID1 xsi:type="node">68</ID1> - <ID2 xsi:type="node">211</ID2> - </child> - <child ID="229" label="Field types" layerID="1" - created="1479313578633" x="-985.41174" y="296.00214" - width="81.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#000000</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6df83301c0a80026548592b8cadb0885</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="230" layerID="1" created="1479313589139" x="-945.41174" - y="318.50214" width="1.0" height="43.597473" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6df83301c0a80026548592b86616b05c</URIString> - <point1 x="-944.91174" y="319.00214"/> - <point2 x="-944.91174" y="361.5996"/> - <ID1 xsi:type="node">229</ID1> - <ID2 xsi:type="node">217</ID2> - </child> - <child ID="231" label="Fill in info" layerID="1" - created="1479314065342" x="-107.36258" y="-69.78337" - width="70.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dfdd7b2c0a80026548592b8f9159d49</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="232" layerID="1" created="1479314065343" x="-219.6206" - y="-59.9087" width="112.758026" height="1.8569527" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dfdd7b2c0a80026548592b838839b4e</URIString> - <point1 x="-219.1206" y="-59.4087"/> - <point2 x="-107.36258" y="-58.551746"/> - <ID1 xsi:type="node">107</ID1> - <ID2 xsi:type="node">231</ID2> - </child> - <child ID="233" label="Insert guards" layerID="1" - created="1479314071070" x="-136.36258" y="-46.7834" width="99.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dfdd7b2c0a80026548592b8fe58d8d6</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="234" layerID="1" created="1479314071071" x="-247.636" - y="-49.643234" width="112.325165" height="10.626976" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dfdd7b2c0a80026548592b8472714c9</URIString> - <point1 x="-247.136" y="-49.143234"/> - <point2 x="-135.81084" y="-39.51626"/> - <ID1 xsi:type="node">107</ID1> - <ID2 xsi:type="node">233</ID2> - </child> - <child ID="239" - label="Name the invariants in the type, and refer to them in the transform" - layerID="1" created="1479314146769" x="401.0136" y="789.73596" - width="446.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dff35b5c0a80026548592b8604b935b</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="240" layerID="1" created="1479314146770" x="600.7352" - y="700.37744" width="21.168274" height="89.8584" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dff35b5c0a80026548592b8b8ea0a14</URIString> - <point1 x="601.23517" y="700.87744"/> - <point2 x="621.40344" y="789.73584"/> - <ID1 xsi:type="node">21</ID1> - <ID2 xsi:type="node">239</ID2> - </child> - <child ID="241" label="Basic form&#xa;already implemented" - layerID="1" created="1479314878724" x="1224.5375" y="997.7446" - width="146.0" height="38.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e09fb5843a6be970d2ffe2507ab588a</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="242" layerID="1" created="1479314878728" x="1323.1526" - y="956.8031" width="56.585815" height="41.441467" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e09fb5a43a6be970d2ffe25101bab58</URIString> - <point1 x="1379.2384" y="957.3031"/> - <point2 x="1323.6526" y="997.74457"/> - <ID1 xsi:type="node">11</ID1> - <ID2 xsi:type="node">241</ID2> - </child> - <child ID="244" label="&#x3b1;-equivalence normal form" layerID="1" - created="1479314913291" x="1434.1376" y="1005.7449" - width="184.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#A6A6A6</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e0b664b43a6be970d2ffe25608d7f84</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="245" layerID="1" created="1479314913294" x="1415.6469" - y="956.803" width="89.88867" height="49.441833" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e0b664b43a6be970d2ffe252aafd35e</URIString> - <point1 x="1416.1469" y="957.30304"/> - <point2 x="1505.0355" y="1005.7449"/> - <ID1 xsi:type="node">11</ID1> - <ID2 xsi:type="node">244</ID2> - </child> - <child ID="246" label="Too hard to implement for now" layerID="1" - created="1479314956001" x="1452.3375" y="1052.5447" - width="210.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#A6A6A6</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e0b664c43a6be970d2ffe253b42a8fa</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="247" layerID="1" created="1479314956003" x="1533.3042" - y="1028.2449" width="16.866577" height="24.799805" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e0b664c43a6be970d2ffe25426d76fa</URIString> - <point1 x="1533.8043" y="1028.7449"/> - <point2 x="1549.6709" y="1052.5447"/> - <ID1 xsi:type="node">244</ID1> - <ID2 xsi:type="node">246</ID2> - </child> - <child ID="252" - label="http://docs.racket-lang.org/graph/index.html#%28def._%28%28lib._graph%2Fmain..rkt%29._coloring%2Fgreedy%29%29" - layerID="1" created="1479315385244" x="436.13745" y="60.144775" - width="784.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e12548843a6be970d2ffe259bb5e939</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="253" layerID="1" created="1479315385245" x="1218.9329" - y="76.13478" width="60.11206" height="1.75383" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e12548843a6be970d2ffe25f25ed174</URIString> - <point1 x="1278.5449" y="77.38861"/> - <point2 x="1219.4329" y="76.63478"/> - <ID1 xsi:type="node">23</ID1> - <ID2 xsi:type="node">252</ID2> - </child> - <child ID="257" label=" " layerID="1" created="1479315626294" - x="-689.56244" y="696.5272" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e18c7df43a6be970d2ffe25f6c630d7</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="258" label=" " layerID="1" created="1479315626294" - x="-689.56244" y="657.5272" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e18c7df43a6be970d2ffe259db0c3ce</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="259" label=" " layerID="1" created="1479315626294" - x="-689.56244" y="589.63354" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e18c7df43a6be970d2ffe25e603c10f</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="260" label=" " layerID="1" created="1479315626294" - x="-689.56244" y="550.63367" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e18c7df43a6be970d2ffe25580295ca</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="261" label=" " layerID="1" created="1479315626294" - x="-689.56244" y="476.68677" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e18c7df43a6be970d2ffe250d1629cb</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="262" label=" " layerID="1" created="1479315626294" - x="-689.56244" y="438.0868" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e18c7e043a6be970d2ffe25e477a71a</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="263" label=" " layerID="1" created="1479315626294" - x="-689.56244" y="399.08667" width="97.0" height="23.0" - strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFFFFF</fillColor> - <strokeColor>#D0D0D0</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e18c7e043a6be970d2ffe25b3ec0015</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="264" - label="Well-scopedness&#xa;via &#x2200; flag on the inputs" - layerID="1" created="1479315626294" x="-716.26245" y="343.76224" - width="161.0" height="38.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#000000</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e18c7e043a6be970d2ffe25522374c0</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="269" label="enforces" layerID="1" created="1479315766762" - x="-602.6625" y="246.14484" width="70.0" height="23.0" - strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e18c7e043a6be970d2ffe25045c93ba</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="270" layerID="1" created="1479315766763" x="-742.9568" - y="267.95978" width="147.40094" height="56.76346" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e18c7e043a6be970d2ffe25f58b5507</URIString> - <point1 x="-742.4568" y="324.2232"/> - <point2 x="-596.05585" y="268.45975"/> - <ID1 xsi:type="node">216</ID1> - <ID2 xsi:type="node">269</ID2> - </child> - <child ID="273" layerID="1" created="1479315784203" x="-547.75836" - y="268.64478" width="22.596802" height="13.172211" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e18c7e043a6be970d2ffe25213bebda</URIString> - <point1 x="-547.25836" y="269.1448"/> - <point2 x="-525.66156" y="281.31702"/> - <ID1 xsi:type="node">269</ID1> - <ID2 xsi:type="node">215</ID2> - </child> - <child ID="275" layerID="1" created="1479315857711" x="-623.95337" - y="268.64478" width="49.3407" height="75.61749" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e18c7e043a6be970d2ffe25b2914e66</URIString> - <point1 x="-623.45337" y="343.76227"/> - <point2 x="-575.1127" y="269.14478"/> - <ID1 xsi:type="node">264</ID1> - <ID2 xsi:type="node">269</ID2> - </child> - <child ID="278" label="Compile-time policy" layerID="1" - created="1479316015544" x="-834.6625" y="38.944725" - width="134.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e1c69c643a6be970d2ffe25714e5bc9</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="279" layerID="1" created="1479316015546" x="-757.89404" - y="-55.799194" width="85.15155" height="95.2439" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e1c69c643a6be970d2ffe25ca3da090</URIString> - <point1 x="-673.24243" y="-55.299194"/> - <point2 x="-757.394" y="38.944702"/> - <ID1 xsi:type="node">90</ID1> - <ID2 xsi:type="node">278</ID2> - </child> - <child ID="280" label="Run-time check" layerID="1" - created="1479316019912" x="-495.4625" y="37.344727" - width="110.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e1c69c643a6be970d2ffe25751b3e9d</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="281" layerID="1" created="1479316019914" x="-641.3467" - y="-55.799225" width="179.25693" height="93.64395" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e1c69c643a6be970d2ffe25264e9ee1</URIString> - <point1 x="-640.8467" y="-55.299225"/> - <point2 x="-462.58975" y="37.344727"/> - <ID1 xsi:type="node">90</ID1> - <ID2 xsi:type="node">280</ID2> - </child> - <child ID="284" layerID="1" created="1479316050351" x="-809.0899" - y="61.444824" width="40.168945" height="257.1548" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e1c69c643a6be970d2ffe25391232ea</URIString> - <point1 x="-769.42096" y="61.944824"/> - <point2 x="-808.5899" y="318.0996"/> - <ID1 xsi:type="node">278</ID1> - <ID2 xsi:type="node">216</ID2> - </child> - <child ID="285" layerID="1" created="1479316052183" x="-763.3057" - y="61.444702" width="120.01904" height="282.8175" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e1c69c643a6be970d2ffe253e59616a</URIString> - <point1 x="-762.8057" y="61.944702"/> - <point2 x="-643.7867" y="343.7622"/> - <ID1 xsi:type="node">278</ID1> - <ID2 xsi:type="node">264</ID2> - </child> - <child ID="286" layerID="1" created="1479316060242" x="-444.6682" - y="59.84375" width="4.5158997" height="213.90625" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e1c69c643a6be970d2ffe2578e91de4</URIString> - <point1 x="-440.65234" y="60.34375"/> - <point2 x="-444.16824" y="273.25"/> - <ID1 xsi:type="node">280</ID1> - <ID2 xsi:type="node">215</ID2> - </child> - <child ID="289" layerID="1" created="1479316096459" x="-434.91504" - y="59.844727" width="148.90305" height="282.25482" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e1c69c743a6be970d2ffe258016a9d1</URIString> - <point1 x="-434.415" y="60.344727"/> - <point2 x="-286.51196" y="341.59955"/> - <ID1 xsi:type="node">280</ID1> - <ID2 xsi:type="node">214</ID2> - </child> - <child ID="291" - label="Invariants expressed as a dummy type on the graph / node" - layerID="1" created="1479316157024" x="-663.86255" y="868.74475" - width="396.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e1dc69443a6be970d2ffe25c307cfac</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="293" - label="Enforcements indicate which invariant they satisfy or check" - layerID="1" created="1479316213134" x="3.1374512" y="1054.7448" - width="395.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e1fb64c43a6be970d2ffe25894f7080</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="295" label=" " layerID="1" created="1479316329322" - x="175.13745" y="656.74475" width="15.0" height="23.0" - strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e218e1c43a6be970d2ffe25c3d8bcae</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="296" layerID="1" created="1479316329323" x="189.63745" - y="667.68555" width="5.4420776" height="1.0220337" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e218e1d43a6be970d2ffe253b54752d</URIString> - <point1 x="194.57953" y="668.18555"/> - <point2 x="190.13745" y="668.2076"/> - <ID1 xsi:type="node">143</ID1> - <ID2 xsi:type="node">295</ID2> - </child> - <child ID="314" - label="Each node has an extra field of the following type:&#xa;" - layerID="1" created="1479317112254" x="-826.86255" y="972.24475" - width="339.0" height="107.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e2c94fe43a6be970d2ffe25ab2d9e8d</URIString> - <child ID="313" - label="(invariants-wrapper (case (&#x2192; inv&#x2081; inv-arg &#x2026; #t) &#x2026; (&#x2192; inv&#x2099; inv-arg &#x2026; #t)))" - created="1479317031021" x="5.0" y="38.0" width="276.0" - height="63.0" strokeWidth="0.0" autoSized="false" xsi:type="text"> - <strokeColor>#404040</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-14</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e2c950143a6be970d2ffe25c8aa5ef1</URIString> - <richText>&lt;html&gt; - &lt;head&gt; - &lt;style type="text/css"&gt; - &lt;!-- - body { margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; font-size: 12; font-family: SansSerif; color: #000000 } - ol { margin-top: 6; font-family: SansSerif; vertical-align: middle; margin-left: 30; font-size: 12; list-style-position: outside } - p { margin-top: 0; margin-left: 0; margin-right: 0; margin-bottom: 0; color: #000000 } - ul { margin-top: 6; font-size: 12; margin-left: 30; vertical-align: middle; list-style-position: outside; font-family: SansSerif } - --&gt; - &lt;/style&gt; - - &lt;/head&gt; - &lt;body&gt; - &lt;p&gt; - &lt;font face="DejaVu Sans Mono"&gt;(invariants-wrapper &lt;/font&gt; - &lt;/p&gt; - &lt;p&gt; - &lt;font face="DejaVu Sans Mono"&gt;(case (&amp;#8594; inv&amp;#8321; inv-arg &amp;#8230; #t) &lt;/font&gt; - &lt;/p&gt; - &lt;p&gt; - &lt;font face="DejaVu Sans Mono"&gt;&amp;#8230; &lt;/font&gt; - &lt;/p&gt; - &lt;p&gt; - &lt;font face="DejaVu Sans Mono"&gt;(&amp;#8594; inv&amp;#8345; inv-arg &amp;#8230; #t)))&lt;/font&gt; - &lt;/p&gt; - &lt;/body&gt; -&lt;/html&gt; -</richText> - <label>(invariants-wrapper (case (&#x2192; inv&#x2081; inv-arg &#x2026; #t) &#x2026; (&#x2192; inv&#x2099; inv-arg &#x2026; #t)))</label> - </child> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="315" layerID="1" created="1479317179397" x="-587.4485" - y="891.24475" width="106.950165" height="81.5" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e309f2643a6be970d2ffe2565dbc3a9</URIString> - <point1 x="-480.99832" y="891.74475"/> - <point2 x="-586.9485" y="972.24475"/> - <ID1 xsi:type="node">291</ID1> - <ID2 xsi:type="node">314</ID2> - </child> - <child ID="318" - label="Use a private struct to prevent forging of the invariants aggregated in a case&#x2192;&#xa;(since it is never executed, any non-terminating &#x3bb; could otherwise be supplied).&#xa;" - layerID="1" created="1479317202233" x="-960.86255" y="1145.7448" - width="531.0" height="77.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e309f2643a6be970d2ffe2541159360</URIString> - <child ID="324" - label="(struct &#xa; invariants-wrapper ())" - created="1479317283315" x="5.0" y="53.0" width="214.0" - height="18.0" strokeWidth="0.0" autoSized="false" xsi:type="text"> - <strokeColor>#404040</strokeColor> - <textColor>#000000</textColor> - <font>-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e309f2643a6be970d2ffe254bc731a8</URIString> - <richText>&lt;html&gt; - &lt;head color="#000000" style="color: #000000"&gt; - &lt;style type="text/css"&gt; - &lt;!-- - body { margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; font-size: 11; font-family: SansSerif; color: #000000 } - ol { margin-top: 6; font-family: SansSerif; vertical-align: middle; margin-left: 30; font-size: 11; list-style-position: outside } - p { margin-top: 0; margin-left: 0; margin-right: 0; margin-bottom: 0; color: #000000 } - ul { margin-top: 6; font-size: 11; margin-left: 30; vertical-align: middle; list-style-position: outside; font-family: SansSerif } - --&gt; - &lt;/style&gt; - - &lt;/head&gt; - &lt;body&gt; - &lt;p&gt; - &lt;font style="font-size:12;" color="#000000" face="DejaVu Sans Mono"&gt;(struct - invariants-wrapper ())&lt;/font&gt; - &lt;/p&gt; - &lt;/body&gt; -&lt;/html&gt; -</richText> - <label>(struct - invariants-wrapper ())</label> - </child> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="319" layerID="1" created="1479317202235" x="-686.63226" - y="1078.7448" width="16.943237" height="67.5" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e309f2643a6be970d2ffe25415de0b8</URIString> - <point1 x="-670.189" y="1079.2448"/> - <point2 x="-686.13226" y="1145.7448"/> - <ID1 xsi:type="node">314</ID1> - <ID2 xsi:type="node">318</ID2> - </child> - <child ID="326" - label="graph invariants should only define the dummy type used to identify them" - layerID="1" created="1479317586757" x="-968.86255" y="1282.7448" - width="611.0" height="172.25" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e380d1843a6be970d2ffe256d1f3a53</URIString> - <child ID="328" - label="The actual enforcement is built-in or defined as a contract" - created="1479317923153" x="34.0" y="23.0" width="394.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e38dc3343a6be970d2ffe25548c6fd1</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="325" - label="(define-for-syntax invariant-introducer (make-syntax-introducer)) ;; the body should return the syntax for a &#xa; type, ;; such that less precise invariants are supertypes of that type. (define-syntax/parse (define-graph-invariant (name g-descriptor arg &#x2026;) . body) #'(define-syntax name (graph-invariant (&#x3bb; (g-descriptor arg &#x2026;) . body))))" - created="1479317551796" x="34.0" y="43.25" width="572.0" - height="123.0" strokeWidth="0.0" autoSized="false" xsi:type="text"> - <strokeColor>#404040</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-14</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e380d1843a6be970d2ffe2537b566f6</URIString> - <richText>&lt;html&gt; - &lt;head color="#000000" style="color: #000000"&gt; - &lt;style type="text/css"&gt; - &lt;!-- - body { margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; font-size: 12; font-family: SansSerif; color: #000000 } - ol { margin-top: 6; font-family: SansSerif; vertical-align: middle; margin-left: 30; font-size: 12; list-style-position: outside } - p { margin-top: 0; margin-left: 0; margin-right: 0; margin-bottom: 0; color: #000000 } - ul { margin-top: 6; font-size: 12; margin-left: 30; vertical-align: middle; list-style-position: outside; font-family: SansSerif } - --&gt; - &lt;/style&gt; - - &lt;/head&gt; - &lt;body&gt; - &lt;p color="#000000" style="color: #000000"&gt; - &lt;font face="DejaVu Sans Mono"&gt;(define-for-syntax invariant-introducer &lt;/font&gt; - &lt;/p&gt; - &lt;p color="#000000" style="color: #000000"&gt; - &lt;font face="DejaVu Sans Mono"&gt;(make-syntax-introducer)) &lt;/font&gt; - &lt;/p&gt; - &lt;p color="#000000" style="color: #000000"&gt; - &lt;font face="DejaVu Sans Mono"&gt;;; the body should return the syntax for a - type, &lt;/font&gt; - &lt;/p&gt; - &lt;p color="#000000" style="color: #000000"&gt; - &lt;font face="DejaVu Sans Mono"&gt;;; such that less precise invariants are - supertypes of that type. &lt;/font&gt; - &lt;/p&gt; - &lt;p color="#000000" style="color: #000000"&gt; - &lt;font face="DejaVu Sans Mono"&gt;(define-syntax/parse - (define-graph-invariant (name g-descriptor arg &amp;#8230;) . body) &lt;/font&gt; - &lt;/p&gt; - &lt;p color="#000000" style="color: #000000"&gt; - &lt;font face="DejaVu Sans Mono"&gt;#'(define-syntax name &lt;/font&gt; - &lt;/p&gt; - &lt;p color="#000000" style="color: #000000"&gt; - &lt;font face="DejaVu Sans Mono"&gt;(graph-invariant &lt;/font&gt; - &lt;/p&gt; - &lt;p color="#000000" style="color: #000000"&gt; - &lt;font face="DejaVu Sans Mono"&gt;(&amp;#955; (g-descriptor arg &amp;#8230;) . body))))&lt;/font&gt; - &lt;/p&gt; - &lt;/body&gt; -&lt;/html&gt; -</richText> - <label>(define-for-syntax invariant-introducer (make-syntax-introducer)) ;; the body should return the syntax for a - type, ;; such that less precise invariants are supertypes of that type. (define-syntax/parse (define-graph-invariant (name g-descriptor arg &#x2026;) . body) #'(define-syntax name (graph-invariant (&#x3bb; (g-descriptor arg &#x2026;) . body))))</label> - </child> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="327" layerID="1" created="1479317586758" x="-689.1896" - y="1222.2446" width="11.399414" height="61.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e380d1943a6be970d2ffe25baaa9b00</URIString> - <point1 x="-688.6896" y="1222.7446"/> - <point2 x="-678.29016" y="1282.7446"/> - <ID1 xsi:type="node">318</ID1> - <ID2 xsi:type="node">326</ID2> - </child> - <child ID="332" - label="The returned type may contain symbols, to indicate node names and field names,&#xa;and will contain a reference to a private struct type, so that&#xa;two invariants with the same name defined in separate won't conflict" - layerID="1" created="1479317996531" x="-1558.8625" y="1375.2448" - width="543.0" height="53.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e3ba69443a6be970d2ffe2557b43407</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="333" layerID="1" created="1479318002683" x="-1016.36255" - y="1393.3777" width="82.0" height="2.8078613" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e3ba69443a6be970d2ffe25f3986e24</URIString> - <point1 x="-934.86255" y="1393.8777"/> - <point2 x="-1015.86255" y="1395.6855"/> - <ID1 xsi:type="text">325</ID1> - <ID2 xsi:type="node">332</ID2> - </child> - <child ID="335" - label="Possibility to define a contract, which checks the output" - layerID="1" created="1479323690314" x="-287.0293" y="1256.2448" - width="602.0" height="158.25" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e9111d2c0a80026616d9239e83b633f</URIString> - <child ID="337" - label="The body should produce a function of type (&#x2192; (Listof Node&#x1d62;) &#x2026; Boolean)" - created="1479323705555" x="34.0" y="23.0" width="488.0" - height="26.0" strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e9111d3c0a80026616d923930b32673</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="341" - label="The body should also return the syntax for the graph invariant dummy types that it enforces" - created="1479323869262" x="34.0" y="45.5" width="610.0" - height="25.0" strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e9407e3c0a80026616d9239a5640863</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="334" - label="(define-syntax/parse (define-graph-contract (name g-descriptor arg &#x2026;) . &#xa; body) #'(define-syntax name (graph-contract (&#x3bb; (g-descriptor arg &#x2026;) . body))))" - created="1479323593315" x="34.0" y="67.25" width="563.0" - height="85.0" strokeWidth="0.0" autoSized="false" xsi:type="text"> - <strokeColor>#404040</strokeColor> - <textColor>#000000</textColor> - <font>-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e8fd854c0a80026616d9239752cb6ef</URIString> - <richText>&lt;html&gt; - &lt;head color="#000000" style="color: #000000"&gt; - &lt;style type="text/css"&gt; - &lt;!-- - body { margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; font-size: 13; font-family: Arial; color: #000000 } - ol { margin-top: 6; font-family: Arial; vertical-align: middle; margin-left: 30; font-size: 13; list-style-position: outside } - p { margin-top: 0; margin-left: 0; margin-right: 0; margin-bottom: 0; color: #000000 } - ul { margin-top: 6; font-size: 13; margin-left: 30; vertical-align: middle; list-style-position: outside; font-family: Arial } - --&gt; - &lt;/style&gt; - - &lt;/head&gt; - &lt;body&gt; - &lt;p color="#000000" style="color: #000000"&gt; - &lt;font style="font-size:12;" face="DejaVu Sans Mono"&gt;(define-syntax/parse - (define-graph-contract (name g-descriptor arg &amp;#8230;) . body) &lt;/font&gt; - &lt;/p&gt; - &lt;p color="#000000" style="color: #000000"&gt; - &lt;font style="font-size:12;" face="DejaVu Sans Mono"&gt;#'(define-syntax - name &lt;/font&gt; - &lt;/p&gt; - &lt;p color="#000000" style="color: #000000"&gt; - &lt;font style="font-size:12;" face="DejaVu Sans Mono"&gt;(graph-contract &lt;/font&gt; - &lt;/p&gt; - &lt;p color="#000000" style="color: #000000"&gt; - &lt;font style="font-size:12;" face="DejaVu Sans Mono"&gt;(&amp;#955; (g-descriptor arg - &amp;#8230;) . body)))) &lt;/font&gt; - &lt;/p&gt; - &lt;p color="#000000" style="color: #000000"&gt; - - &lt;/p&gt; - &lt;/body&gt; -&lt;/html&gt; -</richText> - <label>(define-syntax/parse (define-graph-contract (name g-descriptor arg &#x2026;) . - body) #'(define-syntax name (graph-contract (&#x3bb; (g-descriptor arg &#x2026;) . body))))</label> - </child> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="339" layerID="1" created="1479323727259" x="68.35225" - y="1077.2448" width="124.80871" height="179.5" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e9111d4c0a80026616d9239034cd2a4</URIString> - <point1 x="192.66096" y="1077.7448"/> - <point2 x="68.85226" y="1256.2448"/> - <ID1 xsi:type="node">293</ID1> - <ID2 xsi:type="node">335</ID2> - </child> - <child ID="340" layerID="1" created="1479323738615" x="-640.4145" - y="1317.7285" width="353.8852" height="10.250732" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6e9111d4c0a80026616d92391e592054</URIString> - <point1 x="-639.9145" y="1318.2285"/> - <point2 x="-287.0293" y="1327.4792"/> - <ID1 xsi:type="node">328</ID1> - <ID2 xsi:type="node">335</ID2> - </child> - <child ID="342" - label="Define a wrapper, which may alter the input value and input types, and the output value and output types" - layerID="1" created="1479326681064" x="347.9707" y="1262.2448" - width="726.0" height="202.25" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6ec139a9c0a80026616d923967bf1cb6</URIString> - <child ID="346" - label="The body should return one transformer function per node type, plus one more transformer function." - created="1479328512808" x="34.0" y="23.0" width="830.6667" - height="25.0" strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6ee8e020c0a80026616d9239a263353a</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="348" - label="The transformer functions have the following type:" - created="1479328987933" x="34.0" y="44.75" width="339.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6ee8e021c0a80026616d9239ad712d82</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="352" - label="(-> syntax? (listof syntax?) (values &#xa; boolean? syntax?))" - created="1479329393216" x="34.0" y="65.0" width="460.0" - height="18.0" strokeWidth="0.0" autoSized="false" xsi:type="text"> - <strokeColor>#404040</strokeColor> - <textColor>#000000</textColor> - <font>DejaVu Sans Mono-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6ee8e021c0a80026616d92391acf1941</URIString> - <richText>&lt;html&gt; - &lt;head color="#000000" style="color: #000000"&gt; - &lt;style type="text/css"&gt; - &lt;!-- - body { margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; font-size: 12; font-family: SansSerif; color: #000000 } - ol { margin-top: 6; font-family: SansSerif; vertical-align: middle; margin-left: 30; font-size: 12; list-style-position: outside } - p { margin-top: 0; margin-left: 0; margin-right: 0; margin-bottom: 0; color: #000000 } - ul { margin-top: 6; font-size: 12; margin-left: 30; vertical-align: middle; list-style-position: outside; font-family: SansSerif } - --&gt; - &lt;/style&gt; - - &lt;/head&gt; - &lt;body&gt; - &lt;p color="#000000" style="color: #000000"&gt; - &lt;font face="DejaVu Sans Mono"&gt;(-&amp;gt; syntax? (listof syntax?) (values - boolean? syntax?))&lt;/font&gt; - &lt;/p&gt; - &lt;/body&gt; -&lt;/html&gt; -</richText> - <label>(-&gt; syntax? (listof syntax?) (values - boolean? syntax?))</label> - </child> - <child ID="351" - label="where the first argument is the mapping's body, and the second argument is a list of input argument names&#xa;The return values are a boolean indicating if the body was wrapped in some way, and the wrapped (or original) body.&#xa;The last extra function alters the whole graph result (at the level of nodes with placeholders (?)), so that it may inject extra fields" - created="1479329173663" x="34.0" y="86.0" width="858.0" - height="59.0" strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6ee8e021c0a80026616d9239b05b1b10</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="344" - label="(define-syntax/parse (define-graph-wrapper (name g-descriptor arg&#x1d62; &#x2026;) . &#xa; body) #'(define-syntax name (graph-wrapper (&#x3bb; (g-descriptor arg&#x1d62; &#x2026;) . body))))" - created="1479326880502" x="34.0" y="133.25" width="575.0" - height="63.0" strokeWidth="0.0" autoSized="false" xsi:type="text"> - <strokeColor>#404040</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-14</font> - <URIString>http://vue.tufts.edu/rdf/resource/6ec139a9c0a80026616d9239a14dd476</URIString> - <richText>&lt;html&gt; - &lt;head color="#000000" style="color: #000000"&gt; - &lt;style type="text/css"&gt; - &lt;!-- - body { margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; font-size: 12; font-family: SansSerif; color: #000000 } - ol { margin-top: 6; font-family: SansSerif; vertical-align: middle; margin-left: 30; font-size: 12; list-style-position: outside } - p { margin-top: 0; margin-left: 0; margin-right: 0; margin-bottom: 0; color: #000000 } - ul { margin-top: 6; font-size: 12; margin-left: 30; vertical-align: middle; list-style-position: outside; font-family: SansSerif } - --&gt; - &lt;/style&gt; - - &lt;/head&gt; - &lt;body&gt; - &lt;p color="#000000" style="color: #000000"&gt; - &lt;font face="DejaVu Sans Mono"&gt;(define-syntax/parse (define-graph-wrapper - (name g-descriptor arg&amp;#7522; &amp;#8230;) . body) &lt;/font&gt; - &lt;/p&gt; - &lt;p color="#000000" style="color: #000000"&gt; - &lt;font face="DejaVu Sans Mono"&gt;#'(define-syntax name &lt;/font&gt; - &lt;/p&gt; - &lt;p color="#000000" style="color: #000000"&gt; - &lt;font face="DejaVu Sans Mono"&gt;(graph-wrapper &lt;/font&gt; - &lt;/p&gt; - &lt;p color="#000000" style="color: #000000"&gt; - &lt;font face="DejaVu Sans Mono"&gt;(&amp;#955; (g-descriptor arg&amp;#7522; &amp;#8230;) . body))))&lt;/font&gt; - &lt;/p&gt; - &lt;/body&gt; -&lt;/html&gt; -</richText> - <label>(define-syntax/parse (define-graph-wrapper (name g-descriptor arg&#x1d62; &#x2026;) . - body) #'(define-syntax name (graph-wrapper (&#x3bb; (g-descriptor arg&#x1d62; &#x2026;) . body))))</label> - </child> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="345" layerID="1" created="1479326900002" x="219.88948" - y="1077.2448" width="317.8918" height="185.5" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6ec139aac0a80026616d92397220832f</URIString> - <point1 x="220.3895" y="1077.7448"/> - <point2 x="537.2813" y="1262.2448"/> - <ID1 xsi:type="node">293</ID1> - <ID2 xsi:type="node">342</ID2> - </child> - <child ID="353" label="Garbage collection" layerID="1" - created="1479341039823" x="1477.9707" y="129.74475" - width="136.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#8AEE95</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6f9963d1c0a80026616d92398f0f2135</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="354" layerID="1" created="1479341039825" x="1401.7124" - y="152.24463" width="138.59094" height="257.55835" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6f9963d1c0a80026616d92393e0bc6fe</URIString> - <point1 x="1402.2124" y="409.30298"/> - <point2 x="1539.8033" y="152.74463"/> - <ID1 xsi:type="node">15</ID1> - <ID2 xsi:type="node">353</ID2> - </child> - <child ID="355" label="Too hard to implement for now" layerID="1" - created="1479341061597" x="1622.9707" y="-37.25525" - width="210.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#A6A6A6</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6f9963d1c0a80026616d9239f16e4b43</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="356" layerID="1" created="1479341061598" x="1558.0037" - y="-14.755249" width="157.93408" height="145.0" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6f9963d1c0a80026616d923937836369</URIString> - <point1 x="1558.5037" y="129.74475"/> - <point2 x="1715.4377" y="-14.255249"/> - <ID1 xsi:type="node">353</ID1> - <ID2 xsi:type="node">355</ID2> - </child> - <child ID="357" label="Row polymorphism" layerID="1" - created="1479345782598" x="1853.9707" y="409.74475" - width="129.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#8AEE95</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6fe22188c0a80026616d92392b2a40f2</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="358" layerID="1" created="1479345782600" x="1419.6936" - y="432.24475" width="454.7085" height="118.06995" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6fe22188c0a80026616d9239f2e33d1e</URIString> - <point1 x="1420.1936" y="549.8147"/> - <point2 x="1873.9021" y="432.74475"/> - <ID1 xsi:type="node">6</ID1> - <ID2 xsi:type="node">357</ID2> - </child> - <child ID="359" label="Extending existing graph types" layerID="1" - created="1479345797404" x="1045.9707" y="204.74475" - width="210.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#8AEE95</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6fe22188c0a80026616d9239be9c047a</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="360" layerID="1" created="1479345797406" x="1158.7649" - y="227.24475" width="229.48596" height="317.8009" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6fe22189c0a80026616d9239eb7ccf81</URIString> - <point1 x="1387.7509" y="544.54565"/> - <point2 x="1159.2649" y="227.74475"/> - <ID1 xsi:type="node">6</ID1> - <ID2 xsi:type="node">359</ID2> - </child> - <child ID="361" label="Define a graph-info structure" layerID="1" - created="1479345850749" x="752.9707" y="171.74475" width="230.0" - height="46.25" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FEFD8C</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6fe26c5ec0a80026616d9239fd7f5890</URIString> - <child ID="365" label="copy from old implementation" - created="1479346259321" x="34.0" y="23.0" width="200.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6fe8bf99c0a80026616d9239dee715fd</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="362" layerID="1" created="1479345850751" x="982.4707" - y="203.0557" width="66.3761" height="5.937851" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6fe26c5ec0a80026616d92393d9d5229</URIString> - <point1 x="1048.3468" y="208.49356"/> - <point2 x="982.9707" y="203.55571"/> - <ID1 xsi:type="node">359</ID1> - <ID2 xsi:type="node">361</ID2> - </child> - <child ID="363" - label="A graph transformation lists its accepted input types, we have to make the code within work with all" - layerID="1" created="1479345855459" x="2831.9707" y="421.74475" - width="660.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6fe26c5ec0a80026616d92392fbc03c6</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="364" layerID="1" created="1479345855461" x="1982.4707" - y="421.3672" width="850.33936" height="9.196289" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6fe26c5ec0a80026616d9239976c9ae7</URIString> - <point1 x="1982.9707" y="421.8672"/> - <point2 x="2832.31" y="430.06348"/> - <ID1 xsi:type="node">357</ID1> - <ID2 xsi:type="node">363</ID2> - </child> - <child ID="366" label="Define a wrapper syntax with + - &#xb1;" - layerID="1" created="1479346280567" x="744.9707" y="239.74475" - width="266.0" height="67.25" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FEFD8C</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6feebb15c0a80026616d923958a3c2b1</URIString> - <child ID="368" label="Fetch the old graph info" - created="1479346367496" x="34.0" y="23.0" width="167.0" - height="24.0" strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FEFD8C</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6feebb15c0a80026616d9239749dd475</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="369" label="Add/remove fields" - created="1479346381443" x="34.0" y="44.0" width="184.0" - height="23.0" strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FEFD8C</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6feebb15c0a80026616d9239715edb34</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="367" layerID="1" created="1479346280569" x="1009.5972" - y="227.24475" width="86.91492" height="18.97763" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6feebb15c0a80026616d9239cdd2238d</URIString> - <point1 x="1096.0122" y="227.74475"/> - <point2 x="1010.0973" y="245.72238"/> - <ID1 xsi:type="node">359</ID1> - <ID2 xsi:type="node">366</ID2> - </child> - <child ID="370" - label="What about invariants?&#xa;* Just copy them over syntactically?&#xa;* Require that they are re-specified&#xa;(at least by explicitly copying them by their name)" - layerID="1" created="1479346589797" x="788.9707" y="332.74475" - width="329.0" height="68.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6feebb15c0a80026616d9239ae9362ed</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="371" layerID="1" created="1479346589799" x="997.58856" - y="227.24475" width="138.79065" height="106.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/6feebb15c0a80026616d92394b902499</URIString> - <point1 x="1135.8793" y="227.74475"/> - <point2 x="998.0886" y="332.74475"/> - <ID1 xsi:type="node">359</ID1> - <ID2 xsi:type="node">370</ID2> - </child> - <child ID="372" - label="Need to make split / with / merge work with nodes,&#xa;or at least make the basic graph transformations work with explicit row polymorphism" - layerID="1" created="1479347912017" x="1595.9707" y="268.74475" - width="565.0" height="38.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/7002a307c0a80026616d9239fea067fb</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="373" layerID="1" created="1479347912025" x="1883.6636" - y="306.24463" width="31.861328" height="104.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/7002a308c0a80026616d9239fd1b7118</URIString> - <point1 x="1915.0249" y="409.74463"/> - <point2 x="1884.1636" y="306.74463"/> - <ID1 xsi:type="node">357</ID1> - <ID2 xsi:type="node">372</ID2> - </child> - <child ID="376" - label="Provide a &quot;with&quot; form, so that mappings can extend or alter the inputs?" - layerID="1" created="1479385905764" x="3414.6375" y="491.74475" - width="473.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/72463402c0a8002633539faa9129b25a</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="377" layerID="1" created="1479385905770" x="3241.834" - y="444.24475" width="329.44043" height="48.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/72463402c0a8002633539faadc8678cc</URIString> - <point1 x="3242.334" y="444.74475"/> - <point2 x="3570.7744" y="491.74475"/> - <ID1 xsi:type="node">363</ID1> - <ID2 xsi:type="node">376</ID2> - </child> - <child ID="380" label="Solutions" layerID="1" - created="1479386183958" x="2847.6375" y="551.74475" - width="626.25" height="128.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/7249df95c0a8002633539faa8116b929</URIString> - <child ID="378" - label="Solution 1: hide the extra fields in the &quot;raw&quot; field" - created="1479386144228" x="34.0" y="23.0" width="324.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#A6A6A6</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/7249df95c0a8002633539faa04884126</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="382" - label="Solution 2: allow the use of split/with/merge, auto-insert a mergefor the + - &#xb1; cases" - created="1479386844095" x="34.0" y="43.25" width="562.0" - height="24.0" strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FEFD8C</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/7254d752c0a8002633539faa3f2cc14b</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="383" - label="Solution 3: in the mapping signature, explicitly indicate a row type variable" - created="1479386922237" x="34.0" y="64.25" width="491.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#E6F7FD</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/725bf582c0a8002633539faa375d2f0c</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="374" - label="Partial solution: for mappings which specify a derived type (with + - &#xb1;) for their output, auto-copy the remaining fields?" - created="1479385818415" x="34.0" y="84.5" width="782.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#E6F7FD</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/72463400c0a8002633539faa503d1c44</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="393" - label="Allow limited-field mappings (mappings from n to m fields of a node, keeping the rest intact)" - created="1479387268964" x="34.0" y="104.75" width="604.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#E6F7FD</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/725bf582c0a8002633539faae6c01aeb</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="381" layerID="1" created="1479386183961" x="3160.686" - y="444.21875" width="1.7087402" height="108.03125" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/7249df95c0a8002633539faa48b8542b</URIString> - <point1 x="3161.8948" y="444.71875"/> - <point2 x="3161.186" y="551.75"/> - <ID1 xsi:type="node">363</ID1> - <ID2 xsi:type="node">380</ID2> - </child> - <child ID="387" - label="Problem: these operations need to explicitly specify the possible types&#xa;for the auto-insertion, it's okay (we know them statically), but for user code it's a bit too verbose" - layerID="1" created="1479387124402" x="3501.6375" y="581.24475" - width="645.0" height="38.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FC938D</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/725bf583c0a8002633539faa15a27783</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="390" layerID="1" created="1479387136326" x="3302.6375" - y="601.39746" width="199.5" height="2.017212" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/725bf583c0a8002633539faa21ba73d6</URIString> - <point1 x="3303.1375" y="602.9147"/> - <point2 x="3501.6375" y="601.89746"/> - <ID1 xsi:type="node">382</ID1> - <ID2 xsi:type="node">387</ID2> - </child> - <child ID="395" - label="Could we define some sort of &quot;with&quot; macro which just acts like cons, and leave the fusion of fields to be done outside of the graph?&#xa;It then becomes possible to combine the return type info with the input type info to limit the number of cases to handle" - layerID="1" created="1479387466709" x="3503.6375" y="652.74475" - width="870.0" height="38.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#A6A6A6</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/72668aa3c0a8002633539faafb0eb90d</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="396" layerID="1" created="1479387466711" x="3854.0645" - y="618.74475" width="54.64673" height="34.5" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/72668aa3c0a8002633539faa97a18d9d</URIString> - <point1 x="3854.5642" y="619.24475"/> - <point2 x="3908.211" y="652.74475"/> - <ID1 xsi:type="node">387</ID1> - <ID2 xsi:type="node">395</ID2> - </child> - <child ID="397" label="Polymorphic node types" layerID="1" - created="1479387905581" x="1708.6375" y="727.74475" - width="166.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#8AEE95</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/72668aa3c0a8002633539faacd029888</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="398" layerID="1" created="1479387905582" x="1416.4615" - y="565.2322" width="350.84326" height="163.01257" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/72668aa3c0a8002633539faa2503ab0e</URIString> - <point1 x="1416.9615" y="565.7322"/> - <point2 x="1766.8048" y="727.74475"/> - <ID1 xsi:type="node">6</ID1> - <ID2 xsi:type="node">397</ID2> - </child> - <child ID="400" layerID="1" created="1479387927584" x="1792.5825" - y="432.24463" width="117.076416" height="296.0005" - strokeWidth="1.0" autoSized="false" controlCount="1" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/72668aa4c0a8002633539faaa932392e</URIString> - <point1 x="1793.0825" y="727.7451"/> - <point2 x="1909.1589" y="432.74463"/> - <ID1 xsi:type="node">397</ID1> - <ID2 xsi:type="node">357</ID2> - <ctrlPoint0 x="1815.6375" y="548.24475" xsi:type="point"/> - </child> - <child ID="404" layerID="1" created="1479387967910" x="1801.7073" - y="432.25" width="117.14758" height="295.99475" - strokeWidth="1.0" autoSized="false" controlCount="1" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/72668aa4c0a8002633539faa8f40befb</URIString> - <point1 x="1918.3549" y="432.75"/> - <point2 x="1802.2073" y="727.74475"/> - <ID1 xsi:type="node">357</ID1> - <ID2 xsi:type="node">397</ID2> - <ctrlPoint0 x="1916.6375" y="603.24475" xsi:type="point"/> - </child> - <child ID="406" layerID="1" created="1479388021013" x="211.80775" - y="717.66406" width="125.32594" height="337.5807" - strokeWidth="1.0" autoSized="false" controlCount="1" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/72668aa4c0a8002633539faa3cb33fdb</URIString> - <point1 x="336.6337" y="718.16406"/> - <point2 x="212.30775" y="1054.7448"/> - <ID1 xsi:type="node">134</ID1> - <ID2 xsi:type="node">293</ID2> - <ctrlPoint0 x="337.63745" y="931.24475" xsi:type="point"/> - </child> - <child ID="408" layerID="1" created="1479388041109" x="-268.36255" - y="679.2012" width="451.3379" height="201.54358" - strokeWidth="1.0" autoSized="false" controlCount="1" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/72668aa4c0a8002633539faa9a64a9f9</URIString> - <point1 x="182.47534" y="679.7012"/> - <point2 x="-267.86255" y="880.24475"/> - <ID1 xsi:type="node">295</ID1> - <ID2 xsi:type="node">291</ID2> - <ctrlPoint0 x="179.63745" y="880.24475" xsi:type="point"/> - </child> - <child ID="409" layerID="1" created="1479388138737" x="1408.7244" - y="1172.803" width="150.40967" height="45.793213" - strokeWidth="1.0" autoSized="false" controlCount="1" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/72688d2cc0a8002633539faa2223c3fb</URIString> - <point1 x="1409.2244" y="1173.303"/> - <point2 x="1558.634" y="1218.0962"/> - <ID1 xsi:type="node">25</ID1> - <ID2 xsi:type="node">44</ID2> - <ctrlPoint0 x="1464.6375" y="1218.2448" xsi:type="point"/> - </child> - <child ID="410" layerID="1" created="1479388143803" x="1399.9028" - y="1172.803" width="119.57471" height="96.49426" - strokeWidth="1.0" autoSized="false" controlCount="1" - arrowState="2" xsi:type="link"> - <strokeColor>#000000</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/72688d2cc0a8002633539faacb736715</URIString> - <point1 x="1400.4028" y="1173.303"/> - <point2 x="1518.9775" y="1268.7972"/> - <ID1 xsi:type="node">25</ID1> - <ID2 xsi:type="node">42</ID2> - <ctrlPoint0 x="1444.6375" y="1268.2448" xsi:type="point"/> - </child> - <child ID="411" layerID="1" created="1479388189966" x="1296.6572" - y="1172.803" width="93.310425" height="76.42578" - strokeWidth="1.0" autoSized="false" controlCount="1" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/72688d2cc0a8002633539faad8be8121</URIString> - <point1 x="1389.4677" y="1173.303"/> - <point2 x="1297.1572" y="1248.7288"/> - <ID1 xsi:type="node">25</ID1> - <ID2 xsi:type="node">27</ID2> - <ctrlPoint0 x="1352.6375" y="1249.2448" xsi:type="point"/> - </child> - <child ID="412" - label="Already implemented for tagged structures,&#xa;should not be too hard to make it work for graphs" - layerID="1" created="1479389260693" x="1793.6375" y="790.74475" - width="338.0" height="38.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FEFD8C</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/7279521dc0a8002633539faa9926c093</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="413" layerID="1" created="1479389260695" x="1819.031" - y="750.24475" width="98.02136" height="41.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/7279521dc0a8002633539faa28480501</URIString> - <point1 x="1819.531" y="750.74475"/> - <point2 x="1916.5524" y="790.74475"/> - <ID1 xsi:type="node">397</ID1> - <ID2 xsi:type="node">412</ID2> - </child> - <child ID="414" - label="1. record the fields added via node-with+, node-with! and node-with!!&#xa;2. The types which may have been added are therefore:&#xa;(difference input-types output-types) &#x2229; fields-mentionned-in-with*" - layerID="1" created="1479390037236" x="3858.6375" y="740.74475" - width="466.0" height="53.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#A6A6A6</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/7287a2ccc0a8002633539faa8697b9f3</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="415" layerID="1" created="1479390037237" x="3968.5771" - y="690.24475" width="81.10449" height="51.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/7287a2ccc0a8002633539faa2c556ff8</URIString> - <point1 x="3969.0771" y="690.74475"/> - <point2 x="4049.1816" y="740.74475"/> - <ID1 xsi:type="node">395</ID1> - <ID2 xsi:type="node">414</ID2> - </child> - <child ID="416" - label="This does not allowof mixing the explicit with* for structures and the node-with*" - layerID="1" created="1479390248006" x="4378.6377" y="811.74475" - width="526.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FC938D</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/7288d8b8c0a8002633539faa3849d5b4</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="419" layerID="1" created="1479390353025" x="3301.897" - y="514.24475" width="318.7273" height="85.60602" - strokeWidth="1.0" autoSized="false" controlCount="1" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/7289950ec0a8002633539faa78352364</URIString> - <point1 x="3302.397" y="599.35077"/> - <point2 x="3620.1243" y="514.74475"/> - <ID1 xsi:type="node">382</ID1> - <ID2 xsi:type="node">376</ID2> - <ctrlPoint0 x="3397.6375" y="597.24475" xsi:type="point"/> - </child> - <child ID="420" - label="Problem: the macro will only be accessible within the graph transformation's body&#xa;This issue also occurs with node creation functions too (but they are functions, so they can at least be passed around)" - layerID="1" created="1479402724372" x="4412.6377" y="757.74475" - width="801.0" height="38.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FC938D</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/734b04c1afd9d7675fea10f2925b4ae0</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="423" - label="To pass the graph row tvar to other functions, make a new sort of &#x2200; (like for #:row),&#xa;and use (g-row-inst f g-row-var)." - layerID="1" created="1479403067621" x="3020.6375" y="765.24475" - width="562.0" height="38.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#E6F7FD</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/7353a85bafd9d7675fea10f24895dc43</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="424" layerID="1" created="1479403607747" x="3078.0073" - y="632.74475" width="196.0542" height="133.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/7353a85bafd9d7675fea10f2505e36aa</URIString> - <point1 x="3078.5073" y="633.24475"/> - <point2 x="3273.5615" y="765.24475"/> - <ID1 xsi:type="node">383</ID1> - <ID2 xsi:type="node">423</ID2> - </child> - <child ID="394" - label="Won't handle gracefully the case of mappings returning nested nodes" - layerID="1" created="1479387344773" x="3337.1375" y="716.74475" - width="468.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FC938D</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/725bf582c0a8002633539faa75b6ba0c</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="425" layerID="1" created="1479403710634" x="3170.8987" - y="673.24475" width="316.39014" height="44.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/7355c611afd9d7675fea10f2464a6ef0</URIString> - <point1 x="3171.3987" y="673.74475"/> - <point2 x="3486.7888" y="716.74475"/> - <ID1 xsi:type="node">393</ID1> - <ID2 xsi:type="node">394</ID2> - </child> - <child ID="426" layerID="1" created="1479404272403" x="4324.1377" - y="769.8127" width="89.0" height="2.1586914" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/735e8357afd9d7675fea10f25dfdfc46</URIString> - <point1 x="4324.6377" y="770.3127"/> - <point2 x="4412.6377" y="771.4714"/> - <ID1 xsi:type="node">414</ID1> - <ID2 xsi:type="node">420</ID2> - </child> - <child ID="427" layerID="1" created="1479404290679" x="4103.9146" - y="793.2446" width="275.22314" height="30.500122" - strokeWidth="1.0" autoSized="false" controlCount="1" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/735e8357afd9d7675fea10f2729a7e75</URIString> - <point1 x="4104.4146" y="793.7446"/> - <point2 x="4378.6377" y="823.24475"/> - <ID1 xsi:type="node">414</ID1> - <ID2 xsi:type="node">416</ID2> - <ctrlPoint0 x="4118.6377" y="823.24475" xsi:type="point"/> - </child> - <child ID="428" - label="Don't record the fields added. Instead, return a tagged structure with *only* the fields added, and stash aside the original.&#xa;We know what the original may be statically (one of the graph's nodes)." - layerID="1" created="1479404327217" x="3520.6375" y="854.74475" - width="818.0" height="38.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#A6A6A6</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/73636845afd9d7675fea10f2a9ff2eca</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="430" layerID="1" created="1479404329622" x="3803.7974" - y="690.24475" width="95.55615" height="165.0" strokeWidth="1.0" - autoSized="false" controlCount="1" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/73636845afd9d7675fea10f26ca61710</URIString> - <point1 x="3898.8535" y="690.74475"/> - <point2 x="3887.0615" y="854.74475"/> - <ID1 xsi:type="node">395</ID1> - <ID2 xsi:type="node">428</ID2> - <ctrlPoint0 x="3715.6375" y="778.24475" xsi:type="point"/> - </child> - <child ID="431" - label="Problem: what then should be the return type of the mapping?&#xa;(U (tagged tag all-fields &#x2026;)&#xa;(tagged WITH extra-fields &#x2026; (tagged tag original-fields))&#xa;Problem with that: it won't work with functional updates (i.e. it'll work only with+, not with!! nor with!)&#xa;because the with!! won't know what is the type of the tagged structure." - layerID="1" created="1479404856705" x="3604.6375" y="923.74475" - width="656.0" height="83.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FC938D</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/736a755dafd9d7675fea10f20c6acfd9</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="432" layerID="1" created="1479404856708" x="3929.7603" - y="892.2422" width="2.0163574" height="32.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/736a755dafd9d7675fea10f2f958e7ad</URIString> - <point1 x="3930.2605" y="892.7422"/> - <point2 x="3931.2769" y="923.7422"/> - <ID1 xsi:type="node">428</ID1> - <ID2 xsi:type="node">431</ID2> - </child> - <child ID="433" - label="Optionnally parameterize node types with an extra polymorphic type for the &quot;row&quot;&#xa;This poly type encapsulates the &quot;extra&quot; fields.&#xa;The return type of the mapping should indicate that the node has a &quot;row&quot; and which tvar to use&#xa;Statically, we can recognize that from the input, and perform the merge in an easy way" - layerID="1" created="1479481584246" x="2273.6375" y="737.74475" - width="635.0" height="68.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#A6A6A6</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/77fa5631c0a83801659a3967307a2681</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="434" layerID="1" created="1479481584251" x="2664.9995" - y="591.49475" width="319.77393" height="146.75" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/77fa5637c0a83801659a39672e53f0db</URIString> - <point1 x="2984.2734" y="591.99475"/> - <point2 x="2665.4995" y="737.74475"/> - <ID1 xsi:type="node">378</ID1> - <ID2 xsi:type="node">433</ID2> - </child> - <child ID="439" - label="This does not however allow the use of &quot;with&quot; etc. without specifying the &quot;main&quot; fields" - layerID="1" created="1479485975528" x="2316.6375" y="865.74475" - width="566.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FC938D</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/784b6258c0a83801659a396706b41c0d</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="440" layerID="1" created="1479485975532" x="2593.377" - y="805.2422" width="5.8342285" height="61.001953" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/784b6259c0a83801659a3967a5919df0</URIString> - <point1 x="2593.8767" y="805.7422"/> - <point2 x="2598.711" y="865.74414"/> - <ID1 xsi:type="node">433</ID1> - <ID2 xsi:type="node">439</ID2> - </child> - <child ID="443" label="More solutions" layerID="1" - created="1479486767440" x="3081.6375" y="272.74475" - width="110.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/784b6259c0a83801659a396709970398</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="444" layerID="1" created="1479486767449" x="3138.0928" - y="295.24414" width="22.423096" height="127.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/784b6259c0a83801659a39670a45e1ce</URIString> - <point1 x="3160.0156" y="421.74414"/> - <point2 x="3138.5925" y="295.74414"/> - <ID1 xsi:type="node">363</ID1> - <ID2 xsi:type="node">443</ID2> - </child> - <child ID="445" - label="Cheapy trivial tracking: use let-syntax on the inputs, so that we know their type" - layerID="1" created="1479486772901" x="2382.6375" y="160.74475" - width="527.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#A6A6A6</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/784b6259c0a83801659a3967733b628e</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="446" layerID="1" created="1479486772904" x="2696.001" - y="183.24475" width="393.2898" height="90.57483" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/784b625ac0a83801659a3967666d1aa4</URIString> - <point1 x="3088.791" y="273.31958"/> - <point2 x="2696.5012" y="183.74475"/> - <ID1 xsi:type="node">443</ID1> - <ID2 xsi:type="node">445</ID2> - </child> - <child ID="447" - label="When the result is just a single node for which we know the type (but not the chain of with! etc.)&#xa;auto-create the node, filling each field via (get-field f result) || (get-field f (next result)) || &#x2026;&#xa;and with! etc. only return a sort of pair with the new or overwritten fields in a tagged structure at the front, and the original in the rest" - layerID="1" created="1479486800251" x="2352.6375" y="-40.25525" - width="887.0" height="53.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#A6A6A6</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/784b625ac0a83801659a3967a167ad78</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="448" layerID="1" created="1479486800255" x="2825.917" - y="12.244873" width="298.08008" height="260.99976" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/784b625ac0a83801659a396755702e91</URIString> - <point1 x="3123.497" y="272.74463"/> - <point2 x="2826.417" y="12.744873"/> - <ID1 xsi:type="node">443</ID1> - <ID2 xsi:type="node">447</ID2> - </child> - <child ID="451" - label="Won't work for map etc, those will need an annotation" - layerID="1" created="1479487002756" x="2460.6375" y="113.74475" - width="364.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FC938D</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/784e56c5c0a83801659a39679b10ce32</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="452" layerID="1" created="1479487002761" x="2642.9941" - y="136.2461" width="2.7871094" height="25.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/784e56cfc0a83801659a396764247fc5</URIString> - <point1 x="2645.2812" y="160.7461"/> - <point2 x="2643.4941" y="136.7461"/> - <ID1 xsi:type="node">445</ID1> - <ID2 xsi:type="node">451</ID2> - </child> - <child ID="455" - label="Could work, we don't need to statically know the type for get-field/fallback" - layerID="1" created="1479487076289" x="2513.6375" y="-207.25525" - width="492.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#A6A6A6</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/784e56cfc0a83801659a3967c532603f</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="456" layerID="1" created="1479487076302" x="2761.4438" - y="-184.75488" width="29.878906" height="145.0" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/784e56cfc0a83801659a39678a19388f</URIString> - <point1 x="2790.8228" y="-40.254883"/> - <point2 x="2761.9438" y="-184.25488"/> - <ID1 xsi:type="node">447</ID1> - <ID2 xsi:type="node">455</ID2> - </child> - <child ID="457" - label="but we must ensure that the return type is correct. How could we do that???" - layerID="1" created="1479487132743" x="3062.6375" y="-216.25525" - width="508.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FC938D</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/784e56d0c0a83801659a396759692c9e</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="458" layerID="1" created="1479487132747" x="3004.6394" - y="-201.15958" width="59.021973" height="1.9375153" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/784e56d0c0a83801659a3967b64162ba</URIString> - <point1 x="3005.1394" y="-199.72206"/> - <point2 x="3063.1614" y="-200.65958"/> - <ID1 xsi:type="node">455</ID1> - <ID2 xsi:type="node">457</ID2> - </child> - <child ID="463" - label="Bind the result with let, letting it infer the type,&#xa;grab the fields with get-field/fallback&#xa;and only enforce the type on the result / on the individual fields" - layerID="1" created="1479489493797" x="3104.6375" y="-178.25525" - width="425.0" height="53.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#A6A6A6</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/7872f6c7c0a83801659a3967b9244b5d</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="464" layerID="1" created="1479489493820" x="3316.2458" - y="-193.75" width="1.1416016" height="16.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/7872f6c7c0a83801659a3967fb310cfc</URIString> - <point1 x="3316.7458" y="-193.25"/> - <point2 x="3316.8875" y="-178.25"/> - <ID1 xsi:type="node">457</ID1> - <ID2 xsi:type="node">463</ID2> - </child> - <child ID="465" - label="Subtyping and recursive types with TR sometimes rejects valid subtyping relationships" - layerID="1" created="1479489570917" x="1969.6375" y="479.74475" - width="570.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FEFD8C</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/787577e6c0a83801659a3967e32a4328</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="466" layerID="1" created="1479489570921" x="1972.8401" - y="432.17023" width="227.0697" height="48.074493" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/787577e7c0a83801659a39671d0d1cc7</URIString> - <point1 x="1973.3402" y="432.67023"/> - <point2 x="2199.41" y="479.74472"/> - <ID1 xsi:type="node">357</ID1> - <ID2 xsi:type="node">465</ID2> - </child> - <child ID="467" - label="Not so much of a problem,&#xa;because we don't use subtyping, we use *bounded* row polymorphism&#xa;so we always know the exact list of types allwed,&#xa;and don't really use the subtyping aside from (U alt&#x2081; &#x2026; alt&#x2099;) at the top" - layerID="1" created="1479489603603" x="2039.6375" y="536.74475" - width="470.0" height="68.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FEFD8C</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/787577e7c0a83801659a3967df77be38</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="468" layerID="1" created="1479489603606" x="2257.0305" - y="502.24512" width="9.553711" height="35.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/787577e7c0a83801659a39674bacedb2</URIString> - <point1 x="2257.5305" y="502.74512"/> - <point2 x="2266.0842" y="536.7451"/> - <ID1 xsi:type="node">465</ID1> - <ID2 xsi:type="node">467</ID2> - </child> - <child ID="471" - label="Pb: a loop will loose type information, so we have to hardcode a few iterations of fetching ->next" - layerID="1" created="1479493749797" x="2996.6375" y="-109.25525" - width="647.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FC938D</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/78b501a5c0a83801659a39678e8cb2cd</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="472" layerID="1" created="1479493749799" x="3318.1099" - y="-125.75391" width="1.888916" height="17.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/78b501a6c0a83801659a39673e57b5e0</URIString> - <point1 x="3318.6096" y="-125.25391"/> - <point2 x="3319.4985" y="-109.25391"/> - <ID1 xsi:type="node">463</ID1> - <ID2 xsi:type="node">471</ID2> - </child> - <child ID="473" - label="To avoid a large code blowup, factor out the get-field which will be called in several places in a polymorphic function?" - layerID="1" created="1479493833435" x="2934.6375" y="-73.25525" - width="773.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#A6A6A6</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/78b501a6c0a83801659a396729606ba0</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="474" layerID="1" created="1479493833437" x="3319.9565" - y="-86.75781" width="1.361084" height="13.9921875" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/78b501a6c0a83801659a39679b169ce5</URIString> - <point1 x="3320.4568" y="-86.25781"/> - <point2 x="3320.8179" y="-73.265625"/> - <ID1 xsi:type="node">471</ID1> - <ID2 xsi:type="node">473</ID2> - </child> - <child ID="475" - label="Must specify the node name or tag+fields in the with* forms, possibly with a &quot;row&quot; variable.&#xa;The node name should be concise enough that it's not too much of a pain to write it in a lot of places." - layerID="1" created="1479493941528" x="3284.6375" y="211.74475" - width="681.0" height="38.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#A6A6A6</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/78b782c0c0a83801659a396727249705</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="477" layerID="1" created="1479494033735" x="3153.2751" - y="232.3084" width="131.8623" height="40.936234" - strokeWidth="1.0" autoSized="false" controlCount="1" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/78b782c1c0a83801659a3967c215e1f3</URIString> - <point1 x="3153.7751" y="272.74463"/> - <point2 x="3284.6375" y="232.8084"/> - <ID1 xsi:type="node">443</ID1> - <ID2 xsi:type="node">475</ID2> - <ctrlPoint0 x="3212.6375" y="233.24475" xsi:type="point"/> - </child> - <child ID="478" - label="Detect all structure types which are present as inputs or outputs (or within the mapping?)&#xa;and use that information to make a large case handling" - layerID="1" created="1479494059762" x="3265.6375" y="266.74475" - width="598.0" height="38.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#A6A6A6</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/78b9713fc0a83801659a396797741710</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="479" layerID="1" created="1479494059763" x="3191.1375" - y="283.9375" width="75.0" height="1.2593689" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/78b9713fc0a83801659a39678b01ea9d</URIString> - <point1 x="3191.6375" y="284.4375"/> - <point2 x="3265.6375" y="284.69687"/> - <ID1 xsi:type="node">443</ID1> - <ID2 xsi:type="node">478</ID2> - </child> - <child ID="482" label="Pb: rather costly (code size)" layerID="1" - created="1479494147236" x="3378.6375" y="316.74475" - width="196.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FC938D</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/78b9713fc0a83801659a39670e4489d6</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="483" layerID="1" created="1479494147238" x="3499.9492" - y="304.24475" width="25.847168" height="13.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/78b97140c0a83801659a396776a928b8</URIString> - <point1 x="3525.2964" y="304.74475"/> - <point2 x="3500.4492" y="316.74475"/> - <ID1 xsi:type="node">478</ID1> - <ID2 xsi:type="node">482</ID2> - </child> - <child ID="484" label="Pb: we can't detect everything" layerID="1" - created="1479494157560" x="3593.6375" y="316.74475" - width="208.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FC938D</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/78b97140c0a83801659a396750c3a7da</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="485" layerID="1" created="1479494157562" x="3623.5964" - y="304.24475" width="38.552734" height="13.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/78b97140c0a83801659a396707564963</URIString> - <point1 x="3624.0964" y="304.74475"/> - <point2 x="3661.6492" y="316.74475"/> - <ID1 xsi:type="node">478</ID1> - <ID2 xsi:type="node">484</ID2> - </child> - <child ID="488" - label="Since we don't need occurrence typing for incomplete nodes&#x2026;" - layerID="1" created="1479494214687" x="3106.6375" y="109.74475" - width="419.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/78ba99b9c0a83801659a396792c09d82</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="489" layerID="1" created="1479494214689" x="3148.8015" - y="132.24487" width="155.17188" height="140.99976" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/78ba99b9c0a83801659a396789c84846</URIString> - <point1 x="3149.3015" y="272.74463"/> - <point2 x="3303.4734" y="132.74487"/> - <ID1 xsi:type="node">443</ID1> - <ID2 xsi:type="node">488</ID2> - </child> - <child ID="490" - label="Pb: I'm not sure we can type this correctly (perhaps relying heavily on inference?" - layerID="1" created="1479494404441" x="3681.6375" y="-20.255249" - width="534.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FC938D</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/78bd72dec0a83801659a39679db74cd5</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="498" label="Key" layerID="1" created="1482930066792" - x="1898.6375" y="-205.75525" width="395.75" height="172.5" - strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F4F5E9</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-18</font> - <URIString>http://vue.tufts.edu/rdf/resource/45873cde534430712734d86ab1152fe7</URIString> - <child ID="499" label="Potential solution (not implemented yet)" - created="1482930095971" x="34.0" y="30.0" width="361.33334" - height="27.0" strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FFC63B</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-16</font> - <URIString>http://vue.tufts.edu/rdf/resource/45873cde534430712734d86a6173ded7</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="495" label="Problem" created="1482929988379" x="34.0" - y="53.25" width="86.666664" height="27.0" strokeWidth="1.0" - autoSized="false" xsi:type="node"> - <fillColor>#FC938D</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-16</font> - <URIString>http://vue.tufts.edu/rdf/resource/45873cdf534430712734d86a3f094d92</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="493" label="Should be OK (not implemented yet)" - created="1482929962993" x="34.0" y="76.5" width="318.66666" - height="27.0" strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#FEFD8C</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-16</font> - <URIString>http://vue.tufts.edu/rdf/resource/45873cdf534430712734d86a14e4a638</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="494" label="Done" created="1482929973452" x="34.0" - y="99.75" width="63.0" height="27.0" strokeWidth="1.0" - autoSized="false" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#5491A4</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-16</font> - <URIString>http://vue.tufts.edu/rdf/resource/45873cdf534430712734d86a1e77c5e8</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="500" - label="Valid but not implemented alternative / enhancement" - created="1482930253480" x="34.0" y="123.0" width="474.66666" - height="27.0" strokeWidth="1.0" autoSized="false" xsi:type="node"> - <fillColor>#E6F7FD</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-16</font> - <URIString>http://vue.tufts.edu/rdf/resource/45bba55b534430712734d86a7b98e7af</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="496" label="Rejected solution" - created="1482930039269" x="34.0" y="146.25" - width="153.33333" height="27.0" strokeWidth="1.0" - autoSized="false" xsi:type="node"> - <fillColor>#A6A6A6</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-16</font> - <URIString>http://vue.tufts.edu/rdf/resource/45873cdf534430712734d86aab608348</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="503" - label="I doubt we could find a way to infer the graph row variable to pass in a feasible way.&#xa;We could override #%app to allow a more concise syntax, but that's it." - layerID="1" created="1482933605087" x="2936.6375" y="845.24475" - width="559.0" height="38.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FC938D</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/45bba55c534430712734d86a16caa731</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="506" layerID="1" created="1482933646174" x="3235.9436" - y="802.7446" width="45.887695" height="43.000244" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/45bbf23d534430712734d86a4fad75b2</URIString> - <point1 x="3281.3313" y="803.2446"/> - <point2 x="3236.4436" y="845.2449"/> - <ID1 xsi:type="node">423</ID1> - <ID2 xsi:type="node">503</ID2> - </child> - <child ID="507" - label="can we use the representation as a case&#x2192; ?" - layerID="1" created="1482936022767" x="3303.6375" y="-14.255249" - width="309.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#A6A6A6</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/45e66670534430712734d86a57e07278</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="508" layerID="1" created="1482936022770" x="3328.8071" - y="8.244629" width="116.66138" height="102.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/45e66670534430712734d86a070392ee</URIString> - <point1 x="3329.307" y="109.74463"/> - <point2 x="3444.9683" y="8.744629"/> - <ID1 xsi:type="node">488</ID1> - <ID2 xsi:type="node">507</ID2> - </child> - <child ID="509" layerID="1" created="1482936026239" x="3612.0593" - y="-5.9935493" width="70.43408" height="1.8493462" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/45e66670534430712734d86a90157415</URIString> - <point1 x="3612.5593" y="-4.644203"/> - <point2 x="3681.9934" y="-5.4935493"/> - <ID1 xsi:type="node">507</ID1> - <ID2 xsi:type="node">490</ID2> - </child> - <child ID="510" - label="Representation as a binary tree with fields as the leaves.&#xa;To avoid the memory cost of carrying the intermediate nodes, we actually store the fields inside a closure,&#xa;which builds and returns the tree on request.&#xa;When initially building such records, known record types can be represented in a compact way.&#xa;When the record is updated (add / remove / modify fields), a series of &quot;delta&quot; patches are stored,&#xa;with a memory cost of O(1) per patch and a run-time extraction cost of O(log N) per patch (where N is the total number of fields in the program)" - layerID="1" created="1482936061557" x="3611.6375" y="65.74475" - width="944.0" height="98.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#C1F780</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/45e66670534430712734d86a3a5e0161</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="511" layerID="1" created="1482936061559" x="3525.0825" - y="118.24214" width="87.05493" height="1.7288055" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/45e66670534430712734d86ac0cf2c24</URIString> - <point1 x="3525.5825" y="119.47095"/> - <point2 x="3611.6375" y="118.74214"/> - <ID1 xsi:type="node">488</ID1> - <ID2 xsi:type="node">510</ID2> - </child> - <child ID="512" - label="To also get occurrence typing (probably not across modified versions of a record, only for the same exact unmodified record),&#xa;we can turn the closure over the field values (which is a thunk) into a pure promise.&#xa;Accessing the fields will be slower (O(log N) + O(log N) per patch), but at least it can be done without loss of functionality&#xa;(accesses of modified records within a mapping should be rare in practice, so the cost is acceptble)" - layerID="1" created="1482936478751" x="3997.6377" y="204.74475" - width="835.0" height="68.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FEFD8C</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/45ec4fff534430712734d86aa07fbb12</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="513" layerID="1" created="1482936478755" x="4214.134" - y="163.24487" width="110.6084" height="41.999878" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/45ec4fff534430712734d86a24c87b1e</URIString> - <point1 x="4214.634" y="163.74487"/> - <point2 x="4324.242" y="204.74475"/> - <ID1 xsi:type="node">510</ID1> - <ID2 xsi:type="node">512</ID2> - </child> - <child ID="514" - label="Problem: how do we make the field accessors &quot;hybrid&quot;,&#xa;i.e. working both on fixed records and flex records?&#xa;We don't want nested field accesses to build up a tower of U types,&#xa;which makes acceesses very costly for the typechecker" - layerID="1" created="1482936685798" x="3909.6375" y="310.24475" - width="454.0" height="68.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FC938D</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/45ec4fff534430712734d86a19adbd4d</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="516" layerID="1" created="1482936769032" x="4225.891" - y="272.24475" width="99.993164" height="38.500122" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/45ec4fff534430712734d86a0c6770e9</URIString> - <point1 x="4325.3843" y="272.74475"/> - <point2 x="4226.391" y="310.24487"/> - <ID1 xsi:type="node">512</ID1> - <ID2 xsi:type="node">514</ID2> - </child> - <child ID="517" - label="It's already the case anyway when a field appears in more than a single struct." - layerID="1" created="1482936781221" x="3874.6375" y="413.74475" - width="527.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FFC63B</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/45ec4fff534430712734d86a0944806f</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="518" layerID="1" created="1482936781223" x="4136.7676" - y="377.76562" width="1.6572266" height="36.484375" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/45ec4fff534430712734d86a1c61af46</URIString> - <point1 x="4137.2676" y="378.26562"/> - <point2 x="4137.925" y="413.75"/> - <ID1 xsi:type="node">514</ID1> - <ID2 xsi:type="node">517</ID2> - </child> - <child ID="519" - label="Problem: types like Has-get and the same tagged structure type&#xa;won't accept flex structs with the right fields&#xa;Adding a (U &#x2026;) will make an exponential type size &#x2192; not good" - layerID="1" created="1483019817725" x="4524.6377" y="309.74475" - width="433.0" height="53.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FC938D</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/4b10aeea534430712734d86a7563260a</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="520" layerID="1" created="1483019817727" x="4528.32" - y="272.24475" width="124.71289" height="38.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/4b10aeea534430712734d86a3bbe533b</URIString> - <point1 x="4528.82" y="272.74475"/> - <point2 x="4652.5327" y="309.74475"/> - <ID1 xsi:type="node">512</ID1> - <ID2 xsi:type="node">519</ID2> - </child> - <child ID="521" - label="We have to require that the user converts back to the tagged structure representation&#xa;when passing to something which expects a tagged structure&#xa;(i.e. distinguish the tagged structure types, and the flex tagged structure types)" - layerID="1" created="1483019947983" x="4462.6377" y="394.74475" - width="586.0" height="53.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FFC63B</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/4b10aeea534430712734d86afd00a858</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="522" layerID="1" created="1483019947985" x="4745.158" - y="362.24414" width="6.458496" height="32.998047" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/4b10aeea534430712734d86ae4487e0b</URIString> - <point1 x="4745.658" y="362.74414"/> - <point2 x="4751.1167" y="394.7422"/> - <ID1 xsi:type="node">519</ID1> - <ID2 xsi:type="node">521</ID2> - </child> - <child ID="523" - label="Possible improvement: count the number of patches, when it goes beyond a certain threshold,&#xa;recopy all the fields" - layerID="1" created="1483023191462" x="4231.6377" y="-63.25525" - width="630.0" height="38.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FFC63B</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/4b15d0d1534430712734d86a297e96f8</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="524" layerID="1" created="1483023191464" x="4225.8223" - y="-25.755249" width="265.9878" height="92.00012" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/4b15d0d1534430712734d86ae98942d0</URIString> - <point1 x="4226.3228" y="65.74487"/> - <point2 x="4491.3105" y="-25.255249"/> - <ID1 xsi:type="node">510</ID1> - <ID2 xsi:type="node">523</ID2> - </child> - <child ID="525" - label="Problem: we don't know which fields to copy, so to do it in a typechecked way,&#xa;we would need to dispatch on the known struct types,&#xa;and otherwise fall back to keeping the patches, or keeping some patches based on the largest known sub-struct type." - layerID="1" created="1483023305811" x="3944.6377" y="-159.25525" - width="793.0" height="53.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FC938D</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/4b15d0d1534430712734d86a64c609f2</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="526" layerID="1" created="1483023305812" x="4402.172" - y="-106.75513" width="100.84717" height="43.999878" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/4b15d0d1534430712734d86ac3110955</URIString> - <point1 x="4502.519" y="-63.25525"/> - <point2 x="4402.672" y="-106.25513"/> - <ID1 xsi:type="node">523</ID1> - <ID2 xsi:type="node">525</ID2> - </child> - <child ID="528" - label="Otherwise, we could recopy all the fields on output of graph mappings,&#xa;as we know the type there (it's specified for the graph)" - layerID="1" created="1483039527123" x="4797.6377" y="-135.25525" - width="471.0" height="38.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#FEFD8C</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/4c0c7efe534430712734d86a6143bf3b</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="529" layerID="1" created="1483039527125" x="4674.5195" - y="-97.75525" width="230.73633" height="35.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/4c0c7efe534430712734d86a20138645</URIString> - <point1 x="4675.0195" y="-63.25525"/> - <point2 x="4904.756" y="-97.25525"/> - <ID1 xsi:type="node">523</ID1> - <ID2 xsi:type="node">528</ID2> - </child> - <child ID="530" layerID="1" created="1483039599401" x="4737.1377" - y="-123.80114" width="61.0" height="2.4306335" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/4c0c7efe534430712734d86a22d85a28</URIString> - <point1 x="4737.6377" y="-123.30114"/> - <point2 x="4797.6377" y="-121.87051"/> - <ID1 xsi:type="node">525</ID1> - <ID2 xsi:type="node">528</ID2> - </child> - <child ID="9" label="As a wrapper?" layerID="1" - created="1479309895903" x="1676.3673" y="913.9207" width="105.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b00c0a80026548592b8a0766ac6</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="531" layerID="1" created="1483046153686" x="1688.6351" - y="880.4206" width="30.464355" height="34.000122" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/4c709721534430712734d86a3c298a33</URIString> - <point1 x="1689.1351" y="880.9206"/> - <point2 x="1718.5995" y="913.9207"/> - <ID1 xsi:type="node">7</ID1> - <ID2 xsi:type="node">9</ID2> - </child> - <child ID="534" layerID="1" created="1483046733635" x="-661.06274" - y="-191.75513" width="24.68274" height="113.95581" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/4c7aa01c534430712734d86a674135d7</URIString> - <point1 x="-660.56274" y="-78.29932"/> - <point2 x="-636.88" y="-191.25513"/> - <ID1 xsi:type="node">90</ID1> - <ID2 xsi:type="node">103</ID2> - </child> - <child ID="535" - label="Place run-time checks and ann checks after the &quot;editing&quot; policies&#xa;(so that the order of the run-time and ann checks do not matter much)" - layerID="1" created="1483046744434" x="-467.36255" - y="-217.25525" width="474.0" height="38.0" strokeWidth="1.0" - autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/4c7aa01c534430712734d86af85a0d62</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="536" layerID="1" created="1483046744436" x="-524.4689" - y="-202.02475" width="57.606323" height="1.6303558" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/4c7aa01c534430712734d86aedc8c725</URIString> - <point1 x="-523.9689" y="-201.52475"/> - <point2 x="-467.36255" y="-200.8944"/> - <ID1 xsi:type="node">103</ID1> - <ID2 xsi:type="node">535</ID2> - </child> - <child ID="538" label="i.e. a lens" layerID="1" - created="1484518582413" x="3000.6375" y="699.74475" width="76.0" - height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#E6F7FD</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/a46d8f60c0a801286acbb58b97c6fd0a</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="539" layerID="1" created="1484518582423" x="3055.4656" - y="673.2446" width="40.17627" height="27.000122" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/a46d8f61c0a801286acbb58b996c697e</URIString> - <point1 x="3095.1418" y="673.7446"/> - <point2 x="3055.9656" y="699.74475"/> - <ID1 xsi:type="node">393</ID1> - <ID2 xsi:type="node">538</ID2> - </child> - <child ID="540" - label="Could be implemented using the function-updating-binarry-tree trick&#xa;Start from a tree with all positions filled with an empty vector (can be implemented as a single &quot;base&quot; function)&#xa;and then &quot;cons&quot; the non-empty vectors, effectively hiding the empty ones" - layerID="1" created="1484520835681" x="983.63745" y="-145.25525" - width="730.0" height="53.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/a46d8f61c0a801286acbb58b2b628a00</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="541" layerID="1" created="1484520835688" x="1368.2502" - y="-92.75525" width="169.49231" height="223.00012" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/a46d8f62c0a801286acbb58b19d6b212</URIString> - <point1 x="1537.2426" y="129.74487"/> - <point2 x="1368.7502" y="-92.25525"/> - <ID1 xsi:type="node">353</ID1> - <ID2 xsi:type="node">540</ID2> - </child> - <child ID="542" - label="O(1) memory overhead for each type which is live within an SCC&#xa;O(m) time overhead for access, m being the number of SCCs to traverse before reaching the desired node from its ancestor&#xa;The O(m) factor can probably be turned into a O(log m) with a bit of extra space usage" - layerID="1" created="1484521031023" x="926.63745" y="-235.25525" - width="825.0" height="53.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/a46d8f62c0a801286acbb58beacd7655</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="543" layerID="1" created="1484521031026" x="1341.4347" - y="-182.75488" width="4.9055176" height="38.0" strokeWidth="1.0" - autoSized="false" controlCount="0" arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/a46d8f62c0a801286acbb58b90bacc82</URIString> - <point1 x="1345.8402" y="-145.25488"/> - <point2 x="1341.9347" y="-182.25488"/> - <ID1 xsi:type="node">540</ID1> - <ID2 xsi:type="node">542</ID2> - </child> - <child ID="544" label="Check addition of new fields to the input" - layerID="1" created="1484557019620" x="2235.3042" y="324.74472" - width="274.0" height="23.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/a68081d4c0a801286ae39894efbfa682</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="545" layerID="1" created="1484557019630" x="1975.7919" - y="347.24472" width="335.61157" height="63.670532" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/a68081d5c0a801286ae398949e441433</URIString> - <point1 x="1976.2917" y="410.41525"/> - <point2 x="2310.9033" y="347.74472"/> - <ID1 xsi:type="node">357</ID1> - <ID2 xsi:type="node">544</ID2> - </child> - <child ID="546" - label="By versionning the lists of fields,&#xa;and indicating the last-good version number&#xa;in the graph creation code &#x2014; new versions have to be&#xa;approved by bumping the number." - layerID="1" created="1484557036779" x="2181.971" y="222.0781" - width="368.0" height="68.0" strokeWidth="1.0" autoSized="true" xsi:type="node"> - <fillColor>#F2AE45</fillColor> - <strokeColor>#776D6D</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-12</font> - <URIString>http://vue.tufts.edu/rdf/resource/a68081d5c0a801286ae398942effba1f</URIString> - <shape arcwidth="20.0" archeight="20.0" xsi:type="roundRect"/> - </child> - <child ID="547" layerID="1" created="1484557036786" x="2368.157" - y="289.57812" width="3.7387695" height="35.66797" - strokeWidth="1.0" autoSized="false" controlCount="0" - arrowState="2" xsi:type="link"> - <strokeColor>#404040</strokeColor> - <textColor>#404040</textColor> - <font>SansSerif-plain-11</font> - <URIString>http://vue.tufts.edu/rdf/resource/a68081d6c0a801286ae398944c00f8fa</URIString> - <point1 x="2371.3958" y="324.7461"/> - <point2 x="2368.657" y="290.07812"/> - <ID1 xsi:type="node">544</ID1> - <ID2 xsi:type="node">546</ID2> - </child> - <layer ID="1" label="Layer 1" created="1479309847607" x="0.0" - y="0.0" width="1.4E-45" height="1.4E-45" strokeWidth="0.0" autoSized="false"> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b15c0a80026548592b8d2f3fee2</URIString> - </layer> - <userZoom>0.75</userZoom> - <userOrigin x="-1182.522" y="-189.81644"/> - <presentationBackground>#FFFFFF</presentationBackground> - <PathwayList currentPathway="0" revealerIndex="-1"> - <pathway ID="0" label="Chemin sans nom" created="1479309847603" - x="0.0" y="0.0" width="1.4E-45" height="1.4E-45" - strokeWidth="0.0" autoSized="false" currentIndex="0" open="true"> - <strokeColor>#B3993333</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-14</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b16c0a80026548592b8204729d3</URIString> - <masterSlide ID="2" created="1479309847623" x="0.0" y="0.0" - width="800.0" height="600.0" locked="true" - strokeWidth="0.0" autoSized="false"> - <fillColor>#000000</fillColor> - <strokeColor>#404040</strokeColor> - <textColor>#000000</textColor> - <font>SansSerif-plain-14</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b16c0a80026548592b817230376</URIString> - <titleStyle ID="3" label="Header" - created="1479309850047" x="329.0" y="174.5" - width="142.0" height="51.0" strokeWidth="0.0" - autoSized="true" isStyle="true" xsi:type="node"> - <strokeColor>#404040</strokeColor> - <textColor>#FFFFFF</textColor> - <font>Gill Sans-plain-36</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b17c0a80026548592b88a8fba25</URIString> - <shape xsi:type="rectangle"/> - </titleStyle> - <textStyle ID="4" label="Slide Text" - created="1479309850048" x="340.0" y="282.5" - width="120.0" height="35.0" strokeWidth="0.0" - autoSized="true" isStyle="true" xsi:type="node"> - <strokeColor>#404040</strokeColor> - <textColor>#FFFFFF</textColor> - <font>Gill Sans-plain-22</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b17c0a80026548592b8c426a9c8</URIString> - <shape xsi:type="rectangle"/> - </textStyle> - <linkStyle ID="5" label="Links" created="1479309850107" - x="372.5" y="385.0" width="55.0" height="30.0" - strokeWidth="0.0" autoSized="true" isStyle="true" xsi:type="node"> - <strokeColor>#404040</strokeColor> - <textColor>#B3BFE3</textColor> - <font>Gill Sans-plain-18</font> - <URIString>http://vue.tufts.edu/rdf/resource/6dbf6b18c0a80026548592b8ea0d19d7</URIString> - <shape xsi:type="rectangle"/> - </linkStyle> - </masterSlide> - </pathway> - </PathwayList> - <date>2016-11-16</date> - <modelVersion>6</modelVersion> - <saveLocation>/home/georges/phc/racket-packages/phc-graph</saveLocation> - <saveFile>/home/georges/phc/racket-packages/phc-graph/Graph-notes-copy2.vue</saveFile> -</LW-MAP> diff --git a/LICENSE.txt b/LICENSE.txt @@ -1,11 +0,0 @@ -phc-graph -Copyright (c) 2016 georges - -This package is distributed under the GNU Lesser General Public -License (LGPL). This means that you can link phc-graph into proprietary -applications, provided you follow the rules stated in the LGPL. You -can also modify this package; if you distribute a modified version, -you must distribute it under the terms of the LGPL, which in -particular means that you must release the source code for the -modified software. See http://www.gnu.org/copyleft/lesser.html -for more information. diff --git a/README.md b/README.md @@ -1,3 +0,0 @@ -phc-graph -========= -README text here. diff --git a/alpha-equivalence-normal-form.rkt b/alpha-equivalence-normal-form.rkt @@ -1,79 +0,0 @@ -#lang racket -(let () - ;; Given an order-independent let - (let ([x 'b] - [y 'a]) - (cons x y)) - - ;; e.g. represented roughly as: - (list 'let - (set (cons 'x ''b) (cons 'y ''a)) ;; bindings - (list 'cons 'x 'y)) ;; body - - ;; Can we devise an α-equivalence normal form? - - ;; Let's sort the right-hand side of the let bindings, and number them in that - ;; order. x gets renamed to var1, and y gets renamed to var0, given the order - ;; ('a, 'b) - (let ([var0 'a] - [var1 'b]) - (cons var1 var0)) - - ;; The idea roughly amounts to transforming sets into lists by sorting their - ;; contents, knowing that the sort operation must not depend on unrenamed - ;; variables. Given a letrec, what can we do? - - (let ([x 'b] - [y 'a]) - (letrec ([f (λ (v) (f (cons v x)))] - [g (λ (v) (g (cons v y)))]) - '…)) - - ;; In the example above, x and y can be renamed first, giving var1 and var0 - ;; respectively. Then it becomes possible to sort f and g, as they differ - ;; by their references to var1 and var0 respectively, and these have already - ;; been assigned a new number. - - (letrec ([f (λ (v) (f v))] - [g (λ (v) (f v))]) - '…) - - ;; Here, we have no difference in the values, but there is a difference in the - ;; way these values refer to the bingings: f refers to itself, while g refers to - ;; f. Topologically sorting that graph would give a cannon order. - - (letrec ([f (λ (v) (g v))] - [g (λ (v) (f v))]) - '…) - - ;; Here, there is no difference in the values, and swapping them gives a new - ;; graph isomorphic to the original. Another more complex case follows: - - (letrec ([f (λ (v) (g v))] - [g (λ (v) (h v))] - [h (λ (v) (f v))]) - '…) - - ;; In these cases, the order we assign to each variable does not matter, as they - ;; are strictly symmetric (in the sense that the bound values are at run-time - ;; observarionally identical). - - ;; What general solution can we find? - ;; * What if we topo-sort bindings which cannot be distinguished by their values - ;; * then, within each SCC, if there are some values which are isomorphic to - ;; each other, they can be grouped together for the purpose of numbering. - ;; this operation can be repeated. - ;; * By alternating these two steps, do we systematically get a - ;; topologically-sorted DAG, where some nodes are a group of nodes which were - ;; isomorphic one level down? - ;; - ;; Relevant: - ;; @inproceedings{babai1983canonical, - ;; title={Canonical labeling of graphs}, - ;; author={Babai, L{\'a}szl{\'o} and Luks, Eugene M}, - ;; booktitle={Proceedings of the fifteenth annual ACM symposium on Theory of computing}, - ;; pages={171--183}, - ;; year={1983}, - ;; organization={ACM} - ;; } - (void)) -\ No newline at end of file diff --git a/bench001.rkt b/bench001.rkt @@ -1,32 +0,0 @@ -#lang type-expander/lang -(require (for-syntax racket - phc-toolkit)) - -(struct Or ()) -(define-type-expander (Invariants stx) - (syntax-case stx () - [(_ invᵢ …) - #'(→ (U Or (→ invᵢ Void) …) Void) - #;#'(→ (→ (∩ invᵢ …) Void) Void)])) - - - -(define-syntax (foo stx) - (syntax-case stx () - [(_ T nb) - #`(define-type T - (Invariants - #,@(map (λ (x) #`(List 'a 'b 'c 'd 'e 'f 'g 'h 'i 'j 'k #,x 'm 'n)) - (range (syntax-e #'nb)))))])) -(foo T0 600) -(foo T1 550) - -(define f0 : T0 (λ (x) (void))) - -(define-syntax (repeat stx) - (syntax-case stx () - [(_ n body) - #`(begin #,@(map (const #'body) - (range (syntax-e #'n))))])) -(repeat 100 - (ann f0 T1)) -\ No newline at end of file diff --git a/dispatch-union.rkt b/dispatch-union.rkt @@ -1,52 +0,0 @@ -#lang typed/racket/base - -(require racket/require - phc-toolkit - phc-adt - (for-syntax racket/base - phc-toolkit/untyped - racket/syntax - racket/format - syntax/parse - syntax/parse/experimental/template - type-expander/expander - "free-identifier-tree-equal.rkt") - (for-meta 2 racket/base) - (for-meta 2 phc-toolkit/untyped) - (for-meta 2 syntax/parse)) - -(provide dispatch-union) - -(define-syntax/parse (dispatch-union v - ([type-to-replaceᵢ Aᵢ predicateᵢ] …) - [Xⱼ resultⱼ] …) - (define-syntax-class to-replace - (pattern [t result] - #:with (_ predicate) - (findf (λ (r) (free-id-tree=? #'t (stx-car r))) - (syntax->list - #'([type-to-replaceᵢ predicateᵢ] …))) - #:with clause #`[(predicate v) result])) - - (define-syntax-class tagged - #:literals (tagged) - (pattern [(tagged name [fieldₖ (~optional :colon) typeₖ] …) result] - #:with clause #`[((tagged? name fieldₖ …) v) result])) - - (define-syntax-class other - (pattern [other result] - #:with clause #`[else result])) - - ((λ (x) (local-require racket/pretty) #;(pretty-write (syntax->datum x)) x) - (syntax-parse #'([Xⱼ resultⱼ] …) - [({~or to-replace:to-replace - tagged:tagged - {~between other:other 0 1 - #:too-many (~a "only one non-tagged type can be part of" - " the union")}} - …) - (quasisyntax/top-loc stx - (cond - to-replace.clause … - tagged.clause … - other.clause …))]))) -\ No newline at end of file diff --git a/features-and-implementation b/features-and-implementation @@ -1,40 +0,0 @@ -* gc -* automatic generation of mappings Old → New - - -* safe and automatic generation of 1↔1, 1↔many and many↔1 backward references - -** global directives which apply to all nodes types: insert a pointer to the root, insert a backward pointer for every link (i.e. .back brings back to the previous node) - -** the backward references specify the link that should be reversed, as well as a path from there. That way, methods can have a backward pointer to the "call" instructions referencing them, but the backward pointer should not - directly point to the "call" instruction, but instead to the instruction's containing method, accessed with ".method". Maybe some syntactic sugar can allow this to be specified as #:backward-reference method.instructions.*[call] - -* try to think about PHOAS - -** Strong HOAS article: https://www.schoolofhaskell.com/user/edwardk/phoas - - - -* mapping-placeholder = Placeholder type, one for each mapping -* mapping-incomplete-result = (~> mapping) types within the mapping's result type are replaced by (U mapping-placeholder mapping-incomplete-result), and node types are replaced by (U xxx old-node) -* mapping-with-promises-result = node types within the mapping's result type are replaced by node-promise - -* node-promise = (Promise node-with-promises) -* node-with-promises = node types within the node's fields are replaced by node-promise - - - - - - - - - - - -To discuss: -* maybe add a "self" variable, so that a mapping can give to others a placeholder for the node it is currently generating? That wouldn't play well with mappings which generate multiple nodes and/or part of a node. -** self is a opaque "SELF" token, not an actual placeholder - -Minor TODOs: -* If we can guarantee that any two nodes within the same graph are (not (equal? …)), then we can implement a fast negative equality test, in addition to the existing fast equality test (which compares the "raw" field of nodes). diff --git a/features-and-implementation2 b/features-and-implementation2 @@ -1,142 +0,0 @@ -On verification -=============== - -* Some guarantees can be enforced statically using the type system. - They are in a way proven to be enforeced in the expanded code, - but in order to write verified compilers, it would be necessary to - prove that the type indeed enforces the desired property, for all - possible macro inputs. - - Advantage: these proofs need to be written only once for the graph macro, - and can be relied on by all compilers written using these static guarantees. -* Some guarantees can be enforced statically "by construction", - and the design patterns used to enforce them are guaranteed to be - correctly applied because the code is macro-generated. - In order to write verified compilers, it would be necessary to - prove that the macro-generated code always enforces the desired property. - - Advantage: these proofs need to be written only once for the graph macro, - and can be relied on by all compilers written using these static guarantees. -* Some guarantees can be enforced at run-time. - This allows catching bugs early, and ensures no incorrect output can occur - when these guarantees are broken. It does not however ensure that the compiler - will never break these guarantees. It is therefore still possible to ship a - broken compiler which fails on valid inputs. - - Drawback: it is necessary for every compiler written using such guards to prove - that the guards are never raised. - - -Features -======== - -* GC: - * Group nodes by SCC - * Two kinds of "indices" pointers: - * index within the current strongly-connected component - * direct pointer to a descendant SCC + index within it - * To limit the waste when there is an SCC not containing nodes of a given type, - do not use a fixed tuple of vectors of nodes. Instead, use a "list with possible omissions". - Problem: the size of the fully-expanded type in TR is O(2ⁿ) for these. - Either: - * use casts - * pay the compile-time price of a huge type (not feasible with large N) - * pay the run-time price of bloated components (feasible but costly with large N) - * use a case→ function, which returns the empty vector as a fallback. With pure functions, this could be doable. - * Problem: generating all the possible functions means O(2^n) templates for closures that may be used at - run-time - * Otherwise, generate one closure over 1 array, one closure over 2 arrays, one over 3 arrays, etc. - and also close over some markers indicating to which "real" arrays these correspond. - This means O(2n) space usage worst-case. - Problem again: the construction function for such a case→ while minimizing the number of values closed on - has a large O(2^n) type too. - * typed clojure has typed heterogeneous maps https://github.com/clojure/core.typed/wiki/Types#heterogeneous-maps - * In theory it could be possible to give hints to the GC, - but Racket's GC does not offer that possibility. - -GC Implementation: -* Must be optional -* Initially, all nodes within a single component, all indices are of the "slef + index" kind. -* Use tarjan's algorithm -* group nodes by SCC - Update references to nodes in the same SCC, using just an index - Update references to nodes in "lower" SCCs, using a pointer to the SCC + an index. -* Due to the higher memory cost (+ 1 reference for references to other SCCs), - and the poor set of options for implementation (cast, exponential size of type, or large memory usage) - we will not implement the GC. - - We argue that in most cases it would not be useful, as compilers will normally work on the whole graph, and - not on a subgraph. In the rare case where only part of a graph is needed, applying the graph-level identity - transformation to the nodes of interest would effectively copy them and the nodes reachable from these new roots, - thereby allowing the original graph to be freed. - -* Invariants - * Scope of the invariants: - * Input contracts, types and structural properties - * Output contracts, types and structural properties - * Transformation invariants (relate the input and output graphs) - * Time of verification: - * Run-time - Should be easy enough to implement: Add a define-graph-invariant form, recognize these options, and check - them at run-time. Implemented as some sorts of contracts. - * Compile-time - * Node types - * Statically-enforced structural invariants at the level of node types - (e.g. disallow cycles in the types, to ensure there are no cycles in the instance) - * Macros can be used to generate code which is known to be correct - e.g. paths - * Concern: static "by construction" guarantees may interfere with each other, if they fill in some nodes, - e.g. a "no cycles starting from this node" constraint would not work as expected if a "backwards link" - is filled in afterwards. We probably need to hardcode a set of constraints which know about eachother - and about the potential interactions. - * Conserve well-scopedness within a transition: pass in nodes flagged with a ∀ type, and check - that the output contains that flag. - * PHOAS - * Specification - * Invariants specified in the graph type - * Transformation invariants specified on the graph creation code - * Checks (run-time or the various compile-time mechanisms) are specified in the graph creation code - The graph creation code must enforce all invariants within the type - That way, it is guaranteed that any instance of the graph type satisfies its invariants, either by - construction, or as a guard at the end of the construction. - -* Automatic generation of mappings - * when there is no mapping taking an old node as an input, a mapping is automatically generated. - The mapping simply translates the old node to the new node type, and recursively transforms its fields, - traversing lists etc. - * When there is a mapping with more than one argument, then no mapping is auto-generated for that input node type, - and instead calls to the mapping must be explicit (i.e. can't return the old node type). - * This means that we have a mechanism before the actual core graph macro, which checks and decides which mappings - to auto-generate. - * We also have a mechanism for auto-calling transformations on input node types - * Possibility to escape this, in order to actually insert a reference to the old graph? - * Some notation in the type, to indicate that it's "protected" in some way? - * Some wrapper indicating that it should merely be unwrapped, not processed? (I think that's better). - -* Structural node equality - * Would be nice to coalesce nodes which are equal? (i.e. hash consing) - so that any two nodes which are equal? within the same graph have the same index. - I suppose this would be rather costly: O(n log n) comparisons, with each comparison potentially - costly, in principle. If we cached results, we could achieve a better run-time in practice, and - perhaps a better theoretical complexity if we handled cycles ourselves. - * The general algorithm when there are no unordered sets is deterministic finite automaton minimization - * The general algorithm when there are unordered sets is nondeterministic finite automaton minimization - * We could cache all calls to equal? on two nodes for a limited dynamic scope. - * If we have this, then we can, for comparisons within the same graph, quickly return #t or #f based on eq? - * Alpha-equivalence comparisons - (i.e. ignore the actual values of some fields, except for constraining the shape of the graph) - Possibility: create values which are unique within the graph, but are ignored when comparing - nodes from different graphs. - I'm not sure whether plainly erasing the information won't be enough, for a weaker form of alpha-equivalence? - * Alpha-equivalence can't easily be implemented atop equal?, dropping it for now. - It's not extremely useful anyway, as thanks to the full-blown graph representation, we are likely to - discard names early on (keeping them just for printing / debuggin purposes). - - - - - - -* Coloring: the existing graph library for Racket has some coloring algorithms: - http://docs.racket-lang.org/graph/index.html#%28def._%28%28lib._graph%2Fmain..rkt%29._coloring%2Fgreedy%29%29 - Maybe we can build a wrapper for those? -\ No newline at end of file diff --git a/features-and-implementation3 b/features-and-implementation3 @@ -1,99 +0,0 @@ -* Invariants - * Scope of the invariants: - * Input contracts, types and structural properties - * Output contracts, types and structural properties - * Transformation invariants (relate the input and output graphs) - * Time of verification: - * Run-time - Should be easy enough to implement: Add a define-graph-invariant form, recognize these options, and check - them at run-time. Implemented as some sorts of contracts. - * Compile-time - * Node types - * Statically-enforced structural invariants at the level of node types - (e.g. disallow cycles in the types, to ensure there are no cycles in the instance) - * Macros can be used to generate code which is known to be correct - e.g. paths - * Concern: static "by construction" guarantees may interfere with each other, if they fill in some nodes, - e.g. a "no cycles starting from this node" constraint would not work as expected if a "backwards link" - is filled in afterwards. We probably need to hardcode a set of constraints which know about eachother - and about the potential interactions. - * Conserve well-scopedness within a transition: pass in nodes flagged with a ∀ type, and check - that the output contains that flag. Potentially out-of-scope fields in the input do not have the flag. - * PHOAS - * Specification - * Invariants specified in the graph type - * Transformation invariants specified on the graph creation code - * Checks (run-time or the various compile-time mechanisms) are specified in the graph creation code - The graph creation code must enforce all invariants within the type - That way, it is guaranteed that any instance of the graph type satisfies its invariants, either by - construction, or as a guard at the end of the construction. - -; The body should produce a function of type (→ (Listof Nodeᵢ) … Boolean) -; The body should also return an indication about which invariants it ensures. Maybe use {~seq #:ensures (invariant-name inariant-arg …)} … - however this does not allow the body to perform some minimal amount of rewriting on the "ensures" options. -(define-syntax/parse (define-graph-contract (name g-descriptor arg …) . body) - #'(define-syntax name - (graph-contract - (λ (g-descriptor arg …) . body)))) - -;; TODO: find a way to translate this to a type, with subtyping for weaker invariants. -;; The type only serves to testify that the invariant was statically enforced or dynamically checked at construction, it does not actually encode the property using the type system. -(struct invariants-wrapper ()) ;; Use a private struct to prevent forging of the invariants aggregated in a case→ (since it is never executed, any non-terminating λ could otherwise be supplied). -(define-for-syntax invariant-introducer - (make-syntax-introducer)) -;; the body should return the syntax for a type, such that less precise invariants are supertypes of that type. -(define-syntax/parse (define-graph-invariant (name g-descriptor arg …) . body) - #'(define-syntax name - (graph-invariant - (λ (g-descriptor arg …) . body)))) - -The type of a graph node with the invariants inv₁ … invₙ on the graph must include an extra dummy field with type -(invariants-wrapper - (case (→ inv₁ inv-arg … #t) - … - (→ invₙ inv-arg … #t))) - -The invariant arguments can be symbols, to indicate node types or field names. - -Concern: invariants on a graph may not have the same semantics if the graph has more or fewer nodes? - -* Automatic generation of mappings - * when there is no mapping taking an old node as an input, a mapping is automatically generated. - The mapping simply translates the old node to the new node type, and recursively transforms its fields, - traversing lists etc. - * When there is a mapping with more than one argument, then no mapping is auto-generated for that input node type, - and instead calls to the mapping must be explicit (i.e. can't return the old node type). - * This means that we have a mechanism before the actual core graph macro, which checks and decides which mappings - to auto-generate. - * We also have a mechanism for auto-calling transformations on input node types - * Possibility to escape this, in order to actually insert a reference to the old graph? - * Some notation in the type, to indicate that the output should be an "old" node here - * In the rare case where we have an (U (Old nd) nd), in the mapping use some (old v) wrapper - indicating that the returned it should merely be unwrapped, not processed. - -(define-syntax define-graph-type - (syntax-parser - [(_ _name [_nodeᵢ [_fieldᵢⱼ :colon _τᵢⱼ] …] …) - ;; save the graph type metadata - ])) - -(define-syntax define-graph-transformer - (syntax-parser - [(_ _name graph-type) - ;; TODO - ])) - -* Structural node equality - * Would be nice to coalesce nodes which are equal? (i.e. hash consing) - so that any two nodes which are equal? within the same graph have the same index. - I suppose this would be rather costly: O(n log n) comparisons, with each comparison potentially - costly, in principle. If we cached results, we could achieve a better run-time in practice, and - perhaps a better theoretical complexity if we handled cycles ourselves. - * The general algorithm when there are no unordered sets is deterministic finite automaton minimization - * The general algorithm when there are unordered sets is nondeterministic finite automaton minimization - * We could cache all calls to equal? on two nodes for a limited dynamic scope. - * If we have this, then we can, for comparisons within the same graph, quickly return #t or #f based on eq? - -* Coloring: the existing graph library for Racket has some coloring algorithms: - http://docs.racket-lang.org/graph/index.html#%28def._%28%28lib._graph%2Fmain..rkt%29._coloring%2Fgreedy%29%29 - Maybe we can build a wrapper for those? -\ No newline at end of file diff --git a/flexible-with-utils.hl.rkt b/flexible-with-utils.hl.rkt @@ -1,118 +0,0 @@ -#lang aful/unhygienic hyper-literate type-expander/lang - -@(require scribble-math) - -@title[#:tag-prefix "utils" - #:style manual-doc-style]{Utility math functions for binary tree - manipulation} - -@(chunks-toc-prefix - '("(lib phc-graph/scribblings/phc-graph-implementation.scrbl)" - "phc-graph/flexible-with" - "utils")) - -@defmodule[(lib "phc-graph/flexible-with-utils.hl.rkt")] - -@(unless-preexpanding - (require (for-label (submod "..")))) - -@chunk[<*> - (require (for-syntax racket/base)) - - (provide (for-syntax to-bits - from-bits - floor-log2 - ceiling-log2)) - - <to-bits> - <from-bits> - <floor-log2> - <ceiling-log2> - - (module* test racket/base - (require (for-template (submod ".."))) - (require rackunit) - <test-to-bits> - <test-from-bits>)] - -@defproc[(to-bits [n exact-nonnegative-integer?]) (listof boolean?)]{} - -@CHUNK[<to-bits> - ; 1 => 1 - ; 2 3 => 10 11 - ;4 5 6 7 => 100 101 110 111 - ;89 ab cd ef => 1000 1001 1010 1011 1100 1101 1110 1111 - - ; 1 => "" - ; 2 3 => 0 1 - ;4 5 6 7 => 00 01 10 11 - ;89 ab cd ef => 000 001 010 011 100 101 110 111 - - ; 0 => 0 - ; 1 2 => 1 10 - ;3 4 5 6 => 11 100 101 110 - ;78 9a bc de => 111 1000 1001 1010 1011 1100 1101 1110 - - - (define-for-syntax (to-bits n) - (reverse - (let loop ([n n]) - (if (= n 0) - null - (let-values ([(q r) (quotient/remainder n 2)]) - (cons (if (= r 1) #t #f) (loop q)))))))] - -@chunk[<test-to-bits> - (check-equal? (to-bits 0) '()) - (check-equal? (to-bits 1) '(#t)) - (check-equal? (to-bits 2) '(#t #f)) - (check-equal? (to-bits 3) '(#t #t)) - (check-equal? (to-bits 4) '(#t #f #f)) - (check-equal? (to-bits 5) '(#t #f #t)) - (check-equal? (to-bits 6) '(#t #t #f)) - (check-equal? (to-bits 7) '(#t #t #t)) - (check-equal? (to-bits 8) '(#t #f #f #f)) - (check-equal? (to-bits 12) '(#t #t #f #f)) - (check-equal? (to-bits 1024) '(#t #f #f #f #f #f #f #f #f #f #f))] - -@defproc[(from-bits [n (listof boolean?)]) exact-nonnegative-integer?]{} - -@CHUNK[<from-bits> - (define-for-syntax (from-bits b) - (foldl (λ (bᵢ acc) - (+ (* acc 2) (if bᵢ 1 0))) - 0 - b))] - -@chunk[<test-from-bits> - (check-equal? (from-bits '()) 0) - (check-equal? (from-bits '(#t)) 1) - (check-equal? (from-bits '(#t #f)) 2) - (check-equal? (from-bits '(#t #t)) 3) - (check-equal? (from-bits '(#t #f #f)) 4) - (check-equal? (from-bits '(#t #f #t)) 5) - (check-equal? (from-bits '(#t #t #f)) 6) - (check-equal? (from-bits '(#t #t #t)) 7) - (check-equal? (from-bits '(#t #f #f #f)) 8) - (check-equal? (from-bits '(#t #t #f #f)) 12) - (check-equal? (from-bits '(#t #f #f #f #f #f #f #f #f #f #f)) 1024)] - -@defproc[(floor-log2 [n exact-positive-integer?]) - exact-nonnegative-integer?]{ - Exact computation of @${\lfloor\log_2(n)\rfloor}. -} - -@chunk[<floor-log2> - (define-for-syntax (floor-log2 n) - (if (<= n 1) - 0 - (add1 (floor-log2 (quotient n 2)))))] - -@defproc[(ceiling-log2 [n exact-positive-integer?]) - exact-nonnegative-integer?]{ - Exact computation of @${\lceil\log_2(n)\rceil}. -} - -@chunk[<ceiling-log2> - (define-for-syntax (ceiling-log2 n) - (floor-log2 (sub1 (* n 2))))] diff --git a/flexible-with.hl.rkt b/flexible-with.hl.rkt @@ -1,365 +0,0 @@ -#lang aful/unhygienic hyper-literate type-expander/lang - -@title[#:style manual-doc-style ;#:style (with-html5 manual-doc-style) - #:tag "flexible-with" - #:tag-prefix "phc-graph/flexible-with"]{Flexible functional - modification and extension of records} - -@(chunks-toc-prefix - '("(lib phc-graph/scribblings/phc-graph-implementation.scrbl)" - "phc-graph/flexible-with")) - -@section{Type of a tree-record, with a hole} - -@CHUNK[<tree-type-with-replacement> - (define-for-syntax (tree-type-with-replacement n last τ*) - (define-values (next mod) (quotient/remainder n 2)) - (cond [(null? τ*) last] - [(= mod 0) - (tree-type-with-replacement next - #`(Pairof #,last #,(car τ*)) - (cdr τ*))] - [else - (tree-type-with-replacement next - #`(Pairof #,(car τ*) #,last) - (cdr τ*))]))] - -@section{Functionally updating a tree-record} - -@subsection{Adding and modifying fields} - -Since we only deal with functional updates of immutable records, modifying a -field does little more than discarding the old value, and injecting the new -value instead into the new, updated record. - -Adding a new field is done using the same exact operation: missing fields are -denoted by a special value, @racket['NONE], while present fields are -represented as instances of the polymorphic struct @racket[(Some T)]. Adding a -new field is therefore as simple as discarding the old @racket['NONE] marker, -and replacing it with the new value, wrapped with @racket[Some]. A field -update would instead discard the old instance of @racket[Some], and replace it -with a new one. - -@CHUNK[<make-replace-in-tree-body> - (if (= i 1) - #'(delay/pure/stateless replacement) - (let* ([bits (to-bits i)] - [next (from-bits (cons #t (cddr bits)))] - [mod (cadr bits)]) - (define/with-syntax next-id (vector-ref low-names (sub1 next))) - (if mod - #`(replace-right (inst next-id #,@τ*-limited+T-next) - tree-thunk - replacement) - #`(replace-left (inst next-id #,@τ*-limited+T-next) - tree-thunk - replacement))))] - -@CHUNK[<define-replace-in-tree> - (: replace-right (∀ (A B C R) (→ (→ (Promise B) R (Promise C)) - (Promise (Pairof A B)) - R - (Promise (Pairof A C))))) - (define-pure/stateless - #:∀ (A B C R) - (replace-right [next-id : (→ (Promise B) R (Promise C))] - [tree-thunk : (Promise (Pairof A B))] - [replacement : R]) - (delay/pure/stateless - (let ([tree (force tree-thunk)]) - (let ([left-subtree (car tree)] - [right-subtree (cdr tree)]) - (cons left-subtree - (force (next-id (delay/pure/stateless right-subtree) - replacement))))))) - (: replace-left (∀ (A B C R) (→ (→ (Promise A) R (Promise C)) - (Promise (Pairof A B)) - R - (Promise (Pairof C B))))) - (define-pure/stateless - #:∀ (A B C R) - (replace-left [next-id : (→ (Promise A) R (Promise C))] - [tree-thunk : (Promise (Pairof A B))] - [replacement : R]) - (delay/pure/stateless - (let ([tree (force tree-thunk)]) - (let ([left-subtree (car tree)] - [right-subtree (cdr tree)]) - (cons (force (next-id (delay/pure/stateless left-subtree) - replacement)) - right-subtree))))) - - (define-for-syntax (define-replace-in-tree low-names names rm-names τ* i depth) - (define/with-syntax name (vector-ref names (sub1 i))) - (define/with-syntax rm-name (vector-ref rm-names (sub1 i))) - (define/with-syntax low-name (vector-ref low-names (sub1 i))) - (define/with-syntax tree-type-with-replacement-name (gensym 'tree-type-with-replacement)) - (define/with-syntax tree-replacement-type-name (gensym 'tree-replacement-type)) - (define τ*-limited (take τ* depth)) - (define τ*-limited+T-next (if (= depth 0) - (list #'T) - (append (take τ* (sub1 depth)) (list #'T)))) - #`(begin - (provide name rm-name) - (define-type (tree-type-with-replacement-name #,@τ*-limited T) - (Promise #,(tree-type-with-replacement i #'T τ*-limited))) - - (: low-name - (∀ (#,@τ*-limited T) - (→ (tree-type-with-replacement-name #,@τ*-limited Any) - T - (tree-type-with-replacement-name #,@τ*-limited T)))) - (define-pure/stateless - #:∀ (#,@τ*-limited T) - (low-name [tree-thunk : (tree-type-with-replacement-name #,@τ*-limited Any)] - [replacement : T]) - : (Promise #,(tree-type-with-replacement i #'T τ*-limited)) - #,<make-replace-in-tree-body>) - - (: name - (∀ (#,@τ*-limited T) - (→ (tree-type-with-replacement-name #,@τ*-limited Any) - T - (tree-type-with-replacement-name #,@τ*-limited (Some T))))) - (define (name tree-thunk replacement) - (low-name tree-thunk (Some replacement))) - - (: rm-name - (∀ (#,@τ*-limited) - (→ (tree-type-with-replacement-name #,@τ*-limited (Some Any)) - (tree-type-with-replacement-name #,@τ*-limited 'NONE)))) - (define (rm-name tree-thunk) - (low-name tree-thunk 'NONE))))] - -@section{Auxiliary values} - -The following sections reuse a few values which are derived from the list of -fields: - -@CHUNK[<utils> - (define all-fields #'(field …)) - (define depth-above (ceiling-log2 (length (syntax->list #'(field …))))) - (define offset (expt 2 depth-above)) - (define i*-above (range 1 (expt 2 depth-above))) - (define names (list->vector - (append (map (λ (i) (format-id #'here "-with-~a" i)) - i*-above) - (stx-map (λ (f) (format-id f "with-~a" f)) - #'(field …))))) - (define rm-names (list->vector - (append (map (λ (i) (format-id #'here "-without-~a" i)) - i*-above) - (stx-map (λ (f) (format-id f "without-~a" f)) - #'(field …))))) - (define low-names (list->vector - (append (map (λ (i) (format-id #'here "-u-with-~a" i)) - i*-above) - (stx-map (λ (f) (format-id f "u-with-~a" f)) - #'(field …)))))] - -@section{Type of a tree-record} - -@CHUNK[<τ-tree-with-fields> - (define-for-syntax (τ-tree-with-fields struct-fields fields) - (define/with-syntax (struct-field …) struct-fields) - (define/with-syntax (field …) fields) - <utils> - ;; Like in convert-from-struct - (define lookup - (make-free-id-table - (for/list ([n (in-syntax all-fields)] - [i (in-naturals)]) - (cons n (+ i offset))))) - (define fields+indices - (sort (stx-map #λ(cons % (free-id-table-ref lookup %)) - #'(struct-field …)) - < - #:key cdr)) - - (define up (* offset 2)) - - ;; Like in convert-fields, but with Pairof - (define (f i) - ;(displayln (list i '/ up (syntax->datum #`#,fields+indices))) - (if (and (pair? fields+indices) (= i (cdar fields+indices))) - (begin0 - `(Some ,(caar fields+indices)) - (set! fields+indices (cdr fields+indices))) - (if (>= (* i 2) up) ;; DEPTH - ''NONE - (begin - `(Pairof ,(f (* i 2)) - ,(f (add1 (* i 2)))))))) - (f 1))] - -@section{Conversion to and from record-trees} - -@CHUNK[<define-struct↔tree> - (define-for-syntax (define-struct↔tree - offset all-fields τ* struct-name fields) - (define/with-syntax (field …) fields) - (define/with-syntax fields→tree-name - (format-id struct-name "~a→tree" struct-name)) - (define/with-syntax tree→fields-name - (format-id struct-name "tree→~a" struct-name)) - (define lookup - (make-free-id-table - (for/list ([n (in-syntax all-fields)] - [i (in-naturals)]) - (cons n (+ i offset))))) - (define fields+indices - (sort (stx-map #λ(cons % (free-id-table-ref lookup %)) - fields) - < - #:key cdr)) - #`(begin - (: fields→tree-name (∀ (field …) - (→ field … - (Promise #,(τ-tree-with-fields #'(field …) - all-fields))))) - (define (fields→tree-name field …) - (delay/pure/stateless - #,(convert-fields (* offset 2) fields+indices))) - - (: tree→fields-name (∀ (field …) - (→ (Promise #,(τ-tree-with-fields #'(field …) - all-fields)) - (Values field …)))) - (define (tree→fields-name tree-thunk) - (define tree (force tree-thunk)) - #,(convert-back-fields (* offset 2) fields+indices))))] - -@subsection{Creating a new tree-record} - -@CHUNK[<convert-fields> - (define-for-syntax (convert-fields up fields+indices) - ;(displayln fields+indices) - (define (f i) - ;(displayln (list i '/ up (syntax->datum #`#,fields+indices))) - (if (and (pair? fields+indices) (= i (cdar fields+indices))) - (begin0 - `(Some ,(caar fields+indices)) - (set! fields+indices (cdr fields+indices))) - (if (>= (* i 2) up) ;; DEPTH - ''NONE - `(cons ,(f (* i 2)) - ,(f (add1 (* i 2))))))) - ;(displayln (syntax->datum #`#,(f 1))) - (f 1))] - - -@subsection{Extracting all the fields from a tree-record} - -We traverse the tree in preorder, and accumulate definitions naming the -interesting subparts of the trees (those where there are fields). - -@CHUNK[<convert-back-fields> - (define-for-syntax (convert-back-fields up fields+indices) - (define result '()) - (define definitions '()) - (define (f i t) - (if (and (pair? fields+indices) (= i (cdar fields+indices))) - (begin0 - (begin - (set! result (cons #`(Some-v #,t) result)) - #t) - (set! fields+indices (cdr fields+indices))) - (if (>= (* i 2) up) ;; DEPTH - #f - (let* ([left-t (string->symbol - (format "subtree-~a" (* i 2)))] - [right-t (string->symbol - (format "subtree-~a" (add1 (* i 2))))] - [left (f (* i 2) left-t)] - [right (f (add1 (* i 2)) right-t)]) - (cond - [(and left right) - (set! definitions (cons #`(define #,left-t (car #,t)) - definitions)) - (set! definitions (cons #`(define #,right-t (cdr #,t)) - definitions)) - #t] - [left - (set! definitions (cons #`(define #,left-t (car #,t)) - definitions)) - #t] - [right - (set! definitions (cons #`(define #,right-t (cdr #,t)) - definitions)) - #t] - [else - #f]))))) - (f 1 #'tree) - #`(begin #,@definitions (values . #,(reverse result))))] - -@section{Defining the converters and accessors for each known record type} - -@CHUNK[<define-trees> - (define-for-syntax (define-trees stx) - (syntax-case stx () - [(bt-fields-id (field …) [struct struct-field …] …) - (let () - <utils> - (define ∀-types (map #λ(format-id #'here "τ~a" %) - (range (add1 depth-above)))) - (define total-nb-functions (vector-length names)) - <define-trees-result>)]))] - -@CHUNK[<bt-fields-type> - (define-for-syntax (bt-fields-type fields) - (λ (stx) - (syntax-case stx () - [(_ . fs) - #`(∀ fs (Promise #,(τ-tree-with-fields #'fs - fields)))])))] - -@CHUNK[<define-trees-result> - #`(begin - (define-type-expander bt-fields-id - (bt-fields-type #'#,(syntax-local-introduce #'(field …)))) - #,@(map #λ(define-replace-in-tree low-names names rm-names ∀-types % (floor-log2 %)) - (range 1 (add1 total-nb-functions))) - #;#,@(map #λ(define-remove-in-tree rm-names ∀-types % (floor-log2 %)) - (range 1 (add1 total-nb-functions))) - #,@(map #λ(define-struct↔tree - offset all-fields ∀-types %1 %2) - (syntax->list #'(struct …)) - (syntax->list #'([struct-field …] …))))] - -@subsection{Putting it all together} - -@chunk[<maybe> - (struct (T) Some ([v : T]) #:transparent) - (define-type (Maybe T) (U (Some T) 'NONE))] - -@chunk[<*> - (require delay-pure - "flexible-with-utils.hl.rkt" - (for-syntax (rename-in racket/base [... …]) - syntax/stx - racket/syntax - racket/list - syntax/id-table - racket/sequence) - (for-meta 2 racket/base)) - - (provide (for-syntax define-trees) - ;; For tests: - (struct-out Some) - - ;;DEBUG: - (for-syntax τ-tree-with-fields) - ) - - <maybe> - <tree-type-with-replacement> - <define-replace-in-tree> - ;<define-remove-in-tree> - <convert-fields> - <convert-back-fields> - <τ-tree-with-fields> - <define-struct↔tree> - <define-trees> - <bt-fields-type>] - -@include-section[(submod "flexible-with-utils.hl.rkt" doc)] -\ No newline at end of file diff --git a/free-identifier-tree-equal.rkt b/free-identifier-tree-equal.rkt @@ -1,91 +0,0 @@ -#lang racket - -(require racket/struct - ;; TODO: move delay-pure/private/immutable-struct to a separate package - delay-pure/private/immutable-struct) ;; for immutable-struct? below. - -(provide free-id-tree=? - free-id-tree-hash-code - free-id-tree-secondary-hash-code - - free-id-tree-table? - immutable-free-id-tree-table? - mutable-free-id-tree-table? - weak-free-id-tree-table? - make-immutable-free-id-tree-table - make-mutable-free-id-tree-table - make-weak-free-id-tree-table) - -;; Contract: -;; TODO: move to tr-immutable -(define isyntax/c - (flat-rec-contract isyntax - (or/c boolean? - char? - number? - keyword? - null? - (and/c string? immutable?) - symbol? - (box/c isyntax #:immutable #t) - (cons/c isyntax isyntax) - (vectorof isyntax #:immutable #t) - (syntax/c isyntax) - (and/c immutable-struct? - prefab-struct-key - (λ (v) - (andmap isyntax/c (struct->list v))))))) - -(define/contract (free-id-tree=? a b [r equal?]) - (-> isyntax/c isyntax/c boolean?) - (define (rec=? a b) (free-id-tree=? a b r)) - (cond - [(identifier? a) (and (identifier? b) - (free-identifier=? a b))] - [(syntax? a) (and (syntax? b) - (rec=? (syntax-e a) - (syntax-e b)))] - [(pair? a) (and (pair? b) - (rec=? (car a) (car b)) - (rec=? (cdr a) (cdr b)))] - [(vector? a) (and (vector? b) - (rec=? (vector->list a) - (vector->list b)))] - [(box? a) (and (box? b) - (rec=? (unbox a) - (unbox b)))] - [(prefab-struct-key a) - => (λ (a-key) - (let ([b-key (prefab-struct-key b)]) - (and (equal? a-key b-key) - (rec=? (struct->list a) - (struct->list b)))))] - [(null? a) (null? b)] - [else (equal? a b)])) - -(define/contract ((free-id-tree-hash hc) a) - (-> (-> any/c fixnum?) (-> isyntax/c fixnum?)) - (define rec-hash (free-id-tree-hash hc)) - (cond - [(identifier? a) (hc (syntax-e #'a))] - [(syntax? a) (rec-hash (syntax-e a))] - [(pair? a) (hc (cons (rec-hash (car a)) - (rec-hash (cdr a))))] - [(vector? a) (hc (list->vector (map rec-hash (vector->list a))))] - [(box? a) (hc (box (rec-hash (unbox a))))] - [(prefab-struct-key a) - => (λ (a-key) - (hc (apply make-prefab-struct a-key - (rec-hash (struct->list a)))))] - [else (hc a)])) - -(define free-id-tree-hash-code - (free-id-tree-hash equal-hash-code)) -(define free-id-tree-secondary-hash-code - (free-id-tree-hash equal-secondary-hash-code)) - -(define-custom-hash-types free-id-tree-table - #:key? syntax? - free-id-tree=? - free-id-tree-hash-code - free-id-tree-secondary-hash-code) diff --git a/graph-info.hl.rkt b/graph-info.hl.rkt @@ -1,347 +0,0 @@ -#lang hyper-literate racket #:no-auto-require - -@require[scribble-math - scribble-enhanced/doc - "notations.rkt" - (for-label racket)] - -@title[#:style (with-html5 manual-doc-style) - #:tag "graph-info" - #:tag-prefix "phc-graph/graph-info"]{Compile-time graph metadata} - -@(chunks-toc-prefix - '("(lib phc-graph/scribblings/phc-graph-implementation.scrbl)" - "phc-graph/graph-info")) - -We define here the compile-time metadata describing a graph type. - -@section{Graph type information} - -The type of a graph is actually the type of its constituent nodes. The node -types may be polymorphic in the @racket[_tvars] type variables. The root node -name and the order of the nodes are purely indicative here, as a reference to -any node in the graph instance would be indistinguishable from a graph rooted -in that node type. - -The @racket[_invariants] are not enforced by the node types. Instead, the node -types just include the invariant type as a witness (inside the @racket[raw] -field). The invariant is enforced either by construction, or with a run-time -check performed during the graph creation. - -@chunk[<graph-info> - (struct+/contract graph-info - ([name identifier?] - [tvars (listof identifier?)] - [root-node identifier?] - [node-order (listof identifier?)] - [nodes (hash/c symbol? node-info? #:immutable #t)] - [invariants (set/c invariant-info? #:kind 'immutable #:cmp 'equal)]) - #:transparent - #:methods gen:custom-write - [(define write-proc (struct-printer 'graph-info))] - #:property prop:custom-print-quotable 'never)] - -@;{ - Since sets created with @racket[set] cannot be used within syntax objects - (they cannot be marshalled into compiled code), we fake sets using hashes with - empty values: - - @chunk[<hash-set/c> - (provide hash-set/c) - (define/contract (hash-set/c elem/c - #:kind [kind 'dont-care] - #:cmp [cmp 'dont-care]) - (->* (chaperone-contract?) - (#:kind (or/c 'dont-care 'immutable 'mutable - 'weak 'mutable-or-weak) - #:cmp (or/c 'dont-care 'equal 'eqv 'eq)) - contract?) - (define immutable - (case kind - [(immutable) #t] - [(dont-care) 'dont-care] - [else #f])) - (define h (hash/c elem/c - null? - #:immutable immutable)) - (define cmp-contracts - (case cmp - [(dont-care) empty] - [(equal) (list hash-equal?)] - [(eqv) (list hash-eqv?)] - [(eq) (list hash-eq?)])) - (define weak-contracts - (case kind - [(weak) (list hash-weak?)] - ;; This is redundant: the mutable check is already included above - [(mutable-or-weak) (list (or/c hash-weak? (not/c immutable?)))] - [(dont-care) empty] - [else (list (not/c hash-weak?))])) - (if (empty? (append cmp-contracts weak-contracts)) - h - (apply and/c (append (list h) cmp-contracts weak-contracts))))] - - @chunk[<hash-set/c> - (provide equal-hash-set/c) - (define/contract (equal-hash-set/c elem/c - #:kind [kind 'dont-care]) - (->* (chaperone-contract?) - (#:kind (or/c 'dont-care 'immutable 'mutable - 'weak 'mutable-or-weak)) - contract?) - (hash-set/c elem/c #:kind kind #:cmp 'equal))] - - @chunk[<hash-set/c> - (provide list->equal-hash-set) - (define/contract (list->equal-hash-set l) - (-> (listof any/c) (equal-hash-set/c any/c #:kind 'immutable)) - (make-immutable-hash (map (λ (v) (cons v null)) l)))] -} - -@section{Graph builder information} - -The information about a graph type is valid regardless of how the graph -instances are constructed, and is therefore rather succinct. - -The @racket[graph-builder-info] @racket[struct] extends this with meaningful -information about graph transformations. Two transformations which have the -same output graph type may use different sets of mapping functions. -Furthermore, the @racket[_dependent-invariants] are invariants relating the -input and output of a graph transformation. - -The @racket[_multi-constructor] identifier refers to a function which takes -@${n} lists of lists of mapping argument tuples, and returns @${n} lists of -lists of nodes. It is the most general function allowing the creation of -instances of the graph. Wrappers which accept a single tuple of arguments and -return the corresponding node can be written based on it. - -@chunk[<graph-builder-info> - (struct+/contract graph-builder-info graph-info - ([name identifier?] - [tvars (listof identifier?)] - [root-node identifier?] - [node-order (listof identifier?)] - [nodes (hash/c symbol? node-info? #:immutable #t)] - [invariants (set/c invariant-info? #:kind 'immutable #:cmp 'equal)]) - ([multi-constructor identifier?] - [root-mapping identifier?] - [mapping-order (listof identifier?)] - [mappings (hash/c symbol? mapping-info? #:immutable #t)] - [dependent-invariants (set/c dependent-invariant-info? - #:kind 'immutable - #:cmp 'equal)]) - #:transparent - #:methods gen:custom-write - [(define write-proc (struct-printer 'graph-builder-info))] - #:property prop:custom-print-quotable 'never)] - -@section{Node information} - -@chunk[<node-info> - (struct+/contract node-info - ([predicate? identifier?] - [field-order (listof identifier?)] - [fields (hash/c symbol? field-info? #:immutable #t)] - [promise-type stx-type/c] - ;; Wrappers can mean that we have incomplete types with fewer - ;; fields than the final node type. - ;[make-incomplete-type identifier?] - ;[incomplete-type identifier?] - ) - #:transparent - #:methods gen:custom-write - [(define write-proc (struct-printer 'node-info))] - #:property prop:custom-print-quotable 'never)] - -@section{Field information} - -A field has a type. - -@chunk[<field-info> - (struct+/contract field-info - ([type stx-type/c]) - #:transparent - #:methods gen:custom-write - [(define write-proc (struct-printer 'field-info))] - #:property prop:custom-print-quotable 'never)] - -@;[incomplete-type identifier?] - -@section{Invariant information} - -@chunk[<invariant-info> - (struct+/contract invariant-info - ([predicate identifier?] ; (→ RootNode Boolean : +witness-type) - [witness-type stx-type/c]) - #:transparent - #:methods gen:custom-write - [(define write-proc (struct-printer 'invariant-info))] - #:property prop:custom-print-quotable 'never - #:methods gen:equal+hash - [(define (equal-proc a b r) - (free-id-tree=? (vector->immutable-vector (struct->vector a)) - (vector->immutable-vector (struct->vector b)))) - (define (hash-proc a r) - (free-id-tree-hash-code - (vector->immutable-vector (struct->vector a)))) - (define (hash2-proc a r) - (free-id-tree-secondary-hash-code - (vector->immutable-vector (struct->vector a))))])] - -@section{Dependent invariant information} - -The invariants described in the previous section assert properties of a graph -instance in isolation. It is however desirable to also describe invariants -which relate the old and the new graph in a graph transformation. - -@chunk[<dependent-invariant-info> - (struct+/contract dependent-invariant-info - ([checker identifier?] ; (→ RootMappingArguments… NewGraphRoot Boolean) - [name identifier?]) - #:transparent - #:methods gen:custom-write - [(define write-proc (struct-printer 'dependent-invariant-info))] - #:property prop:custom-print-quotable 'never - #:methods gen:equal+hash - [(define (equal-proc a b r) - (free-id-tree=? (vector->immutable-vector (struct->vector a)) - (vector->immutable-vector (struct->vector b)))) - (define (hash-proc a r) - (free-id-tree-hash-code - (vector->immutable-vector (struct->vector a)))) - (define (hash2-proc a r) - (free-id-tree-secondary-hash-code - (vector->immutable-vector (struct->vector a))))])] - -@section{Mapping information} - -@chunk[<mapping-info> - (struct+/contract mapping-info - ([mapping-function identifier?] - [with-promises-type identifier?] - [make-placeholder-type identifier?] - [placeholder-type identifier?]) - #:transparent - #:methods gen:custom-write - [(define write-proc (struct-printer 'mapping-info))] - #:property prop:custom-print-quotable 'never)] - -@section{Printing} - -It is much easier to debug graph information if it is free from the visual -clutter of printed syntax objects (which waste most of the screen real estate -printing @tt{#<syntax:/path/to/file}, when the interesting part is the -contents of the syntax object). - -We therefore pre-process the fields, transforming syntax objects into regular -data. - -@chunk[<printer> - (define (to-datum v) - (syntax->datum (datum->syntax #f v))) - - (define ((syntax-convert old-print-convert-hook) - val basic-convert sub-convert) - (cond - [(set? val) - (cons 'set (map sub-convert (set->list val)))] - [(and (hash? val) (immutable? val)) - (cons 'hash - (append-map (λ (p) (list (sub-convert (car p)) - (sub-convert (cdr p)))) - (hash->list val)))] - [(syntax? val) - (list 'syntax (to-datum val))] - [else - (old-print-convert-hook val basic-convert sub-convert)])) - - (define ((struct-printer ctor) st port mode) - (match-define (vector name fields ...) (struct->vector st)) - (define-values (info skipped?) (struct-info st)) - (define-values (-short-name _2 _3 _4 _5 _6 _7 _8) - (struct-type-info info)) - (define short-name (or ctor -short-name)) - (define (to-datum v) - (syntax->datum (datum->syntax #f v))) - (case mode - [(#t) - (display "#(" port) - (display name port) - (for-each (λ (f) - (display " " port) - (write (to-datum f) port)) - fields) - (display ")" port)] - [(#f) - (display "#(" port) - (display name port) - (for-each (λ (f) - (display " " port) - (display (to-datum f) port)) - fields) - (display ")" port)] - [else - (let ([old-print-convert-hook (current-print-convert-hook)]) - (parameterize ([constructor-style-printing #t] - [show-sharing #f] - [current-print-convert-hook - (syntax-convert old-print-convert-hook)]) - (write - (cons short-name - (map print-convert - ;; to-datum doesn't work if I map it on the fields? - fields)) - port)))]))] - -@CHUNK[<*> - (require phc-toolkit/untyped - type-expander/expander - racket/struct - mzlib/pconvert - "free-identifier-tree-equal.rkt" - (for-syntax phc-toolkit/untyped - syntax/parse - syntax/parse/experimental/template - racket/syntax)) - - (define-syntax/parse - (struct+/contract name {~optional parent} - {~optional ([parent-field parent-contract] ...)} - ([field contract] ...) - {~optional {~and transparent #:transparent}} - (~and {~seq methods+props ...} - (~seq (~or {~seq #:methods _ _} - {~seq #:property _ _}) - ...))) - #:with name/c (format-id #'name "~a/c" #'name) - ;(quasisyntax/loc (stx-car this-syntax) - ; #, - (template - (begin - (struct name (?? parent) (field ...) - (?? transparent) - methods+props ...) - (define name/c - (struct/c name - (?? (?@ parent-contract ...)) - contract ...)) - (module+ test - (require rackunit) - (check-pred flat-contract? name/c)) - (provide name/c - (contract-out (struct (?? (name parent) name) - ((?? (?@ [parent-field parent-contract] - ...)) - [field contract] - ...))))))) - - ;<hash-set/c> - <printer> - - <field-info> - <node-info> - <invariant-info> - <dependent-invariant-info> - <graph-info> - <mapping-info> - <graph-builder-info>] diff --git a/graph-type.hl.rkt b/graph-type.hl.rkt @@ -1,144 +0,0 @@ -#lang aful/unhygienic hyper-literate typed/racket #:no-auto-require - -@require[scribble-math - scribble-enhanced/doc - "notations.rkt" - (for-label racket)] - -@title[#:style (with-html5 manual-doc-style) - #:tag "graph-type" - #:tag-prefix "phc-graph/graph-type"]{Declaring graph types} - -@(chunks-toc-prefix - '("(lib phc-graph/scribblings/phc-graph-implementation.scrbl)" - "phc-graph/graph-type")) - -The @racket[define-graph-type] form binds @racket[name] to a -@racket[graph-info] struct. The @racket[name] therefore contains metadata -describing among other things the types of nodes, the invariants that -instances of this graph type will satisfy. - -@chunk[<signature> - (begin-for-syntax - (define-syntax-class signature - #:datum-literals (∈ ∋ ≡ ≢ ∉) - #:literals (:) - (pattern - (~no-order {~once name} - {~maybe #:∀ (tvar …)} - {~once (~and {~seq (nodeᵢ:id [fieldᵢⱼ:id : τᵢⱼ:type] - …) …} - {~seq [root-node . _] _ …})} - {~seq #:invariant a {~and op {~or ∈ ∋ ≡ ≢ ∉}} b} - {~seq #:invariant p}))))] - -@section{Implementation} - -The @racket[define-graph-type] macro expands to code which defines names for -the node types. It then binds the given @racket[name] to the -@racket[graph-info] instance built by @racket[build-graph-info]. - -@CHUNK[<define-graph-type> - (begin-for-syntax - (define-template-metafunction (!check-remembered-node! stx) - (syntax-case stx () - [(_ nodeᵢ fieldᵢⱼ …) - (syntax-local-template-metafunction-introduce - (check-remembered-node! #'(nodeᵢ fieldᵢⱼ …)))]))) - - (define-syntax/parse (define-graph-type . {~and whole :signature}) - ;; fire off the eventual delayed errors added by build-graph-info - (lift-maybe-delayed-errors) - #`(begin - <declare-node-types> - (define-syntax name - (build-graph-info (quote-syntax whole)))))] - -@section{Declaring the node types} - -@chunk[<declare-node-types> - (define-type nodeᵢ - (Promise - ((!check-remembered-node! nodeᵢ fieldᵢⱼ …) τᵢⱼ … - 'Database - 'Index))) - …] - -@section{Creating the @racket[graph-info] instance} - -@CHUNK[<build-graph-info> - (define-for-syntax (build-graph-info stx) - (parameterize ([disable-remember-immediate-error #t]) - (syntax-parse stx - [:signature - <graph-info>])))] - -@chunk[<graph-info> - (graph-info #'name - (syntax->list (if (attribute tvar) #'(tvar …) #'())) - #'root-node - (syntax->list #'(nodeᵢ …)) - (make-immutable-hash - (map cons - (stx-map syntax-e #'(nodeᵢ …)) - (stx-map (λ/syntax-case (nodeᵢ node-incompleteᵢ - [fieldᵢⱼ τᵢⱼ] …) () - <node-info>) - #'([nodeᵢ node-incompleteᵢ - [fieldᵢⱼ τᵢⱼ] …] …)))) - (list->set - (append - (stx-map (λ/syntax-case (op a b) () <invariant-info-op>) - #'([op a b] …)) - (stx-map (λ/syntax-case p () <invariant-info-p>) - #'(p …)))))] - -@chunk[<node-info> - (node-info (meta-struct-predicate - (check-remembered-node! #'(nodeᵢ fieldᵢⱼ …))) - (syntax->list #'(fieldᵢⱼ …)) - (make-immutable-hash - (map cons - (stx-map syntax-e #'(fieldᵢⱼ …)) - (stx-map (λ/syntax-case (fieldᵢⱼ τᵢⱼ) () - <field-info>) - #'([fieldᵢⱼ τᵢⱼ] …)))) - #'nodeᵢ ; promise type - #;(meta-struct-constructor - (check-remembered-tagged! #'(node-incompleteᵢ fieldᵢⱼ …))) - #;(check-remembered-tagged! #'(node-incompleteᵢ fieldᵢⱼ …)))] - -@chunk[<field-info> - (field-info #'τᵢⱼ)] - -@chunk[<invariant-info-op> - (invariant-info #'predicateTODO - #'witnessTODO)] - -@chunk[<invariant-info-p> - (invariant-info #'predicateTODO - #'witnessTODO)] - -@section{Putting it all together} - -@chunk[<*> - (require racket/require - phc-toolkit - remember - (lib "phc-adt/tagged-structure-low-level.hl.rkt") - (for-syntax "graph-info.hl.rkt" - type-expander/expander - phc-toolkit/untyped - (subtract-in syntax/parse phc-graph/subtemplate) - racket/set - phc-graph/subtemplate-override - racket/syntax - extensible-parser-specifications - backport-template-pr1514/experimental/template) - (for-meta 2 racket/base)) - - (provide define-graph-type) - - <signature> - <build-graph-info> - <define-graph-type>] -\ No newline at end of file diff --git a/graph.hl.rkt b/graph.hl.rkt @@ -1,119 +0,0 @@ -#lang hyper-literate typed/racket/base #:no-auto-require -@(require scribble-math - racket/require - scribble-enhanced/doc - racket/require - hyper-literate - (subtract-in scribble/struct scribble-enhanced/doc) - scribble/decode - (for-label racket/format - racket/promise - racket/list - type-expander - (except-in (subtract-in typed/racket/base type-expander) - values) - (only-in racket/base values) - (subtract-in racket/contract typed/racket/base) - phc-toolkit - phc-toolkit/untyped-only - remember)) -@(unless-preexpanding - (require (for-label (submod "..")))) -@doc-lib-setup - -@title[#:style (with-html5 manual-doc-style) - #:tag "graph-impl" - #:tag-prefix "phc-graph/graph-impl"]{Implementation of the graph macro} - -@(chunks-toc-prefix - '("(lib phc-graph/scribblings/phc-graph-implementation.scrbl)" - "phc-graph/graph-impl")) - - -@chunk[<graph> - (define-syntax define-graph - (syntax-parser - [<signature> - <implementation>]))] - -@chunk[<signature> - (_ _name - [[_nodeᵢ [_fieldᵢⱼ :colon _τᵢⱼ] …] …] - [[(_mappingₖ [_argₖₗ _τₖₗ] …) :colon _return-typeₖ . _bodyₖ] …])] - -@chunk[<implementation> - #'()] - -@section{Overview of the implementation (draft)} - -@chunk[<implementation-draft> - <create-Qₖ> - <re-bind-mappings> - <define-indices> - <process-queues>] - -@chunk[<define-indices> - (define/with-syntax (_indexₖ …) (stx-map gensym #'(_idxₖ …))) - #'(begin - (define-type _indexₖ (graph-index '_indexₖ)) - …)] - -@chunk[<define-index> - (struct (K) graph-index ([key : K] [index : Index]))] - -Create one queue @racket[_Qₖ] for each mapping: - -@chunk[<create-Qₖ> - #'(begin - (define _Qₖ <create-queue>) - (define _Qₖ-enqueue <TODO>) - (define _Qₖ-pop <TODO>) - …)] - -Re-bind mappings to catch outbound calls: - -@chunk[<re-bind-mappings> - #'(let ([_mappingₖ _make-placeholderₖ] …) - . bodyₖ)] - -Define functions which enqueue into a given @racket[_Qₖ] and start processing. -The final @racket[_name] macro dispatches to these functions. - -@chunk[<entry-pointₖ> - #'(begin - (define (_entry-pointₖ _argₖₗ …) - (entry-point #:mappingₖ (list (list _argₖₗ …)))) - …)] - -These are based upon the main @racket[entry-point], which takes any number of -initial elements to enqueue, and processes the queues till they are all empty. - -@chunk[<entry-point> - #'(define (entry-point #:mappingₖ [_argsₖ* : (Listof (List τₖₗ …)) '()]) - (for ([_argsₖ (in-list _argsₖ*)]) - (let-values ([(_argₖₗ …) _argsₖ]) - (Qₖ-enqueue _argₖₗ …))))] - -@chunk[<process-queues> - (until queues are all empty - process item, see below)] - -@itemlist[ - @item{Find and replace references to old nodes and new incomplete nodes and - new placeholder nodes, instead insert indices.} - @item{Problem: we need to actually insert indices for references to nodes, - not for references to mappings (those have to be inlined).}] - - -@chunk[<*> - (require racket/require - (for-syntax (subtract-in (combine-in racket/base - syntax/parse) - "subtemplate-override.rkt") - phc-toolkit/untyped - type-expander/expander - "subtemplate-override.rkt") - "traversal.hl.rkt" - phc-toolkit) - <define-index> - <graph>] -\ No newline at end of file diff --git a/info.rkt b/info.rkt @@ -1,32 +0,0 @@ -#lang info -(define collection "phc-graph") -(define deps '("base" - "rackunit-lib" - "phc-toolkit" - "phc-adt" - "type-expander" - "hyper-literate" - "scribble-enhanced" - "typed-racket-lib" - "srfi-lite-lib" - "delay-pure" - "backport-template-pr1514" - "typed-map" - "scribble-lib" - "pconvert-lib" - "remember" - "extensible-parser-specifications")) -(define build-deps '("scribble-lib" - "racket-doc" - "remember" - "typed-racket-doc" - "aful" - "scribble-math")) -(define scribblings - '(("scribblings/phc-graph.scrbl" () - ("Data Structures")) - ("scribblings/phc-graph-implementation.scrbl" (multi-page) - ("Data Structures")))) -(define pkg-desc "Description Here") -(define version "0.0") -(define pkg-authors '("Georges Dupéron")) diff --git a/invariants-phantom.hl.rkt b/invariants-phantom.hl.rkt @@ -1,483 +0,0 @@ -#lang aful/unhygienic hyper-literate type-expander/lang - -@require[scribble-math - scribble-enhanced/doc - "notations.rkt"] - -@title[#:style (with-html5 manual-doc-style) - #:tag "inv-phantom" - #:tag-prefix "phc-graph/inv-phantom"]{Tracking checked contracts - via refinement types} - -@(chunks-toc-prefix - '("(lib phc-graph/scribblings/phc-graph-implementation.scrbl)" - "phc-graph/inv-phantom")) - -@section{Introduction} - -The cautious compiler writer will no doubt want to check that the graph used -to represent the program verifies some structural properties. For example, the -compiled language might not allow cycles between types. Another desirable -property is that the @racket[in-method] field of an instruction points back to -the method containing it. We will use this second property as a running -example in this section. - -@section{Implementation overview : subtyping, variance and phantom types} - -It is possible to express with Typed/Racket that a @racket[Method] should -contain a list of @racket[Instruction]s, and that @racket[Instruction]s should -point to a @racket[Method]@note{We are not concerned here about the ability to - create such values, which necessarily contain some form of cycle. The goal of - the graph library is indeed to handle the creation and traversal of such - cyclic data structures in a safe way}: - -@chunk[<invariant-1> - (struct Instruction ([opcode : Byte] - [in-method : Method])) - (struct Method ([body : (Listof Instruction)]))] - -This type does not, however, encode the fact that an instruction should point -to the method containing it. Typed/Racket does not really have a notion of -singleton types, aside from symbols and other primitive data. It also lacks a -way to type "the value itself" (e.g. to describe a single-field structure -pointing to itself, possibly via a @racket[Promise]). This means that the -property could only be expressed in a rather contrived way, if it is at all -possible. - -@; (define-type Self-Loop (∀ (A) (→ (Pairof Integer (Self-Loop A))))) - -We decide to rely instead on a run-time check, i.e. a sort of contract which -checks the structural invariant on the whole graph. In order to let the -type-checker know whether a value was checked against that contract or not, we -include within the node a phantom type which is used as a flag, indicating -that the graph was checked against that contract. This phantom type in a sense -refines the node type, indicating an additional property (which, in our case, -is not checked at compile-time but instead enforced at run-time). - -@chunk[<invariant-2> - (struct (Flag) Instruction ([opcode : Byte] - [in-method : (Method Flag)])) - (struct (Flag) Method ([body : (Listof (Instruction Flag))]))] - -We would then write a function accepting a @racket[Method] for which the -contract @racket[method→instruction→same-method] was checked like this: - -@chunk[<invariant-2-use> - (λ ([m : (Method 'method→instruction→same-method)]) - …)] - -Unfortunately, this attempt fails to catch errors as one would expect, because -Typed/Racket discards unused polymorphic arguments, as can be seen in the -following example, which type-checks without any complaint: - -@chunk[<phantom-types-ignored> - (struct (Phantom) S ([x : Integer])) - (define inst-sa : (S 'a) (S 1)) - (ann inst-sa (S 'b))] - -We must therefore make a field with the @racket[Flag] type actually appear -within the instance: - -@chunk[<invariant-3> - (struct (Flag) Instruction ([opcode : Byte] - [in-method : (Method Flag)] - [flag : Flag])) - (struct (Flag) Method ([body : (Listof (Instruction Flag))] - [flag : Flag]))] - -Another issue is that the flag can easily be forged. We would therefore like -to wrap it in a struct type which is only accessible by the graph library: - -@chunk[<invariant-4> - (struct (Flag) Flag-Wrapper-Struct ([flag : Flag])) - (define-type Flag-Wrapper Flag-Wrapper-Struct) - (code:comment "provide only the type, not the constructor or accessor") - (provide Flag-Wrapper)] - -We would like to be able to indicate that a graph node has validated several -invariants. For that, we need a way to represent the type of a "set" of -invariant witnesses. We also want some subtyping relationship between the -sets: a set @${s₁} with more invariant witnesses should be a subtype of a -subset @${s₂ ⊆ s₁}. We can order the invariant witnesses and use @racket[Rec] -to build the type of a list of invariant witnesses, where some may be missing: - -@chunk[<invariant-set-as-List+Rec> - (define-type At-Least-InvB+InvD - (Rec R₁ (U (Pairof Any R₁) - (Pairof 'InvB (Rec R₂ (U (Pairof Any R₂) - (Pairof 'InvD (Listof Any))))))))] - -@chunk[<invariant-set-as-List+Rec-use> - (ann '(InvA InvB InvC InvD InvE) At-Least-InvB+InvD) - (ann '(InvB InvD) At-Least-InvB+InvD) - (code:comment "Rejected, because it lacks 'InvD") - (code:comment "(ann '(InvB InvC InvE) At-Least-InvB+InvD)") - (code:comment "The elements must be in the right order,") - (code:comment "this would be rejected by the typechecker:") - (code:comment "(ann '(InvD InvB) At-Least-InvB+InvD)")] - -Another solution is to group the witnesses in an untagged union with -@racket[U], and place it in a contravariant position: - -@chunk[<invariant-set-as-contravariant-U> - (define-type At-Least-InvB+InvD - (→ (U 'InvB 'InvD) Void))] - -In the case where no invariant is present in the untagged union, the type -@racket[(U)] a.k.a @racket[Nothing], the bottom type with no value, would -appear. This type is somewhat pathological and allows absurd reasoning (a -function accepting @racket[Nothing] can never be called, which may incite the -type checker to perform excessive elision). To avoid any pitfalls, we will -systematically include a dummy element @racket[Or] in the union, to make sure -the union never becomes empty. - -This solution also has the advantage that the size of the run-time witness is -constant, and does not depend on the number of checked contracts (unlike the -representation using a list). In practice the function should never be called. -It can however simply be implemented in a way which pleases the type checked -as a function accepting anything and returning void. - -In addition to testifying that a graph node was checked against multiple, -separate contracts, there might be some contracts which check stronger -properties than others. A way to encode this relationship in the type system -is to have subtyping relationships between the contract witnesses, so that -@; TODO: get rid of the textit -@${\textit{P}₁(x) ⇒ \textit{P}₂(x) ⇒ \textit{Inv}₁ @texsubtype \textit{Inv}₂}: - -@chunk[<invariant-contract-subtyping> - (struct InvWeak ()) - (struct InvStrong InvWeak ())] - -If the witnesses must appear in a contravariant position (when using -@racket[U] to group them), the relationship must be reversed: - -@chunk[<invariant-contract-subtyping> - (struct InvStrongContra ()) - (struct InvWeakContra InvStrongContra ())] - -Alternatively, it is possible to use a second contravariant position to -reverse the subtyping relationship again: - -@chunk[<invariant-contract-subtyping> - (struct InvWeak ()) - (struct InvStrong InvWeak ()) - - (define InvWeakContra (→ InvWeak Void)) - (define InvStrongContra (→ InvStrong Void))] - -Finally, we note that the invariants should always be represented using a -particular struct type, instead of using a symbol, so that name clashes are -not a problem. - -@section{Encoding property implication as subtyping} - -The witness for a strong property should be a subtype of the witness for a -weaker property. This allows a node with a strong property to be passed where -a node with a weaker property is passed. - -@chunk[<structural-draft> - (code:comment "Draft ideas") - - (struct ∈ ()) - (struct ≡ ()) - (struct ∉ ()) - - ;(List Rel From Path1 Path2) - (List ≡ ANodeName (List f1 f2) (List)) - (List ∈ ANodeName (List f1 f2) (List)) - (List ∉ ANodeName (List f1 f2) (List)) - (List ∉ ANodeName (List (* f1 f2 f3 f4) (* f5 f6)) (List)) - - ;(List From Path+Rel) - (List ANodeName (List f1 f2 ≡)) - (List ANodeName (List f1 f2 ∈)) - (List ANodeName (List f1 f2 ∉)) - (List ANodeName (List (List f1 ∉) - (List f2 ∉) - (List f3 ∉) - (List f4 - (List f5 ∉) - (List f6 ∉)))) - - ;; How to make it have the right kind of subtyping? - - - ] - -@subsection{Properties applying to all reachable nodes from @racket[x]} - -The property @racket[x ≢ x.**] can be expanded to a series of properties. For -example, if @racket[x] has two fields @racket[a] and @racket[d], the former -itself having two fields @racket[b] and @racket[c], and the latter having a -field @racket[e], itself with a field @racket[f]: -@chunk[<expanded-path-set> - (x ≢ x.a) - (x ≢ x.a.b) - (x ≢ x.a.c) - (x ≢ x.d) - (x ≢ x.d.e) - (x ≢ x.d.e.f)] - -@subsection{Prefix trees to the rescue} - -This expanded representation is however costly, and can be expressed more -concisely by factoring out the prefixes. - -@chunk[<prefixes> - (x ≢ (x (a (b) (c)) - (d (e (f)))))] - -One thing which notably cannot be represented concisely in this way is -@racket[x.a.** ≢ x.b.**], meaning that the subgraphs rooted at @racket[x.a] -and @racket[x.b] are disjoint. It would be possible to have a representation -combining a prefix-tree on the left, and a prefix-tree on the right, implying -the cartesian product of both sets of paths. This has a negligible cost in the -size of the type for the case where one of the members of the cartesian -product, as we end up with the following (the left-hand-side @racket[x] gains -an extra pair of parentheses, because it is now an empty tree): - -@chunk[<prefixes> - ((x) ≢ (x (a (b) (c)) - (d (e (f)))))] - -This does not allow concise expression of all properties, i.e. this is a form -of compression, which encodes concisely likely sets of pairs of paths, but is -of little help for more random properties. For example, if a random subset of -the cartesian product of reachable paths is selected, there is no obvious way -to encode it in a significantly more concise way than simply listing the pairs -of paths one by one. - -@subsection{Cycles in properties} - -If a @racket[**] path element (i.e. a set of paths representing any path of -any length) corresponds to a part of the graph which contains a cycle in the -type, it is necessary to make that cycle appear in the expanded form. For -that, we use @racket[Rec]. Supposing that the node @racket[x] has two fields, -@racket[a] and @racket[c], the first itself having a field @racket[b] of type -@racket[x]. We would expand @racket[x.**] to the following shape: - -@racket[(Rec X (≢ (Node0 'x) - (Node2 'x - (Field1 'a (Field1 'b (Field1 X))) - (Field1 'c))))] - -If one of the fields refers not to the root, but to - -TODO: distinction between root nodes and fields in the path. Add an @racket[ε] -component at the root of each path? - -@subsection{Partial paths} - -Partial paths: if a property holds between @racket[x.a] and @racket[x.b], then -it is stronger than a property which holds between @racket[y.fx.a] and -@racket[y.fx.b] (i.e. the common prefix path narrows down the set of pairs of -values which are related by the property). - -A possible solution idea: mask the "beginning" of the path with a @racket[∀] -or @racket[Any]. Either use -@racket[(Rec Ign (U (Field1 Any Ign) Actual-tail-of-type))], or reverse the -``list'', so that one writes @racket[(Field1 'b (Field1 'a Any))], i.e. we -have @racket[(Field1 field-name up)] instead of -@racket[(Field1 field-name children)]. The problem with the reversed version -is that two child fields @racket[b] and @racket[c] need to refer to the same -parent @racket[a], which leads to duplication or naming (in the case of -naming, Typed/Racket tends to perform some inlining anyway, except if tricks -are used to force the type to be recursive (in which case the subtyping / type -matching is less good and fails to recognise weaker or equivalent formulations -of the type)). The problem with the @racket[Rec] solution for an ignored head -of any length is that the number of fields is not known in advance (but -hopefully our representation choices to allow weaker properties with missing -fields could make this a non-problem?). - -@subsection{Array and list indices} - -When a path reaches an array, list, set or another similar collection, the -special path element @racket[*] can be used to indicate ``any element in the -array or list''. Specific indices can be indicated by an integer, or for lists -with @racket[car], @racket[first], @racket[second], @racket[third] and so on. -The special path elements @racket[cdr] and @racket[rest] access the rest of -the list, i.e. everything but the first element. - -@subsection{Other richer properties} - -Other richer properties can be expressed, like -@racket[x.len = (length x.somelist)]. This property calls some racket -primitives (@racket[length]), and compares numeric values. However, we do not -attempt to make the type checker automatically recognise weaker or equivalent -properties. Instead, we simply add to the phantom type a literal description -of the checked property, which will only match the same exact property. - -@section{Implementation} - -@subsection{The witness value} - -Since all witnesses will have a type of the form -@racket[(→ (U (→ invᵢ Void) …) Void)], they can all be represented at run-time -by a single value: a function accepting any argument and returning -@racket[Void]. Note that the type of the witness is normally a phantom type, -and an actual value is supplied only because Typed/Racket drops phantom types -before typechecking, as mentioned earlier. - -@chunk[<witness-value> - (: witness-value (→ Any Void)) - (define witness-value (λ (x) (void)))] - -@subsection{Grouping multiple invariants} - -As mentioned earlier, we group invariants together using an untagged union -@racket[U], which must appear in a contravariant position. We wish to express -witnesses for stronger invariants as subtypes of witnesses for weaker -invariants, and therefore use a second nested function type to flip again the -variance direction. We always include the Or element in the union, to avoid -having an empty union. - -@chunk[<grouping-invariants> - (struct Or ()) - (define-type-expander (Invariants stx) - (syntax-case stx () - [(_ invᵢ …) - #'(→ (U Or (→ invᵢ Void) …) Void) - #;#'(→ (→ (∩ invᵢ …) Void) Void)]))] - -@subsection{Structural (in)equality and (non-)membership invariants} - -@subsubsection{Comparison operator tokens} - -We define some tokens which will be used to identify the operator which -relates two nodes in the graph. - -@chunk[<comparison-operators> - (struct (A) inv≡ ([a : A])) - (struct (A) inv≢ ([a : A])) - ;(struct inv∈ ()) ;; Can be expressed in terms of ≡ - ;(struct inv∉ ()) ;; Can be expressed in terms of ≢ - ] - -@CHUNK[<≡> - (define-for-syntax (relation inv) - (syntax-parser - [(_ (pre-a … {~literal _} post-a …) - (pre-b … {~literal _} post-b …)) - #:with (r-pre-a …) (reverse (syntax->list #'(pre-a …))) - #:with (r-pre-b …) (reverse (syntax->list #'(pre-b …))) - ;; Use U to make it order-independent - #`(#,inv (U (Pairof (Cycle r-pre-a …) - (Cycle post-a …)) - (Pairof (Cycle r-pre-b …) - (Cycle post-b …))))])) - - (define-type-expander ≡ (relation #'inv≡)) - (define-type-expander ≢ (relation #'inv≢))] - -@chunk[<cycles> - (struct ε () #:transparent) - (struct (T) Target () #:transparent) - (struct (T) NonTarget Target ([x : T]) #:transparent) - - (define-type-expander Cycle - (syntax-parser - [(_ field:id … {~literal ↙} loop1:id … (target:id) loop2:id …) - #'(List* (NonTarget ε) - (NonTarget 'field) … - (Rec R (List* (NonTarget 'loop1) … ;(NonTarget 'loop1) … - (Target 'target) ;(NonTarget 'target) - (NonTarget 'loop2) … ;(NonTarget 'loop2) … - R)))] - [(_ field … target) - ;; TODO: something special at the end? - #'(List (NonTarget ε) (NonTarget 'field) … (Target 'target))] - [(_) - #'(List (Target ε))]))] - -@;{@[ - - ;.a.b = .x.y - ;(l1=a ∧ l2=b ∧ r1=x ∧ r2=y) ⇒ eq - ;¬(l1=a ∧ l2=b ∧ r1=x ∧ r2=y) ∨ eq - ;¬l1=a ∨ ¬l2=b ∨ ¬r1=x ∨ ¬r2=y ∨ eq - - ;.a.c = .x.y - ;(l1=a ∧ l2=c ∧ r1=x ∧ r2=y) ⇒ eq - - ;.a.c = .x.z - ;(l1=a ∧ l2=b ∧ r1=x ∧ r2=z) ⇒ eq - ;¬l1=a ∨ ¬l2=b ∨ ¬r1=x ∨ ¬r2=z ∨ eq - - - ;.a.b = .x.y ∧ .a.c = .x.z - ;(¬l1=a ∨ ¬l2=b ∨ ¬r1=x ∨ ¬r2=y ∨ eq) ∧ (¬l1=a ∨ ¬l2=b ∨ ¬r1=x ∨ ¬r2=z ∨ eq) - ;¬¬(¬l1=a ∨ ¬l2=b ∨ ¬r1=x ∨ ¬r2=y ∨ eq) ∧ (¬l1=a ∨ ¬l2=b ∨ ¬r1=x ∨ ¬r2=z ∨ eq) - ;¬(l1=a ∧ l2=b ∧ r1=x ∧ r2=y ∧ eq) ∨ (l1=a ∧ l2=b ∧ r1=x ∧ r2=z ∧ ¬eq) - ]} - -@; Problem with ∩: it factors out too much, (∩ '(a . b) '(a . c) '(x . b)) -@; becomes (Pairof (∩ 'a 'x) (∩ 'b 'c)), which is equivalent to have all four -@; elements of {a,x} × {b,c}, but we only want three out of these four. - -Two sorts of paths inside (in)equality constraints: - -@itemlist[ - @item{those anchored on a node, stating that - @$${ - ∀\ \textit{node} : \textit{NodeType},\quad - \textit{node}.\textit{path}₁ ≡ \textit{node}.\textit{path}₂}} - @item{those not anchored on a node, stating that - @$${ - \begin{array}{c} - ∀\ \textit{node}₁ : \textit{NodeType}₁,\quad - ∀\ \textit{node}₂ : \textit{NodeType}₂,\\ - \textit{node}₁.\textit{path}₁ ≡ \textit{node}₂.\textit{path}₂ - \end{array}}}] - -@subsection{Putting it all together} - -@chunk[<check-a-stronger-b> - (define-syntax (check-a-stronger-or-same-b stx) - (syntax-case stx () - [(_ stronger weaker) - (syntax/top-loc stx - (check-ann (ann witness-value stronger) - weaker))])) - - (define-syntax (check-a-same-b stx) - (syntax-case stx () - [(_ a b) - (syntax/top-loc stx - (begin - (check-ann (ann witness-value a) b) - (check-ann (ann witness-value b) a)))]))] - -@chunk[<*> - (require (for-syntax phc-toolkit/untyped - syntax/parse)) - - <witness-value> - <grouping-invariants> - <cycles> - <comparison-operators> - <≡> - - (module+ test - (require phc-toolkit) - <check-a-stronger-b> - - (ann witness-value (Invariants)) ;; No invariants - (ann witness-value (Invariants (≡ (_ a) (_ a b c)))) - - (check-a-stronger-or-same-b (Invariants (≡ (_ a) (_ a b c))) - (Invariants)) - - (check-a-same-b (Invariants (≡ (_ a) (_ a b c))) - (Invariants (≡ (_ a b c) (_ a)))) - - (check-a-stronger-or-same-b (Invariants (≡ (_) (_ b c)) - (≡ (_) (_ b d))) - (Invariants (≡ (_) (_ b c)))) - (check-a-stronger-or-same-b (Invariants (≡ (_) (_ b d)) - (≡ (_) (_ b c))) - (Invariants (≡ (_) (_ b c)))) - - (check-a-stronger-or-same-b (Invariants (≡ (_) - (_ b d a b d ↙ a b (d)))) - (Invariants (≡ (_) - (_ b d ↙ a b (d))))))] diff --git a/main.rkt b/main.rkt @@ -1,35 +0,0 @@ -#lang racket/base - -(module+ test - (require rackunit)) - -;; Notice -;; To install (from within the package directory): -;; $ raco pkg install -;; To install (once uploaded to pkgs.racket-lang.org): -;; $ raco pkg install <<name>> -;; To uninstall: -;; $ raco pkg remove <<name>> -;; To view documentation: -;; $ raco docs <<name>> -;; -;; For your convenience, we have included a LICENSE.txt file, which links to -;; the GNU Lesser General Public License. -;; If you would prefer to use a different license, replace LICENSE.txt with the -;; desired license. -;; -;; Some users like to add a `private/` directory, place auxiliary files there, -;; and require them in `main.rkt`. -;; -;; See the current version of the racket style guide here: -;; http://docs.racket-lang.org/style/index.html - -;; Code here - -(module+ test - ;; Tests to be run with raco test - ) - -(module+ main - ;; Main entry point, executed when run with the `racket` executable or DrRacket. - ) diff --git a/notations.rkt b/notations.rkt @@ -1,7 +0,0 @@ -#lang racket - -(require scribble/base) - -(provide texsubtype) - -(define texsubtype "<:") -\ No newline at end of file diff --git a/scribblings/phc-graph-implementation.scrbl b/scribblings/phc-graph-implementation.scrbl @@ -1,19 +0,0 @@ -#lang scribble/manual -@require[@for-label[phc-graph - racket/base]] - -@title{Ph.C Graph library: Implementation} -@author[@author+email["Georges Dupéron" "georges.duperon@gmail.com"]] - -This library is implemented using literate programming. The implementation -details are presented in the following sections. The user documentation is in -the @other-doc['(lib "phc-graph/scribblings/phc-graph.scrbl")] document. - -@(table-of-contents) - -@include-section[(submod "../traversal.hl.rkt" doc)] -@include-section[(submod "../flexible-with.hl.rkt" doc)] -@include-section[(submod "../invariants-phantom.hl.rkt" doc)] -@include-section[(submod "../graph-info.hl.rkt" doc)] -@include-section[(submod "../graph-type.hl.rkt" doc)] -@include-section[(submod "../graph.hl.rkt" doc)] -\ No newline at end of file diff --git a/scribblings/phc-graph.scrbl b/scribblings/phc-graph.scrbl @@ -1,14 +0,0 @@ -#lang scribble/manual -@require[@for-label[phc-graph - racket/base]] - -@title{Ph.C Graph library} -@author[@author+email["Georges Dupéron" "georges.duperon@gmail.com"]] - -This library is implmented using literate programming. The -implementation details are presented in -@other-doc['(lib "phc-graph/scribblings/phc-graph-implementation.scrbl")]. - -@defmodule[phc-graph] - -Package Description Here diff --git a/test/adt-pre-declarations.rkt b/test/adt-pre-declarations.rkt @@ -1,17 +0,0 @@ -#lang s-exp phc-adt/declarations -(remembered! tagged-structure (tg a b)) -(remembered! tagged-structure (tg a c)) -(remembered! tagged-structure (t0)) -(remembered! tagged-structure (City citizens name streets)) -(remembered! tagged-structure (Street houses name)) -(remembered! tagged-structure (House owner)) -(remembered! tagged-structure (Person name)) -(remembered! tagged-structure (node-incompleteᵢ citizens name streets)) -(remembered! tagged-structure (node-incompleteᵢ houses name)) -(remembered! tagged-structure (node-incompleteᵢ owner)) -(remembered! tagged-structure (node-incompleteᵢ name)) -(remembered! tagged-structure (| City-incomplete| citizens name streets)) -(remembered! tagged-structure (| Street-incomplete| houses name)) -(remembered! tagged-structure (| House-incomplete| owner)) -(remembered! tagged-structure (| Person-incomplete| name)) -(remembered! tagged-structure (City name)) diff --git a/test/assumption-equivalent-types-same-type.rkt b/test/assumption-equivalent-types-same-type.rkt @@ -1,49 +0,0 @@ -#lang typed/racket - -;; Check that equivalent type specifications are correctly interpreted as -;; being the same type by Typed/Racket. -;; -;; This was not the case in some situations in older versions of Typed/Racket, -;; but I am not sure whether this reproduces the same issue, or whether this -;; file would typecheck in older versions too. - -(let () - (define-type (Foo X) - (U X (List 'foo (Bar X) (Foo X)))) - - (define-type (Bar Y) - (List 'bar (Foo Y))) - - (define-type (Foo2 X) - (U X (List 'foo (Bar2 X) (Foo2 X)))) - - (define-type (Bar2 Y) - (List 'bar (Foo2 Y))) - - (λ #:∀ (A) ([x : (Foo A)]) - ;; Check here: - (ann (ann x (Foo2 A)) (Foo A))) - - (void)) - -(struct (a b) st-foo ([a : a] [b : b])) -(struct (a) st-bar ([a : a])) - -(let () - (define-type (Foo X) - (U X (st-foo (Bar X) (Foo X)))) - - (define-type (Bar Y) - (st-bar (Foo Y))) - - (define-type (Foo2 X) - (U X (st-foo (Bar2 X) (Foo2 X)))) - - (define-type (Bar2 Y) - (st-bar (Foo2 Y))) - - (λ #:∀ (A) ([x : (Foo A)]) - ;; Check here: - (ann (ann x (Foo2 A)) (Foo A))) - - (void)) -\ No newline at end of file diff --git a/test/ck.rkt b/test/ck.rkt @@ -1,21 +0,0 @@ -#lang typed/racket/base - -(require phc-toolkit - (for-syntax racket/base - syntax/parse - type-expander/expander - phc-toolkit/untyped)) - -(provide check-equal?-values:) - -(define-syntax check-equal?-values: - (syntax-parser - [(_ actual {~maybe :colon type:type-expand!} expected ...) - (quasisyntax/top-loc this-syntax - (check-equal?: (call-with-values (ann (λ () actual) - (-> #,(if (attribute type) - #'type.expanded - #'AnyValues))) - (λ l l)) - (list expected ...)))])) - -\ No newline at end of file diff --git a/test/invariant-phantom-tr-assumptions.rkt b/test/invariant-phantom-tr-assumptions.rkt @@ -1,42 +0,0 @@ -#lang typed/racket - -(struct A ()) -(struct B A ()) -(struct C A ()) - -(: f (→ (U 'x A) Void)) -(define (f _) (void)) - -(let () - (ann f (→ (U B C) Void)) - (ann f (→ (U 'x B C) Void)) - (ann f (→ (U 'x C) Void)) - (ann f (→ (U 'x A C) Void)) - (ann f (→ (U 'x) Void)) - (ann f (→ (U) Void)) - (void)) - -;;;;;;;;;; - -;; Reverse order (BB, CC and DD are more precise invariants than AA) -(struct AA ()) -(struct BB AA ()) -(struct CC AA ()) -(struct DD AA ()) - -(define-type (Invariant X) (→ X Void)) - -(: g (→ (U (Invariant 'x) (Invariant BB) (Invariant CC)) Void)) -(define (g _) (void)) - -;; Everything works as expected -(let () - (ann g (→ (U (Invariant BB) (Invariant CC)) Void)) - (ann g (→ (U (Invariant 'x) (Invariant BB) (Invariant CC)) Void)) - (ann g (→ (U (Invariant 'x) (Invariant CC)) Void)) - (ann g (→ (U (Invariant 'x)) Void)) - (ann g (→ (U) Void)) - ;; AA works, as it should - (ann g (→ (U (Invariant 'x) (Invariant AA) (Invariant CC)) Void)) - (ann g (→ (U (Invariant 'x) (Invariant AA)) Void)) - (void)) -\ No newline at end of file diff --git a/test/invariant-phantom-tr-assumptions2.rkt b/test/invariant-phantom-tr-assumptions2.rkt @@ -1,69 +0,0 @@ -#lang typed/racket - -(: f (→ (→ (U (Rec R (List (List 'a R) - (List 'b R))) - (Rec R (List (List 'a R) - (List 'c R)))) - Void) - Void)) -(define (f x) (void)) - -(ann f (→ (→ (U (Rec K (List (List 'a K) (List 'c K))) - (Rec W (List (List 'a W) (List 'b W)))) - Void) Void)) - -(ann f (→ (→ (U (Rec W (List (List 'a W) (List 'b W))) - (Rec K (List (List 'a K) (List 'c K)))) - Void) Void)) - -(: g (→ (→ (Rec A (Rec B (List (List 'a A) - (List 'b B)))) - Void) - Void)) -(define (g x) (void)) - -(ann g - (→ (→ (Rec B (Rec A (List (List 'a A) - (List 'b B)))) - Void) - Void)) - -(ann g - (→ (→ (Rec X (List (List 'a X) - (List 'b X))) - Void) - Void)) - -(define-type (≡ X Y) (List '≡ X Y)) - -(: h (→ (→ (∀ (X1 X2) (→ (U (≡ (List 'a 'b X1) - (List 'c 'd X1)) - (≡ (List 'e 'f X2) - (List 'g 'g X2))))) - Void) - Void)) -(define (h x) (void)) - - -(ann (λ ([x : (Rec R (Pairof 'a (Pairof 'b R)))]) (void)) - (-> (Rec R (Pairof 'a (Pairof 'b R))) Void)) - -(ann (λ ([x : (Rec R (Pairof 'a (Pairof 'b R)))]) (void)) - (-> (Pairof 'a (Rec R (Pairof 'b (Pairof 'a R)))) Void)) - -(ann (λ ([x : (Rec R (List 'a (List 'b R)))]) (void)) - (-> (List 'a (Rec R (List 'b (List 'a R)))) Void)) - -(ann (λ ([x : (Rec R (List 'a R (List 'b R)))]) (void)) - (-> (Rec R (Pairof 'a (Pairof R (Pairof (List 'b R) Null)))) Void)) - -(ann (λ ([x : (Rec R (List 'a R (List 'b R)))]) (void)) - (-> (Pairof 'a (Rec R (Pairof (Pairof 'a R) (Pairof (List 'b (Pairof 'a R)) Null)))) Void)) - -(ann (λ ([x : (Rec R (List 'a R (List 'b R)))]) (void)) - (-> (Pairof 'a (Pairof (Pairof 'a - (Rec R (Pairof (Pairof 'a R) (Pairof (List 'b (Pairof 'a R)) Null))) - ) - (Pairof (List 'b (Pairof 'a - (Rec R (Pairof (Pairof 'a R) (Pairof (List 'b (Pairof 'a R)) Null))) - )) Null))) Void)) -\ No newline at end of file diff --git a/test/test-flexible-with.rkt b/test/test-flexible-with.rkt @@ -1,79 +0,0 @@ -#lang aful/unhygienic type-expander/lang - -(require (lib "phc-graph/flexible-with.hl.rkt") - (for-syntax racket/syntax - racket/list - (rename-in racket/base [... …])) - phc-toolkit - typed-map - type-expander) - -(define-syntax (gs stx) - (syntax-case stx () - [(_ bt-fields-id nfields (f …) [struct struct-field …] …) - (let () - (define/with-syntax (field …) - (append (syntax->list #'(f …)) - (map (λ (_) (datum->syntax #'nfields (gensym 'g))) - (range (- (syntax-e #'nfields) - (length (syntax->list #'(f …)))))))) - (define-trees #'(bt-fields-id - (field …) - [struct struct-field …] …)))])) - -(gs bt-fields - 16 - (a b c) - [sab a b] - [sbc b c] - [sabc a b c]) - -(define-type btac (bt-fields a c)) - -(check-equal?: - (~> (ann (with-c (sab→tree 1 2) 'nine) - ((bt-fields a b c) One Positive-Byte 'nine)) - force - flatten - (filter Some? _) - (map Some-v _) - list->set) - (set 1 2 'nine)) - - -(check-equal?: - (call-with-values - #λ(tree→sab (sab→tree 1 2)) - list) - '(1 2)) - -(check-equal?: - (call-with-values - #λ(tree→sabc (ann (with-c (sab→tree 1 2) 'nine) - ((bt-fields a b c) One Positive-Byte 'nine))) - list) - '(1 2 nine)) - -(check-equal?: - (call-with-values - #λ(tree→sabc (with-c (sab→tree 'NONE 'NONE) 'NONE)) - list) - '(NONE NONE NONE)) - -(check-equal?: - (call-with-values - #λ(tree→sab (without-c (with-c (sab→tree 'NONE 'NONE) 'NONE))) - list) - '(NONE NONE)) - -(check-equal?: - (call-with-values - #λ(tree→sbc (without-a (with-c (sab→tree 'NONE 'NONE) 'NONE))) - list) - '(NONE NONE)) - -(check-equal?: - (call-with-values - #λ(tree→sbc (without-a (with-c (sab→tree 1 2) 3))) - list) - '(2 3)) -\ No newline at end of file diff --git a/test/test-graph-type.rkt b/test/test-graph-type.rkt @@ -1,39 +0,0 @@ -#lang typed/racket - -(require phc-adt - (lib "phc-graph/graph-type.hl.rkt")) -(adt-init) - -(provide g1) - -(define-graph-type g1 - [City [name : String] - [streets : (Listof Street)] - [citizens : (Listof Person)]] - [Street [name : String] - [houses : (Listof House)]] - [House [owner : Person]] - [Person [name : String]] - #:invariant City.citizens._ ∈ City.streets._.houses._.owner - #:invariant City.citizens._ ∋ City.streets._.houses._.owner) - -(require (for-syntax racket/pretty - racket/base)) -(eval #'(begin - (define-syntax (dbg _stx) - (parameterize ([pretty-print-columns 188]) - (pretty-print (syntax-local-value #'g1))) - #'(void)) - (dbg))) - -(require (for-syntax syntax/parse - "../graph-info.hl.rkt")) - -(define-syntax dbg - (syntax-parser - [(_ t) - #`(define-type t - #,(node-info-promise-type - (hash-ref (graph-info-nodes (syntax-local-value #'g1)) 'City)))])) -(dbg t-city) -;(define-type expected (t-city Number String Symbol 'Database 'Index)) -\ No newline at end of file diff --git a/test/test-traversal-1.rkt b/test/test-traversal-1.rkt @@ -1,102 +0,0 @@ -#lang type-expander - -(require "traversal-util.rkt" - "ck.rkt") - -(define-type Foo (Listof String)) - -(define-fold f₁ t₁ Null String) -(define-fold f₂ t₂ (Pairof Null Null) String) -(define-fold f₃ t₃ String String) -(define-fold f₄ t₄ (Pairof Null String) String) -(define-fold f₅ t₅ (Listof Null) String) -(define-fold f₆ t₆ (List Null (Pairof Null Null) Null) String) -(define-fold f₇ t₇ (Listof String) String) -(define-fold f₈ t₈ (List String Foo (Listof String)) String) -(define-fold f₉ t₉ (List (Listof String) Foo (Listof String)) (Listof String)) -(define-fold f₁₀ t₁₀ (List String Foo (Listof String)) (Listof String)) -(define-fold f₁₁ t₁₁ (List (Listof String) (Listof Number)) (Listof String)) -(define-fold f₁₂ t₁₂ (List (Listof String) (Listof String)) (Listof String)) -(define-fold f₁₃ t₁₃ - (List Null - (Pairof (List (List Null)) - (List (List Null))) - Null) - String) - -(define (string->symbol+acc [x : String] [acc : Integer]) - (values (string->symbol x) (add1 acc))) - -(check-equal?-values: ((f₁ string? string->symbol+acc) '() 0) - '() 0) - -(check-equal?-values: ((f₁ string? string->symbol+acc) '() 0) - : (Values Null Integer) - '() 0) - -(check-equal?-values: ((f₂ string? string->symbol+acc) '(() . ()) 0) - : (Values (Pairof Null Null) Integer) - '(() . ()) 0) - -(check-equal?-values: ((f₃ string? string->symbol+acc) "abc" 0) - : (Values Symbol Integer) - 'abc 1) - -(check-equal?-values: ((f₄ string? string->symbol+acc) '(() . "def") 0) - : (Values (Pairof Null Symbol) Integer) - '(() . def) 1) - -(check-equal?-values: ((f₅ string? string->symbol+acc) '(() () () ()) 0) - : (Values (Listof Null) Integer) - '(() () () ()) 0) - -(check-equal?-values: ((f₅ string? string->symbol+acc) '(()) 0) - : (Values (Listof Null) Integer) - '(()) 0) - -(check-equal?-values: ((f₅ string? string->symbol+acc) '() 0) - : (Values (Listof Null) Integer) - '() 0) - -(check-equal?-values: ((f₆ string? string->symbol+acc) '(() (() . ()) ()) 0) - : (Values (List Null (Pairof Null Null) Null) Integer) - '(() (() . ()) ()) 0) - -(check-equal?-values: ((f₇ string? string->symbol+acc) '("abc" "def" "ghi") 0) - : (Values (Listof Symbol) Integer) - '(abc def ghi) 3) - -(check-equal?-values: ((f₈ string? string->symbol+acc) '("abc" ("def" "ghi") - ("jkl" "mno")) - 0) - : (Values (List Symbol (Listof String) (Listof Symbol)) - Integer) - '(abc ("def" "ghi") (jkl mno)) 3) - -(check-equal?-values: ((f₉ (make-predicate (Listof String)) - (λ ([l : (Listof String)] [acc : Integer]) - (values (map string->symbol l) - (add1 acc)))) - '(("a" "b" "c") - ("def" "ghi") - ("jkl" "mno")) - 0) - : (Values (List (Listof Symbol) - (Listof String) - (Listof Symbol)) - Integer) - '((a b c) ("def" "ghi") (jkl mno)) 2) - -(check-equal?-values: ((f₁₀ (make-predicate (Listof String)) - (λ ([l : (Listof String)] [acc : Integer]) - (values (map string->symbol l) - (add1 acc)))) - '("abc" - ("def" "ghi") - ("jkl" "mno")) - 0) - : (Values (List String - (Listof String) - (Listof Symbol)) - Integer) - '("abc" ("def" "ghi") (jkl mno)) 1) diff --git a/test/test-traversal-2.rkt b/test/test-traversal-2.rkt @@ -1,114 +0,0 @@ -#lang typed/racket - -(require "traversal-util.rkt" - type-expander - phc-adt - "ck.rkt" - "../dispatch-union.rkt") ;; DEBUG -(adt-init) - -(define-fold f₁ t₁ (tagged tg [a String] [b Boolean]) String) -(define-fold f₂ t₂ (U (tagged tg [a String] [b Boolean])) String) -(define-fold f₃ t₃ (U (tagged tg [a String] [b Boolean]) - (tagged tg [a Boolean] [c String])) - String) -(define-fold f₄ t₄ (U (tagged tg [a String] [b Boolean]) - String - (tagged tg [a Boolean] [c String])) - String) -(define-fold f₅ t₅ (U (tagged t0) - String - (tagged tg [a Boolean] [c String])) - String) -(define-fold f₆ t₆ (U String - (tagged tg [a String] [b Boolean])) - String) - -(define (string->symbol+acc [x : String] [acc : Integer]) - (values (string->symbol x) (add1 acc))) - -(check-equal?-values: - ((f₁ string? string->symbol+acc) (tagged tg [a "abc"] [b #f]) 0) - : (Values (tagged tg [a Symbol] [b Boolean]) Integer) - (tagged tg [a 'abc] [b #f]) 1) - -(check-equal?-values: - ((f₂ string? string->symbol+acc) (tagged tg [a "abc"] [b #f]) 0) - : (Values (U (tagged tg [a Symbol] [b Boolean])) Integer) - (tagged tg [a 'abc] [b #f]) 1) - -(check-equal?-values: - ((f₃ string? string->symbol+acc) (tagged tg [a "abc"] [b #f]) 0) - : (Values (U (tagged tg [a Symbol] [b Boolean]) - (tagged tg [a Boolean] [c Symbol])) - Integer) - (tagged tg [a 'abc] [b #f]) 1) - -(check-equal?-values: - ((f₃ string? string->symbol+acc) (tagged tg [a #t] [c "def"]) 0) - : (Values (U (tagged tg [a Symbol] [b Boolean]) - (tagged tg [a Boolean] [c Symbol])) - Integer) - (tagged tg [a #t] [c 'def]) 1) - -(check-equal?-values: - ((f₄ string? string->symbol+acc) (tagged tg [a "abc"] [b #f]) 0) - : (Values (U (tagged tg [a Symbol] [b Boolean]) - Symbol - (tagged tg [a Boolean] [c Symbol])) - Integer) - (tagged tg [a 'abc] [b #f]) 1) - -(check-equal?-values: - ((f₄ string? string->symbol+acc) "ghi" 0) - : (Values (U (tagged tg [a Symbol] [b Boolean]) - Symbol - (tagged tg [a Boolean] [c Symbol])) - Integer) - 'ghi 1) - -(check-equal?-values: - ((f₄ string? string->symbol+acc) (tagged tg [a #t] [c "def"]) 0) - : (Values (U (tagged tg [a Symbol] [b Boolean]) - Symbol - (tagged tg [a Boolean] [c Symbol])) - Integer) - (tagged tg [a #t] [c 'def]) 1) - -(check-equal?-values: - ((f₅ string? string->symbol+acc) (tagged t0 #:instance) 0) - : (Values (U (tagged t0) - Symbol - (tagged tg [a Boolean] [c Symbol])) - Integer) - (tagged t0 #:instance) 0) - -(check-equal?-values: - ((f₅ string? string->symbol+acc) "ghi" 0) - : (Values (U (tagged t0) - Symbol - (tagged tg [a Boolean] [c Symbol])) - Integer) - 'ghi 1) - -(check-equal?-values: - ((f₅ string? string->symbol+acc) (tagged tg [a #t] [c "def"]) 0) - : (Values (U (tagged t0) - Symbol - (tagged tg [a Boolean] [c Symbol])) - Integer) - (tagged tg [a #t] [c 'def]) 1) - -(check-equal?-values: - ((f₆ string? string->symbol+acc) (tagged tg [a "abc"] [b #f]) 0) - : (Values (U (tagged tg [a Symbol] [b Boolean]) - Symbol) - Integer) - (tagged tg [a 'abc] [b #f]) 1) - -(check-equal?-values: - ((f₆ string? string->symbol+acc) "ghi" 0) - : (Values (U (tagged tg [a Symbol] [b Boolean]) - Symbol) - Integer) - 'ghi 1) diff --git a/test/traversal-util.rkt b/test/traversal-util.rkt @@ -1,22 +0,0 @@ -#lang typed/racket -(require (for-syntax syntax/parse - backport-template-pr1514/experimental/template - type-expander/expander) - "../traversal.hl.rkt") - -(provide define-fold) - -(define-syntax define-fold - (syntax-parser - [(_ _function-name:id - _type-name:id - whole-type:type - _type-to-replaceᵢ:type ...) - (with-folds - (λ () - (template - (begin - (define-type _type-name - (∀-replace-in-type whole-type _type-to-replaceᵢ ...)) - (define _function-name - (λ-replace-in-instance whole-type _type-to-replaceᵢ ...))))))])) -\ No newline at end of file diff --git a/thoughts.rkt b/thoughts.rkt @@ -1,124 +0,0 @@ -#lang type-expander/lang - -#| -Adding fields to the prefix path makes it weaker -Adding fields to the postfix path makes it stronger - -(Expand prefix postfix) -=> (and prefixᵢ postfix) … -Also could be expanded as: -=> (and prefix postfixᵢ) … - -Rewording ((u pre_x pre_x2) pre_a _ post_b (u post_c post_c2) -=> property holds iff - pre1 = a - and (pre2 = x or pre2 = x2) - and post1 = b - and (post2 = c or post2 = c2) -|# - -(define-type (F A) (I (I A))) -(define-type (I A) (→ A Void)) - -(define-type eqA1 (F (Pairof (List* (∩ (G 'a1) (G 'a2)) (∩ (G 'u1) (G 'u2))) - (List (G 'b) (G 'c))))) - -(define-type eqB1 (F (∩ (Pairof (List* (G 'a1) (∩ (G 'u1) (G 'u2))) - (List (G 'b) (G 'c))) - (Pairof (List* (G 'a2) (∩ (G 'u1) (G 'u2))) - (List (G 'b) (G 'c)))))) - -(define-type eqC1 (F (∩ (Pairof (List* (∩ (G 'a1) (G 'a2)) (∩ (G 'u1))) - (List (G 'b) (G 'c))) - (Pairof (List* (∩ (G 'a1) (G 'a2)) (∩ (G 'u2))) - (List (G 'b) (G 'c)))))) - -(define-type weakerD1 (F (∩ (Pairof (List* (∩ (G 'a1) (G 'a2)) (∩ (G 'u1))) - (List (G 'b) (G 'c)))))) - -(define-type strongerE1 (F (∩ (Pairof (List* (∩ (G 'a1) (G 'a2)) (∩ (G 'u1) (G 'u2))) - (∩ (List (G 'b) (G 'c)) - (List (G 'b2) (G 'c))))))) - -(define-type strongerF1 (F (∩ (Pairof (List* (∩ (G 'a1) (G 'a2)) (∩ (G 'u1) (G 'u2))) - (Pairof (G 'b) (∩ (List (G 'c)) - (List (G 'c2)))))))) - -(define-type altF1 (F (∩ (Pairof (List* (∩ (G 'a1) (G 'a2)) (∩ (G 'u1) (G 'u2))) - (Pairof (G 'b) (List (G 'c)))) - (Pairof (List* (∩ (G 'a1) (G 'a2)) (∩ (G 'u1) (G 'u2))) - (Pairof (G 'b) (List (G 'c2))))))) - -(ann (ann (λ (x) (void)) eqA1) eqB1) -(ann (ann (λ (x) (void)) eqA1) eqC1) -(ann (ann (λ (x) (void)) eqB1) eqA1) -(ann (ann (λ (x) (void)) eqB1) eqC1) -(ann (ann (λ (x) (void)) eqC1) eqA1) -(ann (ann (λ (x) (void)) eqC1) eqB1) -(ann (ann (λ (x) (void)) eqA1) weakerD1) -(ann (ann (λ (x) (void)) eqB1) weakerD1) -(ann (ann (λ (x) (void)) eqC1) weakerD1) -;(ann (ann (λ (x) (void)) eqA1) strongerD1) ;; rejected, as it should -(ann (ann (λ (x) (void)) strongerE1) eqA1) -;(ann (ann (λ (x) (void)) eqA1) strongerE1) ;; rejected, as it should -(ann (ann (λ (x) (void)) strongerF1) eqA1) -;(ann (ann (λ (x) (void)) eqA1) strongerF1) ;; rejected, as it should -(ann (ann (λ (x) (void)) altF1) eqA1) -;(ann (ann (λ (x) (void)) eqA1) altF1) ;; rejected, as it should -(ann (ann (λ (x) (void)) altF1) strongerF1) -(ann (ann (λ (x) (void)) strongerF1) altF1) - - - - -(let () - (define-type eqA2 (F (case→ (→ (List 'b 'c) 'a1) - (→ (List 'b 'c) 'a2)))) - - (define-type eqB2 (F (case→ (→ (List 'b 'c) - (U 'a1 'a2))))) - - (ann (ann (λ (x) (void)) eqA2) eqB2) - #;(ann (ann (λ (x) (void)) eqB2) eqA2)) - -;(let () -(define-type (G A) (F A)) -(define-type-expander (+ stx) (syntax-case stx () [(_ . rest) #'(∩ . rest)])) -(define-type-expander (* stx) (syntax-case stx () [(_ . rest) #'(U . rest)])) - -(define-type eqA2 (F (+ (* (G 'b) (G 'c) (G 'a1)) - (* (G 'b) (G 'c) (G 'a2))))) - -(define-type eqB2 (F (+ (* (G 'b) (G 'c) (+ (G 'a1) (G 'a2)))))) - -(define-type Weaker2 (F (+ (* (G 'b) (G 'c) (G 'a1))))) - -(ann (ann (λ (x) (void)) eqA2) eqB2) -(ann (ann (λ (x) (void)) eqB2) eqA2) -(ann (ann (λ (x) (void)) eqA2) Weaker2) -(ann (ann (λ (x) (void)) eqB2) Weaker2) -;(ann (ann (λ (x) (void)) Weaker2) eqA2) -;(ann (ann (λ (x) (void)) Weaker2) eqB2) -;) - - - -(let () - (define-type weaker3 - (F (∩ (G (Rec R (List* 'a Any R))) - (G (Rec R (List* Any 'b R)))))) - (define-type stronger3 - (F (∩ (G (List* 'a Any (Rec R (List* 'a Any R)))) - (G (List* Any 'b (Rec R (List* Any 'b R))))))) - - (ann (ann (λ (x) (void)) stronger3) weaker3) - ) - -#| -Put the U ∩ inside the positional list? -What about loops of different sizes => won't work -What about merging all the invariants blindly => won't work, but we can -special-case merging these regexp-like invariants, as long as the merging -doesn't need any info about the regexp itself -(e.g. all are "merge the second elements") -|# -\ No newline at end of file diff --git a/times.rkt.txt b/times.rkt.txt @@ -1,76 +0,0 @@ -#lang racket -(require plot) -(parameterize ([plot-x-transform log-transform] - [plot-x-ticks (log-ticks #:base 2)] - [plot-y-transform log-transform] - [plot-y-ticks (log-ticks #:base 2)]) - (plot - #:x-min 1 #:x-max 3000 - #:y-min 1 #:y-max 3000 - (list - (lines #:color 1 - '(#(16 16) - #(17 25) - #(20 26) - #(24 29) - #(28 31) - #(32 35) ; 20 with shared implementation & type, 22 shrd impl only - #(33 60) - #(40 67) - #(48 77) - #(56 80) - #(64 92) ;; 46 - #(65 168) - #(80 189) - #(96 216) - #(128 276) - #(129 562) - #(256 911) - #(257 2078) - #(512 3000) ;; rough estimation - )) - ;; with shared implementation & type: - (lines #:color 2 - '(#(16 11) - ;#(17 25) - ;#(20 26) - ;#(24 29) - ;#(28 31) - #(32 20) - ;#(33 60) - ;#(40 67) - ;#(48 77) - ;#(56 80) - #(64 46) - ;#(65 168) - ;#(80 189) - ;#(96 216) - #(128 120) - ;#(129 562) - #(256 363) - ;#(257 2078) - #(512 1317) - )) - ;; further optimisations - (lines #:color 3 - '(#(16 10) - #(17 12) - #(20 13) - #(24 13) - #(28 14) - #(32 15) - #(33 22) - #(40 24) - #(48 26) - #(56 28) - #(64 30) - #(65 49) - #(80 54) - #(96 57) - #(128 69) - #(129 129) - #(256 186) - #(257 372) - #(512 587) - ))))) - diff --git a/traversal.hl.rkt b/traversal.hl.rkt @@ -1,397 +0,0 @@ -#lang hyper-literate typed/racket/base #:no-require-lang #:no-auto-require -@(require racket/require - scribble-enhanced/doc - racket/require - hyper-literate - (subtract-in scribble/struct scribble-enhanced/doc) - scribble/decode - (for-label racket/format - racket/promise - racket/list - syntax/parse - syntax/parse/experimental/template - type-expander - (except-in (subtract-in typed/racket/base type-expander) - values) - (only-in racket/base values) - (subtract-in racket/contract typed/racket/base) - phc-toolkit - phc-toolkit/untyped-only - remember)) -@(unless-preexpanding - (require (for-label (submod "..")))) -@doc-lib-setup - -@title[#:style manual-doc-style - #:tag "traversal" - #:tag-prefix "phc-graph/traversal"]{Parametric replacement of parts of - data structures} - -@(chunks-toc-prefix - '("(lib phc-graph/scribblings/phc-graph-implementation.scrbl)" - "phc-graph/traversal")) - -@(table-of-contents) - -@(declare-exporting (lib "phc-graph/traversal.hl.rkt")) - -@section{Introduction} - -This utility allows functionally updating parts of data structures. The -@racket[define-fold] macro takes the type of the whole data structure and a -list of type names associated with their predicate. It locates all literal -occurrences of those type names within the data structure, and identifies -those locations as the parts to replace. The type of the whole data structure -is expressed as a syntactic tree. Within that syntactic tree, only the parts -which are syntactically equal to one of the types to replace are considered. - -As an example, suppose the whole type is -@racket[(List Foo Number (Listof String))], and @racket[Foo] is defined as: - -@racketblock[(define-type Foo (Listof String))] - -If @racket[Foo] is given as a type to replace, and its replacement type is -@racket[(Listof Symbol)], then the type of the result would be: - -@racketblock[(List (Listof Symbol) Number (Listof String))] - -The second occurrence of @racket[(Listof String)], although semantically -equivalent to the type to replace, @racket[Foo], will not be altered, as it is -not expressed syntactically using the @racket[Foo] identifier. - -@defform[(define-fold function-name type-name whole-type type-to-replaceᵢ ...)]{ - The @racket[define-fold] macro takes the type of the whole data structure, and - a list of types to replace, each associated with a predicate for that type. It - @;defines @racket[_name] as a macro, which behaves as follows: - defines @racket[(type-name Tᵢ ...)] as a polymorphic type, with one type - argument for each @racket[type-to-replaceᵢ], such that - - @racketblock[(type-name type-to-replaceᵢ ...)] - - is the same type as - - @racketblock[whole-type] - - In other words, @racket[type-name] is defined as @racket[whole-type], except - that each syntactic occurrence of a @racket[type-to-replaceᵢ] is replaced with - the corresponding type argument @racket[Tᵢ]. - - It also defines @racket[function-name] as a function, with the type - - @racketblock[(∀ (Aᵢ ... Bᵢ ... Acc) - (→ (?@ (→ Any Boolean : Aᵢ) - (→ Aᵢ Acc (Values Bᵢ Acc))) - ... - (→ (type-name Aᵢ ...) - Acc - (Values (type-name Bᵢ ...) - Acc))))] - - We use the @racket[?@] notation from - @racketmodname[syntax/parse/experimental/template] to indicate that the - function accepts a predicate, followed by an update function, followed by - another predicate, and so on. For example, the function type when there are - three @racket[type-to-replaceᵢ] would be: - - @racketblock[(∀ (A₁ A₂ A₃ B₁ B₂ B₃ Acc) - (→ (→ Any Boolean : A₁) - (→ A₁ Acc (Values B₁ Acc)) - (→ Any Boolean : A₂) - (→ A₂ Acc (Values B₂ Acc)) - (→ Any Boolean : A₃) - (→ A₃ Acc (Values B₃ Acc)) - (→ (type-name A₁ A₂ A₃) - Acc - (Values (type-name B₁ B₂ B₃) - Acc))))] - - The @racket[function-name] replaces all values in the whole data structure - which are present in locations corresponding to a @racket[type-to-replaceᵢ] in - the @racket[whole-type]. It expects those values to have the type @racket[Aᵢ], - i.e. its input type is not restricted to @racket[whole-type], any polymorphic - instance of @racket[type-name] is valid. Each value is passed as an argument - to the corresponding update function with type - @racket[(→ Aᵢ Acc (Values Bᵢ Acc))], and the result of type @racket[Bᵢ] is - used as a replacement. - - An accumulator value, with the type @racket[Acc], is threaded through all - calls to all update functions, so that the update functions can communicate - state in a functional way.} - -@section{Implementation} - -@subsection{Caching the results of @racket[define-fold]} - -@chunk[<with-folds> - (define-for-syntax get-f-cache (make-parameter #f)) - (define-for-syntax get-τ-cache (make-parameter #f)) - (define-for-syntax get-f-defs (make-parameter #f)) - (define-for-syntax get-τ-defs (make-parameter #f)) - (define-for-syntax (with-folds thunk) - ;; TODO: should probably use bound-id instead. - (parameterize ([get-f-cache (make-mutable-free-id-tree-table)] - [get-τ-cache (make-mutable-free-id-tree-table)] - [get-f-defs (box '())] - [get-τ-defs (box '())]) - (define/with-syntax thunk-result (thunk)) - (with-syntax ([([f-id f-body f-type] …) (unbox (get-f-defs))] - [([τ-id . τ-body] …) (unbox (get-τ-defs))]) - #`(begin (define-type τ-id τ-body) … - (: f-id f-type) … - (define f-id f-body) … - thunk-result))))] - -@;@subsection{…} - - -@; TODO: recursively go down the tree. If there are no replacements, return #f -@; all the way up, so that a simple identity function can be applied in these -@; cases. - - -@CHUNK[<api> - (define-template-metafunction (replace-in-type stx) - (syntax-case stx () - [(_ _whole-type [_type-to-replaceᵢ _Tᵢ] …) - #`(#,(syntax-local-template-metafunction-introduce - (fold-τ #'(_whole-type _type-to-replaceᵢ …))) _Tᵢ …)]))] - -@CHUNK[<api> - (define-template-metafunction (∀-replace-in-type stx) - (syntax-case stx () - [(_ _whole-type _type-to-replaceᵢ …) - (syntax-local-template-metafunction-introduce - (fold-τ #'(_whole-type _type-to-replaceᵢ …)))]))] - -@CHUNK[<fold-τ> - (define fold-τ - (syntax-parser - [(_whole-type:type _type-to-replaceᵢ:type …) - #:with rec-args #'([_type-to-replaceᵢ _Tᵢ] …) - (cached [τ- - (get-τ-cache) - (get-τ-defs) - #'(_whole-type _type-to-replaceᵢ …)] - (define replacements (make-immutable-free-id-tree-table - (map syntax-e - (syntax->list - #'([_type-to-replaceᵢ . _Tᵢ] …))))) - #`(∀ (_Tᵢ …) - #,(syntax-parse #'_whole-type - #:literals (Null Pairof Listof List Vectorof Vector U tagged) - <type-cases>)))]))] - -@CHUNK[<cached> - (begin-for-syntax - (define-syntax-rule (cached [base cache defs key] . body) - (begin - (unless (and cache defs) - (error "fold-τ and fold-f must be called within with-folds")) - (if (dict-has-key? cache key) - (dict-ref cache key) - (let ([base #`#,(gensym 'base)]) - (dict-set! cache key base) - (let ([result (let () . body)]) - (set-box! defs `([,base . ,result] . ,(unbox defs))) - base))))))] - -@CHUNK[<api> - (define-template-metafunction (replace-in-instance stx) - (syntax-case stx () - [(_ _whole-type [_type-to-replaceᵢ _predicateᵢ _updateᵢ] …) - #`(#,(syntax-local-template-metafunction-introduce - (fold-f #'(_whole-type _type-to-replaceᵢ …))) - {?@ _predicateᵢ _updateᵢ} …)]))] - -@CHUNK[<api> - (define-template-metafunction (λ-replace-in-instance stx) - (syntax-case stx () - [(_ _whole-type _type-to-replaceᵢ …) - (syntax-local-introduce - (fold-f #'(_whole-type _type-to-replaceᵢ …)))]))] - -@CHUNK[<fold-f> - (define fold-f - (syntax-parser - [(_whole-type:type _type-to-replaceᵢ:type …) - #:with rec-args #'([_type-to-replaceᵢ _predicateᵢ _updateᵢ] …) - (define replacements (make-immutable-free-id-tree-table - (map syntax-e - (syntax->list - #'([_type-to-replaceᵢ . _updateᵢ] …))))) - (define/with-syntax _args #'({?@ _predicateᵢ _updateᵢ} …)) - (cached [f- - (get-f-cache) - (get-f-defs) - #'(_whole-type _type-to-replaceᵢ …)] - #`[(λ ({?@ _predicateᵢ _updateᵢ} …) - (λ (v acc) - #,(syntax-parse #'_whole-type - #:literals (Null Pairof Listof List Vectorof Vector U tagged) - <f-cases>))) - (∀ (_Aᵢ … _Bᵢ … Acc) - (→ (?@ (→ Any Boolean : _Aᵢ) - (→ _Aᵢ Acc (Values _Bᵢ Acc))) - … - (→ (replace-in-type _whole-type - [_type-to-replaceᵢ _Aᵢ] …) - Acc - (Values (replace-in-type _whole-type - [_type-to-replaceᵢ _Bᵢ] …) - Acc))))])]))] - -@chunk[<f-cases> - [t - #:when (dict-has-key? replacements #'t) - #:with _update (dict-ref replacements #'t) - #'(_update v acc)]] - -@chunk[<type-cases> - [t - #:when (dict-has-key? replacements #'t) - #:with _T (dict-ref replacements #'t) - #'_T]] - -@chunk[<type-cases> - [(~or Null (List)) - #'Null]] - -@chunk[<f-cases> - [(~or Null (List)) - #'(values v acc)]] - - -@CHUNK[<type-cases> - [(Pairof X Y) - #'(Pairof (replace-in-type X . rec-args) - (replace-in-type Y . rec-args))]] - -@CHUNK[<f-cases> - [(Pairof X Y) - #'(let*-values ([(result-x acc-x) - ((replace-in-instance X . rec-args) (car v) acc)] - [(result-y acc-y) - ((replace-in-instance Y . rec-args) (cdr v) acc-x)]) - (values (cons result-x result-y) acc-y))]] - -@CHUNK[<type-cases> - [(Listof X) - #'(Listof (replace-in-type X . rec-args))]] - -@CHUNK[<f-cases> - [(Listof X) - #'(foldl-map (replace-in-instance X . rec-args) - acc v)]] - -@CHUNK[<type-cases> - [(Vectorof X) - #'(Vectorof (replace-in-type X . rec-args))]] - -@CHUNK[<ftype-cases> - [(Vectorof X) - #'(vector->immutable-vector - (list->vector - (foldl-map (replace-in-instance X . rec-args) - acc - (vector->list v))))]] - - -@CHUNK[<type-cases> - [(List X Y …) - #'(Pairof (replace-in-type X . rec-args) - (replace-in-type (List Y …) . rec-args))]] - -@CHUNK[<f-cases> - [(List X Y …) - #'(let*-values ([(result-x acc-x) ((replace-in-instance X . rec-args) - (car v) - acc)] - [(result-y* acc-y*) ((replace-in-instance (List Y …) . rec-args) - (cdr v) - acc-x)]) - (values (cons result-x result-y*) acc-y*))]] - -@CHUNK[<type-cases> - [(U _Xⱼ …) - #'(U (replace-in-type _Xⱼ . rec-args) …)]] - -@CHUNK[<f-cases> - [(U _Xⱼ …) - #'(dispatch-union v - ([_type-to-replaceᵢ Aᵢ _predicateᵢ] …) - [_Xⱼ ((replace-in-instance _Xⱼ . rec-args) v acc)] - …)]] - -@CHUNK[<type-cases> - [(tagged _name [_fieldⱼ (~optional :colon) _Xⱼ] …) - #'(tagged _name [_fieldⱼ : (replace-in-type _Xⱼ . rec-args)] …)]] - -@CHUNK[<f-cases> - [(tagged _name [_fieldⱼ (~optional :colon) _Xⱼ] …) - #'(let*-values - ([(_resultⱼ acc) - ((replace-in-instance _Xⱼ . rec-args) (uniform-get v _fieldⱼ) - acc)] - …) - (values (tagged _name #:instance [_fieldⱼ _resultⱼ] …) - acc))]] - -@chunk[<type-cases> - [else-T - #'else-T]] - -@chunk[<f-cases> - [else-T - #'(values v acc)]] - - -where @racket[foldl-map] is defined as: - -@chunk[<foldl-map> - (: foldl-map (∀ (A B Acc) (→ (→ A Acc (Values B Acc)) - Acc - (Listof A) - (Values (Listof B) Acc)))) - (define (foldl-map f acc l) - (if (null? l) - (values l - acc) - (let*-values ([(v a) (f (car l) acc)] - [(ll aa) (foldl-map f a (cdr l))]) - (values (cons v ll) - aa))))] - -@section{Putting it all together} - -@chunk[<*> - (require racket/require - phc-toolkit - type-expander - phc-adt - "dispatch-union.rkt" - (for-syntax "subtemplate-override.rkt" - (subtract-in (combine-in racket/base - syntax/parse) - "subtemplate-override.rkt") - backport-template-pr1514/experimental/template - phc-toolkit/untyped - racket/syntax - type-expander/expander - "free-identifier-tree-equal.rkt" - racket/dict) - (for-meta 2 racket/base) - (for-meta 2 phc-toolkit/untyped) - (for-meta 2 syntax/parse)) - - (provide (for-syntax with-folds - replace-in-type - ∀-replace-in-type - replace-in-instance - λ-replace-in-instance)) - <foldl-map> - <with-folds> - <cached> - (begin-for-syntax - <api> - <fold-τ> - <fold-f>)] -\ No newline at end of file