aclai-lab / aclai-lab/SoleData.jl
It's all about graphs, right?
- Linguagem predominante
- Julia
- Estrelas
- 13
- Forks
- 4
- Merge médio
- 14min
- PRs com merge (30d)
- 1
Descrição
Hi guys,
Do you see any differences between graph theory and *modal* symbolic learning?
I don't, maybe I am being quite superficial?
I am writing this issue to anticipate the refactoring/simplification work are going to do in the next months.
This is a fragment of code I just wrote in ModalAssociationRules.jl, to fit my experiments with generic `AbstractDataset` types rather than `UniformFullDimensionalDataset`s. It is inspired by some code I read from @alberto-paparella.
Do you think this is garbage? The underlying philosophy is: please, gimme my graph, gimme my coloured edges, and let me fix which symbol holds on every node.
No jungle types. Stick to Graphs.jl as much as possible, and keep it simple. No strongly-coupled code enabling heavy optimizations.
```julia
struct Logiset <: SoleData.AbstractLogiset
instances::Vector{KripkeStructure}
end
```
After the above, we could implement the standard Vector interface via @forward macro (Lazy.jl package). Something like:
```julia
@forward Logiset.instances Logiset begin
length
getindex
setindex!
push!
pop!
iterate
end
```
The rest could be something like:
```julia
# this is not the complete interface, but only a few dispatches I needed in ModalAssociationRules.jl
function instances(logiset::Logiset)
return logiset.instances
end
function ninstances(logiset::Logiset)
return logiset |> length # and this is a renaming for length(::Vector{KripkeStructure}), because of @forward
end
function getinstance(
logiset::Logiset,
i::Int64
)::SoleLogics.LogicalInstance
return SoleLogics.LogicalInstance(
SoleLogics.InterpretationVector(logiset |> instances), i)
end
function frame(logiset::Logiset, i::Int64)
instances(logiset)[i] |> frame
end
```
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Avaliação
Esta issue ainda não foi avaliada.