shen-ruby 0.12.1 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/HISTORY.md +5 -0
  3. data/README.md +8 -12
  4. data/Rakefile +4 -9
  5. data/bin/shen_test_suite.rb +0 -1
  6. data/bin/srrepl +2 -4
  7. data/lib/shen_ruby/shen.rb +98 -0
  8. data/lib/shen_ruby/version.rb +1 -1
  9. data/shen-ruby.gemspec +3 -3
  10. data/shen/README.txt +9 -13
  11. data/shen/release/BSD +24 -0
  12. data/shen/release/klambda/core.kl +157 -0
  13. data/shen/release/klambda/declarations.kl +109 -0
  14. data/shen/release/klambda/load.kl +59 -0
  15. data/shen/release/klambda/macros.kl +91 -0
  16. data/shen/release/klambda/prolog.kl +228 -0
  17. data/shen/release/klambda/reader.kl +198 -0
  18. data/shen/release/klambda/sequent.kl +142 -0
  19. data/shen/release/klambda/sys.kl +253 -0
  20. data/shen/release/klambda/t-star.kl +123 -0
  21. data/shen/release/klambda/toplevel.kl +110 -0
  22. data/shen/release/klambda/track.kl +79 -0
  23. data/shen/release/{k_lambda → klambda}/types.kl +41 -63
  24. data/shen/release/klambda/writer.kl +81 -0
  25. data/shen/release/klambda/yacc.kl +87 -0
  26. data/shen/release/license.pdf +0 -0
  27. data/shen/release/test_programs/Chap13/problems.txt +26 -26
  28. data/shen/release/test_programs/README.shen +52 -52
  29. data/shen/release/test_programs/TinyLispFunctions.txt +15 -15
  30. data/shen/release/test_programs/TinyTypes.shen +55 -55
  31. data/shen/release/test_programs/binary.shen +24 -24
  32. data/shen/release/test_programs/bubble_version_1.shen +28 -28
  33. data/shen/release/test_programs/bubble_version_2.shen +22 -22
  34. data/shen/release/test_programs/calculator.shen +21 -21
  35. data/shen/release/test_programs/cartprod.shen +23 -23
  36. data/shen/release/test_programs/change.shen +25 -25
  37. data/shen/release/test_programs/classes-defaults.shen +94 -94
  38. data/shen/release/test_programs/classes-inheritance.shen +100 -100
  39. data/shen/release/test_programs/classes-typed.shen +74 -74
  40. data/shen/release/test_programs/classes-untyped.shen +46 -46
  41. data/shen/release/test_programs/depth_.shen +14 -14
  42. data/shen/release/test_programs/einstein.shen +34 -34
  43. data/shen/release/test_programs/fruit_machine.shen +46 -46
  44. data/shen/release/test_programs/interpreter.shen +217 -217
  45. data/shen/release/test_programs/metaprog.shen +85 -85
  46. data/shen/release/test_programs/minim.shen +192 -192
  47. data/shen/release/test_programs/mutual.shen +11 -11
  48. data/shen/release/test_programs/n_queens.shen +45 -45
  49. data/shen/release/test_programs/newton_version_1.shen +33 -33
  50. data/shen/release/test_programs/newton_version_2.shen +24 -24
  51. data/shen/release/test_programs/parse.prl +14 -14
  52. data/shen/release/test_programs/parser.shen +51 -51
  53. data/shen/release/test_programs/powerset.shen +10 -10
  54. data/shen/release/test_programs/prime.shen +10 -10
  55. data/shen/release/test_programs/prolog.shen +78 -78
  56. data/shen/release/test_programs/proof_assistant.shen +80 -80
  57. data/shen/release/test_programs/proplog_version_1.shen +25 -25
  58. data/shen/release/test_programs/proplog_version_2.shen +27 -27
  59. data/shen/release/test_programs/qmachine.shen +66 -66
  60. data/shen/release/test_programs/red-black.shen +54 -54
  61. data/shen/release/test_programs/search.shen +55 -55
  62. data/shen/release/test_programs/semantic_net.shen +44 -44
  63. data/shen/release/test_programs/spreadsheet.shen +34 -34
  64. data/shen/release/test_programs/stack.shen +27 -27
  65. data/shen/release/test_programs/streams.shen +20 -20
  66. data/shen/release/test_programs/strings.shen +57 -57
  67. data/shen/release/test_programs/structures-typed.shen +71 -71
  68. data/shen/release/test_programs/structures-untyped.shen +41 -41
  69. data/shen/release/test_programs/tests.shen +232 -232
  70. data/shen/release/test_programs/types.shen +11 -11
  71. data/shen/release/test_programs/whist.shen +239 -239
  72. data/shen/release/test_programs/yacc.shen +132 -132
  73. metadata +21 -35
  74. data/shen/lib/shen_ruby/shen.rb +0 -160
  75. data/shen/license.txt +0 -34
  76. data/shen/release/benchmarks/N_queens.shen +0 -45
  77. data/shen/release/benchmarks/README.shen +0 -14
  78. data/shen/release/benchmarks/benchmarks.shen +0 -52
  79. data/shen/release/benchmarks/bigprog +0 -2173
  80. data/shen/release/benchmarks/einstein.shen +0 -33
  81. data/shen/release/benchmarks/heatwave.gif +0 -0
  82. data/shen/release/benchmarks/interpreter.shen +0 -219
  83. data/shen/release/benchmarks/jnk.shen +0 -194
  84. data/shen/release/benchmarks/picture.jpg +0 -0
  85. data/shen/release/benchmarks/plato.jpg +0 -0
  86. data/shen/release/benchmarks/powerset.shen +0 -10
  87. data/shen/release/benchmarks/prime.shen +0 -10
  88. data/shen/release/benchmarks/short.shen +0 -129
  89. data/shen/release/benchmarks/text.txt +0 -68
  90. data/shen/release/k_lambda/core.kl +0 -181
  91. data/shen/release/k_lambda/declarations.kl +0 -131
  92. data/shen/release/k_lambda/load.kl +0 -84
  93. data/shen/release/k_lambda/macros.kl +0 -112
  94. data/shen/release/k_lambda/prolog.kl +0 -252
  95. data/shen/release/k_lambda/reader.kl +0 -222
  96. data/shen/release/k_lambda/sequent.kl +0 -166
  97. data/shen/release/k_lambda/sys.kl +0 -271
  98. data/shen/release/k_lambda/t-star.kl +0 -139
  99. data/shen/release/k_lambda/toplevel.kl +0 -135
  100. data/shen/release/k_lambda/track.kl +0 -103
  101. data/shen/release/k_lambda/writer.kl +0 -105
  102. data/shen/release/k_lambda/yacc.kl +0 -113
