Skip to content

Commit

Permalink
Improve dimensional frame
Browse files Browse the repository at this point in the history
  • Loading branch information
giopaglia committed Nov 15, 2024
1 parent 1587bc7 commit fd24eda
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ julia> accessibles(fr, SoleLogics.Point(3), SoleLogics.GreaterRel) |> collect

```julia
# An interval temporal frame on 10 (equidistant) points
julia> fr = SoleLogics.FullDimensionalFrame(10);
julia> fr = SoleLogics.FullDimensionalFrame(10, Interval{Int});

# Interval Algebra (IA) relation `L` (later, see [Halpern & Shoham, 1991](https://dl.acm.org/doi/abs/10.1145/115234.115351))
julia> accessibles(fr, Interval(3,5), IA_L) |> collect
Expand Down
2 changes: 1 addition & 1 deletion src/types/algebras/relations/IntervalAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ julia> IARelations
julia> @assert SoleLogics._IA_L() == IA_L
julia> fr = SoleLogics.FullDimensionalFrame((10,),);
julia> fr = SoleLogics.FullDimensionalFrame((10,), Interval{Int});
julia> collect(accessibles(fr, Interval(2,5), IA_L))
15-element Vector{Interval{Int64}}:
Expand Down
2 changes: 1 addition & 1 deletion src/types/algebras/relations/RCC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ julia> RCC8Relations
julia> @assert SoleLogics._Topo_DC() == Topo_DC
julia> fr = SoleLogics.FullDimensionalFrame((10,),);
julia> fr = SoleLogics.FullDimensionalFrame((10,), Interval{Int});
julia> collect(accessibles(fr, Interval(4,8), Topo_DC))
6-element Vector{Interval{Int64}}:
Expand Down
4 changes: 2 additions & 2 deletions src/types/modal-logic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ access the current world and all worlds, respectively.
# Examples
```julia-repl
julia> fr = SoleLogics.FullDimensionalFrame((10,),);
julia> fr = SoleLogics.FullDimensionalFrame((10,), Interval{Int});
julia> Interval(8,11) in (accessibles(fr, Interval(2,5), IA_L))
true
Expand Down Expand Up @@ -276,7 +276,7 @@ Return the worlds in frame `fr` that are accessible from world `w` via relation
# Examples
```julia-repl
julia> fr = SoleLogics.FullDimensionalFrame((10,),);
julia> fr = SoleLogics.FullDimensionalFrame((10,), Interval{Int});
julia> typeof(accessibles(fr, Interval(2,5), IA_L))
Base.Generator{...}
Expand Down
7 changes: 5 additions & 2 deletions src/utils/algebras/frames/full-dimensional-frame/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ julia> SoleLogics.allworlds(SoleLogics.FullDimensionalFrame((),))
1-element Vector{OneWorld}:
julia> nworlds(SoleLogics.FullDimensionalFrame((10,),))
julia> nworlds(SoleLogics.FullDimensionalFrame((10,), Interval{Int}))
55
julia> nworlds(SoleLogics.FullDimensionalFrame((10,10),))
Expand Down Expand Up @@ -62,7 +62,10 @@ struct FullDimensionalFrame{N,W<:AbstractWorld} <: AbstractDimensionalFrame{N,W}
FullDimensionalFrame{N,W}(channelsize)
end

function FullDimensionalFrame(channelsize::Tuple{})
function FullDimensionalFrame(channelsize::Tuple{}, W::Union{Nothing,Type{<:AbstractWorld}} = nothing)
if !isnothing(W)
@warn "Ignoring worldtype provided ($(W)) and defaulting to worldtype to OneWorld."
end
W = OneWorld
FullDimensionalFrame{0,W}(channelsize)
end
Expand Down

0 comments on commit fd24eda

Please sign in to comment.