@@ -34,10 +34,10 @@ settings = ExploreSettings(domains, search = :complete)
34
34
"""
35
35
function ExploreSettings (
36
36
domains;
37
- complete_search_limit = 10 ^ 6 ,
38
- max_samplings = sum (domain_size, domains; init = 0 ),
39
- search = :flexible ,
40
- solutions_limit = floor (Int, sqrt (max_samplings)),
37
+ complete_search_limit= 10 ^ 6 ,
38
+ max_samplings= sum (domain_size, domains; init= 0 ),
39
+ search= :flexible ,
40
+ solutions_limit= floor (Int, sqrt (max_samplings)),
41
41
)
42
42
return ExploreSettings (complete_search_limit, max_samplings, search, solutions_limit)
43
43
end
@@ -85,8 +85,8 @@ explorer = Explorer(concepts, domains, objective)
85
85
function Explorer (
86
86
concepts,
87
87
domains,
88
- objective = nothing ;
89
- settings = ExploreSettings (domains),
88
+ objective= nothing ;
89
+ settings= ExploreSettings (domains),
90
90
)
91
91
F1 = isempty (concepts) ? Function : Union{map (c -> typeof (c[1 ]), concepts)... }
92
92
D = isempty (domains) ? AbstractDomain : Union{map (typeof, domains)... }
@@ -124,7 +124,7 @@ key = push!(explorer, (sum, [1, 2]))
124
124
```
125
125
"""
126
126
function Base. push! (explorer:: Explorer , concept:: Tuple{Function,Vector{Int}} )
127
- max_key = maximum (keys (explorer. concepts); init = 0 )
127
+ max_key = maximum (keys (explorer. concepts); init= 0 )
128
128
explorer. concepts[max_key+ 1 ] = concept
129
129
return max_key + 1
130
130
end
@@ -171,7 +171,7 @@ key = push!(explorer, domain([1, 2, 3]))
171
171
```
172
172
"""
173
173
function Base. push! (explorer:: Explorer , domain:: AbstractDomain )
174
- max_key = maximum (keys (explorer. domains); init = 0 )
174
+ max_key = maximum (keys (explorer. domains); init= 0 )
175
175
explorer. domains[max_key+ 1 ] = domain
176
176
return max_key + 1
177
177
end
@@ -219,7 +219,7 @@ set!(explorer, x -> sum(x))
219
219
"""
220
220
set! (explorer:: Explorer , objective:: Function ) = explorer. objective = objective
221
221
222
- function update_exploration! (explorer, f, c, search = explorer. settings. search)
222
+ function update_exploration! (explorer, f, c, search= explorer. settings. search)
223
223
solutions = explorer. state. solutions
224
224
non_sltns = explorer. state. non_solutions
225
225
obj = explorer. objective
@@ -261,7 +261,7 @@ function _explore!(explorer, f, ::Val{:partial};)
261
261
end
262
262
263
263
function _explore! (explorer, f, :: Val{:complete} )
264
- C = Base. Iterators. product (map (d -> get_domain (d), explorer. domains |> values)... )
264
+ C = Base. Iterators. product (Iterators . map (d -> get_domain (d), explorer. domains |> values)... )
265
265
foreach (c -> update_exploration! (explorer, f, c, :complete ), C)
266
266
return nothing
267
267
end
@@ -322,7 +322,7 @@ domains = [domain([1, 2, 3]), domain([4, 5, 6])]
322
322
solutions, non_solutions = explore(domains, allunique)
323
323
```
324
324
"""
325
- function explore (domains, concept; settings = ExploreSettings (domains), parameters... )
325
+ function explore (domains, concept; settings= ExploreSettings (domains), parameters... )
326
326
f = x -> concept (x; parameters... )
327
327
explorer = Explorer ([(f, Vector {Int} ())], domains; settings)
328
328
explore! (explorer)
346
346
@test length (X) == factorial (4 )
347
347
@test length (X̅) == 4 ^ 4 - factorial (4 )
348
348
349
- explorer = ConstraintDomains. Explorer ()
349
+ explorer = ConstraintDomains. Explorer ([(allunique, 1 : 4 )], domains )
350
350
end
0 commit comments