@@ -0,0 +1,123 @@
1
+ "Copyright (c) 2015, Mark Tarver
2
+
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+ 1. Redistributions of source code must retain the above copyright
8
+ notice, this list of conditions and the following disclaimer.
9
+ 2. Redistributions in binary form must reproduce the above copyright
10
+ notice, this list of conditions and the following disclaimer in the
11
+ documentation and/or other materials provided with the distribution.
12
+ 3. The name of Mark Tarver may not be used to endorse or promote products
13
+ derived from this software without specific prior written permission.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY Mark Tarver ''AS IS'' AND ANY
16
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL Mark Tarver BE LIABLE FOR ANY
19
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
25
+
26
+ (defun shen.typecheck (V2028 V2029) (let Curry (shen.curry V2028) (let ProcessN (shen.start-new-prolog-process) (let Type (shen.insert-prolog-variables (shen.demodulate (shen.curry-type V2029)) ProcessN) (let Continuation (freeze (return Type ProcessN shen.void)) (shen.t* (cons Curry (cons : (cons Type ()))) () ProcessN Continuation))))))
27
+
28
+ (defun shen.curry (V2030) (cond ((and (cons? V2030) (shen.special? (hd V2030))) (cons (hd V2030) (map shen.curry (tl V2030)))) ((and (cons? V2030) (and (cons? (tl V2030)) (shen.extraspecial? (hd V2030)))) V2030) ((and (cons? V2030) (and (= type (hd V2030)) (and (cons? (tl V2030)) (and (cons? (tl (tl V2030))) (= () (tl (tl (tl V2030)))))))) (cons type (cons (shen.curry (hd (tl V2030))) (tl (tl V2030))))) ((and (cons? V2030) (and (cons? (tl V2030)) (cons? (tl (tl V2030))))) (shen.curry (cons (cons (hd V2030) (cons (hd (tl V2030)) ())) (tl (tl V2030))))) ((and (cons? V2030) (and (cons? (tl V2030)) (= () (tl (tl V2030))))) (cons (shen.curry (hd V2030)) (cons (shen.curry (hd (tl V2030))) ()))) (true V2030)))
29
+
30
+ (defun shen.special? (V2031) (element? V2031 (value shen.*special*)))
31
+
32
+ (defun shen.extraspecial? (V2032) (element? V2032 (value shen.*extraspecial*)))
33
+
34
+ (defun shen.t* (V2033 V2034 V2035 V2036) (let Throwcontrol (shen.catchpoint) (shen.cutpoint Throwcontrol (let Case (let Error (shen.newpv V2035) (do (shen.incinfs) (fwhen (shen.maxinfexceeded?) V2035 (freeze (bind Error (shen.errormaxinfs) V2035 V2036))))) (if (= Case false) (let Case (let V2022 (shen.lazyderef V2033 V2035) (if (= fail V2022) (do (shen.incinfs) (cut Throwcontrol V2035 (freeze (shen.prolog-failure V2035 V2036)))) false)) (if (= Case false) (let Case (let V2023 (shen.lazyderef V2033 V2035) (if (cons? V2023) (let X (hd V2023) (let V2024 (shen.lazyderef (tl V2023) V2035) (if (cons? V2024) (let V2025 (shen.lazyderef (hd V2024) V2035) (if (= : V2025) (let V2026 (shen.lazyderef (tl V2024) V2035) (if (cons? V2026) (let A (hd V2026) (let V2027 (shen.lazyderef (tl V2026) V2035) (if (= () V2027) (do (shen.incinfs) (fwhen (shen.type-theory-enabled?) V2035 (freeze (cut Throwcontrol V2035 (freeze (shen.th* X A V2034 V2035 V2036)))))) false))) false)) false)) false))) false)) (if (= Case false) (let Datatypes (shen.newpv V2035) (do (shen.incinfs) (shen.show V2033 V2034 V2035 (freeze (bind Datatypes (value shen.*datatypes*) V2035 (freeze (shen.udefs* V2033 V2034 Datatypes V2035 V2036))))))) Case)) Case)) Case)))))
35
+
36
+ (defun shen.type-theory-enabled? () (value shen.*shen-type-theory-enabled?*))
37
+
38
+ (defun enable-type-theory (V2041) (cond ((= + V2041) (set shen.*shen-type-theory-enabled?* true)) ((= - V2041) (set shen.*shen-type-theory-enabled?* false)) (true (simple-error "enable-type-theory expects a + or a -
39
+ "))))
40
+
41
+ (defun shen.prolog-failure (V2050 V2051) false)
42
+
43
+ (defun shen.maxinfexceeded? () (> (inferences) (value shen.*maxinferences*)))
44
+
45
+ (defun shen.errormaxinfs () (simple-error "maximum inferences exceeded~%"))
46
+
47
+ (defun shen.udefs* (V2052 V2053 V2054 V2055 V2056) (let Case (let V2018 (shen.lazyderef V2054 V2055) (if (cons? V2018) (let D (hd V2018) (do (shen.incinfs) (call (cons D (cons V2052 (cons V2053 ()))) V2055 V2056))) false)) (if (= Case false) (let V2019 (shen.lazyderef V2054 V2055) (if (cons? V2019) (let Ds (tl V2019) (do (shen.incinfs) (shen.udefs* V2052 V2053 Ds V2055 V2056))) false)) Case)))
48
+
49
+ (defun shen.th* (V2057 V2058 V2059 V2060 V2061) (let Throwcontrol (shen.catchpoint) (shen.cutpoint Throwcontrol (let Case (do (shen.incinfs) (shen.show (cons V2057 (cons : (cons V2058 ()))) V2059 V2060 (freeze (fwhen false V2060 V2061)))) (if (= Case false) (let Case (let F (shen.newpv V2060) (do (shen.incinfs) (fwhen (shen.typedf? (shen.lazyderef V2057 V2060)) V2060 (freeze (bind F (shen.sigf (shen.lazyderef V2057 V2060)) V2060 (freeze (call (cons F (cons V2058 ())) V2060 V2061))))))) (if (= Case false) (let Case (do (shen.incinfs) (shen.base V2057 V2058 V2060 V2061)) (if (= Case false) (let Case (do (shen.incinfs) (shen.by_hypothesis V2057 V2058 V2059 V2060 V2061)) (if (= Case false) (let Case (let V1914 (shen.lazyderef V2057 V2060) (if (cons? V1914) (let F (hd V1914) (let V1915 (shen.lazyderef (tl V1914) V2060) (if (= () V1915) (do (shen.incinfs) (shen.th* F (cons --> (cons V2058 ())) V2059 V2060 V2061)) false))) false)) (if (= Case false) (let Case (let V1916 (shen.lazyderef V2057 V2060) (if (cons? V1916) (let F (hd V1916) (let V1917 (shen.lazyderef (tl V1916) V2060) (if (cons? V1917) (let X (hd V1917) (let V1918 (shen.lazyderef (tl V1917) V2060) (if (= () V1918) (let B (shen.newpv V2060) (do (shen.incinfs) (shen.th* F (cons B (cons --> (cons V2058 ()))) V2059 V2060 (freeze (shen.th* X B V2059 V2060 V2061))))) false))) false))) false)) (if (= Case false) (let Case (let V1919 (shen.lazyderef V2057 V2060) (if (cons? V1919) (let V1920 (shen.lazyderef (hd V1919) V2060) (if (= cons V1920) (let V1921 (shen.lazyderef (tl V1919) V2060) (if (cons? V1921) (let X (hd V1921) (let V1922 (shen.lazyderef (tl V1921) V2060) (if (cons? V1922) (let Y (hd V1922) (let V1923 (shen.lazyderef (tl V1922) V2060) (if (= () V1923) (let V1924 (shen.lazyderef V2058 V2060) (if (cons? V1924) (let V1925 (shen.lazyderef (hd V1924) V2060) (if (= list V1925) (let V1926 (shen.lazyderef (tl V1924) V2060) (if (cons? V1926) (let A (hd V1926) (let V1927 (shen.lazyderef (tl V1926) V2060) (if (= () V1927) (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y (cons list (cons A ())) V2059 V2060 V2061)))) (if (shen.pvar? V1927) (do (shen.bindv V1927 () V2060) (let Result (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y (cons list (cons A ())) V2059 V2060 V2061)))) (do (shen.unbindv V1927 V2060) Result))) false)))) (if (shen.pvar? V1926) (let A (shen.newpv V2060) (do (shen.bindv V1926 (cons A ()) V2060) (let Result (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y (cons list (cons A ())) V2059 V2060 V2061)))) (do (shen.unbindv V1926 V2060) Result)))) false))) (if (shen.pvar? V1925) (do (shen.bindv V1925 list V2060) (let Result (let V1928 (shen.lazyderef (tl V1924) V2060) (if (cons? V1928) (let A (hd V1928) (let V1929 (shen.lazyderef (tl V1928) V2060) (if (= () V1929) (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y (cons list (cons A ())) V2059 V2060 V2061)))) (if (shen.pvar? V1929) (do (shen.bindv V1929 () V2060) (let Result (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y (cons list (cons A ())) V2059 V2060 V2061)))) (do (shen.unbindv V1929 V2060) Result))) false)))) (if (shen.pvar? V1928) (let A (shen.newpv V2060) (do (shen.bindv V1928 (cons A ()) V2060) (let Result (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y (cons list (cons A ())) V2059 V2060 V2061)))) (do (shen.unbindv V1928 V2060) Result)))) false))) (do (shen.unbindv V1925 V2060) Result))) false))) (if (shen.pvar? V1924) (let A (shen.newpv V2060) (do (shen.bindv V1924 (cons list (cons A ())) V2060) (let Result (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y (cons list (cons A ())) V2059 V2060 V2061)))) (do (shen.unbindv V1924 V2060) Result)))) false))) false))) false))) false)) false)) false)) (if (= Case false) (let Case (let V1930 (shen.lazyderef V2057 V2060) (if (cons? V1930) (let V1931 (shen.lazyderef (hd V1930) V2060) (if (= @p V1931) (let V1932 (shen.lazyderef (tl V1930) V2060) (if (cons? V1932) (let X (hd V1932) (let V1933 (shen.lazyderef (tl V1932) V2060) (if (cons? V1933) (let Y (hd V1933) (let V1934 (shen.lazyderef (tl V1933) V2060) (if (= () V1934) (let V1935 (shen.lazyderef V2058 V2060) (if (cons? V1935) (let A (hd V1935) (let V1936 (shen.lazyderef (tl V1935) V2060) (if (cons? V1936) (let V1937 (shen.lazyderef (hd V1936) V2060) (if (= * V1937) (let V1938 (shen.lazyderef (tl V1936) V2060) (if (cons? V1938) (let B (hd V1938) (let V1939 (shen.lazyderef (tl V1938) V2060) (if (= () V1939) (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y B V2059 V2060 V2061)))) (if (shen.pvar? V1939) (do (shen.bindv V1939 () V2060) (let Result (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y B V2059 V2060 V2061)))) (do (shen.unbindv V1939 V2060) Result))) false)))) (if (shen.pvar? V1938) (let B (shen.newpv V2060) (do (shen.bindv V1938 (cons B ()) V2060) (let Result (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y B V2059 V2060 V2061)))) (do (shen.unbindv V1938 V2060) Result)))) false))) (if (shen.pvar? V1937) (do (shen.bindv V1937 * V2060) (let Result (let V1940 (shen.lazyderef (tl V1936) V2060) (if (cons? V1940) (let B (hd V1940) (let V1941 (shen.lazyderef (tl V1940) V2060) (if (= () V1941) (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y B V2059 V2060 V2061)))) (if (shen.pvar? V1941) (do (shen.bindv V1941 () V2060) (let Result (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y B V2059 V2060 V2061)))) (do (shen.unbindv V1941 V2060) Result))) false)))) (if (shen.pvar? V1940) (let B (shen.newpv V2060) (do (shen.bindv V1940 (cons B ()) V2060) (let Result (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y B V2059 V2060 V2061)))) (do (shen.unbindv V1940 V2060) Result)))) false))) (do (shen.unbindv V1937 V2060) Result))) false))) (if (shen.pvar? V1936) (let B (shen.newpv V2060) (do (shen.bindv V1936 (cons * (cons B ())) V2060) (let Result (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y B V2059 V2060 V2061)))) (do (shen.unbindv V1936 V2060) Result)))) false)))) (if (shen.pvar? V1935) (let A (shen.newpv V2060) (let B (shen.newpv V2060) (do (shen.bindv V1935 (cons A (cons * (cons B ()))) V2060) (let Result (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y B V2059 V2060 V2061)))) (do (shen.unbindv V1935 V2060) Result))))) false))) false))) false))) false)) false)) false)) (if (= Case false) (let Case (let V1942 (shen.lazyderef V2057 V2060) (if (cons? V1942) (let V1943 (shen.lazyderef (hd V1942) V2060) (if (= @v V1943) (let V1944 (shen.lazyderef (tl V1942) V2060) (if (cons? V1944) (let X (hd V1944) (let V1945 (shen.lazyderef (tl V1944) V2060) (if (cons? V1945) (let Y (hd V1945) (let V1946 (shen.lazyderef (tl V1945) V2060) (if (= () V1946) (let V1947 (shen.lazyderef V2058 V2060) (if (cons? V1947) (let V1948 (shen.lazyderef (hd V1947) V2060) (if (= vector V1948) (let V1949 (shen.lazyderef (tl V1947) V2060) (if (cons? V1949) (let A (hd V1949) (let V1950 (shen.lazyderef (tl V1949) V2060) (if (= () V1950) (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y (cons vector (cons A ())) V2059 V2060 V2061)))) (if (shen.pvar? V1950) (do (shen.bindv V1950 () V2060) (let Result (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y (cons vector (cons A ())) V2059 V2060 V2061)))) (do (shen.unbindv V1950 V2060) Result))) false)))) (if (shen.pvar? V1949) (let A (shen.newpv V2060) (do (shen.bindv V1949 (cons A ()) V2060) (let Result (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y (cons vector (cons A ())) V2059 V2060 V2061)))) (do (shen.unbindv V1949 V2060) Result)))) false))) (if (shen.pvar? V1948) (do (shen.bindv V1948 vector V2060) (let Result (let V1951 (shen.lazyderef (tl V1947) V2060) (if (cons? V1951) (let A (hd V1951) (let V1952 (shen.lazyderef (tl V1951) V2060) (if (= () V1952) (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y (cons vector (cons A ())) V2059 V2060 V2061)))) (if (shen.pvar? V1952) (do (shen.bindv V1952 () V2060) (let Result (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y (cons vector (cons A ())) V2059 V2060 V2061)))) (do (shen.unbindv V1952 V2060) Result))) false)))) (if (shen.pvar? V1951) (let A (shen.newpv V2060) (do (shen.bindv V1951 (cons A ()) V2060) (let Result (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y (cons vector (cons A ())) V2059 V2060 V2061)))) (do (shen.unbindv V1951 V2060) Result)))) false))) (do (shen.unbindv V1948 V2060) Result))) false))) (if (shen.pvar? V1947) (let A (shen.newpv V2060) (do (shen.bindv V1947 (cons vector (cons A ())) V2060) (let Result (do (shen.incinfs) (shen.th* X A V2059 V2060 (freeze (shen.th* Y (cons vector (cons A ())) V2059 V2060 V2061)))) (do (shen.unbindv V1947 V2060) Result)))) false))) false))) false))) false)) false)) false)) (if (= Case false) (let Case (let V1953 (shen.lazyderef V2057 V2060) (if (cons? V1953) (let V1954 (shen.lazyderef (hd V1953) V2060) (if (= @s V1954) (let V1955 (shen.lazyderef (tl V1953) V2060) (if (cons? V1955) (let X (hd V1955) (let V1956 (shen.lazyderef (tl V1955) V2060) (if (cons? V1956) (let Y (hd V1956) (let V1957 (shen.lazyderef (tl V1956) V2060) (if (= () V1957) (let V1958 (shen.lazyderef V2058 V2060) (if (= string V1958) (do (shen.incinfs) (shen.th* X string V2059 V2060 (freeze (shen.th* Y string V2059 V2060 V2061)))) (if (shen.pvar? V1958) (do (shen.bindv V1958 string V2060) (let Result (do (shen.incinfs) (shen.th* X string V2059 V2060 (freeze (shen.th* Y string V2059 V2060 V2061)))) (do (shen.unbindv V1958 V2060) Result))) false))) false))) false))) false)) false)) false)) (if (= Case false) (let Case (let V1959 (shen.lazyderef V2057 V2060) (if (cons? V1959) (let V1960 (shen.lazyderef (hd V1959) V2060) (if (= lambda V1960) (let V1961 (shen.lazyderef (tl V1959) V2060) (if (cons? V1961) (let X (hd V1961) (let V1962 (shen.lazyderef (tl V1961) V2060) (if (cons? V1962) (let Y (hd V1962) (let V1963 (shen.lazyderef (tl V1962) V2060) (if (= () V1963) (let V1964 (shen.lazyderef V2058 V2060) (if (cons? V1964) (let A (hd V1964) (let V1965 (shen.lazyderef (tl V1964) V2060) (if (cons? V1965) (let V1966 (shen.lazyderef (hd V1965) V2060) (if (= --> V1966) (let V1967 (shen.lazyderef (tl V1965) V2060) (if (cons? V1967) (let B (hd V1967) (let V1968 (shen.lazyderef (tl V1967) V2060) (if (= () V1968) (let Z (shen.newpv V2060) (let X&& (shen.newpv V2060) (do (shen.incinfs) (cut Throwcontrol V2060 (freeze (bind X&& (shen.placeholder) V2060 (freeze (bind Z (shen.ebr (shen.lazyderef X&& V2060) (shen.lazyderef X V2060) (shen.lazyderef Y V2060)) V2060 (freeze (shen.th* Z B (cons (cons X&& (cons : (cons A ()))) V2059) V2060 V2061)))))))))) (if (shen.pvar? V1968) (do (shen.bindv V1968 () V2060) (let Result (let Z (shen.newpv V2060) (let X&& (shen.newpv V2060) (do (shen.incinfs) (cut Throwcontrol V2060 (freeze (bind X&& (shen.placeholder) V2060 (freeze (bind Z (shen.ebr (shen.lazyderef X&& V2060) (shen.lazyderef X V2060) (shen.lazyderef Y V2060)) V2060 (freeze (shen.th* Z B (cons (cons X&& (cons : (cons A ()))) V2059) V2060 V2061)))))))))) (do (shen.unbindv V1968 V2060) Result))) false)))) (if (shen.pvar? V1967) (let B (shen.newpv V2060) (do (shen.bindv V1967 (cons B ()) V2060) (let Result (let Z (shen.newpv V2060) (let X&& (shen.newpv V2060) (do (shen.incinfs) (cut Throwcontrol V2060 (freeze (bind X&& (shen.placeholder) V2060 (freeze (bind Z (shen.ebr (shen.lazyderef X&& V2060) (shen.lazyderef X V2060) (shen.lazyderef Y V2060)) V2060 (freeze (shen.th* Z B (cons (cons X&& (cons : (cons A ()))) V2059) V2060 V2061)))))))))) (do (shen.unbindv V1967 V2060) Result)))) false))) (if (shen.pvar? V1966) (do (shen.bindv V1966 --> V2060) (let Result (let V1969 (shen.lazyderef (tl V1965) V2060) (if (cons? V1969) (let B (hd V1969) (let V1970 (shen.lazyderef (tl V1969) V2060) (if (= () V1970) (let Z (shen.newpv V2060) (let X&& (shen.newpv V2060) (do (shen.incinfs) (cut Throwcontrol V2060 (freeze (bind X&& (shen.placeholder) V2060 (freeze (bind Z (shen.ebr (shen.lazyderef X&& V2060) (shen.lazyderef X V2060) (shen.lazyderef Y V2060)) V2060 (freeze (shen.th* Z B (cons (cons X&& (cons : (cons A ()))) V2059) V2060 V2061)))))))))) (if (shen.pvar? V1970) (do (shen.bindv V1970 () V2060) (let Result (let Z (shen.newpv V2060) (let X&& (shen.newpv V2060) (do (shen.incinfs) (cut Throwcontrol V2060 (freeze (bind X&& (shen.placeholder) V2060 (freeze (bind Z (shen.ebr (shen.lazyderef X&& V2060) (shen.lazyderef X V2060) (shen.lazyderef Y V2060)) V2060 (freeze (shen.th* Z B (cons (cons X&& (cons : (cons A ()))) V2059) V2060 V2061)))))))))) (do (shen.unbindv V1970 V2060) Result))) false)))) (if (shen.pvar? V1969) (let B (shen.newpv V2060) (do (shen.bindv V1969 (cons B ()) V2060) (let Result (let Z (shen.newpv V2060) (let X&& (shen.newpv V2060) (do (shen.incinfs) (cut Throwcontrol V2060 (freeze (bind X&& (shen.placeholder) V2060 (freeze (bind Z (shen.ebr (shen.lazyderef X&& V2060) (shen.lazyderef X V2060) (shen.lazyderef Y V2060)) V2060 (freeze (shen.th* Z B (cons (cons X&& (cons : (cons A ()))) V2059) V2060 V2061)))))))))) (do (shen.unbindv V1969 V2060) Result)))) false))) (do (shen.unbindv V1966 V2060) Result))) false))) (if (shen.pvar? V1965) (let B (shen.newpv V2060) (do (shen.bindv V1965 (cons --> (cons B ())) V2060) (let Result (let Z (shen.newpv V2060) (let X&& (shen.newpv V2060) (do (shen.incinfs) (cut Throwcontrol V2060 (freeze (bind X&& (shen.placeholder) V2060 (freeze (bind Z (shen.ebr (shen.lazyderef X&& V2060) (shen.lazyderef X V2060) (shen.lazyderef Y V2060)) V2060 (freeze (shen.th* Z B (cons (cons X&& (cons : (cons A ()))) V2059) V2060 V2061)))))))))) (do (shen.unbindv V1965 V2060) Result)))) false)))) (if (shen.pvar? V1964) (let A (shen.newpv V2060) (let B (shen.newpv V2060) (do (shen.bindv V1964 (cons A (cons --> (cons B ()))) V2060) (let Result (let Z (shen.newpv V2060) (let X&& (shen.newpv V2060) (do (shen.incinfs) (cut Throwcontrol V2060 (freeze (bind X&& (shen.placeholder) V2060 (freeze (bind Z (shen.ebr (shen.lazyderef X&& V2060) (shen.lazyderef X V2060) (shen.lazyderef Y V2060)) V2060 (freeze (shen.th* Z B (cons (cons X&& (cons : (cons A ()))) V2059) V2060 V2061)))))))))) (do (shen.unbindv V1964 V2060) Result))))) false))) false))) false))) false)) false)) false)) (if (= Case false) (let Case (let V1971 (shen.lazyderef V2057 V2060) (if (cons? V1971) (let V1972 (shen.lazyderef (hd V1971) V2060) (if (= let V1972) (let V1973 (shen.lazyderef (tl V1971) V2060) (if (cons? V1973) (let X (hd V1973) (let V1974 (shen.lazyderef (tl V1973) V2060) (if (cons? V1974) (let Y (hd V1974) (let V1975 (shen.lazyderef (tl V1974) V2060) (if (cons? V1975) (let Z (hd V1975) (let V1976 (shen.lazyderef (tl V1975) V2060) (if (= () V1976) (let W (shen.newpv V2060) (let X&& (shen.newpv V2060) (let B (shen.newpv V2060) (do (shen.incinfs) (shen.th* Y B V2059 V2060 (freeze (bind X&& (shen.placeholder) V2060 (freeze (bind W (shen.ebr (shen.lazyderef X&& V2060) (shen.lazyderef X V2060) (shen.lazyderef Z V2060)) V2060 (freeze (shen.th* W V2058 (cons (cons X&& (cons : (cons B ()))) V2059) V2060 V2061))))))))))) false))) false))) false))) false)) false)) false)) (if (= Case false) (let Case (let V1977 (shen.lazyderef V2057 V2060) (if (cons? V1977) (let V1978 (shen.lazyderef (hd V1977) V2060) (if (= open V1978) (let V1979 (shen.lazyderef (tl V1977) V2060) (if (cons? V1979) (let FileName (hd V1979) (let V1980 (shen.lazyderef (tl V1979) V2060) (if (cons? V1980) (let Direction1910 (hd V1980) (let V1981 (shen.lazyderef (tl V1980) V2060) (if (= () V1981) (let V1982 (shen.lazyderef V2058 V2060) (if (cons? V1982) (let V1983 (shen.lazyderef (hd V1982) V2060) (if (= stream V1983) (let V1984 (shen.lazyderef (tl V1982) V2060) (if (cons? V1984) (let Direction (hd V1984) (let V1985 (shen.lazyderef (tl V1984) V2060) (if (= () V1985) (do (shen.incinfs) (unify! Direction Direction1910 V2060 (freeze (cut Throwcontrol V2060 (freeze (shen.th* FileName string V2059 V2060 V2061)))))) (if (shen.pvar? V1985) (do (shen.bindv V1985 () V2060) (let Result (do (shen.incinfs) (unify! Direction Direction1910 V2060 (freeze (cut Throwcontrol V2060 (freeze (shen.th* FileName string V2059 V2060 V2061)))))) (do (shen.unbindv V1985 V2060) Result))) false)))) (if (shen.pvar? V1984) (let Direction (shen.newpv V2060) (do (shen.bindv V1984 (cons Direction ()) V2060) (let Result (do (shen.incinfs) (unify! Direction Direction1910 V2060 (freeze (cut Throwcontrol V2060 (freeze (shen.th* FileName string V2059 V2060 V2061)))))) (do (shen.unbindv V1984 V2060) Result)))) false))) (if (shen.pvar? V1983) (do (shen.bindv V1983 stream V2060) (let Result (let V1986 (shen.lazyderef (tl V1982) V2060) (if (cons? V1986) (let Direction (hd V1986) (let V1987 (shen.lazyderef (tl V1986) V2060) (if (= () V1987) (do (shen.incinfs) (unify! Direction Direction1910 V2060 (freeze (cut Throwcontrol V2060 (freeze (shen.th* FileName string V2059 V2060 V2061)))))) (if (shen.pvar? V1987) (do (shen.bindv V1987 () V2060) (let Result (do (shen.incinfs) (unify! Direction Direction1910 V2060 (freeze (cut Throwcontrol V2060 (freeze (shen.th* FileName string V2059 V2060 V2061)))))) (do (shen.unbindv V1987 V2060) Result))) false)))) (if (shen.pvar? V1986) (let Direction (shen.newpv V2060) (do (shen.bindv V1986 (cons Direction ()) V2060) (let Result (do (shen.incinfs) (unify! Direction Direction1910 V2060 (freeze (cut Throwcontrol V2060 (freeze (shen.th* FileName string V2059 V2060 V2061)))))) (do (shen.unbindv V1986 V2060) Result)))) false))) (do (shen.unbindv V1983 V2060) Result))) false))) (if (shen.pvar? V1982) (let Direction (shen.newpv V2060) (do (shen.bindv V1982 (cons stream (cons Direction ())) V2060) (let Result (do (shen.incinfs) (unify! Direction Direction1910 V2060 (freeze (cut Throwcontrol V2060 (freeze (shen.th* FileName string V2059 V2060 V2061)))))) (do (shen.unbindv V1982 V2060) Result)))) false))) false))) false))) false)) false)) false)) (if (= Case false) (let Case (let V1988 (shen.lazyderef V2057 V2060) (if (cons? V1988) (let V1989 (shen.lazyderef (hd V1988) V2060) (if (= type V1989) (let V1990 (shen.lazyderef (tl V1988) V2060) (if (cons? V1990) (let X (hd V1990) (let V1991 (shen.lazyderef (tl V1990) V2060) (if (cons? V1991) (let A (hd V1991) (let V1992 (shen.lazyderef (tl V1991) V2060) (if (= () V1992) (do (shen.incinfs) (cut Throwcontrol V2060 (freeze (unify A V2058 V2060 (freeze (shen.th* X A V2059 V2060 V2061)))))) false))) false))) false)) false)) false)) (if (= Case false) (let Case (let V1993 (shen.lazyderef V2057 V2060) (if (cons? V1993) (let V1994 (shen.lazyderef (hd V1993) V2060) (if (= input+ V1994) (let V1995 (shen.lazyderef (tl V1993) V2060) (if (cons? V1995) (let A (hd V1995) (let V1996 (shen.lazyderef (tl V1995) V2060) (if (cons? V1996) (let Stream (hd V1996) (let V1997 (shen.lazyderef (tl V1996) V2060) (if (= () V1997) (let C (shen.newpv V2060) (do (shen.incinfs) (bind C (shen.demodulate (shen.lazyderef A V2060)) V2060 (freeze (unify V2058 C V2060 (freeze (shen.th* Stream (cons stream (cons in ())) V2059 V2060 V2061))))))) false))) false))) false)) false)) false)) (if (= Case false) (let Case (let V1998 (shen.lazyderef V2057 V2060) (if (cons? V1998) (let V1999 (shen.lazyderef (hd V1998) V2060) (if (= set V1999) (let V2000 (shen.lazyderef (tl V1998) V2060) (if (cons? V2000) (let Var (hd V2000) (let V2001 (shen.lazyderef (tl V2000) V2060) (if (cons? V2001) (let Val (hd V2001) (let V2002 (shen.lazyderef (tl V2001) V2060) (if (= () V2002) (do (shen.incinfs) (cut Throwcontrol V2060 (freeze (shen.th* Var symbol V2059 V2060 (freeze (cut Throwcontrol V2060 (freeze (shen.th* (cons value (cons Var ())) V2058 V2059 V2060 (freeze (shen.th* Val V2058 V2059 V2060 V2061)))))))))) false))) false))) false)) false)) false)) (if (= Case false) (let Case (let NewHyp (shen.newpv V2060) (do (shen.incinfs) (shen.t*-hyps V2059 NewHyp V2060 (freeze (shen.th* V2057 V2058 NewHyp V2060 V2061))))) (if (= Case false) (let Case (let V2003 (shen.lazyderef V2057 V2060) (if (cons? V2003) (let V2004 (shen.lazyderef (hd V2003) V2060) (if (= define V2004) (let V2005 (shen.lazyderef (tl V2003) V2060) (if (cons? V2005) (let F (hd V2005) (let X (tl V2005) (do (shen.incinfs) (cut Throwcontrol V2060 (freeze (shen.t*-def (cons define (cons F X)) V2058 V2059 V2060 V2061)))))) false)) false)) false)) (if (= Case false) (let Case (let V2006 (shen.lazyderef V2057 V2060) (if (cons? V2006) (let V2007 (shen.lazyderef (hd V2006) V2060) (if (= defmacro V2007) (let V2008 (shen.lazyderef V2058 V2060) (if (= unit V2008) (do (shen.incinfs) (cut Throwcontrol V2060 V2061)) (if (shen.pvar? V2008) (do (shen.bindv V2008 unit V2060) (let Result (do (shen.incinfs) (cut Throwcontrol V2060 V2061)) (do (shen.unbindv V2008 V2060) Result))) false))) false)) false)) (if (= Case false) (let Case (let V2009 (shen.lazyderef V2057 V2060) (if (cons? V2009) (let V2010 (shen.lazyderef (hd V2009) V2060) (if (= shen.process-datatype V2010) (let V2011 (shen.lazyderef V2058 V2060) (if (= symbol V2011) (do (shen.incinfs) (thaw V2061)) (if (shen.pvar? V2011) (do (shen.bindv V2011 symbol V2060) (let Result (do (shen.incinfs) (thaw V2061)) (do (shen.unbindv V2011 V2060) Result))) false))) false)) false)) (if (= Case false) (let Case (let V2012 (shen.lazyderef V2057 V2060) (if (cons? V2012) (let V2013 (shen.lazyderef (hd V2012) V2060) (if (= shen.synonyms-help V2013) (let V2014 (shen.lazyderef V2058 V2060) (if (= symbol V2014) (do (shen.incinfs) (thaw V2061)) (if (shen.pvar? V2014) (do (shen.bindv V2014 symbol V2060) (let Result (do (shen.incinfs) (thaw V2061)) (do (shen.unbindv V2014 V2060) Result))) false))) false)) false)) (if (= Case false) (let Datatypes (shen.newpv V2060) (do (shen.incinfs) (bind Datatypes (value shen.*datatypes*) V2060 (freeze (shen.udefs* (cons V2057 (cons : (cons V2058 ()))) V2059 Datatypes V2060 V2061))))) Case)) Case)) Case)) Case)) Case)) Case)) Case)) Case)) Case)) Case)) Case)) Case)) Case)) Case)) Case)) Case)) Case)) Case)) Case)) Case)) Case)))))
50
+
51
+ (defun shen.t*-hyps (V2062 V2063 V2064 V2065) (let Case (let V1825 (shen.lazyderef V2062 V2064) (if (cons? V1825) (let V1826 (shen.lazyderef (hd V1825) V2064) (if (cons? V1826) (let V1827 (shen.lazyderef (hd V1826) V2064) (if (cons? V1827) (let V1828 (shen.lazyderef (hd V1827) V2064) (if (= cons V1828) (let V1829 (shen.lazyderef (tl V1827) V2064) (if (cons? V1829) (let X (hd V1829) (let V1830 (shen.lazyderef (tl V1829) V2064) (if (cons? V1830) (let Y (hd V1830) (let V1831 (shen.lazyderef (tl V1830) V2064) (if (= () V1831) (let V1832 (shen.lazyderef (tl V1826) V2064) (if (cons? V1832) (let V1833 (shen.lazyderef (hd V1832) V2064) (if (= : V1833) (let V1834 (shen.lazyderef (tl V1832) V2064) (if (cons? V1834) (let V1835 (shen.lazyderef (hd V1834) V2064) (if (cons? V1835) (let V1836 (shen.lazyderef (hd V1835) V2064) (if (= list V1836) (let V1837 (shen.lazyderef (tl V1835) V2064) (if (cons? V1837) (let A (hd V1837) (let V1838 (shen.lazyderef (tl V1837) V2064) (if (= () V1838) (let V1839 (shen.lazyderef (tl V1834) V2064) (if (= () V1839) (let Hyp (tl V1825) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons list (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1839) (do (shen.bindv V1839 () V2064) (let Result (let Hyp (tl V1825) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons list (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1839 V2064) Result))) false))) (if (shen.pvar? V1838) (do (shen.bindv V1838 () V2064) (let Result (let V1840 (shen.lazyderef (tl V1834) V2064) (if (= () V1840) (let Hyp (tl V1825) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons list (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1840) (do (shen.bindv V1840 () V2064) (let Result (let Hyp (tl V1825) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons list (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1840 V2064) Result))) false))) (do (shen.unbindv V1838 V2064) Result))) false)))) (if (shen.pvar? V1837) (let A (shen.newpv V2064) (do (shen.bindv V1837 (cons A ()) V2064) (let Result (let V1841 (shen.lazyderef (tl V1834) V2064) (if (= () V1841) (let Hyp (tl V1825) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons list (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1841) (do (shen.bindv V1841 () V2064) (let Result (let Hyp (tl V1825) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons list (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1841 V2064) Result))) false))) (do (shen.unbindv V1837 V2064) Result)))) false))) (if (shen.pvar? V1836) (do (shen.bindv V1836 list V2064) (let Result (let V1842 (shen.lazyderef (tl V1835) V2064) (if (cons? V1842) (let A (hd V1842) (let V1843 (shen.lazyderef (tl V1842) V2064) (if (= () V1843) (let V1844 (shen.lazyderef (tl V1834) V2064) (if (= () V1844) (let Hyp (tl V1825) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons list (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1844) (do (shen.bindv V1844 () V2064) (let Result (let Hyp (tl V1825) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons list (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1844 V2064) Result))) false))) (if (shen.pvar? V1843) (do (shen.bindv V1843 () V2064) (let Result (let V1845 (shen.lazyderef (tl V1834) V2064) (if (= () V1845) (let Hyp (tl V1825) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons list (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1845) (do (shen.bindv V1845 () V2064) (let Result (let Hyp (tl V1825) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons list (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1845 V2064) Result))) false))) (do (shen.unbindv V1843 V2064) Result))) false)))) (if (shen.pvar? V1842) (let A (shen.newpv V2064) (do (shen.bindv V1842 (cons A ()) V2064) (let Result (let V1846 (shen.lazyderef (tl V1834) V2064) (if (= () V1846) (let Hyp (tl V1825) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons list (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1846) (do (shen.bindv V1846 () V2064) (let Result (let Hyp (tl V1825) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons list (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1846 V2064) Result))) false))) (do (shen.unbindv V1842 V2064) Result)))) false))) (do (shen.unbindv V1836 V2064) Result))) false))) (if (shen.pvar? V1835) (let A (shen.newpv V2064) (do (shen.bindv V1835 (cons list (cons A ())) V2064) (let Result (let V1847 (shen.lazyderef (tl V1834) V2064) (if (= () V1847) (let Hyp (tl V1825) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons list (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1847) (do (shen.bindv V1847 () V2064) (let Result (let Hyp (tl V1825) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons list (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1847 V2064) Result))) false))) (do (shen.unbindv V1835 V2064) Result)))) false))) false)) false)) false)) false))) false))) false)) false)) false)) false)) false)) (if (= Case false) (let Case (let V1848 (shen.lazyderef V2062 V2064) (if (cons? V1848) (let V1849 (shen.lazyderef (hd V1848) V2064) (if (cons? V1849) (let V1850 (shen.lazyderef (hd V1849) V2064) (if (cons? V1850) (let V1851 (shen.lazyderef (hd V1850) V2064) (if (= @p V1851) (let V1852 (shen.lazyderef (tl V1850) V2064) (if (cons? V1852) (let X (hd V1852) (let V1853 (shen.lazyderef (tl V1852) V2064) (if (cons? V1853) (let Y (hd V1853) (let V1854 (shen.lazyderef (tl V1853) V2064) (if (= () V1854) (let V1855 (shen.lazyderef (tl V1849) V2064) (if (cons? V1855) (let V1856 (shen.lazyderef (hd V1855) V2064) (if (= : V1856) (let V1857 (shen.lazyderef (tl V1855) V2064) (if (cons? V1857) (let V1858 (shen.lazyderef (hd V1857) V2064) (if (cons? V1858) (let A (hd V1858) (let V1859 (shen.lazyderef (tl V1858) V2064) (if (cons? V1859) (let V1860 (shen.lazyderef (hd V1859) V2064) (if (= * V1860) (let V1861 (shen.lazyderef (tl V1859) V2064) (if (cons? V1861) (let B (hd V1861) (let V1862 (shen.lazyderef (tl V1861) V2064) (if (= () V1862) (let V1863 (shen.lazyderef (tl V1857) V2064) (if (= () V1863) (let Hyp (tl V1848) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (shen.lazyderef B V2064) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1863) (do (shen.bindv V1863 () V2064) (let Result (let Hyp (tl V1848) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (shen.lazyderef B V2064) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1863 V2064) Result))) false))) (if (shen.pvar? V1862) (do (shen.bindv V1862 () V2064) (let Result (let V1864 (shen.lazyderef (tl V1857) V2064) (if (= () V1864) (let Hyp (tl V1848) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (shen.lazyderef B V2064) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1864) (do (shen.bindv V1864 () V2064) (let Result (let Hyp (tl V1848) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (shen.lazyderef B V2064) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1864 V2064) Result))) false))) (do (shen.unbindv V1862 V2064) Result))) false)))) (if (shen.pvar? V1861) (let B (shen.newpv V2064) (do (shen.bindv V1861 (cons B ()) V2064) (let Result (let V1865 (shen.lazyderef (tl V1857) V2064) (if (= () V1865) (let Hyp (tl V1848) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (shen.lazyderef B V2064) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1865) (do (shen.bindv V1865 () V2064) (let Result (let Hyp (tl V1848) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (shen.lazyderef B V2064) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1865 V2064) Result))) false))) (do (shen.unbindv V1861 V2064) Result)))) false))) (if (shen.pvar? V1860) (do (shen.bindv V1860 * V2064) (let Result (let V1866 (shen.lazyderef (tl V1859) V2064) (if (cons? V1866) (let B (hd V1866) (let V1867 (shen.lazyderef (tl V1866) V2064) (if (= () V1867) (let V1868 (shen.lazyderef (tl V1857) V2064) (if (= () V1868) (let Hyp (tl V1848) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (shen.lazyderef B V2064) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1868) (do (shen.bindv V1868 () V2064) (let Result (let Hyp (tl V1848) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (shen.lazyderef B V2064) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1868 V2064) Result))) false))) (if (shen.pvar? V1867) (do (shen.bindv V1867 () V2064) (let Result (let V1869 (shen.lazyderef (tl V1857) V2064) (if (= () V1869) (let Hyp (tl V1848) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (shen.lazyderef B V2064) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1869) (do (shen.bindv V1869 () V2064) (let Result (let Hyp (tl V1848) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (shen.lazyderef B V2064) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1869 V2064) Result))) false))) (do (shen.unbindv V1867 V2064) Result))) false)))) (if (shen.pvar? V1866) (let B (shen.newpv V2064) (do (shen.bindv V1866 (cons B ()) V2064) (let Result (let V1870 (shen.lazyderef (tl V1857) V2064) (if (= () V1870) (let Hyp (tl V1848) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (shen.lazyderef B V2064) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1870) (do (shen.bindv V1870 () V2064) (let Result (let Hyp (tl V1848) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (shen.lazyderef B V2064) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1870 V2064) Result))) false))) (do (shen.unbindv V1866 V2064) Result)))) false))) (do (shen.unbindv V1860 V2064) Result))) false))) (if (shen.pvar? V1859) (let B (shen.newpv V2064) (do (shen.bindv V1859 (cons * (cons B ())) V2064) (let Result (let V1871 (shen.lazyderef (tl V1857) V2064) (if (= () V1871) (let Hyp (tl V1848) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (shen.lazyderef B V2064) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1871) (do (shen.bindv V1871 () V2064) (let Result (let Hyp (tl V1848) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (shen.lazyderef B V2064) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1871 V2064) Result))) false))) (do (shen.unbindv V1859 V2064) Result)))) false)))) (if (shen.pvar? V1858) (let A (shen.newpv V2064) (let B (shen.newpv V2064) (do (shen.bindv V1858 (cons A (cons * (cons B ()))) V2064) (let Result (let V1872 (shen.lazyderef (tl V1857) V2064) (if (= () V1872) (let Hyp (tl V1848) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (shen.lazyderef B V2064) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1872) (do (shen.bindv V1872 () V2064) (let Result (let Hyp (tl V1848) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (shen.lazyderef B V2064) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1872 V2064) Result))) false))) (do (shen.unbindv V1858 V2064) Result))))) false))) false)) false)) false)) false))) false))) false)) false)) false)) false)) false)) (if (= Case false) (let Case (let V1873 (shen.lazyderef V2062 V2064) (if (cons? V1873) (let V1874 (shen.lazyderef (hd V1873) V2064) (if (cons? V1874) (let V1875 (shen.lazyderef (hd V1874) V2064) (if (cons? V1875) (let V1876 (shen.lazyderef (hd V1875) V2064) (if (= @v V1876) (let V1877 (shen.lazyderef (tl V1875) V2064) (if (cons? V1877) (let X (hd V1877) (let V1878 (shen.lazyderef (tl V1877) V2064) (if (cons? V1878) (let Y (hd V1878) (let V1879 (shen.lazyderef (tl V1878) V2064) (if (= () V1879) (let V1880 (shen.lazyderef (tl V1874) V2064) (if (cons? V1880) (let V1881 (shen.lazyderef (hd V1880) V2064) (if (= : V1881) (let V1882 (shen.lazyderef (tl V1880) V2064) (if (cons? V1882) (let V1883 (shen.lazyderef (hd V1882) V2064) (if (cons? V1883) (let V1884 (shen.lazyderef (hd V1883) V2064) (if (= vector V1884) (let V1885 (shen.lazyderef (tl V1883) V2064) (if (cons? V1885) (let A (hd V1885) (let V1886 (shen.lazyderef (tl V1885) V2064) (if (= () V1886) (let V1887 (shen.lazyderef (tl V1882) V2064) (if (= () V1887) (let Hyp (tl V1873) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons vector (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1887) (do (shen.bindv V1887 () V2064) (let Result (let Hyp (tl V1873) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons vector (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1887 V2064) Result))) false))) (if (shen.pvar? V1886) (do (shen.bindv V1886 () V2064) (let Result (let V1888 (shen.lazyderef (tl V1882) V2064) (if (= () V1888) (let Hyp (tl V1873) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons vector (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1888) (do (shen.bindv V1888 () V2064) (let Result (let Hyp (tl V1873) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons vector (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1888 V2064) Result))) false))) (do (shen.unbindv V1886 V2064) Result))) false)))) (if (shen.pvar? V1885) (let A (shen.newpv V2064) (do (shen.bindv V1885 (cons A ()) V2064) (let Result (let V1889 (shen.lazyderef (tl V1882) V2064) (if (= () V1889) (let Hyp (tl V1873) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons vector (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1889) (do (shen.bindv V1889 () V2064) (let Result (let Hyp (tl V1873) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons vector (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1889 V2064) Result))) false))) (do (shen.unbindv V1885 V2064) Result)))) false))) (if (shen.pvar? V1884) (do (shen.bindv V1884 vector V2064) (let Result (let V1890 (shen.lazyderef (tl V1883) V2064) (if (cons? V1890) (let A (hd V1890) (let V1891 (shen.lazyderef (tl V1890) V2064) (if (= () V1891) (let V1892 (shen.lazyderef (tl V1882) V2064) (if (= () V1892) (let Hyp (tl V1873) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons vector (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1892) (do (shen.bindv V1892 () V2064) (let Result (let Hyp (tl V1873) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons vector (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1892 V2064) Result))) false))) (if (shen.pvar? V1891) (do (shen.bindv V1891 () V2064) (let Result (let V1893 (shen.lazyderef (tl V1882) V2064) (if (= () V1893) (let Hyp (tl V1873) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons vector (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1893) (do (shen.bindv V1893 () V2064) (let Result (let Hyp (tl V1873) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons vector (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1893 V2064) Result))) false))) (do (shen.unbindv V1891 V2064) Result))) false)))) (if (shen.pvar? V1890) (let A (shen.newpv V2064) (do (shen.bindv V1890 (cons A ()) V2064) (let Result (let V1894 (shen.lazyderef (tl V1882) V2064) (if (= () V1894) (let Hyp (tl V1873) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons vector (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1894) (do (shen.bindv V1894 () V2064) (let Result (let Hyp (tl V1873) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons vector (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1894 V2064) Result))) false))) (do (shen.unbindv V1890 V2064) Result)))) false))) (do (shen.unbindv V1884 V2064) Result))) false))) (if (shen.pvar? V1883) (let A (shen.newpv V2064) (do (shen.bindv V1883 (cons vector (cons A ())) V2064) (let Result (let V1895 (shen.lazyderef (tl V1882) V2064) (if (= () V1895) (let Hyp (tl V1873) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons vector (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1895) (do (shen.bindv V1895 () V2064) (let Result (let Hyp (tl V1873) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons (shen.lazyderef A V2064) ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons (cons vector (cons (shen.lazyderef A V2064) ())) ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1895 V2064) Result))) false))) (do (shen.unbindv V1883 V2064) Result)))) false))) false)) false)) false)) false))) false))) false)) false)) false)) false)) false)) (if (= Case false) (let Case (let V1896 (shen.lazyderef V2062 V2064) (if (cons? V1896) (let V1897 (shen.lazyderef (hd V1896) V2064) (if (cons? V1897) (let V1898 (shen.lazyderef (hd V1897) V2064) (if (cons? V1898) (let V1899 (shen.lazyderef (hd V1898) V2064) (if (= @s V1899) (let V1900 (shen.lazyderef (tl V1898) V2064) (if (cons? V1900) (let X (hd V1900) (let V1901 (shen.lazyderef (tl V1900) V2064) (if (cons? V1901) (let Y (hd V1901) (let V1902 (shen.lazyderef (tl V1901) V2064) (if (= () V1902) (let V1903 (shen.lazyderef (tl V1897) V2064) (if (cons? V1903) (let V1904 (shen.lazyderef (hd V1903) V2064) (if (= : V1904) (let V1905 (shen.lazyderef (tl V1903) V2064) (if (cons? V1905) (let V1906 (shen.lazyderef (hd V1905) V2064) (if (= string V1906) (let V1907 (shen.lazyderef (tl V1905) V2064) (if (= () V1907) (let Hyp (tl V1896) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons string ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons string ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1907) (do (shen.bindv V1907 () V2064) (let Result (let Hyp (tl V1896) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons string ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons string ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1907 V2064) Result))) false))) (if (shen.pvar? V1906) (do (shen.bindv V1906 string V2064) (let Result (let V1908 (shen.lazyderef (tl V1905) V2064) (if (= () V1908) (let Hyp (tl V1896) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons string ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons string ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (if (shen.pvar? V1908) (do (shen.bindv V1908 () V2064) (let Result (let Hyp (tl V1896) (do (shen.incinfs) (bind V2063 (cons (cons (shen.lazyderef X V2064) (cons : (cons string ()))) (cons (cons (shen.lazyderef Y V2064) (cons : (cons string ()))) (shen.lazyderef Hyp V2064))) V2064 V2065))) (do (shen.unbindv V1908 V2064) Result))) false))) (do (shen.unbindv V1906 V2064) Result))) false))) false)) false)) false)) false))) false))) false)) false)) false)) false)) false)) (if (= Case false) (let V1909 (shen.lazyderef V2062 V2064) (if (cons? V1909) (let X (hd V1909) (let Hyp (tl V1909) (let NewHyps (shen.newpv V2064) (do (shen.incinfs) (bind V2063 (cons (shen.lazyderef X V2064) (shen.lazyderef NewHyps V2064)) V2064 (freeze (shen.t*-hyps Hyp NewHyps V2064 V2065))))))) false)) Case)) Case)) Case)) Case)))
52
+
53
+ (defun shen.show (V2078 V2079 V2080 V2081) (cond ((value shen.*spy*) (do (shen.line) (do (shen.show-p (shen.deref V2078 V2080)) (do (nl 1) (do (nl 1) (do (shen.show-assumptions (shen.deref V2079 V2080) 1) (do (shen.prhush "
54
+ > " (stoutput)) (do (shen.pause-for-user) (thaw V2081))))))))) (true (thaw V2081))))
55
+
56
+ (defun shen.line () (let Infs (inferences) (shen.prhush (cn "____________________________________________________________ " (shen.app Infs (cn " inference" (shen.app (if (= 1 Infs) "" "s") "
57
+ ?- " shen.a)) shen.a)) (stoutput))))
58
+
59
+ (defun shen.show-p (V2082) (cond ((and (cons? V2082) (and (cons? (tl V2082)) (and (= : (hd (tl V2082))) (and (cons? (tl (tl V2082))) (= () (tl (tl (tl V2082)))))))) (shen.prhush (shen.app (hd V2082) (cn " : " (shen.app (hd (tl (tl V2082))) "" shen.r)) shen.r) (stoutput))) (true (shen.prhush (shen.app V2082 "" shen.r) (stoutput)))))
60
+
61
+ (defun shen.show-assumptions (V2085 V2086) (cond ((= () V2085) shen.skip) ((cons? V2085) (do (shen.prhush (shen.app V2086 ". " shen.a) (stoutput)) (do (shen.show-p (hd V2085)) (do (nl 1) (shen.show-assumptions (tl V2085) (+ V2086 1)))))) (true (shen.f_error shen.show-assumptions))))
62
+
63
+ (defun shen.pause-for-user () (let Byte (read-byte (stinput)) (if (= Byte 94) (simple-error "input aborted
64
+ ") (nl 1))))
65
+
66
+ (defun shen.typedf? (V2087) (cons? (assoc V2087 (value shen.*signedfuncs*))))
67
+
68
+ (defun shen.sigf (V2088) (concat shen.type-signature-of- V2088))
69
+
70
+ (defun shen.placeholder () (gensym &&))
71
+
72
+ (defun shen.base (V2089 V2090 V2091 V2092) (let Case (let V1812 (shen.lazyderef V2090 V2091) (if (= number V1812) (do (shen.incinfs) (fwhen (number? (shen.lazyderef V2089 V2091)) V2091 V2092)) (if (shen.pvar? V1812) (do (shen.bindv V1812 number V2091) (let Result (do (shen.incinfs) (fwhen (number? (shen.lazyderef V2089 V2091)) V2091 V2092)) (do (shen.unbindv V1812 V2091) Result))) false))) (if (= Case false) (let Case (let V1813 (shen.lazyderef V2090 V2091) (if (= boolean V1813) (do (shen.incinfs) (fwhen (boolean? (shen.lazyderef V2089 V2091)) V2091 V2092)) (if (shen.pvar? V1813) (do (shen.bindv V1813 boolean V2091) (let Result (do (shen.incinfs) (fwhen (boolean? (shen.lazyderef V2089 V2091)) V2091 V2092)) (do (shen.unbindv V1813 V2091) Result))) false))) (if (= Case false) (let Case (let V1814 (shen.lazyderef V2090 V2091) (if (= string V1814) (do (shen.incinfs) (fwhen (string? (shen.lazyderef V2089 V2091)) V2091 V2092)) (if (shen.pvar? V1814) (do (shen.bindv V1814 string V2091) (let Result (do (shen.incinfs) (fwhen (string? (shen.lazyderef V2089 V2091)) V2091 V2092)) (do (shen.unbindv V1814 V2091) Result))) false))) (if (= Case false) (let Case (let V1815 (shen.lazyderef V2090 V2091) (if (= symbol V1815) (do (shen.incinfs) (fwhen (symbol? (shen.lazyderef V2089 V2091)) V2091 (freeze (fwhen (not (shen.ue? (shen.lazyderef V2089 V2091))) V2091 V2092)))) (if (shen.pvar? V1815) (do (shen.bindv V1815 symbol V2091) (let Result (do (shen.incinfs) (fwhen (symbol? (shen.lazyderef V2089 V2091)) V2091 (freeze (fwhen (not (shen.ue? (shen.lazyderef V2089 V2091))) V2091 V2092)))) (do (shen.unbindv V1815 V2091) Result))) false))) (if (= Case false) (let V1816 (shen.lazyderef V2089 V2091) (if (= () V1816) (let V1817 (shen.lazyderef V2090 V2091) (if (cons? V1817) (let V1818 (shen.lazyderef (hd V1817) V2091) (if (= list V1818) (let V1819 (shen.lazyderef (tl V1817) V2091) (if (cons? V1819) (let A (hd V1819) (let V1820 (shen.lazyderef (tl V1819) V2091) (if (= () V1820) (do (shen.incinfs) (thaw V2092)) (if (shen.pvar? V1820) (do (shen.bindv V1820 () V2091) (let Result (do (shen.incinfs) (thaw V2092)) (do (shen.unbindv V1820 V2091) Result))) false)))) (if (shen.pvar? V1819) (let A (shen.newpv V2091) (do (shen.bindv V1819 (cons A ()) V2091) (let Result (do (shen.incinfs) (thaw V2092)) (do (shen.unbindv V1819 V2091) Result)))) false))) (if (shen.pvar? V1818) (do (shen.bindv V1818 list V2091) (let Result (let V1821 (shen.lazyderef (tl V1817) V2091) (if (cons? V1821) (let A (hd V1821) (let V1822 (shen.lazyderef (tl V1821) V2091) (if (= () V1822) (do (shen.incinfs) (thaw V2092)) (if (shen.pvar? V1822) (do (shen.bindv V1822 () V2091) (let Result (do (shen.incinfs) (thaw V2092)) (do (shen.unbindv V1822 V2091) Result))) false)))) (if (shen.pvar? V1821) (let A (shen.newpv V2091) (do (shen.bindv V1821 (cons A ()) V2091) (let Result (do (shen.incinfs) (thaw V2092)) (do (shen.unbindv V1821 V2091) Result)))) false))) (do (shen.unbindv V1818 V2091) Result))) false))) (if (shen.pvar? V1817) (let A (shen.newpv V2091) (do (shen.bindv V1817 (cons list (cons A ())) V2091) (let Result (do (shen.incinfs) (thaw V2092)) (do (shen.unbindv V1817 V2091) Result)))) false))) false)) Case)) Case)) Case)) Case)))
73
+
74
+ (defun shen.by_hypothesis (V2093 V2094 V2095 V2096 V2097) (let Case (let V1803 (shen.lazyderef V2095 V2096) (if (cons? V1803) (let V1804 (shen.lazyderef (hd V1803) V2096) (if (cons? V1804) (let Y (hd V1804) (let V1805 (shen.lazyderef (tl V1804) V2096) (if (cons? V1805) (let V1806 (shen.lazyderef (hd V1805) V2096) (if (= : V1806) (let V1807 (shen.lazyderef (tl V1805) V2096) (if (cons? V1807) (let B (hd V1807) (let V1808 (shen.lazyderef (tl V1807) V2096) (if (= () V1808) (do (shen.incinfs) (identical V2093 Y V2096 (freeze (unify! V2094 B V2096 V2097)))) false))) false)) false)) false))) false)) false)) (if (= Case false) (let V1809 (shen.lazyderef V2095 V2096) (if (cons? V1809) (let Hyp (tl V1809) (do (shen.incinfs) (shen.by_hypothesis V2093 V2094 Hyp V2096 V2097))) false)) Case)))
75
+
76
+ (defun shen.t*-def (V2098 V2099 V2100 V2101 V2102) (let V1797 (shen.lazyderef V2098 V2101) (if (cons? V1797) (let V1798 (shen.lazyderef (hd V1797) V2101) (if (= define V1798) (let V1799 (shen.lazyderef (tl V1797) V2101) (if (cons? V1799) (let F (hd V1799) (let X (tl V1799) (let E (shen.newpv V2101) (do (shen.incinfs) (shen.t*-defh (compile shen.<sig+rules> X (lambda E (if (cons? E) (simple-error (cn "parse error here: " (shen.app E "
77
+ " shen.s))) (simple-error "parse error
78
+ ")))) F V2099 V2100 V2101 V2102))))) false)) false)) false)))
79
+
80
+ (defun shen.t*-defh (V2103 V2104 V2105 V2106 V2107 V2108) (let V1793 (shen.lazyderef V2103 V2107) (if (cons? V1793) (let Sig (hd V1793) (let Rules (tl V1793) (do (shen.incinfs) (shen.t*-defhh Sig (shen.ue-sig Sig) V2104 V2105 V2106 Rules V2107 V2108)))) false)))
81
+
82
+ (defun shen.t*-defhh (V2109 V2110 V2111 V2112 V2113 V2114 V2115 V2116) (do (shen.incinfs) (shen.t*-rules V2114 V2110 1 V2111 (cons (cons V2111 (cons : (cons V2110 ()))) V2113) V2115 (freeze (shen.memo V2111 V2109 V2112 V2115 V2116)))))
83
+
84
+ (defun shen.memo (V2117 V2118 V2119 V2120 V2121) (let Jnk (shen.newpv V2120) (do (shen.incinfs) (unify! V2119 V2118 V2120 (freeze (bind Jnk (declare (shen.lazyderef V2117 V2120) (shen.lazyderef V2119 V2120)) V2120 V2121))))))
85
+
86
+ (defun shen.<sig+rules> (V2122) (let Parse_shen.<signature> (shen.<signature> V2122) (if (not (= (fail) Parse_shen.<signature>)) (let Parse_shen.<non-ll-rules> (shen.<non-ll-rules> Parse_shen.<signature>) (if (not (= (fail) Parse_shen.<non-ll-rules>)) (shen.pair (hd Parse_shen.<non-ll-rules>) (cons (shen.hdtl Parse_shen.<signature>) (shen.hdtl Parse_shen.<non-ll-rules>))) (fail))) (fail))))
87
+
88
+ (defun shen.<non-ll-rules> (V2123) (let YaccParse (let Parse_shen.<rule> (shen.<rule> V2123) (if (not (= (fail) Parse_shen.<rule>)) (let Parse_shen.<non-ll-rules> (shen.<non-ll-rules> Parse_shen.<rule>) (if (not (= (fail) Parse_shen.<non-ll-rules>)) (shen.pair (hd Parse_shen.<non-ll-rules>) (cons (shen.hdtl Parse_shen.<rule>) (shen.hdtl Parse_shen.<non-ll-rules>))) (fail))) (fail))) (if (= YaccParse (fail)) (let Parse_shen.<rule> (shen.<rule> V2123) (if (not (= (fail) Parse_shen.<rule>)) (shen.pair (hd Parse_shen.<rule>) (cons (shen.hdtl Parse_shen.<rule>) ())) (fail))) YaccParse)))
89
+
90
+ (defun shen.ue (V2124) (cond ((and (cons? V2124) (and (cons? (tl V2124)) (and (= () (tl (tl V2124))) (= (hd V2124) protect)))) V2124) ((cons? V2124) (map shen.ue V2124)) ((variable? V2124) (concat && V2124)) (true V2124)))
91
+
92
+ (defun shen.ue-sig (V2125) (cond ((cons? V2125) (map shen.ue-sig V2125)) ((variable? V2125) (concat &&& V2125)) (true V2125)))
93
+
94
+ (defun shen.ues (V2130) (cond ((shen.ue? V2130) (cons V2130 ())) ((cons? V2130) (union (shen.ues (hd V2130)) (shen.ues (tl V2130)))) (true ())))
95
+
96
+ (defun shen.ue? (V2131) (and (symbol? V2131) (shen.ue-h? (str V2131))))
97
+
98
+ (defun shen.ue-h? (V2138) (cond ((and (shen.+string? V2138) (and (= "&" (pos V2138 0)) (and (shen.+string? (tlstr V2138)) (= "&" (pos (tlstr V2138) 0))))) true) (true false)))
99
+
100
+ (defun shen.t*-rules (V2139 V2140 V2141 V2142 V2143 V2144 V2145) (let Throwcontrol (shen.catchpoint) (shen.cutpoint Throwcontrol (let Case (let V1777 (shen.lazyderef V2139 V2144) (if (= () V1777) (do (shen.incinfs) (thaw V2145)) false)) (if (= Case false) (let Case (let V1778 (shen.lazyderef V2139 V2144) (if (cons? V1778) (let Rule (hd V1778) (let Rules (tl V1778) (do (shen.incinfs) (shen.t*-rule (shen.ue Rule) V2140 V2143 V2144 (freeze (cut Throwcontrol V2144 (freeze (shen.t*-rules Rules V2140 (+ V2141 1) V2142 V2143 V2144 V2145)))))))) false)) (if (= Case false) (let Err (shen.newpv V2144) (do (shen.incinfs) (bind Err (simple-error (cn "type error in rule " (shen.app (shen.lazyderef V2141 V2144) (cn " of " (shen.app (shen.lazyderef V2142 V2144) "" shen.a)) shen.a))) V2144 V2145))) Case)) Case)))))
101
+
102
+ (defun shen.t*-rule (V2146 V2147 V2148 V2149 V2150) (let Throwcontrol (shen.catchpoint) (shen.cutpoint Throwcontrol (let V1769 (shen.lazyderef V2146 V2149) (if (cons? V1769) (let Patterns (hd V1769) (let V1770 (shen.lazyderef (tl V1769) V2149) (if (cons? V1770) (let Action (hd V1770) (let V1771 (shen.lazyderef (tl V1770) V2149) (if (= () V1771) (let NewHyps (shen.newpv V2149) (do (shen.incinfs) (shen.newhyps (shen.placeholders Patterns) V2148 NewHyps V2149 (freeze (shen.t*-patterns Patterns V2147 NewHyps V2149 (freeze (cut Throwcontrol V2149 (freeze (shen.t*-action (shen.curry (shen.ue Action)) (shen.result-type Patterns V2147) (shen.patthyps Patterns V2147 V2148) V2149 V2150))))))))) false))) false))) false)))))
103
+
104
+ (defun shen.placeholders (V2155) (cond ((shen.ue? V2155) (cons V2155 ())) ((cons? V2155) (union (shen.placeholders (hd V2155)) (shen.placeholders (tl V2155)))) (true ())))
105
+
106
+ (defun shen.newhyps (V2156 V2157 V2158 V2159 V2160) (let Case (let V1756 (shen.lazyderef V2156 V2159) (if (= () V1756) (do (shen.incinfs) (unify! V2158 V2157 V2159 V2160)) false)) (if (= Case false) (let V1757 (shen.lazyderef V2156 V2159) (if (cons? V1757) (let V1752 (hd V1757) (let Vs (tl V1757) (let V1758 (shen.lazyderef V2158 V2159) (if (cons? V1758) (let V1759 (shen.lazyderef (hd V1758) V2159) (if (cons? V1759) (let V (hd V1759) (let V1760 (shen.lazyderef (tl V1759) V2159) (if (cons? V1760) (let V1761 (shen.lazyderef (hd V1760) V2159) (if (= : V1761) (let V1762 (shen.lazyderef (tl V1760) V2159) (if (cons? V1762) (let A (hd V1762) (let V1763 (shen.lazyderef (tl V1762) V2159) (if (= () V1763) (let NewHyp (tl V1758) (do (shen.incinfs) (unify! V V1752 V2159 (freeze (shen.newhyps Vs V2157 NewHyp V2159 V2160))))) (if (shen.pvar? V1763) (do (shen.bindv V1763 () V2159) (let Result (let NewHyp (tl V1758) (do (shen.incinfs) (unify! V V1752 V2159 (freeze (shen.newhyps Vs V2157 NewHyp V2159 V2160))))) (do (shen.unbindv V1763 V2159) Result))) false)))) (if (shen.pvar? V1762) (let A (shen.newpv V2159) (do (shen.bindv V1762 (cons A ()) V2159) (let Result (let NewHyp (tl V1758) (do (shen.incinfs) (unify! V V1752 V2159 (freeze (shen.newhyps Vs V2157 NewHyp V2159 V2160))))) (do (shen.unbindv V1762 V2159) Result)))) false))) (if (shen.pvar? V1761) (do (shen.bindv V1761 : V2159) (let Result (let V1764 (shen.lazyderef (tl V1760) V2159) (if (cons? V1764) (let A (hd V1764) (let V1765 (shen.lazyderef (tl V1764) V2159) (if (= () V1765) (let NewHyp (tl V1758) (do (shen.incinfs) (unify! V V1752 V2159 (freeze (shen.newhyps Vs V2157 NewHyp V2159 V2160))))) (if (shen.pvar? V1765) (do (shen.bindv V1765 () V2159) (let Result (let NewHyp (tl V1758) (do (shen.incinfs) (unify! V V1752 V2159 (freeze (shen.newhyps Vs V2157 NewHyp V2159 V2160))))) (do (shen.unbindv V1765 V2159) Result))) false)))) (if (shen.pvar? V1764) (let A (shen.newpv V2159) (do (shen.bindv V1764 (cons A ()) V2159) (let Result (let NewHyp (tl V1758) (do (shen.incinfs) (unify! V V1752 V2159 (freeze (shen.newhyps Vs V2157 NewHyp V2159 V2160))))) (do (shen.unbindv V1764 V2159) Result)))) false))) (do (shen.unbindv V1761 V2159) Result))) false))) (if (shen.pvar? V1760) (let A (shen.newpv V2159) (do (shen.bindv V1760 (cons : (cons A ())) V2159) (let Result (let NewHyp (tl V1758) (do (shen.incinfs) (unify! V V1752 V2159 (freeze (shen.newhyps Vs V2157 NewHyp V2159 V2160))))) (do (shen.unbindv V1760 V2159) Result)))) false)))) (if (shen.pvar? V1759) (let V (shen.newpv V2159) (let A (shen.newpv V2159) (do (shen.bindv V1759 (cons V (cons : (cons A ()))) V2159) (let Result (let NewHyp (tl V1758) (do (shen.incinfs) (unify! V V1752 V2159 (freeze (shen.newhyps Vs V2157 NewHyp V2159 V2160))))) (do (shen.unbindv V1759 V2159) Result))))) false))) (if (shen.pvar? V1758) (let V (shen.newpv V2159) (let A (shen.newpv V2159) (let NewHyp (shen.newpv V2159) (do (shen.bindv V1758 (cons (cons V (cons : (cons A ()))) NewHyp) V2159) (let Result (do (shen.incinfs) (unify! V V1752 V2159 (freeze (shen.newhyps Vs V2157 NewHyp V2159 V2160)))) (do (shen.unbindv V1758 V2159) Result)))))) false))))) false)) Case)))
107
+
108
+ (defun shen.patthyps (V2163 V2164 V2165) (cond ((= () V2163) V2165) ((and (cons? V2163) (and (cons? V2164) (and (cons? (tl V2164)) (and (= --> (hd (tl V2164))) (and (cons? (tl (tl V2164))) (= () (tl (tl (tl V2164))))))))) (adjoin (cons (hd V2163) (cons : (cons (hd V2164) ()))) (shen.patthyps (tl V2163) (hd (tl (tl V2164))) V2165))) (true (shen.f_error shen.patthyps))))
109
+
110
+ (defun shen.result-type (V2170 V2171) (cond ((= () V2170) V2171) ((and (cons? V2170) (and (cons? V2171) (and (cons? (tl V2171)) (and (= --> (hd (tl V2171))) (and (cons? (tl (tl V2171))) (= () (tl (tl (tl V2171))))))))) (shen.result-type (tl V2170) (hd (tl (tl V2171))))) (true (shen.f_error shen.result-type))))
111
+
112
+ (defun shen.t*-patterns (V2172 V2173 V2174 V2175 V2176) (let Case (let V1744 (shen.lazyderef V2172 V2175) (if (= () V1744) (do (shen.incinfs) (thaw V2176)) false)) (if (= Case false) (let V1745 (shen.lazyderef V2172 V2175) (if (cons? V1745) (let Pattern (hd V1745) (let Patterns (tl V1745) (let V1746 (shen.lazyderef V2173 V2175) (if (cons? V1746) (let A (hd V1746) (let V1747 (shen.lazyderef (tl V1746) V2175) (if (cons? V1747) (let V1748 (shen.lazyderef (hd V1747) V2175) (if (= --> V1748) (let V1749 (shen.lazyderef (tl V1747) V2175) (if (cons? V1749) (let B (hd V1749) (let V1750 (shen.lazyderef (tl V1749) V2175) (if (= () V1750) (do (shen.incinfs) (shen.t* (cons Pattern (cons : (cons A ()))) V2174 V2175 (freeze (shen.t*-patterns Patterns B V2174 V2175 V2176)))) false))) false)) false)) false))) false)))) false)) Case)))
113
+
114
+ (defun shen.t*-action (V2177 V2178 V2179 V2180 V2181) (let Throwcontrol (shen.catchpoint) (shen.cutpoint Throwcontrol (let Case (let V1721 (shen.lazyderef V2177 V2180) (if (cons? V1721) (let V1722 (shen.lazyderef (hd V1721) V2180) (if (= where V1722) (let V1723 (shen.lazyderef (tl V1721) V2180) (if (cons? V1723) (let P (hd V1723) (let V1724 (shen.lazyderef (tl V1723) V2180) (if (cons? V1724) (let Action (hd V1724) (let V1725 (shen.lazyderef (tl V1724) V2180) (if (= () V1725) (do (shen.incinfs) (cut Throwcontrol V2180 (freeze (shen.t* (cons P (cons : (cons boolean ()))) V2179 V2180 (freeze (cut Throwcontrol V2180 (freeze (shen.t*-action Action V2178 (cons (cons P (cons : (cons verified ()))) V2179) V2180 V2181)))))))) false))) false))) false)) false)) false)) (if (= Case false) (let Case (let V1726 (shen.lazyderef V2177 V2180) (if (cons? V1726) (let V1727 (shen.lazyderef (hd V1726) V2180) (if (= shen.choicepoint! V1727) (let V1728 (shen.lazyderef (tl V1726) V2180) (if (cons? V1728) (let V1729 (shen.lazyderef (hd V1728) V2180) (if (cons? V1729) (let V1730 (shen.lazyderef (hd V1729) V2180) (if (cons? V1730) (let V1731 (shen.lazyderef (hd V1730) V2180) (if (= fail-if V1731) (let V1732 (shen.lazyderef (tl V1730) V2180) (if (cons? V1732) (let F (hd V1732) (let V1733 (shen.lazyderef (tl V1732) V2180) (if (= () V1733) (let V1734 (shen.lazyderef (tl V1729) V2180) (if (cons? V1734) (let Action (hd V1734) (let V1735 (shen.lazyderef (tl V1734) V2180) (if (= () V1735) (let V1736 (shen.lazyderef (tl V1728) V2180) (if (= () V1736) (do (shen.incinfs) (cut Throwcontrol V2180 (freeze (shen.t*-action (cons where (cons (cons not (cons (cons F (cons Action ())) ())) (cons Action ()))) V2178 V2179 V2180 V2181)))) false)) false))) false)) false))) false)) false)) false)) false)) false)) false)) false)) (if (= Case false) (let Case (let V1737 (shen.lazyderef V2177 V2180) (if (cons? V1737) (let V1738 (shen.lazyderef (hd V1737) V2180) (if (= shen.choicepoint! V1738) (let V1739 (shen.lazyderef (tl V1737) V2180) (if (cons? V1739) (let Action (hd V1739) (let V1740 (shen.lazyderef (tl V1739) V2180) (if (= () V1740) (do (shen.incinfs) (cut Throwcontrol V2180 (freeze (shen.t*-action (cons where (cons (cons not (cons (cons (cons = (cons Action ())) (cons (cons fail ()) ())) ())) (cons Action ()))) V2178 V2179 V2180 V2181)))) false))) false)) false)) false)) (if (= Case false) (do (shen.incinfs) (shen.t* (cons V2177 (cons : (cons V2178 ()))) V2179 V2180 V2181)) Case)) Case)) Case)))))
115
+
116
+ (defun findall (V2182 V2183 V2184 V2185 V2186) (let B (shen.newpv V2185) (let A (shen.newpv V2185) (do (shen.incinfs) (bind A (gensym shen.a) V2185 (freeze (bind B (set (shen.lazyderef A V2185) ()) V2185 (freeze (shen.findallhelp V2182 V2183 V2184 A V2185 V2186)))))))))
117
+
118
+ (defun shen.findallhelp (V2187 V2188 V2189 V2190 V2191 V2192) (let Case (do (shen.incinfs) (call V2188 V2191 (freeze (shen.remember V2190 V2187 V2191 (freeze (fwhen false V2191 V2192)))))) (if (= Case false) (do (shen.incinfs) (bind V2189 (value (shen.lazyderef V2190 V2191)) V2191 V2192)) Case)))
119
+
120
+ (defun shen.remember (V2193 V2194 V2195 V2196) (let B (shen.newpv V2195) (do (shen.incinfs) (bind B (set (shen.deref V2193 V2195) (cons (shen.deref V2194 V2195) (value (shen.deref V2193 V2195)))) V2195 V2196))))
121
+
122
+
123
+
@@ -0,0 +1,110 @@
1
+ "Copyright (c) 2015, Mark Tarver
2
+
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+ 1. Redistributions of source code must retain the above copyright
8
+ notice, this list of conditions and the following disclaimer.
9
+ 2. Redistributions in binary form must reproduce the above copyright
10
+ notice, this list of conditions and the following disclaimer in the
11
+ documentation and/or other materials provided with the distribution.
12
+ 3. The name of Mark Tarver may not be used to endorse or promote products
13
+ derived from this software without specific prior written permission.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY Mark Tarver ''AS IS'' AND ANY
16
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL Mark Tarver BE LIABLE FOR ANY
19
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
25
+
26
+ (defun shen.shen () (do (shen.credits) (shen.loop)))
27
+
28
+ (defun shen.loop () (do (shen.initialise_environment) (do (shen.prompt) (do (trap-error (shen.read-evaluate-print) (lambda E (pr (error-to-string E) (stoutput)))) (shen.loop)))))
29
+
30
+ (defun shen.credits () (do (shen.prhush "
31
+ Shen, copyright (C) 2010-2015 Mark Tarver
32
+ " (stoutput)) (do (shen.prhush (cn "www.shenlanguage.org, " (shen.app (value *version*) "
33
+ " shen.a)) (stoutput)) (do (shen.prhush (cn "running under " (shen.app (value *language*) (cn ", implementation: " (shen.app (value *implementation*) "" shen.a)) shen.a)) (stoutput)) (shen.prhush (cn "
34
+ port " (shen.app (value *port*) (cn " ported by " (shen.app (value *porters*) "
35
+ " shen.a)) shen.a)) (stoutput))))))
36
+
37
+ (defun shen.initialise_environment () (shen.multiple-set (cons shen.*call* (cons 0 (cons shen.*infs* (cons 0 (cons shen.*process-counter* (cons 0 (cons shen.*catch* (cons 0 ()))))))))))
38
+
39
+ (defun shen.multiple-set (V2197) (cond ((= () V2197) ()) ((and (cons? V2197) (cons? (tl V2197))) (do (set (hd V2197) (hd (tl V2197))) (shen.multiple-set (tl (tl V2197))))) (true (shen.f_error shen.multiple-set))))
40
+
41
+ (defun destroy (V2198) (declare V2198 symbol))
42
+
43
+ (set shen.*history* ())
44
+
45
+ (defun shen.read-evaluate-print () (let Lineread (shen.toplineread) (let History (value shen.*history*) (let NewLineread (shen.retrieve-from-history-if-needed Lineread History) (let NewHistory (shen.update_history NewLineread History) (let Parsed (fst NewLineread) (shen.toplevel Parsed)))))))
46
+
47
+ (defun shen.retrieve-from-history-if-needed (V2208 V2209) (cond ((and (tuple? V2208) (and (cons? (snd V2208)) (element? (hd (snd V2208)) (cons (shen.space) (cons (shen.newline) ()))))) (shen.retrieve-from-history-if-needed (@p (fst V2208) (tl (snd V2208))) V2209)) ((and (tuple? V2208) (and (cons? (snd V2208)) (and (cons? (tl (snd V2208))) (and (= () (tl (tl (snd V2208)))) (and (cons? V2209) (and (= (hd (snd V2208)) (shen.exclamation)) (= (hd (tl (snd V2208))) (shen.exclamation)))))))) (let PastPrint (shen.prbytes (snd (hd V2209))) (hd V2209))) ((and (tuple? V2208) (and (cons? (snd V2208)) (= (hd (snd V2208)) (shen.exclamation)))) (let Key? (shen.make-key (tl (snd V2208)) V2209) (let Find (head (shen.find-past-inputs Key? V2209)) (let PastPrint (shen.prbytes (snd Find)) Find)))) ((and (tuple? V2208) (and (cons? (snd V2208)) (and (= () (tl (snd V2208))) (= (hd (snd V2208)) (shen.percent))))) (do (shen.print-past-inputs (lambda X true) (reverse V2209) 0) (abort))) ((and (tuple? V2208) (and (cons? (snd V2208)) (= (hd (snd V2208)) (shen.percent)))) (let Key? (shen.make-key (tl (snd V2208)) V2209) (let Pastprint (shen.print-past-inputs Key? (reverse V2209) 0) (abort)))) (true V2208)))
48
+
49
+ (defun shen.percent () 37)
50
+
51
+ (defun shen.exclamation () 33)
52
+
53
+ (defun shen.prbytes (V2210) (do (map (lambda Byte (pr (n->string Byte) (stoutput))) V2210) (nl 1)))
54
+
55
+ (defun shen.update_history (V2211 V2212) (set shen.*history* (cons V2211 V2212)))
56
+
57
+ (defun shen.toplineread () (shen.toplineread_loop (read-byte (stinput)) ()))
58
+
59
+ (defun shen.toplineread_loop (V2214 V2215) (cond ((= V2214 (shen.hat)) (simple-error "line read aborted")) ((element? V2214 (cons (shen.newline) (cons (shen.carriage-return) ()))) (let Line (compile shen.<st_input> V2215 (lambda E shen.nextline)) (let It (shen.record-it V2215) (if (or (= Line shen.nextline) (empty? Line)) (shen.toplineread_loop (read-byte (stinput)) (append V2215 (cons V2214 ()))) (@p Line V2215))))) (true (shen.toplineread_loop (read-byte (stinput)) (append V2215 (cons V2214 ()))))))
60
+
61
+ (defun shen.hat () 94)
62
+
63
+ (defun shen.newline () 10)
64
+
65
+ (defun shen.carriage-return () 13)
66
+
67
+ (defun tc (V2220) (cond ((= + V2220) (set shen.*tc* true)) ((= - V2220) (set shen.*tc* false)) (true (simple-error "tc expects a + or -"))))
68
+
69
+ (defun shen.prompt () (if (value shen.*tc*) (shen.prhush (cn "
70
+
71
+ (" (shen.app (length (value shen.*history*)) "+) " shen.a)) (stoutput)) (shen.prhush (cn "
72
+
73
+ (" (shen.app (length (value shen.*history*)) "-) " shen.a)) (stoutput))))
74
+
75
+ (defun shen.toplevel (V2221) (shen.toplevel_evaluate V2221 (value shen.*tc*)))
76
+
77
+ (defun shen.find-past-inputs (V2222 V2223) (let F (shen.find V2222 V2223) (if (empty? F) (simple-error "input not found
78
+ ") F)))
79
+
80
+ (defun shen.make-key (V2224 V2225) (let Atom (hd (compile shen.<st_input> V2224 (lambda E (if (cons? E) (simple-error (cn "parse error here: " (shen.app E "
81
+ " shen.s))) (simple-error "parse error
82
+ "))))) (if (integer? Atom) (lambda X (= X (nth (+ Atom 1) (reverse V2225)))) (lambda X (shen.prefix? V2224 (shen.trim-gubbins (snd X)))))))
83
+
84
+ (defun shen.trim-gubbins (V2226) (cond ((and (cons? V2226) (= (hd V2226) (shen.space))) (shen.trim-gubbins (tl V2226))) ((and (cons? V2226) (= (hd V2226) (shen.newline))) (shen.trim-gubbins (tl V2226))) ((and (cons? V2226) (= (hd V2226) (shen.carriage-return))) (shen.trim-gubbins (tl V2226))) ((and (cons? V2226) (= (hd V2226) (shen.tab))) (shen.trim-gubbins (tl V2226))) ((and (cons? V2226) (= (hd V2226) (shen.left-round))) (shen.trim-gubbins (tl V2226))) (true V2226)))
85
+
86
+ (defun shen.space () 32)
87
+
88
+ (defun shen.tab () 9)
89
+
90
+ (defun shen.left-round () 40)
91
+
92
+ (defun shen.find (V2233 V2234) (cond ((= () V2234) ()) ((and (cons? V2234) (V2233 (hd V2234))) (cons (hd V2234) (shen.find V2233 (tl V2234)))) ((cons? V2234) (shen.find V2233 (tl V2234))) (true (shen.f_error shen.find))))
93
+
94
+ (defun shen.prefix? (V2246 V2247) (cond ((= () V2246) true) ((and (cons? V2246) (and (cons? V2247) (= (hd V2247) (hd V2246)))) (shen.prefix? (tl V2246) (tl V2247))) (true false)))
95
+
96
+ (defun shen.print-past-inputs (V2256 V2257 V2258) (cond ((= () V2257) _) ((and (cons? V2257) (not (V2256 (hd V2257)))) (shen.print-past-inputs V2256 (tl V2257) (+ V2258 1))) ((and (cons? V2257) (tuple? (hd V2257))) (do (shen.prhush (shen.app V2258 ". " shen.a) (stoutput)) (do (shen.prbytes (snd (hd V2257))) (shen.print-past-inputs V2256 (tl V2257) (+ V2258 1))))) (true (shen.f_error shen.print-past-inputs))))
97
+
98
+ (defun shen.toplevel_evaluate (V2259 V2260) (cond ((and (cons? V2259) (and (cons? (tl V2259)) (and (= : (hd (tl V2259))) (and (cons? (tl (tl V2259))) (and (= () (tl (tl (tl V2259)))) (= true V2260)))))) (shen.typecheck-and-evaluate (hd V2259) (hd (tl (tl V2259))))) ((and (cons? V2259) (cons? (tl V2259))) (do (shen.toplevel_evaluate (cons (hd V2259) ()) V2260) (do (nl 1) (shen.toplevel_evaluate (tl V2259) V2260)))) ((and (cons? V2259) (and (= () (tl V2259)) (= true V2260))) (shen.typecheck-and-evaluate (hd V2259) (gensym A))) ((and (cons? V2259) (and (= () (tl V2259)) (= false V2260))) (let Eval (shen.eval-without-macros (hd V2259)) (print Eval))) (true (shen.f_error shen.toplevel_evaluate))))
99
+
100
+ (defun shen.typecheck-and-evaluate (V2261 V2262) (let Typecheck (shen.typecheck V2261 V2262) (if (= Typecheck false) (simple-error "type error
101
+ ") (let Eval (shen.eval-without-macros V2261) (let Type (shen.pretty-type Typecheck) (shen.prhush (shen.app Eval (cn " : " (shen.app Type "" shen.r)) shen.s) (stoutput)))))))
102
+
103
+ (defun shen.pretty-type (V2263) (shen.mult_subst (value shen.*alphabet*) (shen.extract-pvars V2263) V2263))
104
+
105
+ (defun shen.extract-pvars (V2268) (cond ((shen.pvar? V2268) (cons V2268 ())) ((cons? V2268) (union (shen.extract-pvars (hd V2268)) (shen.extract-pvars (tl V2268)))) (true ())))
106
+
107
+ (defun shen.mult_subst (V2273 V2274 V2275) (cond ((= () V2273) V2275) ((= () V2274) V2275) ((and (cons? V2273) (cons? V2274)) (shen.mult_subst (tl V2273) (tl V2274) (subst (hd V2273) (hd V2274) V2275))) (true (shen.f_error shen.mult_subst))))
108
+
109
+
110
+
@@ -0,0 +1,79 @@
1
+ "Copyright (c) 2015, Mark Tarver
2
+
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+ 1. Redistributions of source code must retain the above copyright
8
+ notice, this list of conditions and the following disclaimer.
9
+ 2. Redistributions in binary form must reproduce the above copyright
10
+ notice, this list of conditions and the following disclaimer in the
11
+ documentation and/or other materials provided with the distribution.
12
+ 3. The name of Mark Tarver may not be used to endorse or promote products
13
+ derived from this software without specific prior written permission.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY Mark Tarver ''AS IS'' AND ANY
16
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL Mark Tarver BE LIABLE FOR ANY
19
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
25
+
26
+ (defun shen.f_error (V2276) (do (shen.prhush (cn "partial function " (shen.app V2276 ";
27
+ " shen.a)) (stoutput)) (do (if (and (not (shen.tracked? V2276)) (y-or-n? (cn "track " (shen.app V2276 "? " shen.a)))) (shen.track-function (ps V2276)) shen.ok) (simple-error "aborted"))))
28
+
29
+ (defun shen.tracked? (V2277) (element? V2277 (value shen.*tracking*)))
30
+
31
+ (defun track (V2278) (let Source (ps V2278) (shen.track-function Source)))
32
+
33
+ (defun shen.track-function (V2279) (cond ((and (cons? V2279) (and (= defun (hd V2279)) (and (cons? (tl V2279)) (and (cons? (tl (tl V2279))) (and (cons? (tl (tl (tl V2279)))) (= () (tl (tl (tl (tl V2279)))))))))) (let KL (cons defun (cons (hd (tl V2279)) (cons (hd (tl (tl V2279))) (cons (shen.insert-tracking-code (hd (tl V2279)) (hd (tl (tl V2279))) (hd (tl (tl (tl V2279))))) ())))) (let Ob (eval-kl KL) (let Tr (set shen.*tracking* (cons Ob (value shen.*tracking*))) Ob)))) (true (shen.f_error shen.track-function))))
34
+
35
+ (defun shen.insert-tracking-code (V2280 V2281 V2282) (cons do (cons (cons set (cons shen.*call* (cons (cons + (cons (cons value (cons shen.*call* ())) (cons 1 ()))) ()))) (cons (cons do (cons (cons shen.input-track (cons (cons value (cons shen.*call* ())) (cons V2280 (cons (shen.cons_form V2281) ())))) (cons (cons do (cons (cons shen.terpri-or-read-char ()) (cons (cons let (cons Result (cons V2282 (cons (cons do (cons (cons shen.output-track (cons (cons value (cons shen.*call* ())) (cons V2280 (cons Result ())))) (cons (cons do (cons (cons set (cons shen.*call* (cons (cons - (cons (cons value (cons shen.*call* ())) (cons 1 ()))) ()))) (cons (cons do (cons (cons shen.terpri-or-read-char ()) (cons Result ()))) ()))) ()))) ())))) ()))) ()))) ()))))
36
+
37
+ (set shen.*step* false)
38
+
39
+ (defun step (V2287) (cond ((= + V2287) (set shen.*step* true)) ((= - V2287) (set shen.*step* false)) (true (simple-error "step expects a + or a -.
40
+ "))))
41
+
42
+ (defun spy (V2292) (cond ((= + V2292) (set shen.*spy* true)) ((= - V2292) (set shen.*spy* false)) (true (simple-error "spy expects a + or a -.
43
+ "))))
44
+
45
+ (defun shen.terpri-or-read-char () (if (value shen.*step*) (shen.check-byte (read-byte (value *stinput*))) (nl 1)))
46
+
47
+ (defun shen.check-byte (V2297) (cond ((= V2297 (shen.hat)) (simple-error "aborted")) (true true)))
48
+
49
+ (defun shen.input-track (V2298 V2299 V2300) (do (shen.prhush (cn "
50
+ " (shen.app (shen.spaces V2298) (cn "<" (shen.app V2298 (cn "> Inputs to " (shen.app V2299 (cn "
51
+ " (shen.app (shen.spaces V2298) "" shen.a)) shen.a)) shen.a)) shen.a)) (stoutput)) (shen.recursively-print V2300)))
52
+
53
+ (defun shen.recursively-print (V2301) (cond ((= () V2301) (shen.prhush " ==>" (stoutput))) ((cons? V2301) (do (print (hd V2301)) (do (shen.prhush ", " (stoutput)) (shen.recursively-print (tl V2301))))) (true (shen.f_error shen.recursively-print))))
54
+
55
+ (defun shen.spaces (V2302) (cond ((= 0 V2302) "") (true (cn " " (shen.spaces (- V2302 1))))))
56
+
57
+ (defun shen.output-track (V2303 V2304 V2305) (shen.prhush (cn "
58
+ " (shen.app (shen.spaces V2303) (cn "<" (shen.app V2303 (cn "> Output from " (shen.app V2304 (cn "
59
+ " (shen.app (shen.spaces V2303) (cn "==> " (shen.app V2305 "" shen.s)) shen.a)) shen.a)) shen.a)) shen.a)) (stoutput)))
60
+
61
+ (defun untrack (V2306) (eval (ps V2306)))
62
+
63
+ (defun profile (V2307) (shen.profile-help (ps V2307)))
64
+
65
+ (defun shen.profile-help (V2312) (cond ((and (cons? V2312) (and (= defun (hd V2312)) (and (cons? (tl V2312)) (and (cons? (tl (tl V2312))) (and (cons? (tl (tl (tl V2312)))) (= () (tl (tl (tl (tl V2312)))))))))) (let G (gensym shen.f) (let Profile (cons defun (cons (hd (tl V2312)) (cons (hd (tl (tl V2312))) (cons (shen.profile-func (hd (tl V2312)) (hd (tl (tl V2312))) (cons G (hd (tl (tl V2312))))) ())))) (let Def (cons defun (cons G (cons (hd (tl (tl V2312))) (cons (subst G (hd (tl V2312)) (hd (tl (tl (tl V2312))))) ())))) (let CompileProfile (shen.eval-without-macros Profile) (let CompileG (shen.eval-without-macros Def) (hd (tl V2312)))))))) (true (simple-error "Cannot profile.
66
+ "))))
67
+
68
+ (defun unprofile (V2313) (untrack V2313))
69
+
70
+ (defun shen.profile-func (V2314 V2315 V2316) (cons let (cons Start (cons (cons get-time (cons run ())) (cons (cons let (cons Result (cons V2316 (cons (cons let (cons Finish (cons (cons - (cons (cons get-time (cons run ())) (cons Start ()))) (cons (cons let (cons Record (cons (cons shen.put-profile (cons V2314 (cons (cons + (cons (cons shen.get-profile (cons V2314 ())) (cons Finish ()))) ()))) (cons Result ())))) ())))) ())))) ())))))
71
+
72
+ (defun profile-results (V2317) (let Results (shen.get-profile V2317) (let Initialise (shen.put-profile V2317 0) (@p V2317 Results))))
73
+
74
+ (defun shen.get-profile (V2318) (trap-error (get V2318 profile (value *property-vector*)) (lambda E 0)))
75
+
76
+ (defun shen.put-profile (V2319 V2320) (put V2319 profile V2320 (value *property-vector*)))
77
+
78
+
79
+
@@ -1,60 +1,36 @@
1
- "**********************************************************************************
2
- * The License *
3
- * *
4
- * The user is free to produce commercial applications with the software, to *
5
- * distribute these applications in source or binary form, and to charge monies *
6
- * for them as he sees fit and in concordance with the laws of the land subject *
7
- * to the following license. *
8
- * *
9
- * 1. The license applies to all the software and all derived software and *
10
- * must appear on such. *
11
- * *
12
- * 2. It is illegal to distribute the software without this license attached *
13
- * to it and use of the software implies agreement with the license as such. *
14
- * It is illegal for anyone who is not the copyright holder to tamper with *
15
- * or change the license. *
16
- * *
17
- * 3. Neither the names of Lambda Associates or the copyright holder may be used *
18
- * to endorse or promote products built using the software without specific *
19
- * prior written permission from the copyright holder. *
20
- * *
21
- * 4. That possession of this license does not confer on the copyright holder *
22
- * any special contractual obligation towards the user. That in no event *
23
- * shall the copyright holder be liable for any direct, indirect, incidental, *
24
- * special, exemplary or consequential damages (including but not limited *
25
- * to procurement of substitute goods or services, loss of use, data, *
26
- * interruption), however caused and on any theory of liability, whether in *
27
- * contract, strict liability or tort (including negligence) arising in any *
28
- * way out of the use of the software, even if advised of the possibility of *
29
- * such damage. *
30
- * *
31
- * 5. It is permitted for the user to change the software, for the purpose of *
32
- * improving performance, correcting an error, or porting to a new platform, *
33
- * and distribute the derived version of Shen provided the resulting program *
34
- * conforms in all respects to the Shen standard and is issued under that *
35
- * title. The user must make it clear with his distribution that he/she is *
36
- * the author of the changes and what these changes are and why. *
37
- * *
38
- * 6. Derived versions of this software in whatever form are subject to the same *
39
- * restrictions. In particular it is not permitted to make derived copies of *
40
- * this software which do not conform to the Shen standard or appear under a *
41
- * different title. *
42
- * *
43
- * It is permitted to distribute versions of Shen which incorporate libraries, *
44
- * graphics or other facilities which are not part of the Shen standard. *
45
- * *
46
- * For an explication of this license see www.shenlanguage.org/license.htm which *
47
- * explains this license in full. *
48
- * *
49
- *****************************************************************************************
50
- "(defun declare (V2168 V2169) (let Record (set shen.*signedfuncs* (cons (cons V2168 V2169) (value shen.*signedfuncs*))) (let Variancy (trap-error (shen.variancy-test V2168 V2169) (lambda E shen.skip)) (let Type (shen.rcons_form (shen.demodulate V2169)) (let F* (concat shen.type-signature-of- V2168) (let Parameters (shen.parameters 1) (let Clause (cons (cons F* (cons X ())) (cons :- (cons (cons (cons unify! (cons X (cons Type ()))) ()) ()))) (let AUM_instruction (shen.aum Clause Parameters) (let Code (shen.aum_to_shen AUM_instruction) (let ShenDef (cons define (cons F* (append Parameters (append (cons ProcessN (cons Continuation ())) (cons -> (cons Code ())))))) (let Eval (shen.eval-without-macros ShenDef) V2168)))))))))))
51
-
52
- (defun shen.demodulate (V2170) (trap-error (let Demod (shen.walk (lambda X2167 (shen.demod X2167)) V2170) (if (= Demod V2170) V2170 (shen.demodulate Demod))) (lambda E V2170)))
53
-
54
- (defun shen.variancy-test (V2171 V2172) (let TypeF (shen.typecheck V2171 B) (let Check (if (= symbol TypeF) shen.skip (if (shen.variant? TypeF V2172) shen.skip (shen.prhush (cn "warning: changing the type of " (shen.app V2171 " may create errors
1
+ "Copyright (c) 2015, Mark Tarver
2
+
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+ 1. Redistributions of source code must retain the above copyright
8
+ notice, this list of conditions and the following disclaimer.
9
+ 2. Redistributions in binary form must reproduce the above copyright
10
+ notice, this list of conditions and the following disclaimer in the
11
+ documentation and/or other materials provided with the distribution.
12
+ 3. The name of Mark Tarver may not be used to endorse or promote products
13
+ derived from this software without specific prior written permission.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY Mark Tarver ''AS IS'' AND ANY
16
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL Mark Tarver BE LIABLE FOR ANY
19
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
25
+
26
+ (defun declare (V2321 V2322) (let Record (set shen.*signedfuncs* (cons (cons V2321 V2322) (value shen.*signedfuncs*))) (let Variancy (trap-error (shen.variancy-test V2321 V2322) (lambda E shen.skip)) (let Type (shen.rcons_form (shen.demodulate V2322)) (let F* (concat shen.type-signature-of- V2321) (let Parameters (shen.parameters 1) (let Clause (cons (cons F* (cons X ())) (cons :- (cons (cons (cons unify! (cons X (cons Type ()))) ()) ()))) (let AUM_instruction (shen.aum Clause Parameters) (let Code (shen.aum_to_shen AUM_instruction) (let ShenDef (cons define (cons F* (append Parameters (append (cons ProcessN (cons Continuation ())) (cons -> (cons Code ())))))) (let Eval (shen.eval-without-macros ShenDef) V2321)))))))))))
27
+
28
+ (defun shen.demodulate (V2323) (trap-error (let Demod (shen.walk shen.demod V2323) (if (= Demod V2323) V2323 (shen.demodulate Demod))) (lambda E V2323)))
29
+
30
+ (defun shen.variancy-test (V2324 V2325) (let TypeF (shen.typecheck V2324 B) (let Check (if (= symbol TypeF) shen.skip (if (shen.variant? TypeF V2325) shen.skip (shen.prhush (cn "warning: changing the type of " (shen.app V2324 " may create errors
55
31
  " shen.a)) (stoutput)))) shen.skip)))
56
32
 
57
- (defun shen.variant? (V2181 V2182) (cond ((= V2182 V2181) true) ((and (cons? V2181) (and (cons? V2182) (= (hd V2182) (hd V2181)))) (shen.variant? (tl V2181) (tl V2182))) ((and (cons? V2181) (and (cons? V2182) (and (shen.pvar? (hd V2181)) (variable? (hd V2182))))) (shen.variant? (subst shen.a (hd V2181) (tl V2181)) (subst shen.a (hd V2182) (tl V2182)))) ((and (cons? V2181) (and (cons? (hd V2181)) (and (cons? V2182) (cons? (hd V2182))))) (shen.variant? (append (hd V2181) (tl V2181)) (append (hd V2182) (tl V2182)))) (true false)))
33
+ (defun shen.variant? (V2336 V2337) (cond ((= V2337 V2336) true) ((and (cons? V2336) (and (cons? V2337) (= (hd V2337) (hd V2336)))) (shen.variant? (tl V2336) (tl V2337))) ((and (cons? V2336) (and (cons? V2337) (and (shen.pvar? (hd V2336)) (variable? (hd V2337))))) (shen.variant? (subst shen.a (hd V2336) (tl V2336)) (subst shen.a (hd V2337) (tl V2337)))) ((and (cons? V2336) (and (cons? (hd V2336)) (and (cons? V2337) (cons? (hd V2337))))) (shen.variant? (append (hd V2336) (tl V2336)) (append (hd V2337) (tl V2337)))) (true false)))
58
34
 
59
35
  (declare absvector? (cons A (cons --> (cons boolean ()))))
60
36
 
@@ -80,7 +56,7 @@
80
56
 
81
57
  (declare cn (cons string (cons --> (cons (cons string (cons --> (cons string ()))) ()))))
82
58
 
83
- (declare compile (cons (cons A (cons ==> (cons B ()))) (cons --> (cons (cons A (cons --> (cons (cons (cons A (cons --> (cons B ()))) (cons --> (cons B ()))) ()))) ()))))
59
+ (declare compile (cons (cons A (cons shen.==> (cons B ()))) (cons --> (cons (cons A (cons --> (cons (cons (cons A (cons --> (cons B ()))) (cons --> (cons B ()))) ()))) ()))))
84
60
 
85
61
  (declare cons? (cons A (cons --> (cons boolean ()))))
86
62
 
@@ -90,9 +66,9 @@
90
66
 
91
67
  (declare do (cons A (cons --> (cons (cons B (cons --> (cons B ()))) ()))))
92
68
 
93
- (declare <e> (cons (cons list (cons A ())) (cons ==> (cons (cons list (cons B ())) ()))))
69
+ (declare <e> (cons (cons list (cons A ())) (cons shen.==> (cons (cons list (cons B ())) ()))))
94
70
 
95
- (declare <!> (cons (cons list (cons A ())) (cons ==> (cons (cons list (cons A ())) ()))))
71
+ (declare shen.<!> (cons (cons list (cons A ())) (cons shen.==> (cons (cons list (cons A ())) ()))))
96
72
 
97
73
  (declare element? (cons A (cons --> (cons (cons (cons list (cons A ())) (cons --> (cons boolean ()))) ()))))
98
74
 
@@ -106,6 +82,8 @@
106
82
 
107
83
  (declare explode (cons A (cons --> (cons (cons list (cons string ())) ()))))
108
84
 
85
+ (declare fail (cons --> (cons symbol ())))
86
+
109
87
  (declare fail-if (cons (cons symbol (cons --> (cons boolean ()))) (cons --> (cons (cons symbol (cons --> (cons symbol ()))) ()))))
110
88
 
111
89
  (declare fix (cons (cons A (cons --> (cons A ()))) (cons --> (cons (cons A (cons --> (cons A ()))) ()))))
@@ -186,6 +164,8 @@
186
164
 
187
165
  (declare os (cons --> (cons string ())))
188
166
 
167
+ (declare package? (cons symbol (cons --> (cons boolean ()))))
168
+
189
169
  (declare port (cons --> (cons string ())))
190
170
 
191
171
  (declare porters (cons --> (cons string ())))
@@ -212,6 +192,8 @@
212
192
 
213
193
  (declare ps (cons symbol (cons --> (cons (cons list (cons unit ())) ()))))
214
194
 
195
+ (declare read (cons (cons stream (cons in ())) (cons --> (cons unit ()))))
196
+
215
197
  (declare read-byte (cons (cons stream (cons in ())) (cons --> (cons number ()))))
216
198
 
217
199
  (declare read-file-as-bytelist (cons string (cons --> (cons (cons list (cons number ())) ()))))
@@ -254,7 +236,7 @@
254
236
 
255
237
  (declare symbol? (cons A (cons --> (cons boolean ()))))
256
238
 
257
- (declare systemf (cons symbol (cons --> (cons (cons list (cons symbol ())) ()))))
239
+ (declare systemf (cons symbol (cons --> (cons symbol ()))))
258
240
 
259
241
  (declare tail (cons (cons list (cons A ())) (cons --> (cons (cons list (cons A ())) ()))))
260
242
 
@@ -316,9 +298,5 @@
316
298
 
317
299
  (declare == (cons A (cons --> (cons (cons B (cons --> (cons boolean ()))) ()))))
318
300
 
319
- (declare shen.in-> (cons (cons A (cons ==> (cons B ()))) (cons --> (cons A ()))))
320
-
321
- (declare shen.<-out (cons (cons A (cons ==> (cons B ()))) (cons --> (cons B ()))))
322
-
323
301
 
324
302