Skip to content

Commit

Permalink
HerbData -> HerbSpecification; add push_preview; try latest Documente…
Browse files Browse the repository at this point in the history
…r.jl version
  • Loading branch information
THinnerichs committed Apr 5, 2024
1 parent 86d0ac7 commit d1afe3c
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: '1.8'
version: '1'
- name: Install dependencies
run: julia --project=docs/ -e '
using Pkg;
Expand Down
3 changes: 1 addition & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
Herb = "c09c6b7f-4f63-49de-90d9-97a3563c0f4a"
HerbConstraints = "1fa96474-3206-4513-b4fa-23913f296dfc"
HerbCore = "2b23ba43-8213-43cb-b5ea-38c12b45bd45"
HerbData = "495a3ad3-8034-41b3-a087-aacf2fd71098"
HerbGrammar = "4ef9e186-2fe5-4b24-8de7-9f7291f24af7"
HerbInterpret = "5bbddadd-02c5-4713-84b8-97364418cca7"
HerbSearch = "3008d8e8-f9aa-438a-92ed-26e9c7b4829f"
HerbSpecification = "6d54aada-062f-46d8-85cf-a1ceaf058a06"

[compat]
Documenter = "0.27"
Documenter = "1"
15 changes: 8 additions & 7 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ using Herb
using HerbConstraints
using HerbSearch
using HerbGrammar
using HerbData
using HerbInterpret
using HerbCore
using HerbSpecification

