aclai-lab / aclai-lab/SoleData.jl
It's all about graphs, right?
- Lenguaje dominante
- Julia
- Estrellas
- 13
- Forks
- 4
- Merge medio
- 14 min
- PR fusionados (30 d)
- 1
Descripción
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
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.