mini_kraken 0.2.03 → 0.2.04
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/CHANGELOG.md +9 -0
- data/lib/mini_kraken/atomic/all_atomic.rb +4 -0
- data/lib/mini_kraken/{core → atomic}/atomic_term.rb +23 -9
- data/lib/mini_kraken/atomic/k_boolean.rb +42 -0
- data/lib/mini_kraken/{core → atomic}/k_integer.rb +2 -1
- data/lib/mini_kraken/{core → atomic}/k_symbol.rb +5 -3
- data/lib/mini_kraken/{core → composite}/composite_term.rb +6 -4
- data/lib/mini_kraken/composite/cons_cell.rb +132 -0
- data/lib/mini_kraken/{core → composite}/cons_cell_visitor.rb +1 -1
- data/lib/mini_kraken/core/association_walker.rb +14 -14
- data/lib/mini_kraken/core/binary_relation.rb +10 -10
- data/lib/mini_kraken/core/equals.rb +159 -161
- data/lib/mini_kraken/core/goal_relation.rb +2 -2
- data/lib/mini_kraken/core/goal_template.rb +7 -7
- data/lib/mini_kraken/core/{variable.rb → log_var.rb} +10 -3
- data/lib/mini_kraken/core/{variable_ref.rb → log_var_ref.rb} +3 -3
- data/lib/mini_kraken/core/tap.rb +46 -0
- data/lib/mini_kraken/core/vocabulary.rb +8 -8
- data/lib/mini_kraken/glue/dsl.rb +21 -17
- data/lib/mini_kraken/glue/fresh_env.rb +7 -2
- data/lib/mini_kraken/glue/fresh_env_factory.rb +1 -1
- data/lib/mini_kraken/glue/run_star_expression.rb +2 -2
- data/lib/mini_kraken/version.rb +1 -1
- data/spec/.rubocop.yml +1 -1
- data/spec/atomic/atomic_term_spec.rb +94 -0
- data/spec/{core → atomic}/k_boolean_spec.rb +19 -34
- data/spec/{core → atomic}/k_symbol_spec.rb +3 -11
- data/spec/{core → composite}/cons_cell_spec.rb +10 -8
- data/spec/{core → composite}/cons_cell_visitor_spec.rb +11 -10
- data/spec/core/association_spec.rb +6 -4
- data/spec/core/association_walker_spec.rb +8 -6
- data/spec/core/conde_spec.rb +19 -17
- data/spec/core/conj2_spec.rb +10 -8
- data/spec/core/def_relation_spec.rb +9 -7
- data/spec/core/disj2_spec.rb +11 -10
- data/spec/core/environment_spec.rb +12 -10
- data/spec/core/equals_spec.rb +12 -10
- data/spec/core/goal_spec.rb +6 -5
- data/spec/core/goal_template_spec.rb +5 -5
- data/spec/core/{variable_ref_spec.rb → log_var_ref_spec.rb} +4 -4
- data/spec/core/{variable_spec.rb → log_var_spec.rb} +4 -4
- data/spec/core/vocabulary_spec.rb +12 -11
- data/spec/glue/dsl_chap1_spec.rb +0 -45
- data/spec/glue/dsl_chap2_spec.rb +115 -7
- data/spec/glue/fresh_env_factory_spec.rb +11 -9
- data/spec/glue/fresh_env_spec.rb +3 -3
- data/spec/glue/run_star_expression_spec.rb +13 -11
- data/spec/support/factory_atomic.rb +22 -0
- data/spec/support/factory_methods.rb +11 -26
- metadata +28 -23
- data/lib/mini_kraken/core/cons_cell.rb +0 -82
- data/lib/mini_kraken/core/k_boolean.rb +0 -35
data/spec/glue/dsl_chap2_spec.rb
CHANGED
@@ -12,8 +12,18 @@ module MiniKraken
|
|
12
12
|
include DSL
|
13
13
|
|
14
14
|
context 'Chapter 2 examples:' do
|
15
|
+
# ((:a) (:b) (:c))
|
16
|
+
let(:abc) { cons(cons(:a), cons(cons(:b), cons(cons(:c)))) }
|
17
|
+
|
18
|
+
# '(:a :c :o :r :n)
|
15
19
|
let(:acorn) { cons(:a, cons(:c, cons(:o, cons(:r, cons(:n))))) }
|
16
20
|
|
21
|
+
# '(:c :o :r :n)
|
22
|
+
let(:corn) { cons(:c, cons(:o, cons(:r, cons(:n)))) }
|
23
|
+
|
24
|
+
# '(:grape :raisin :pear)'
|
25
|
+
let(:fruits) { cons(:grape, cons(:raisin, cons(:pear))) }
|
26
|
+
|
17
27
|
it 'accepts caro definition inspired from frame 2:6' do
|
18
28
|
# Reasoned S2, frame 2:6
|
19
29
|
# (defrel (caro p a)
|
@@ -38,10 +48,10 @@ module MiniKraken
|
|
38
48
|
# In Scheme:
|
39
49
|
# (defrel (caro p a)
|
40
50
|
# (fresh (d)
|
41
|
-
# (== (cons a d)
|
42
|
-
# In Ruby, `p`is a
|
51
|
+
# (== p (cons a d))))
|
52
|
+
# In Ruby, `p`is a standard Kernel method => replace it by `r`
|
43
53
|
def defrel_caro
|
44
|
-
defrel('caro', %w[r a]) { fresh('d', equals(cons(a, d)
|
54
|
+
defrel('caro', %w[r a]) { fresh('d', equals(r, cons(a, d))) }
|
45
55
|
end
|
46
56
|
|
47
57
|
it 'passes frame 2:3' do
|
@@ -83,10 +93,6 @@ module MiniKraken
|
|
83
93
|
# (caro '(grape raisin pear) x)
|
84
94
|
# (caro '((a) (b) (c)) y)
|
85
95
|
# (== (cons x y) r))) ;; r => ((grape a))
|
86
|
-
fruits = cons(:grape, cons(:raisin, cons(:pear)))
|
87
|
-
expect(fruits.to_s).to eq('(:grape :raisin :pear)')
|
88
|
-
abc = cons(cons(:a), cons(cons(:b), cons(cons(:c))))
|
89
|
-
expect(abc.to_s).to eq('((:a) (:b) (:c))')
|
90
96
|
|
91
97
|
result = run_star('r', fresh(%w[x y],
|
92
98
|
[caro(fruits, x),
|
@@ -94,6 +100,108 @@ module MiniKraken
|
|
94
100
|
equals(cons(x, y), r)]))
|
95
101
|
expect(result.car).to eq(cons(:grape, cons(:a)))
|
96
102
|
end
|
103
|
+
|
104
|
+
it 'accepts cdro definition inspired from frame 2:13' do
|
105
|
+
# Reasoned S2, frame 2:13
|
106
|
+
# (defrel (cdro p d)
|
107
|
+
# (fresh (a)
|
108
|
+
# (== (cons a d) p)))
|
109
|
+
|
110
|
+
# As 'p' has a special meaning in Ruby, the argument has been remaned to 'r'
|
111
|
+
cdro_rel = defrel('cdro', %w[r d]) do
|
112
|
+
fresh('a', equals(cons(a, d), r))
|
113
|
+
end
|
114
|
+
|
115
|
+
expect(cdro_rel).to be_kind_of(Core::DefRelation)
|
116
|
+
expect(cdro_rel.name).to eq('cdro')
|
117
|
+
expect(cdro_rel.arity).to eq(2)
|
118
|
+
expect(cdro_rel.formals[0].name).to eq('r')
|
119
|
+
expect(cdro_rel.formals[1].name).to eq('d')
|
120
|
+
g_template = cdro_rel.goal_template
|
121
|
+
expect(g_template).to be_kind_of(FreshEnvFactory)
|
122
|
+
expect(g_template.names).to include('a')
|
123
|
+
end
|
124
|
+
|
125
|
+
# In Scheme:
|
126
|
+
# (defrel (cdro p d)
|
127
|
+
# (fresh (a)
|
128
|
+
# (== p (cons a d))))
|
129
|
+
# In Ruby, `p`is a standard Kernel method => replace it by `r`
|
130
|
+
def defrel_cdro
|
131
|
+
defrel('cdro', %w[r d]) { fresh('aa', equals(r, cons(aa, d))) }
|
132
|
+
end
|
133
|
+
|
134
|
+
it 'passes unnesting process in frame 2:12' do
|
135
|
+
defrel_caro
|
136
|
+
defrel_cdro
|
137
|
+
|
138
|
+
# (run* r
|
139
|
+
# (fresh (v)
|
140
|
+
# (cdro '(acorn) v)
|
141
|
+
# (fresh (w)
|
142
|
+
# (cdro v w)
|
143
|
+
# (caro w r))) ;; r => (o)
|
144
|
+
|
145
|
+
result = run_star('r', fresh('v',
|
146
|
+
[cdro(acorn, v),
|
147
|
+
fresh('w',
|
148
|
+
[cdro(v, w),
|
149
|
+
caro(w, r)])]))
|
150
|
+
expect(result.car).to eq(:o)
|
151
|
+
end
|
152
|
+
|
153
|
+
it 'passes frame 2:15' do
|
154
|
+
defrel_caro
|
155
|
+
defrel_cdro
|
156
|
+
|
157
|
+
# (run* r
|
158
|
+
# (fresh (x y)
|
159
|
+
# (cdro '(grape raisin pear) x)
|
160
|
+
# (caro '((a) (b) (c)) y)
|
161
|
+
# (== (cons x y) r))) ;; r => (((raisin pear) a))
|
162
|
+
|
163
|
+
result = run_star('r', fresh(%w[x y],
|
164
|
+
[cdro(fruits, x),
|
165
|
+
caro(abc, y),
|
166
|
+
equals(cons(x, y), r)]))
|
167
|
+
expect(result.to_s).to eq('(((:raisin :pear) :a))')
|
168
|
+
end
|
169
|
+
|
170
|
+
it 'passes frame 2:16' do
|
171
|
+
defrel_cdro
|
172
|
+
|
173
|
+
# (run* q
|
174
|
+
# (cdro '(a c o r n) '(c o r n))) ;; => (_0)
|
175
|
+
result = run_star('r', cdro(acorn, corn))
|
176
|
+
expect(result.car).to eq(:_0)
|
177
|
+
end
|
178
|
+
|
179
|
+
it 'passes frame 2:17' do
|
180
|
+
defrel_cdro
|
181
|
+
|
182
|
+
# (run* x
|
183
|
+
# (cdro '(c o r n) '(,x r n))) ;; => (o)
|
184
|
+
result = run_star('x', cdro(corn, cons(x, cons(:r, cons(:n)))))
|
185
|
+
expect(result.car).to eq(:o)
|
186
|
+
end
|
187
|
+
|
188
|
+
# it 'passes frame 2:18' do
|
189
|
+
# defrel_caro
|
190
|
+
# defrel_cdro
|
191
|
+
|
192
|
+
# # (run* l
|
193
|
+
# # (fresh (x)
|
194
|
+
# # (cdro l '(c o r n))
|
195
|
+
# # (caro l x)
|
196
|
+
# # (== 'a x))) ;; l => ('(a c o r n))
|
197
|
+
|
198
|
+
# result = run_star('l', fresh('x',
|
199
|
+
# [tap(cdro(l, corn)), # WRONG l => a c o r n (side effect from other tests)
|
200
|
+
# caro(l, x),
|
201
|
+
# equals(:aa, x)
|
202
|
+
# ]))
|
203
|
+
# expect(result.to_s).to eq('((:a :c :o :r :n))')
|
204
|
+
# end
|
97
205
|
end # context
|
98
206
|
end # describe
|
99
207
|
end # module
|
@@ -5,6 +5,7 @@ require_relative '../../lib/mini_kraken/core/formal_arg'
|
|
5
5
|
require_relative '../../lib/mini_kraken/core/formal_ref'
|
6
6
|
require_relative '../../lib/mini_kraken/core/goal_template'
|
7
7
|
|
8
|
+
require_relative '../support/factory_atomic'
|
8
9
|
require_relative '../support/factory_methods'
|
9
10
|
|
10
11
|
# Load the class under test
|
@@ -14,6 +15,7 @@ require_relative '../../lib/mini_kraken/glue/fresh_env_factory'
|
|
14
15
|
module MiniKraken
|
15
16
|
module Glue
|
16
17
|
describe FreshEnvFactory do
|
18
|
+
include MiniKraken::FactoryAtomic # Use mix-in module
|
17
19
|
include FactoryMethods
|
18
20
|
|
19
21
|
# (fresh (d) (== d r))
|
@@ -48,7 +50,7 @@ module MiniKraken
|
|
48
50
|
let(:q_ref) { var_ref('q') }
|
49
51
|
let(:r_formal) { Core::FormalRef.new('r') }
|
50
52
|
let(:a_formal) { Core::FormalRef.new('a') }
|
51
|
-
let(:t_param1) {
|
53
|
+
let(:t_param1) { Composite::ConsCell.new(a_formal, d_ref) }
|
52
54
|
let(:other_goal_t) do
|
53
55
|
Core::GoalTemplate.new(Core::Equals.instance, [t_param1, r_formal])
|
54
56
|
end
|
@@ -59,14 +61,14 @@ module MiniKraken
|
|
59
61
|
|
60
62
|
# Are variables correctly built?
|
61
63
|
expect(created).to be_kind_of(FreshEnv)
|
62
|
-
expect(created.vars['d']).to be_kind_of(Core::
|
64
|
+
expect(created.vars['d']).to be_kind_of(Core::LogVar)
|
63
65
|
|
64
66
|
# Is the goal correectly built?
|
65
67
|
goal = created.goal
|
66
68
|
expect(goal.relation).to eq(Core::Equals.instance)
|
67
|
-
expect(goal.actuals[0]).to be_kind_of(Core::
|
69
|
+
expect(goal.actuals[0]).to be_kind_of(Core::LogVarRef)
|
68
70
|
expect(goal.actuals[0].name).to eq('d')
|
69
|
-
expect(goal.actuals[1]).to be_kind_of(
|
71
|
+
expect(goal.actuals[1]).to be_kind_of(Atomic::KSymbol)
|
70
72
|
expect(goal.actuals[1]).to eq(:pea)
|
71
73
|
end
|
72
74
|
|
@@ -78,17 +80,17 @@ module MiniKraken
|
|
78
80
|
|
79
81
|
# Are variables correctly built?
|
80
82
|
expect(created).to be_kind_of(FreshEnv)
|
81
|
-
expect(created.vars['d']).to be_kind_of(Core::
|
83
|
+
expect(created.vars['d']).to be_kind_of(Core::LogVar)
|
82
84
|
|
83
85
|
# Is the goal correctly built?
|
84
86
|
goal = created.goal
|
85
87
|
expect(goal.relation).to eq(Core::Equals.instance)
|
86
|
-
expect(goal.actuals[0]).to be_kind_of(
|
87
|
-
expect(goal.actuals[0].car).to be_kind_of(Core::
|
88
|
+
expect(goal.actuals[0]).to be_kind_of(Composite::ConsCell)
|
89
|
+
expect(goal.actuals[0].car).to be_kind_of(Core::LogVarRef)
|
88
90
|
expect(goal.actuals[0].car.name).to eq('q')
|
89
|
-
expect(goal.actuals[0].cdr).to be_kind_of(Core::
|
91
|
+
expect(goal.actuals[0].cdr).to be_kind_of(Core::LogVarRef)
|
90
92
|
expect(goal.actuals[0].cdr.name).to eq('d')
|
91
|
-
expect(goal.actuals[1]).to be_kind_of(
|
93
|
+
expect(goal.actuals[1]).to be_kind_of(Composite::ConsCell)
|
92
94
|
expect(goal.actuals[1].to_s).to eq('(:a :c :o :r :n)')
|
93
95
|
end
|
94
96
|
end # context
|
data/spec/glue/fresh_env_spec.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative '../spec_helper' # Use the RSpec framework
|
4
|
+
require_relative '../../lib/mini_kraken/atomic/k_symbol'
|
4
5
|
require_relative '../../lib/mini_kraken/core/goal'
|
5
6
|
require_relative '../../lib/mini_kraken/core/equals'
|
6
7
|
require_relative '../../lib/mini_kraken/core/fail'
|
7
|
-
require_relative '../../lib/mini_kraken/core/k_symbol'
|
8
8
|
require_relative '../../lib/mini_kraken/core/succeed'
|
9
9
|
|
10
10
|
# Load the class under test
|
@@ -14,8 +14,8 @@ require_relative '../../lib/mini_kraken/glue/fresh_env'
|
|
14
14
|
module MiniKraken
|
15
15
|
module Glue
|
16
16
|
describe FreshEnv do
|
17
|
-
let(:pea) {
|
18
|
-
let(:pod) {
|
17
|
+
let(:pea) { Atomic::KSymbol.new(:pea) }
|
18
|
+
let(:pod) { Atomic::KSymbol.new(:pod) }
|
19
19
|
let(:sample_goal) do
|
20
20
|
Core::Goal.new(Core::Equals.instance, [pea, pod])
|
21
21
|
end
|
@@ -13,6 +13,7 @@ require_relative '../../lib/mini_kraken/core/formal_ref'
|
|
13
13
|
require_relative '../../lib/mini_kraken/core/goal_template'
|
14
14
|
require_relative '../../lib/mini_kraken/core/succeed'
|
15
15
|
|
16
|
+
require_relative '../support/factory_atomic'
|
16
17
|
require_relative '../support/factory_methods'
|
17
18
|
|
18
19
|
# Load the class under test
|
@@ -22,6 +23,7 @@ require_relative '../../lib/mini_kraken/glue/run_star_expression'
|
|
22
23
|
module MiniKraken
|
23
24
|
module Glue
|
24
25
|
describe RunStarExpression do
|
26
|
+
include MiniKraken::FactoryAtomic # Use mix-in module
|
25
27
|
include FactoryMethods
|
26
28
|
|
27
29
|
let(:pea) { k_symbol(:pea) }
|
@@ -70,15 +72,15 @@ module MiniKraken
|
|
70
72
|
let(:split) { k_symbol(:split) }
|
71
73
|
let(:tea) { k_symbol(:tea) }
|
72
74
|
let(:virgin) { k_symbol(:virgin) }
|
73
|
-
let(:ref_q) { Core::
|
74
|
-
let(:ref_r) { Core::
|
75
|
-
let(:ref_x) { Core::
|
76
|
-
let(:ref_y) { Core::
|
77
|
-
let(:ref_z) { Core::
|
78
|
-
let(:ref_s) { Core::
|
79
|
-
let(:ref_t) { Core::
|
80
|
-
let(:ref_u) { Core::
|
81
|
-
let(:ref_z) { Core::
|
75
|
+
let(:ref_q) { Core::LogVarRef.new('q') }
|
76
|
+
let(:ref_r) { Core::LogVarRef.new('r') }
|
77
|
+
let(:ref_x) { Core::LogVarRef.new('x') }
|
78
|
+
let(:ref_y) { Core::LogVarRef.new('y') }
|
79
|
+
let(:ref_z) { Core::LogVarRef.new('z') }
|
80
|
+
let(:ref_s) { Core::LogVarRef.new('s') }
|
81
|
+
let(:ref_t) { Core::LogVarRef.new('t') }
|
82
|
+
let(:ref_u) { Core::LogVarRef.new('u') }
|
83
|
+
let(:ref_z) { Core::LogVarRef.new('z') }
|
82
84
|
let(:t_ref) { Core::FormalRef.new('t') }
|
83
85
|
let(:equals_tea) { Core::GoalTemplate.new(Core::Equals.instance, [tea, t_ref]) }
|
84
86
|
let(:equals_cup) { Core::GoalTemplate.new(Core::Equals.instance, [cup, t_ref]) }
|
@@ -148,8 +150,8 @@ module MiniKraken
|
|
148
150
|
end
|
149
151
|
|
150
152
|
it 'should keep variable fresh when no unification occurs (II)' do
|
151
|
-
ref1_q = Core::
|
152
|
-
ref2_q = Core::
|
153
|
+
ref1_q = Core::LogVarRef.new('q')
|
154
|
+
ref2_q = Core::LogVarRef.new('q')
|
153
155
|
goal = equals_goal(ref1_q, ref2_q)
|
154
156
|
instance = RunStarExpression.new('q', goal)
|
155
157
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../lib/mini_kraken/atomic/all_atomic'
|
4
|
+
|
5
|
+
module MiniKraken
|
6
|
+
# Mix-in module that provides convenience factory methods.
|
7
|
+
module FactoryAtomic
|
8
|
+
# Factory method for constructing a KBoolean instance
|
9
|
+
# @param aValue [Boolean]
|
10
|
+
# @return [Core::KBoolean]
|
11
|
+
def k_boolean(aValue)
|
12
|
+
Atomic::KBoolean.new(aValue)
|
13
|
+
end
|
14
|
+
|
15
|
+
# Factory method for constructing a KSymbol instance
|
16
|
+
# @param aSymbol [Symbol]
|
17
|
+
# @return [Core::KSymbol]
|
18
|
+
def k_symbol(aSymbol)
|
19
|
+
Atomic::KSymbol.new(aSymbol)
|
20
|
+
end
|
21
|
+
end # end
|
22
|
+
end # module
|
@@ -1,11 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative '../../lib/mini_kraken/core/any_value'
|
4
|
-
require_relative '../../lib/mini_kraken/
|
5
|
-
require_relative '../../lib/mini_kraken/
|
6
|
-
require_relative '../../lib/mini_kraken/core/
|
7
|
-
require_relative '../../lib/mini_kraken/core/
|
8
|
-
require_relative '../../lib/mini_kraken/core/variable_ref'
|
4
|
+
require_relative '../../lib/mini_kraken/atomic/all_atomic'
|
5
|
+
require_relative '../../lib/mini_kraken/composite/cons_cell'
|
6
|
+
require_relative '../../lib/mini_kraken/core/log_var'
|
7
|
+
require_relative '../../lib/mini_kraken/core/log_var_ref'
|
9
8
|
|
10
9
|
module MiniKraken
|
11
10
|
# Mix-in module that provides convenience factory methods.
|
@@ -24,7 +23,7 @@ module MiniKraken
|
|
24
23
|
# @param obj2 [Term]
|
25
24
|
# @return [Core::ConsCell]
|
26
25
|
def cons(obj1, obj2 = nil)
|
27
|
-
|
26
|
+
Composite::ConsCell.new(obj1, obj2)
|
28
27
|
end
|
29
28
|
|
30
29
|
# Factory method for constructing a goal using the Equals relation.
|
@@ -58,32 +57,18 @@ module MiniKraken
|
|
58
57
|
Core::Goal.new(Core::Disj2.instance, [g1, g2])
|
59
58
|
end
|
60
59
|
|
61
|
-
# Factory method for constructing a
|
62
|
-
# @param aValue [Boolean]
|
63
|
-
# @return [Core::KBoolean]
|
64
|
-
def k_boolean(aValue)
|
65
|
-
Core::KBoolean.new(aValue)
|
66
|
-
end
|
67
|
-
|
68
|
-
# Factory method for constructing a KSymbol instance
|
69
|
-
# @param aSymbol [Symbol]
|
70
|
-
# @return [Core::KSymbol]
|
71
|
-
def k_symbol(aSymbol)
|
72
|
-
Core::KSymbol.new(aSymbol)
|
73
|
-
end
|
74
|
-
|
75
|
-
# Factory method for constructing a Variable
|
60
|
+
# Factory method for constructing a LogVar
|
76
61
|
# @param var_name [String]
|
77
|
-
# @return [Core::
|
62
|
+
# @return [Core::LogVar]
|
78
63
|
def variable(var_name)
|
79
|
-
Core::
|
64
|
+
Core::LogVar.new(var_name)
|
80
65
|
end
|
81
66
|
|
82
|
-
# Factory method for constructing a
|
67
|
+
# Factory method for constructing a LogVarRef
|
83
68
|
# @param var_name [String]
|
84
|
-
# @return [Core::
|
69
|
+
# @return [Core::LogVarRef]
|
85
70
|
def var_ref(var_name)
|
86
|
-
Core::
|
71
|
+
Core::LogVarRef.new(var_name)
|
87
72
|
end
|
88
73
|
end # end
|
89
74
|
end # module
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_kraken
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.04
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitri Geshef
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -69,18 +69,22 @@ files:
|
|
69
69
|
- README.md
|
70
70
|
- Rakefile
|
71
71
|
- lib/mini_kraken.rb
|
72
|
+
- lib/mini_kraken/atomic/all_atomic.rb
|
73
|
+
- lib/mini_kraken/atomic/atomic_term.rb
|
74
|
+
- lib/mini_kraken/atomic/k_boolean.rb
|
75
|
+
- lib/mini_kraken/atomic/k_integer.rb
|
76
|
+
- lib/mini_kraken/atomic/k_symbol.rb
|
77
|
+
- lib/mini_kraken/composite/composite_term.rb
|
78
|
+
- lib/mini_kraken/composite/cons_cell.rb
|
79
|
+
- lib/mini_kraken/composite/cons_cell_visitor.rb
|
72
80
|
- lib/mini_kraken/core/any_value.rb
|
73
81
|
- lib/mini_kraken/core/association.rb
|
74
82
|
- lib/mini_kraken/core/association_walker.rb
|
75
|
-
- lib/mini_kraken/core/atomic_term.rb
|
76
83
|
- lib/mini_kraken/core/base_arg.rb
|
77
84
|
- lib/mini_kraken/core/binary_relation.rb
|
78
85
|
- lib/mini_kraken/core/composite_goal.rb
|
79
|
-
- lib/mini_kraken/core/composite_term.rb
|
80
86
|
- lib/mini_kraken/core/conde.rb
|
81
87
|
- lib/mini_kraken/core/conj2.rb
|
82
|
-
- lib/mini_kraken/core/cons_cell.rb
|
83
|
-
- lib/mini_kraken/core/cons_cell_visitor.rb
|
84
88
|
- lib/mini_kraken/core/def_relation.rb
|
85
89
|
- lib/mini_kraken/core/designation.rb
|
86
90
|
- lib/mini_kraken/core/disj2.rb
|
@@ -95,16 +99,14 @@ files:
|
|
95
99
|
- lib/mini_kraken/core/goal_arg.rb
|
96
100
|
- lib/mini_kraken/core/goal_relation.rb
|
97
101
|
- lib/mini_kraken/core/goal_template.rb
|
98
|
-
- lib/mini_kraken/core/
|
99
|
-
- lib/mini_kraken/core/
|
100
|
-
- lib/mini_kraken/core/k_symbol.rb
|
102
|
+
- lib/mini_kraken/core/log_var.rb
|
103
|
+
- lib/mini_kraken/core/log_var_ref.rb
|
101
104
|
- lib/mini_kraken/core/nullary_relation.rb
|
102
105
|
- lib/mini_kraken/core/outcome.rb
|
103
106
|
- lib/mini_kraken/core/relation.rb
|
104
107
|
- lib/mini_kraken/core/succeed.rb
|
108
|
+
- lib/mini_kraken/core/tap.rb
|
105
109
|
- lib/mini_kraken/core/term.rb
|
106
|
-
- lib/mini_kraken/core/variable.rb
|
107
|
-
- lib/mini_kraken/core/variable_ref.rb
|
108
110
|
- lib/mini_kraken/core/vocabulary.rb
|
109
111
|
- lib/mini_kraken/glue/dsl.rb
|
110
112
|
- lib/mini_kraken/glue/fresh_env.rb
|
@@ -113,12 +115,15 @@ files:
|
|
113
115
|
- lib/mini_kraken/version.rb
|
114
116
|
- mini_kraken.gemspec
|
115
117
|
- spec/.rubocop.yml
|
118
|
+
- spec/atomic/atomic_term_spec.rb
|
119
|
+
- spec/atomic/k_boolean_spec.rb
|
120
|
+
- spec/atomic/k_symbol_spec.rb
|
121
|
+
- spec/composite/cons_cell_spec.rb
|
122
|
+
- spec/composite/cons_cell_visitor_spec.rb
|
116
123
|
- spec/core/association_spec.rb
|
117
124
|
- spec/core/association_walker_spec.rb
|
118
125
|
- spec/core/conde_spec.rb
|
119
126
|
- spec/core/conj2_spec.rb
|
120
|
-
- spec/core/cons_cell_spec.rb
|
121
|
-
- spec/core/cons_cell_visitor_spec.rb
|
122
127
|
- spec/core/def_relation_spec.rb
|
123
128
|
- spec/core/disj2_spec.rb
|
124
129
|
- spec/core/duck_fiber_spec.rb
|
@@ -127,12 +132,10 @@ files:
|
|
127
132
|
- spec/core/fail_spec.rb
|
128
133
|
- spec/core/goal_spec.rb
|
129
134
|
- spec/core/goal_template_spec.rb
|
130
|
-
- spec/core/
|
131
|
-
- spec/core/
|
135
|
+
- spec/core/log_var_ref_spec.rb
|
136
|
+
- spec/core/log_var_spec.rb
|
132
137
|
- spec/core/outcome_spec.rb
|
133
138
|
- spec/core/succeed_spec.rb
|
134
|
-
- spec/core/variable_ref_spec.rb
|
135
|
-
- spec/core/variable_spec.rb
|
136
139
|
- spec/core/vocabulary_spec.rb
|
137
140
|
- spec/glue/dsl_chap1_spec.rb
|
138
141
|
- spec/glue/dsl_chap2_spec.rb
|
@@ -141,6 +144,7 @@ files:
|
|
141
144
|
- spec/glue/run_star_expression_spec.rb
|
142
145
|
- spec/mini_kraken_spec.rb
|
143
146
|
- spec/spec_helper.rb
|
147
|
+
- spec/support/factory_atomic.rb
|
144
148
|
- spec/support/factory_methods.rb
|
145
149
|
homepage: https://github.com/famished-tiger/mini_kraken
|
146
150
|
licenses:
|
@@ -167,12 +171,15 @@ signing_key:
|
|
167
171
|
specification_version: 4
|
168
172
|
summary: Implementation of Minikanren language in Ruby. WIP
|
169
173
|
test_files:
|
174
|
+
- spec/atomic/atomic_term_spec.rb
|
175
|
+
- spec/atomic/k_boolean_spec.rb
|
176
|
+
- spec/atomic/k_symbol_spec.rb
|
177
|
+
- spec/composite/cons_cell_spec.rb
|
178
|
+
- spec/composite/cons_cell_visitor_spec.rb
|
170
179
|
- spec/core/association_spec.rb
|
171
180
|
- spec/core/association_walker_spec.rb
|
172
181
|
- spec/core/conde_spec.rb
|
173
182
|
- spec/core/conj2_spec.rb
|
174
|
-
- spec/core/cons_cell_spec.rb
|
175
|
-
- spec/core/cons_cell_visitor_spec.rb
|
176
183
|
- spec/core/def_relation_spec.rb
|
177
184
|
- spec/core/disj2_spec.rb
|
178
185
|
- spec/core/duck_fiber_spec.rb
|
@@ -181,12 +188,10 @@ test_files:
|
|
181
188
|
- spec/core/fail_spec.rb
|
182
189
|
- spec/core/goal_spec.rb
|
183
190
|
- spec/core/goal_template_spec.rb
|
184
|
-
- spec/core/
|
185
|
-
- spec/core/
|
191
|
+
- spec/core/log_var_ref_spec.rb
|
192
|
+
- spec/core/log_var_spec.rb
|
186
193
|
- spec/core/outcome_spec.rb
|
187
194
|
- spec/core/succeed_spec.rb
|
188
|
-
- spec/core/variable_ref_spec.rb
|
189
|
-
- spec/core/variable_spec.rb
|
190
195
|
- spec/core/vocabulary_spec.rb
|
191
196
|
- spec/glue/dsl_chap1_spec.rb
|
192
197
|
- spec/glue/dsl_chap2_spec.rb
|