makedocs(
modules=[HerbConstraints, HerbSearch, HerbGrammar, HerbData, HerbInterpret, HerbCore],
modules=[HerbConstraints, HerbSearch, HerbGrammar, HerbSpecification, HerbInterpret, HerbCore],
authors="PONYs",
sitename="Herb.jl",
pages = [
Expand All @@ -26,12 +26,12 @@ makedocs(
"Advanced Search Procedures" => "tutorials/advanced_search.md"
],
"Sub-Modules" => [
"HerbGrammar.jl" => "HerbGrammar/index.md",
"HerbSearch.jl" => "HerbSearch/index.md",
"HerbConstraints.jl" => "HerbConstraints/index.md",
"HerbCore.jl" => "HerbData/index.md",
"HerbGrammar.jl" => "HerbGrammar/index.md",
"HerbSpecification.jl" => "HerbSpecification/index.md",
"HerbInterpret.jl" => "HerbInterpret/index.md",
"HerbData.jl" => "HerbData/index.md",
"HerbConstraints.jl" => "HerbConstraints/index.md",
"HerbSearch.jl" => "HerbSearch/index.md",
],
],
format = Documenter.HTML(
Expand All @@ -43,6 +43,7 @@ makedocs(
deploydocs(;
repo="github.com/Herb-AI/Herb.jl.git",
devbranch="documentation",
devurl="dev",
# devurl="dev",
push_preview=true
)

15 changes: 0 additions & 15 deletions docs/src/HerbData/index.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/src/get_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ g = @cfgrammar begin
end
```

Second, the problem specification can be provided using e.g. input/output examples using `HerbData`. Inputs are provided as a `Dict` assigning values to variables, and outputs as arbitrary values. The problem itself is then a list of `IOExample`s using
Second, the problem specification can be provided using e.g. input/output examples using `HerbSpecification`. Inputs are provided as a `Dict` assigning values to variables, and outputs as arbitrary values. The problem itself is then a list of `IOExample`s using

```julia
problem = Problem([IOExample(Dict(:x => x), 2x+1) for x 1:5])
Expand Down Expand Up @@ -58,7 +58,7 @@ See our other tutorials!
## The full code example

```julia
using HerbSearch, HerbData, HerbInterpret, HerbGrammar
using HerbSearch, HerbSpecification, HerbInterpret, HerbGrammar

# define our very simple context-free grammar
# Can add and multiply an input variable x or the integers 1,2.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Julia is a perfect fit for program synthesis due to numerous reasons. Starting f
Herb's functionality is distributed among several sub-packages:
- [HerbCore.jl](@ref HerbCore_docs): The core of Herb.jl defining core concepts to avoid circular dependencies.
- [HerbGrammar.jl](@ref HerbGrammar_docs):
- [HerbData.jl](@ref HerbData_docs):
- [HerbSpecification.jl](@ref HerbSpecification_docs):
- [HerbInterpret.jl](@ref HerbInterpret_docs):
- [HerbSearch.jl](@ref HerbSearch_docs):
- [HerbConstraints.jl](@ref HerbConstraints_docs):
Expand Down
2 changes: 1 addition & 1 deletion docs/src/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ which will both install all dependencies automatically.

For later convenience we can also add the respective dependencies to our project, so that we do not have to write `Herb.HerbGrammar` every time.
```julia
] add HerbConstraints HerbCore HerbData HerbInterpret HerbGrammar HerbSearch
] add HerbConstraints HerbCore HerbSpecification HerbInterpret HerbGrammar HerbSearch
```

And just like this you are done! Welcome to Herb.jl!
Expand Down
4 changes: 2 additions & 2 deletions docs/src/tutorials/advanced_search.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"outputs": [],
"source": [
"using Pkg\n",
"Pkg.add([\"HerbGrammar\", \"HerbData\", \"HerbSearch\", \"HerbInterpret\", \"HerbConstraints\"])\n",
"using HerbGrammar, HerbData, HerbSearch, HerbInterpret, HerbConstraints"
"Pkg.add([\"HerbGrammar\", \"HerbSpecification\", \"HerbSearch\", \"HerbInterpret\", \"HerbConstraints\"])\n",
"using HerbGrammar, HerbSpecification, HerbSearch, HerbInterpret, HerbConstraints"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/advanced_search.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ You can either paste this code into the Julia REPL or run it using the `advanced
To start, we import the necessary packages.

```julia
using HerbGrammar, HerbData, HerbSearch, HerbInterpret
using HerbGrammar, HerbSpecification, HerbSearch, HerbInterpret
```

We start with the same simple grammar from the main file [get_started.md](../get_started.md).
Expand Down
22 changes: 11 additions & 11 deletions docs/src/tutorials/getting_started_with_herb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@
{
"data": {
"text/plain": [
"5-element Vector{Main.Herb.HerbData.IOExample}:\n",
" Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 1), 8)\n",
" Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 2), 11)\n",
" Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 3), 14)\n",
" Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 4), 17)\n",
" Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 5), 20)"
"5-element Vector{Main.Herb.HerbSpecification.IOExample}:\n",
" Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 1), 8)\n",
" Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 2), 11)\n",
" Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 3), 14)\n",
" Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 4), 17)\n",
" Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 5), 20)"
]
},
"metadata": {},
Expand All @@ -136,7 +136,7 @@
],
"source": [
"# Create input-output examples\n",
"examples = [Herb.HerbData.IOExample(Dict(:x => x), 3x+5) for x ∈ 1:5]"
"examples = [Herb.HerbSpecification.IOExample(Dict(:x => x), 3x+5) for x ∈ 1:5]"
]
},
{
Expand All @@ -157,15 +157,15 @@
{
"data": {
"text/plain": [
"Main.Herb.HerbData.Problem(Main.Herb.HerbData.Example[Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 1), 8), Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 2), 11), Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 3), 14), Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 4), 17), Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 5), 20)], \"example\")"
"Main.Herb.HerbSpecification.Problem(Main.Herb.HerbSpecification.Example[Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 1), 8), Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 2), 11), Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 3), 14), Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 4), 17), Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 5), 20)], \"example\")"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"problem = Herb.HerbData.Problem(examples, \"example\")"
"problem = Herb.HerbSpecification.Problem(examples, \"example\")"
]
},
{
Expand Down Expand Up @@ -250,7 +250,7 @@
}
],
"source": [
"problem = Herb.HerbData.Problem([Herb.HerbData.IOExample(Dict(:x => x), 168) for x ∈ 1:5], \"example2\")\n",
"problem = Herb.HerbSpecification.Problem([Herb.HerbSpecification.IOExample(Dict(:x => x), 168) for x ∈ 1:5], \"example2\")\n",
"expr = Herb.HerbSearch.search(g, problem, :Real, enumerator=Herb.HerbSearch.get_dfs_enumerator, max_depth=4, max_size=30, max_time=180)\n",
"print(expr)"
]
Expand All @@ -271,7 +271,7 @@
"metadata": {},
"outputs": [],
"source": [
"problem = Herb.HerbData.Problem([Herb.HerbData.IOExample(Dict(:x => x), 167) for x ∈ 1:5], \"example2\")\n",
"problem = Herb.HerbSpecification.Problem([Herb.HerbSpecification.IOExample(Dict(:x => x), 167) for x ∈ 1:5], \"example2\")\n",
"expr = Herb.HerbSearch.search(g, problem, :Real)\n",
"print(expr)"
]
Expand Down
22 changes: 11 additions & 11 deletions docs/src/tutorials/getting_started_with_herb.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ In the cell below we automatically generate some examples for `x` assigning valu

```julia
# Create input-output examples
examples = [Herb.HerbData.IOExample(Dict(:x => x), 3x+5) for x 1:5]
examples = [Herb.HerbSpecification.IOExample(Dict(:x => x), 3x+5) for x 1:5]
```


5-element Vector{Main.Herb.HerbData.IOExample}:
Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 1), 8)
Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 2), 11)
Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 3), 14)
Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 4), 17)
Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 5), 20)
5-element Vector{Main.Herb.HerbSpecification.IOExample}:
Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 1), 8)
Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 2), 11)
Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 3), 14)
Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 4), 17)
Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 5), 20)


