shen-ruby 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +4 -0
- data/README.md +8 -8
- data/lib/shen_ruby/version.rb +1 -1
- data/shen-ruby.gemspec +1 -1
- data/shen/release/benchmarks/jnk.shen +194 -0
- data/shen/release/k_lambda/declarations.kl +3 -3
- data/shen/release/k_lambda/macros.kl +0 -16
- data/shen/release/k_lambda/prolog.kl +1 -1
- data/shen/release/k_lambda/reader.kl +89 -79
- data/shen/release/k_lambda/sequent.kl +55 -55
- data/shen/release/k_lambda/sys.kl +98 -98
- data/shen/release/k_lambda/t-star.kl +37 -72
- data/shen/release/k_lambda/toplevel.kl +21 -21
- data/shen/release/k_lambda/track.kl +25 -25
- data/shen/release/k_lambda/types.kl +13 -5
- data/shen/release/k_lambda/writer.kl +25 -25
- data/shen/release/k_lambda/yacc.kl +28 -28
- data/shen/release/test_programs/einstein.shen +3 -2
- data/shen/release/test_programs/qmachine.shen +3 -3
- metadata +4 -3
@@ -47,67 +47,67 @@
|
|
47
47
|
* explains this license in full. *
|
48
48
|
* *
|
49
49
|
*****************************************************************************************
|
50
|
-
"(defun shen.yacc (
|
50
|
+
"(defun shen.yacc (V2187) (cond ((and (cons? V2187) (and (= defcc (hd V2187)) (and (cons? (tl V2187)) (and (cons? (tl (tl V2187))) (and (= { (hd (tl (tl V2187)))) (and (cons? (tl (tl (tl V2187)))) (and (cons? (tl (tl (tl (tl V2187))))) (and (= ==> (hd (tl (tl (tl (tl V2187)))))) (and (cons? (tl (tl (tl (tl (tl V2187)))))) (and (cons? (tl (tl (tl (tl (tl (tl V2187))))))) (= } (hd (tl (tl (tl (tl (tl (tl V2187)))))))))))))))))) (shen.yacc (cons defcc (cons (hd (tl V2187)) (tl (tl (tl (tl (tl (tl (tl V2187))))))))))) ((and (cons? V2187) (and (= defcc (hd V2187)) (cons? (tl V2187)))) (shen.yacc->shen (hd (tl V2187)) (tl (tl V2187)))) (true (shen.sys-error shen.yacc))))
|
51
51
|
|
52
|
-
(defun shen.yacc->shen (
|
52
|
+
(defun shen.yacc->shen (V2188 V2189) (let CCRules (shen.split_cc_rules true V2189 ()) (let CCBody (map (lambda X2185 (shen.cc_body X2185)) CCRules) (let YaccCases (shen.yacc_cases CCBody) (cons define (cons V2188 (cons Stream (cons -> (cons (shen.kill-code YaccCases) ())))))))))
|
53
53
|
|
54
|
-
(defun shen.kill-code (
|
54
|
+
(defun shen.kill-code (V2190) (cond ((> (occurrences kill V2190) 0) (cons trap-error (cons V2190 (cons (cons lambda (cons E (cons (cons shen.analyse-kill (cons E ())) ()))) ())))) (true V2190)))
|
55
55
|
|
56
56
|
(defun kill () (simple-error "yacc kill"))
|
57
57
|
|
58
|
-
(defun shen.analyse-kill (
|
58
|
+
(defun shen.analyse-kill (V2191) (let String (error-to-string V2191) (if (= String "yacc kill") (fail) V2191)))
|
59
59
|
|
60
|
-
(defun shen.split_cc_rules (
|
60
|
+
(defun shen.split_cc_rules (V2194 V2195 V2196) (cond ((and (= () V2195) (= () V2196)) ()) ((= () V2195) (cons (shen.split_cc_rule V2194 (reverse V2196) ()) ())) ((and (cons? V2195) (= ; (hd V2195))) (cons (shen.split_cc_rule V2194 (reverse V2196) ()) (shen.split_cc_rules V2194 (tl V2195) ()))) ((cons? V2195) (shen.split_cc_rules V2194 (tl V2195) (cons (hd V2195) V2196))) (true (shen.sys-error shen.split_cc_rules))))
|
61
61
|
|
62
|
-
(defun shen.split_cc_rule (
|
62
|
+
(defun shen.split_cc_rule (V2201 V2202 V2203) (cond ((and (cons? V2202) (and (= := (hd V2202)) (and (cons? (tl V2202)) (= () (tl (tl V2202)))))) (cons (reverse V2203) (tl V2202))) ((and (cons? V2202) (and (= := (hd V2202)) (and (cons? (tl V2202)) (and (cons? (tl (tl V2202))) (and (= where (hd (tl (tl V2202)))) (and (cons? (tl (tl (tl V2202)))) (= () (tl (tl (tl (tl V2202))))))))))) (cons (reverse V2203) (cons (cons where (cons (hd (tl (tl (tl V2202)))) (cons (hd (tl V2202)) ()))) ()))) ((= () V2202) (do (shen.semantic-completion-warning V2201 V2203) (shen.split_cc_rule V2201 (cons := (cons (shen.default_semantics (reverse V2203)) ())) V2203))) ((cons? V2202) (shen.split_cc_rule V2201 (tl V2202) (cons (hd V2202) V2203))) (true (shen.sys-error shen.split_cc_rule))))
|
63
63
|
|
64
|
-
(defun shen.semantic-completion-warning (
|
64
|
+
(defun shen.semantic-completion-warning (V2212 V2213) (cond ((= true V2212) (do (shen.prhush "warning: " (stoutput)) (do (map (lambda X (shen.prhush (shen.app X " " shen.a) (stoutput))) (reverse V2213)) (shen.prhush "has no semantics.
|
65
65
|
" (stoutput))))) (true shen.skip)))
|
66
66
|
|
67
|
-
(defun shen.default_semantics (
|
67
|
+
(defun shen.default_semantics (V2214) (cond ((= () V2214) ()) ((and (cons? V2214) (and (= () (tl V2214)) (shen.grammar_symbol? (hd V2214)))) (hd V2214)) ((and (cons? V2214) (shen.grammar_symbol? (hd V2214))) (cons append (cons (hd V2214) (cons (shen.default_semantics (tl V2214)) ())))) ((cons? V2214) (cons cons (cons (hd V2214) (cons (shen.default_semantics (tl V2214)) ())))) (true (shen.sys-error shen.default_semantics))))
|
68
68
|
|
69
|
-
(defun shen.grammar_symbol? (
|
69
|
+
(defun shen.grammar_symbol? (V2215) (and (symbol? V2215) (let Cs (shen.strip-pathname (explode V2215)) (and (= (hd Cs) "<") (= (hd (reverse Cs)) ">")))))
|
70
70
|
|
71
|
-
(defun shen.yacc_cases (
|
71
|
+
(defun shen.yacc_cases (V2216) (cond ((and (cons? V2216) (= () (tl V2216))) (hd V2216)) ((cons? V2216) (let P YaccParse (cons let (cons P (cons (hd V2216) (cons (cons if (cons (cons = (cons P (cons (cons fail ()) ()))) (cons (shen.yacc_cases (tl V2216)) (cons P ())))) ())))))) (true (shen.sys-error shen.yacc_cases))))
|
72
72
|
|
73
|
-
(defun shen.cc_body (
|
73
|
+
(defun shen.cc_body (V2217) (cond ((and (cons? V2217) (and (cons? (tl V2217)) (= () (tl (tl V2217))))) (shen.syntax (hd V2217) Stream (hd (tl V2217)))) (true (shen.sys-error shen.cc_body))))
|
74
74
|
|
75
|
-
(defun shen.syntax (
|
75
|
+
(defun shen.syntax (V2218 V2219 V2220) (cond ((and (= () V2218) (and (cons? V2220) (and (= where (hd V2220)) (and (cons? (tl V2220)) (and (cons? (tl (tl V2220))) (= () (tl (tl (tl V2220))))))))) (cons if (cons (shen.semantics (hd (tl V2220))) (cons (cons shen.pair (cons (cons hd (cons V2219 ())) (cons (shen.semantics (hd (tl (tl V2220)))) ()))) (cons (cons fail ()) ()))))) ((= () V2218) (cons shen.pair (cons (cons hd (cons V2219 ())) (cons (shen.semantics V2220) ())))) ((cons? V2218) (if (shen.grammar_symbol? (hd V2218)) (shen.recursive_descent V2218 V2219 V2220) (if (variable? (hd V2218)) (shen.variable-match V2218 V2219 V2220) (if (shen.jump_stream? (hd V2218)) (shen.jump_stream V2218 V2219 V2220) (if (shen.terminal? (hd V2218)) (shen.check_stream V2218 V2219 V2220) (if (cons? (hd V2218)) (shen.list-stream (shen.decons (hd V2218)) (tl V2218) V2219 V2220) (simple-error (shen.app (hd V2218) " is not legal syntax
|
76
76
|
" shen.a)))))))) (true (shen.sys-error shen.syntax))))
|
77
77
|
|
78
|
-
(defun shen.list-stream (
|
78
|
+
(defun shen.list-stream (V2221 V2222 V2223 V2224) (let Test (cons and (cons (cons cons? (cons (cons hd (cons V2223 ())) ())) (cons (cons cons? (cons (cons hd (cons (cons hd (cons V2223 ())) ())) ())) ()))) (let Placeholder (gensym shen.place) (let RunOn (shen.syntax V2222 (cons shen.pair (cons (cons tl (cons (cons hd (cons V2223 ())) ())) (cons (cons hd (cons (cons tl (cons V2223 ())) ())) ()))) V2224) (let Action (shen.insert-runon RunOn Placeholder (shen.syntax V2221 (cons shen.pair (cons (cons hd (cons (cons hd (cons V2223 ())) ())) (cons (cons hd (cons (cons tl (cons V2223 ())) ())) ()))) Placeholder)) (cons if (cons Test (cons Action (cons (cons fail ()) ())))))))))
|
79
79
|
|
80
|
-
(defun shen.decons (
|
80
|
+
(defun shen.decons (V2225) (cond ((and (cons? V2225) (and (= cons (hd V2225)) (and (cons? (tl V2225)) (and (cons? (tl (tl V2225))) (and (= () (hd (tl (tl V2225)))) (= () (tl (tl (tl V2225))))))))) (cons (hd (tl V2225)) ())) ((and (cons? V2225) (and (= cons (hd V2225)) (and (cons? (tl V2225)) (and (cons? (tl (tl V2225))) (= () (tl (tl (tl V2225)))))))) (cons (hd (tl V2225)) (shen.decons (hd (tl (tl V2225)))))) (true V2225)))
|
81
81
|
|
82
|
-
(defun shen.insert-runon (
|
82
|
+
(defun shen.insert-runon (V2236 V2237 V2238) (cond ((and (cons? V2238) (and (= shen.pair (hd V2238)) (and (cons? (tl V2238)) (and (cons? (tl (tl V2238))) (and (= () (tl (tl (tl V2238)))) (= (hd (tl (tl V2238))) V2237)))))) V2236) ((cons? V2238) (map (lambda Z (shen.insert-runon V2236 V2237 Z)) V2238)) (true V2238)))
|
83
83
|
|
84
|
-
(defun shen.strip-pathname (
|
84
|
+
(defun shen.strip-pathname (V2244) (cond ((not (element? "." V2244)) V2244) ((cons? V2244) (shen.strip-pathname (tl V2244))) (true (shen.sys-error shen.strip-pathname))))
|
85
85
|
|
86
|
-
(defun shen.recursive_descent (
|
86
|
+
(defun shen.recursive_descent (V2245 V2246 V2247) (cond ((cons? V2245) (let Test (cons (hd V2245) (cons V2246 ())) (let Action (shen.syntax (tl V2245) (concat Parse_ (hd V2245)) V2247) (let Else (cons fail ()) (cons let (cons (concat Parse_ (hd V2245)) (cons Test (cons (cons if (cons (cons not (cons (cons = (cons (cons fail ()) (cons (concat Parse_ (hd V2245)) ()))) ())) (cons Action (cons Else ())))) ())))))))) (true (shen.sys-error shen.recursive_descent))))
|
87
87
|
|
88
|
-
(defun shen.variable-match (
|
88
|
+
(defun shen.variable-match (V2248 V2249 V2250) (cond ((cons? V2248) (let Test (cons cons? (cons (cons hd (cons V2249 ())) ())) (let Action (cons let (cons (concat Parse_ (hd V2248)) (cons (cons hd (cons (cons hd (cons V2249 ())) ())) (cons (shen.syntax (tl V2248) (cons shen.pair (cons (cons tl (cons (cons hd (cons V2249 ())) ())) (cons (cons shen.hdtl (cons V2249 ())) ()))) V2250) ())))) (let Else (cons fail ()) (cons if (cons Test (cons Action (cons Else ())))))))) (true (shen.sys-error shen.variable-match))))
|
89
89
|
|
90
|
-
(defun shen.terminal? (
|
90
|
+
(defun shen.terminal? (V2259) (cond ((cons? V2259) false) ((variable? V2259) false) (true true)))
|
91
91
|
|
92
|
-
(defun shen.jump_stream? (
|
92
|
+
(defun shen.jump_stream? (V2264) (cond ((= V2264 _) true) (true false)))
|
93
93
|
|
94
|
-
(defun shen.check_stream (
|
94
|
+
(defun shen.check_stream (V2265 V2266 V2267) (cond ((cons? V2265) (let Test (cons and (cons (cons cons? (cons (cons hd (cons V2266 ())) ())) (cons (cons = (cons (hd V2265) (cons (cons hd (cons (cons hd (cons V2266 ())) ())) ()))) ()))) (let Action (shen.syntax (tl V2265) (cons shen.pair (cons (cons tl (cons (cons hd (cons V2266 ())) ())) (cons (cons shen.hdtl (cons V2266 ())) ()))) V2267) (let Else (cons fail ()) (cons if (cons Test (cons Action (cons Else ())))))))) (true (shen.sys-error shen.check_stream))))
|
95
95
|
|
96
|
-
(defun shen.jump_stream (
|
96
|
+
(defun shen.jump_stream (V2268 V2269 V2270) (cond ((cons? V2268) (let Test (cons cons? (cons (cons hd (cons V2269 ())) ())) (let Action (shen.syntax (tl V2268) (cons shen.pair (cons (cons tl (cons (cons hd (cons V2269 ())) ())) (cons (cons shen.hdtl (cons V2269 ())) ()))) V2270) (let Else (cons fail ()) (cons if (cons Test (cons Action (cons Else ())))))))) (true (shen.sys-error shen.jump_stream))))
|
97
97
|
|
98
|
-
(defun shen.semantics (
|
98
|
+
(defun shen.semantics (V2271) (cond ((= () V2271) ()) ((shen.grammar_symbol? V2271) (cons shen.hdtl (cons (concat Parse_ V2271) ()))) ((variable? V2271) (concat Parse_ V2271)) ((cons? V2271) (map (lambda X2186 (shen.semantics X2186)) V2271)) (true V2271)))
|
99
99
|
|
100
|
-
(defun shen.snd-or-fail (
|
100
|
+
(defun shen.snd-or-fail (V2278) (cond ((and (cons? V2278) (and (cons? (tl V2278)) (= () (tl (tl V2278))))) (hd (tl V2278))) (true (fail))))
|
101
101
|
|
102
102
|
(defun fail () shen.fail!)
|
103
103
|
|
104
|
-
(defun shen.pair (
|
104
|
+
(defun shen.pair (V2279 V2280) (cons V2279 (cons V2280 ())))
|
105
105
|
|
106
|
-
(defun shen.hdtl (
|
106
|
+
(defun shen.hdtl (V2281) (hd (tl V2281)))
|
107
107
|
|
108
|
-
(defun <!> (
|
108
|
+
(defun <!> (V2288) (cond ((and (cons? V2288) (and (cons? (tl V2288)) (= () (tl (tl V2288))))) (cons () (cons (hd V2288) ()))) (true (fail))))
|
109
109
|
|
110
|
-
(defun <e> (
|
110
|
+
(defun <e> (V2293) (cond ((and (cons? V2293) (and (cons? (tl V2293)) (= () (tl (tl V2293))))) (cons (hd V2293) (cons () ()))) (true (shen.sys-error <e>))))
|
111
111
|
|
112
112
|
|
113
113
|
|
@@ -34,15 +34,15 @@
|
|
34
34
|
|
35
35
|
(define forall
|
36
36
|
{(progression A) --> (A --> boolean) --> boolean}
|
37
|
-
Progression P -> (super Progression P and true))
|
37
|
+
Progression P -> (super Progression P (function and) true))
|
38
38
|
|
39
39
|
(define exists
|
40
40
|
{(progression A) --> (A --> boolean) --> boolean}
|
41
|
-
Progression P -> (super Progression P or false))
|
41
|
+
Progression P -> (super Progression P (function or) false))
|
42
42
|
|
43
43
|
(define for
|
44
44
|
{(progression A) --> (A --> B) --> number}
|
45
|
-
Progression P -> (super Progression P progn 0))
|
45
|
+
Progression P -> (super Progression P (function progn) 0))
|
46
46
|
|
47
47
|
(define progn
|
48
48
|
{A --> B --> B}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shen-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Spurrier
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-09-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '2.12'
|
28
28
|
description: ShenRuby is a port of the Shen programming language to Ruby. It currently
|
29
|
-
supports Shen version
|
29
|
+
supports Shen version 16.
|
30
30
|
email:
|
31
31
|
- greg@sourcematters.org
|
32
32
|
executables:
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- shen/release/benchmarks/einstein.shen
|
92
92
|
- shen/release/benchmarks/heatwave.gif
|
93
93
|
- shen/release/benchmarks/interpreter.shen
|
94
|
+
- shen/release/benchmarks/jnk.shen
|
94
95
|
- shen/release/benchmarks/picture.jpg
|
95
96
|
- shen/release/benchmarks/plato.jpg
|
96
97
|
- shen/release/benchmarks/powerset.shen
|