shen-ruby 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/HISTORY.md +6 -3
- data/README.md +10 -7
- data/bin/shen-ruby +21 -0
- data/bin/shen_ruby +21 -0
- data/lib/shen_ruby/converters.rb +2 -4
- data/lib/shen_ruby/shen.rb +1 -1
- data/lib/shen_ruby/version.rb +1 -1
- data/shen/release/klambda/core.kl +67 -63
- data/shen/release/klambda/declarations.kl +92 -84
- data/shen/release/klambda/load.kl +15 -15
- data/shen/release/klambda/macros.kl +34 -33
- data/shen/release/klambda/prolog.kl +96 -98
- data/shen/release/klambda/reader.kl +83 -83
- data/shen/release/klambda/sequent.kl +55 -55
- data/shen/release/klambda/sys.kl +106 -101
- data/shen/release/klambda/t-star.kl +41 -41
- data/shen/release/klambda/toplevel.kl +21 -21
- data/shen/release/klambda/track.kl +25 -25
- data/shen/release/klambda/types.kl +6 -4
- data/shen/release/klambda/writer.kl +25 -25
- data/shen/release/klambda/yacc.kl +28 -28
- data/shen-ruby.gemspec +3 -3
- metadata +9 -5
@@ -23,118 +23,118 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
23
23
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
24
24
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
25
25
|
|
26
|
-
(defun shen.datatype-error (
|
26
|
+
(defun shen.datatype-error (V17173) (cond ((and (cons? V17173) (and (cons? (tl V17173)) (= () (tl (tl V17173))))) (simple-error (cn "datatype syntax error here:
|
27
27
|
|
28
|
-
" (shen.app (shen.next-50 50 (hd
|
28
|
+
" (shen.app (shen.next-50 50 (hd V17173)) "
|
29
29
|
" shen.a)))) (true (shen.f_error shen.datatype-error))))
|
30
30
|
|
31
|
-
(defun shen.<datatype-rules> (
|
31
|
+
(defun shen.<datatype-rules> (V17175) (let YaccParse (let Parse_shen.<datatype-rule> (shen.<datatype-rule> V17175) (if (not (= (fail) Parse_shen.<datatype-rule>)) (let Parse_shen.<datatype-rules> (shen.<datatype-rules> Parse_shen.<datatype-rule>) (if (not (= (fail) Parse_shen.<datatype-rules>)) (shen.pair (hd Parse_shen.<datatype-rules>) (cons (shen.hdtl Parse_shen.<datatype-rule>) (shen.hdtl Parse_shen.<datatype-rules>))) (fail))) (fail))) (if (= YaccParse (fail)) (let Parse_<e> (<e> V17175) (if (not (= (fail) Parse_<e>)) (shen.pair (hd Parse_<e>) ()) (fail))) YaccParse)))
|
32
32
|
|
33
|
-
(defun shen.<datatype-rule> (
|
33
|
+
(defun shen.<datatype-rule> (V17177) (let YaccParse (let Parse_shen.<side-conditions> (shen.<side-conditions> V17177) (if (not (= (fail) Parse_shen.<side-conditions>)) (let Parse_shen.<premises> (shen.<premises> Parse_shen.<side-conditions>) (if (not (= (fail) Parse_shen.<premises>)) (let Parse_shen.<singleunderline> (shen.<singleunderline> Parse_shen.<premises>) (if (not (= (fail) Parse_shen.<singleunderline>)) (let Parse_shen.<conclusion> (shen.<conclusion> Parse_shen.<singleunderline>) (if (not (= (fail) Parse_shen.<conclusion>)) (shen.pair (hd Parse_shen.<conclusion>) (shen.sequent shen.single (cons (shen.hdtl Parse_shen.<side-conditions>) (cons (shen.hdtl Parse_shen.<premises>) (cons (shen.hdtl Parse_shen.<conclusion>) ()))))) (fail))) (fail))) (fail))) (fail))) (if (= YaccParse (fail)) (let Parse_shen.<side-conditions> (shen.<side-conditions> V17177) (if (not (= (fail) Parse_shen.<side-conditions>)) (let Parse_shen.<premises> (shen.<premises> Parse_shen.<side-conditions>) (if (not (= (fail) Parse_shen.<premises>)) (let Parse_shen.<doubleunderline> (shen.<doubleunderline> Parse_shen.<premises>) (if (not (= (fail) Parse_shen.<doubleunderline>)) (let Parse_shen.<conclusion> (shen.<conclusion> Parse_shen.<doubleunderline>) (if (not (= (fail) Parse_shen.<conclusion>)) (shen.pair (hd Parse_shen.<conclusion>) (shen.sequent shen.double (cons (shen.hdtl Parse_shen.<side-conditions>) (cons (shen.hdtl Parse_shen.<premises>) (cons (shen.hdtl Parse_shen.<conclusion>) ()))))) (fail))) (fail))) (fail))) (fail))) YaccParse)))
|
34
34
|
|
35
|
-
(defun shen.<side-conditions> (
|
35
|
+
(defun shen.<side-conditions> (V17179) (let YaccParse (let Parse_shen.<side-condition> (shen.<side-condition> V17179) (if (not (= (fail) Parse_shen.<side-condition>)) (let Parse_shen.<side-conditions> (shen.<side-conditions> Parse_shen.<side-condition>) (if (not (= (fail) Parse_shen.<side-conditions>)) (shen.pair (hd Parse_shen.<side-conditions>) (cons (shen.hdtl Parse_shen.<side-condition>) (shen.hdtl Parse_shen.<side-conditions>))) (fail))) (fail))) (if (= YaccParse (fail)) (let Parse_<e> (<e> V17179) (if (not (= (fail) Parse_<e>)) (shen.pair (hd Parse_<e>) ()) (fail))) YaccParse)))
|
36
36
|
|
37
|
-
(defun shen.<side-condition> (
|
37
|
+
(defun shen.<side-condition> (V17181) (let YaccParse (if (and (cons? (hd V17181)) (= if (hd (hd V17181)))) (let Parse_shen.<expr> (shen.<expr> (shen.pair (tl (hd V17181)) (shen.hdtl V17181))) (if (not (= (fail) Parse_shen.<expr>)) (shen.pair (hd Parse_shen.<expr>) (cons if (cons (shen.hdtl Parse_shen.<expr>) ()))) (fail))) (fail)) (if (= YaccParse (fail)) (if (and (cons? (hd V17181)) (= let (hd (hd V17181)))) (let Parse_shen.<variable?> (shen.<variable?> (shen.pair (tl (hd V17181)) (shen.hdtl V17181))) (if (not (= (fail) Parse_shen.<variable?>)) (let Parse_shen.<expr> (shen.<expr> Parse_shen.<variable?>) (if (not (= (fail) Parse_shen.<expr>)) (shen.pair (hd Parse_shen.<expr>) (cons let (cons (shen.hdtl Parse_shen.<variable?>) (cons (shen.hdtl Parse_shen.<expr>) ())))) (fail))) (fail))) (fail)) YaccParse)))
|
38
38
|
|
39
|
-
(defun shen.<variable?> (
|
39
|
+
(defun shen.<variable?> (V17183) (if (cons? (hd V17183)) (let Parse_X (hd (hd V17183)) (if (variable? Parse_X) (shen.pair (hd (shen.pair (tl (hd V17183)) (shen.hdtl V17183))) Parse_X) (fail))) (fail)))
|
40
40
|
|
41
|
-
(defun shen.<expr> (
|
41
|
+
(defun shen.<expr> (V17185) (if (cons? (hd V17185)) (let Parse_X (hd (hd V17185)) (if (not (or (element? Parse_X (cons >> (cons ; ()))) (or (shen.singleunderline? Parse_X) (shen.doubleunderline? Parse_X)))) (shen.pair (hd (shen.pair (tl (hd V17185)) (shen.hdtl V17185))) (shen.remove-bar Parse_X)) (fail))) (fail)))
|
42
42
|
|
43
|
-
(defun shen.remove-bar (
|
43
|
+
(defun shen.remove-bar (V17187) (cond ((and (cons? V17187) (and (cons? (tl V17187)) (and (cons? (tl (tl V17187))) (and (= () (tl (tl (tl V17187)))) (= (hd (tl V17187)) bar!))))) (cons (hd V17187) (hd (tl (tl V17187))))) ((cons? V17187) (cons (shen.remove-bar (hd V17187)) (shen.remove-bar (tl V17187)))) (true V17187)))
|
44
44
|
|
45
|
-
(defun shen.<premises> (
|
45
|
+
(defun shen.<premises> (V17189) (let YaccParse (let Parse_shen.<premise> (shen.<premise> V17189) (if (not (= (fail) Parse_shen.<premise>)) (let Parse_shen.<semicolon-symbol> (shen.<semicolon-symbol> Parse_shen.<premise>) (if (not (= (fail) Parse_shen.<semicolon-symbol>)) (let Parse_shen.<premises> (shen.<premises> Parse_shen.<semicolon-symbol>) (if (not (= (fail) Parse_shen.<premises>)) (shen.pair (hd Parse_shen.<premises>) (cons (shen.hdtl Parse_shen.<premise>) (shen.hdtl Parse_shen.<premises>))) (fail))) (fail))) (fail))) (if (= YaccParse (fail)) (let Parse_<e> (<e> V17189) (if (not (= (fail) Parse_<e>)) (shen.pair (hd Parse_<e>) ()) (fail))) YaccParse)))
|
46
46
|
|
47
|
-
(defun shen.<semicolon-symbol> (
|
47
|
+
(defun shen.<semicolon-symbol> (V17191) (if (cons? (hd V17191)) (let Parse_X (hd (hd V17191)) (if (= Parse_X ;) (shen.pair (hd (shen.pair (tl (hd V17191)) (shen.hdtl V17191))) shen.skip) (fail))) (fail)))
|
48
48
|
|
49
|
-
(defun shen.<premise> (
|
49
|
+
(defun shen.<premise> (V17193) (let YaccParse (if (and (cons? (hd V17193)) (= ! (hd (hd V17193)))) (shen.pair (hd (shen.pair (tl (hd V17193)) (shen.hdtl V17193))) !) (fail)) (if (= YaccParse (fail)) (let YaccParse (let Parse_shen.<formulae> (shen.<formulae> V17193) (if (not (= (fail) Parse_shen.<formulae>)) (if (and (cons? (hd Parse_shen.<formulae>)) (= >> (hd (hd Parse_shen.<formulae>)))) (let Parse_shen.<formula> (shen.<formula> (shen.pair (tl (hd Parse_shen.<formulae>)) (shen.hdtl Parse_shen.<formulae>))) (if (not (= (fail) Parse_shen.<formula>)) (shen.pair (hd Parse_shen.<formula>) (shen.sequent (shen.hdtl Parse_shen.<formulae>) (shen.hdtl Parse_shen.<formula>))) (fail))) (fail)) (fail))) (if (= YaccParse (fail)) (let Parse_shen.<formula> (shen.<formula> V17193) (if (not (= (fail) Parse_shen.<formula>)) (shen.pair (hd Parse_shen.<formula>) (shen.sequent () (shen.hdtl Parse_shen.<formula>))) (fail))) YaccParse)) YaccParse)))
|
50
50
|
|
51
|
-
(defun shen.<conclusion> (
|
51
|
+
(defun shen.<conclusion> (V17195) (let YaccParse (let Parse_shen.<formulae> (shen.<formulae> V17195) (if (not (= (fail) Parse_shen.<formulae>)) (if (and (cons? (hd Parse_shen.<formulae>)) (= >> (hd (hd Parse_shen.<formulae>)))) (let Parse_shen.<formula> (shen.<formula> (shen.pair (tl (hd Parse_shen.<formulae>)) (shen.hdtl Parse_shen.<formulae>))) (if (not (= (fail) Parse_shen.<formula>)) (let Parse_shen.<semicolon-symbol> (shen.<semicolon-symbol> Parse_shen.<formula>) (if (not (= (fail) Parse_shen.<semicolon-symbol>)) (shen.pair (hd Parse_shen.<semicolon-symbol>) (shen.sequent (shen.hdtl Parse_shen.<formulae>) (shen.hdtl Parse_shen.<formula>))) (fail))) (fail))) (fail)) (fail))) (if (= YaccParse (fail)) (let Parse_shen.<formula> (shen.<formula> V17195) (if (not (= (fail) Parse_shen.<formula>)) (let Parse_shen.<semicolon-symbol> (shen.<semicolon-symbol> Parse_shen.<formula>) (if (not (= (fail) Parse_shen.<semicolon-symbol>)) (shen.pair (hd Parse_shen.<semicolon-symbol>) (shen.sequent () (shen.hdtl Parse_shen.<formula>))) (fail))) (fail))) YaccParse)))
|
52
52
|
|
53
|
-
(defun shen.sequent (
|
53
|
+
(defun shen.sequent (V17198 V17199) (@p V17198 V17199))
|
54
54
|
|
55
|
-
(defun shen.<formulae> (
|
55
|
+
(defun shen.<formulae> (V17201) (let YaccParse (let Parse_shen.<formula> (shen.<formula> V17201) (if (not (= (fail) Parse_shen.<formula>)) (let Parse_shen.<comma-symbol> (shen.<comma-symbol> Parse_shen.<formula>) (if (not (= (fail) Parse_shen.<comma-symbol>)) (let Parse_shen.<formulae> (shen.<formulae> Parse_shen.<comma-symbol>) (if (not (= (fail) Parse_shen.<formulae>)) (shen.pair (hd Parse_shen.<formulae>) (cons (shen.hdtl Parse_shen.<formula>) (shen.hdtl Parse_shen.<formulae>))) (fail))) (fail))) (fail))) (if (= YaccParse (fail)) (let YaccParse (let Parse_shen.<formula> (shen.<formula> V17201) (if (not (= (fail) Parse_shen.<formula>)) (shen.pair (hd Parse_shen.<formula>) (cons (shen.hdtl Parse_shen.<formula>) ())) (fail))) (if (= YaccParse (fail)) (let Parse_<e> (<e> V17201) (if (not (= (fail) Parse_<e>)) (shen.pair (hd Parse_<e>) ()) (fail))) YaccParse)) YaccParse)))
|
56
56
|
|
57
|
-
(defun shen.<comma-symbol> (
|
57
|
+
(defun shen.<comma-symbol> (V17203) (if (cons? (hd V17203)) (let Parse_X (hd (hd V17203)) (if (= Parse_X (intern ",")) (shen.pair (hd (shen.pair (tl (hd V17203)) (shen.hdtl V17203))) shen.skip) (fail))) (fail)))
|
58
58
|
|
59
|
-
(defun shen.<formula> (
|
59
|
+
(defun shen.<formula> (V17205) (let YaccParse (let Parse_shen.<expr> (shen.<expr> V17205) (if (not (= (fail) Parse_shen.<expr>)) (if (and (cons? (hd Parse_shen.<expr>)) (= : (hd (hd Parse_shen.<expr>)))) (let Parse_shen.<type> (shen.<type> (shen.pair (tl (hd Parse_shen.<expr>)) (shen.hdtl Parse_shen.<expr>))) (if (not (= (fail) Parse_shen.<type>)) (shen.pair (hd Parse_shen.<type>) (cons (shen.curry (shen.hdtl Parse_shen.<expr>)) (cons : (cons (shen.demodulate (shen.hdtl Parse_shen.<type>)) ())))) (fail))) (fail)) (fail))) (if (= YaccParse (fail)) (let Parse_shen.<expr> (shen.<expr> V17205) (if (not (= (fail) Parse_shen.<expr>)) (shen.pair (hd Parse_shen.<expr>) (shen.hdtl Parse_shen.<expr>)) (fail))) YaccParse)))
|
60
60
|
|
61
|
-
(defun shen.<type> (
|
61
|
+
(defun shen.<type> (V17207) (let Parse_shen.<expr> (shen.<expr> V17207) (if (not (= (fail) Parse_shen.<expr>)) (shen.pair (hd Parse_shen.<expr>) (shen.curry-type (shen.hdtl Parse_shen.<expr>))) (fail))))
|
62
62
|
|
63
|
-
(defun shen.<doubleunderline> (
|
63
|
+
(defun shen.<doubleunderline> (V17209) (if (cons? (hd V17209)) (let Parse_X (hd (hd V17209)) (if (shen.doubleunderline? Parse_X) (shen.pair (hd (shen.pair (tl (hd V17209)) (shen.hdtl V17209))) Parse_X) (fail))) (fail)))
|
64
64
|
|
65
|
-
(defun shen.<singleunderline> (
|
65
|
+
(defun shen.<singleunderline> (V17211) (if (cons? (hd V17211)) (let Parse_X (hd (hd V17211)) (if (shen.singleunderline? Parse_X) (shen.pair (hd (shen.pair (tl (hd V17211)) (shen.hdtl V17211))) Parse_X) (fail))) (fail)))
|
66
66
|
|
67
|
-
(defun shen.singleunderline? (
|
67
|
+
(defun shen.singleunderline? (V17213) (and (symbol? V17213) (shen.sh? (str V17213))))
|
68
68
|
|
69
|
-
(defun shen.sh? (
|
69
|
+
(defun shen.sh? (V17215) (cond ((= "_" V17215) true) (true (and (= (pos V17215 0) "_") (shen.sh? (tlstr V17215))))))
|
70
70
|
|
71
|
-
(defun shen.doubleunderline? (
|
71
|
+
(defun shen.doubleunderline? (V17217) (and (symbol? V17217) (shen.dh? (str V17217))))
|
72
72
|
|
73
|
-
(defun shen.dh? (
|
73
|
+
(defun shen.dh? (V17219) (cond ((= "=" V17219) true) (true (and (= (pos V17219 0) "=") (shen.dh? (tlstr V17219))))))
|
74
74
|
|
75
|
-
(defun shen.process-datatype (
|
75
|
+
(defun shen.process-datatype (V17222 V17223) (shen.remember-datatype (shen.s-prolog (shen.rules->horn-clauses V17222 V17223))))
|
76
76
|
|
77
|
-
(defun shen.remember-datatype (
|
77
|
+
(defun shen.remember-datatype (V17229) (cond ((cons? V17229) (do (set shen.*datatypes* (adjoin (hd V17229) (value shen.*datatypes*))) (do (set shen.*alldatatypes* (adjoin (hd V17229) (value shen.*alldatatypes*))) (hd V17229)))) (true (shen.f_error shen.remember-datatype))))
|
78
78
|
|
79
|
-
(defun shen.rules->horn-clauses (
|
79
|
+
(defun shen.rules->horn-clauses (V17234 V17235) (cond ((= () V17235) ()) ((and (cons? V17235) (and (tuple? (hd V17235)) (= shen.single (fst (hd V17235))))) (cons (shen.rule->horn-clause V17234 (snd (hd V17235))) (shen.rules->horn-clauses V17234 (tl V17235)))) ((and (cons? V17235) (and (tuple? (hd V17235)) (= shen.double (fst (hd V17235))))) (shen.rules->horn-clauses V17234 (append (shen.double->singles (snd (hd V17235))) (tl V17235)))) (true (shen.f_error shen.rules->horn-clauses))))
|
80
80
|
|
81
|
-
(defun shen.double->singles (
|
81
|
+
(defun shen.double->singles (V17237) (cons (shen.right-rule V17237) (cons (shen.left-rule V17237) ())))
|
82
82
|
|
83
|
-
(defun shen.right-rule (
|
83
|
+
(defun shen.right-rule (V17239) (@p shen.single V17239))
|
84
84
|
|
85
|
-
(defun shen.left-rule (
|
85
|
+
(defun shen.left-rule (V17241) (cond ((and (cons? V17241) (and (cons? (tl V17241)) (and (cons? (tl (tl V17241))) (and (tuple? (hd (tl (tl V17241)))) (and (= () (fst (hd (tl (tl V17241))))) (= () (tl (tl (tl V17241))))))))) (let Q (gensym Qv) (let NewConclusion (@p (cons (snd (hd (tl (tl V17241)))) ()) Q) (let NewPremises (cons (@p (map (lambda X (shen.right->left X)) (hd (tl V17241))) Q) ()) (@p shen.single (cons (hd V17241) (cons NewPremises (cons NewConclusion ())))))))) (true (shen.f_error shen.left-rule))))
|
86
86
|
|
87
|
-
(defun shen.right->left (
|
87
|
+
(defun shen.right->left (V17247) (cond ((and (tuple? V17247) (= () (fst V17247))) (snd V17247)) (true (simple-error "syntax error with ==========
|
88
88
|
"))))
|
89
89
|
|
90
|
-
(defun shen.rule->horn-clause (
|
90
|
+
(defun shen.rule->horn-clause (V17250 V17251) (cond ((and (cons? V17251) (and (cons? (tl V17251)) (and (cons? (tl (tl V17251))) (and (tuple? (hd (tl (tl V17251)))) (= () (tl (tl (tl V17251)))))))) (cons (shen.rule->horn-clause-head V17250 (snd (hd (tl (tl V17251))))) (cons :- (cons (shen.rule->horn-clause-body (hd V17251) (hd (tl V17251)) (fst (hd (tl (tl V17251))))) ())))) (true (shen.f_error shen.rule->horn-clause))))
|
91
91
|
|
92
|
-
(defun shen.rule->horn-clause-head (
|
92
|
+
(defun shen.rule->horn-clause-head (V17254 V17255) (cons V17254 (cons (shen.mode-ify V17255) (cons Context_1957 ()))))
|
93
93
|
|
94
|
-
(defun shen.mode-ify (
|
94
|
+
(defun shen.mode-ify (V17257) (cond ((and (cons? V17257) (and (cons? (tl V17257)) (and (= : (hd (tl V17257))) (and (cons? (tl (tl V17257))) (= () (tl (tl (tl V17257)))))))) (cons mode (cons (cons (hd V17257) (cons : (cons (cons mode (cons (hd (tl (tl V17257))) (cons + ()))) ()))) (cons - ())))) (true V17257)))
|
95
95
|
|
96
|
-
(defun shen.rule->horn-clause-body (
|
96
|
+
(defun shen.rule->horn-clause-body (V17261 V17262 V17263) (let Variables (map (lambda X (shen.extract_vars X)) V17263) (let Predicates (map (lambda X (gensym shen.cl)) V17263) (let SearchLiterals (shen.construct-search-literals Predicates Variables Context_1957 Context1_1957) (let SearchClauses (shen.construct-search-clauses Predicates V17263 Variables) (let SideLiterals (shen.construct-side-literals V17261) (let PremissLiterals (map (lambda X (shen.construct-premiss-literal X (empty? V17263))) V17262) (append SearchLiterals (append SideLiterals PremissLiterals)))))))))
|
97
97
|
|
98
|
-
(defun shen.construct-search-literals (
|
98
|
+
(defun shen.construct-search-literals (V17272 V17273 V17274 V17275) (cond ((and (= () V17272) (= () V17273)) ()) (true (shen.csl-help V17272 V17273 V17274 V17275))))
|
99
99
|
|
100
|
-
(defun shen.csl-help (
|
100
|
+
(defun shen.csl-help (V17282 V17283 V17284 V17285) (cond ((and (= () V17282) (= () V17283)) (cons (cons bind (cons ContextOut_1957 (cons V17284 ()))) ())) ((and (cons? V17282) (cons? V17283)) (cons (cons (hd V17282) (cons V17284 (cons V17285 (hd V17283)))) (shen.csl-help (tl V17282) (tl V17283) V17285 (gensym Context)))) (true (shen.f_error shen.csl-help))))
|
101
101
|
|
102
|
-
(defun shen.construct-search-clauses (
|
102
|
+
(defun shen.construct-search-clauses (V17289 V17290 V17291) (cond ((and (= () V17289) (and (= () V17290) (= () V17291))) shen.skip) ((and (cons? V17289) (and (cons? V17290) (cons? V17291))) (do (shen.construct-search-clause (hd V17289) (hd V17290) (hd V17291)) (shen.construct-search-clauses (tl V17289) (tl V17290) (tl V17291)))) (true (shen.f_error shen.construct-search-clauses))))
|
103
103
|
|
104
|
-
(defun shen.construct-search-clause (
|
104
|
+
(defun shen.construct-search-clause (V17295 V17296 V17297) (shen.s-prolog (cons (shen.construct-base-search-clause V17295 V17296 V17297) (cons (shen.construct-recursive-search-clause V17295 V17296 V17297) ()))))
|
105
105
|
|
106
|
-
(defun shen.construct-base-search-clause (
|
106
|
+
(defun shen.construct-base-search-clause (V17301 V17302 V17303) (cons (cons V17301 (cons (cons (shen.mode-ify V17302) In_1957) (cons In_1957 V17303))) (cons :- (cons () ()))))
|
107
107
|
|
108
|
-
(defun shen.construct-recursive-search-clause (
|
108
|
+
(defun shen.construct-recursive-search-clause (V17307 V17308 V17309) (cons (cons V17307 (cons (cons Assumption_1957 Assumptions_1957) (cons (cons Assumption_1957 Out_1957) V17309))) (cons :- (cons (cons (cons V17307 (cons Assumptions_1957 (cons Out_1957 V17309))) ()) ()))))
|
109
109
|
|
110
|
-
(defun shen.construct-side-literals (
|
110
|
+
(defun shen.construct-side-literals (V17315) (cond ((= () V17315) ()) ((and (cons? V17315) (and (cons? (hd V17315)) (and (= if (hd (hd V17315))) (and (cons? (tl (hd V17315))) (= () (tl (tl (hd V17315)))))))) (cons (cons when (tl (hd V17315))) (shen.construct-side-literals (tl V17315)))) ((and (cons? V17315) (and (cons? (hd V17315)) (and (= let (hd (hd V17315))) (and (cons? (tl (hd V17315))) (and (cons? (tl (tl (hd V17315)))) (= () (tl (tl (tl (hd V17315)))))))))) (cons (cons is (tl (hd V17315))) (shen.construct-side-literals (tl V17315)))) ((cons? V17315) (shen.construct-side-literals (tl V17315))) (true (shen.f_error shen.construct-side-literals))))
|
111
111
|
|
112
|
-
(defun shen.construct-premiss-literal (
|
112
|
+
(defun shen.construct-premiss-literal (V17322 V17323) (cond ((tuple? V17322) (cons shen.t* (cons (shen.recursive_cons_form (snd V17322)) (cons (shen.construct-context V17323 (fst V17322)) ())))) ((= ! V17322) (cons cut (cons Throwcontrol ()))) (true (shen.f_error shen.construct-premiss-literal))))
|
113
113
|
|
114
|
-
(defun shen.construct-context (
|
114
|
+
(defun shen.construct-context (V17326 V17327) (cond ((and (= true V17326) (= () V17327)) Context_1957) ((and (= false V17326) (= () V17327)) ContextOut_1957) ((cons? V17327) (cons cons (cons (shen.recursive_cons_form (hd V17327)) (cons (shen.construct-context V17326 (tl V17327)) ())))) (true (shen.f_error shen.construct-context))))
|
115
115
|
|
116
|
-
(defun shen.recursive_cons_form (
|
116
|
+
(defun shen.recursive_cons_form (V17329) (cond ((cons? V17329) (cons cons (cons (shen.recursive_cons_form (hd V17329)) (cons (shen.recursive_cons_form (tl V17329)) ())))) (true V17329)))
|
117
117
|
|
118
|
-
(defun preclude (
|
118
|
+
(defun preclude (V17331) (shen.preclude-h (map (lambda X (shen.intern-type X)) V17331)))
|
119
119
|
|
120
|
-
(defun shen.preclude-h (
|
120
|
+
(defun shen.preclude-h (V17333) (let FilterDatatypes (set shen.*datatypes* (difference (value shen.*datatypes*) V17333)) (value shen.*datatypes*)))
|
121
121
|
|
122
|
-
(defun include (
|
122
|
+
(defun include (V17335) (shen.include-h (map (lambda X (shen.intern-type X)) V17335)))
|
123
123
|
|
124
|
-
(defun shen.include-h (
|
124
|
+
(defun shen.include-h (V17337) (let ValidTypes (intersection V17337 (value shen.*alldatatypes*)) (let NewDatatypes (set shen.*datatypes* (union ValidTypes (value shen.*datatypes*))) (value shen.*datatypes*))))
|
125
125
|
|
126
|
-
(defun preclude-all-but (
|
126
|
+
(defun preclude-all-but (V17339) (shen.preclude-h (difference (value shen.*alldatatypes*) (map (lambda X (shen.intern-type X)) V17339))))
|
127
127
|
|
128
|
-
(defun include-all-but (
|
128
|
+
(defun include-all-but (V17341) (shen.include-h (difference (value shen.*alldatatypes*) (map (lambda X (shen.intern-type X)) V17341))))
|
129
129
|
|
130
|
-
(defun shen.synonyms-help (
|
130
|
+
(defun shen.synonyms-help (V17347) (cond ((= () V17347) (shen.demodulation-function (value shen.*tc*) (mapcan (lambda X (shen.demod-rule X)) (value shen.*synonyms*)))) ((and (cons? V17347) (cons? (tl V17347))) (let Vs (difference (shen.extract_vars (hd (tl V17347))) (shen.extract_vars (hd V17347))) (if (empty? Vs) (do (shen.pushnew (cons (hd V17347) (cons (hd (tl V17347)) ())) shen.*synonyms*) (shen.synonyms-help (tl (tl V17347)))) (shen.free_variable_warnings (hd (tl V17347)) Vs)))) (true (simple-error "odd number of synonyms
|
131
131
|
"))))
|
132
132
|
|
133
|
-
(defun shen.pushnew (
|
133
|
+
(defun shen.pushnew (V17350 V17351) (if (element? V17350 (value V17351)) (value V17351) (set V17351 (cons V17350 (value V17351)))))
|
134
134
|
|
135
|
-
(defun shen.demod-rule (
|
135
|
+
(defun shen.demod-rule (V17353) (cond ((and (cons? V17353) (and (cons? (tl V17353)) (= () (tl (tl V17353))))) (cons (shen.rcons_form (hd V17353)) (cons -> (cons (shen.rcons_form (hd (tl V17353))) ())))) (true (shen.f_error shen.demod-rule))))
|
136
136
|
|
137
|
-
(defun shen.demodulation-function (
|
137
|
+
(defun shen.demodulation-function (V17356 V17357) (do (tc -) (do (eval (cons define (cons shen.demod (append V17357 (shen.default-rule))))) (do (if V17356 (tc +) shen.skip) synonyms))))
|
138
138
|
|
139
139
|
(defun shen.default-rule () (cons X (cons -> (cons X ()))))
|
140
140
|
|