Now that we have some input-output examples, we can define the problem.
Expand All @@ -89,11 +89,11 @@ For now, this is irrelevant, and you can give the program any name you like.


```julia
problem = Herb.HerbData.Problem(examples, "example")
problem = Herb.HerbSpecification.Problem(examples, "example")
```


Main.Herb.HerbData.Problem(Main.Herb.HerbData.Example[Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 1), 8), Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 2), 11), Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 3), 14), Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 4), 17), Main.Herb.HerbData.IOExample(Dict{Symbol, Any}(:x => 5), 20)], "example")
Main.Herb.HerbSpecification.Problem(Main.Herb.HerbSpecification.Example[Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 1), 8), Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 2), 11), Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 3), 14), Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 4), 17), Main.Herb.HerbSpecification.IOExample(Dict{Symbol, Any}(:x => 5), 20)], "example")


### Searching
Expand Down Expand Up @@ -135,7 +135,7 @@ Search is done by passing the grammar, the problem and the starting point like b


```julia
problem = Herb.HerbData.Problem([Herb.HerbData.IOExample(Dict(:x => x), 168) for x 1:5], "example2")
problem = Herb.HerbSpecification.Problem([Herb.HerbSpecification.IOExample(Dict(:x => x), 168) for x 1:5], "example2")
expr = Herb.HerbSearch.search(g, problem, :Real, enumerator=Herb.HerbSearch.get_dfs_enumerator, max_depth=4, max_size=30, max_time=180)
print(expr)
```
Expand All @@ -148,7 +148,7 @@ In any case, this concludes our first introduction to the `Herb.jl` program synt


```julia
problem = Herb.HerbData.Problem([Herb.HerbData.IOExample(Dict(:x => x), 167) for x 1:5], "example2")
problem = Herb.HerbSpecification.Problem([Herb.HerbSpecification.IOExample(Dict(:x => x), 167) for x 1:5], "example2")
expr = Herb.HerbSearch.search(g, problem, :Real)
println(expr)
```

0 comments on commit d1afe3c

Please sign in to comment.