diff --git a/README.md b/README.md index abc4c28..ea7dc4c 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/types/algebras/relations/IntervalAlgebra.jl b/src/types/algebras/relations/IntervalAlgebra.jl index 49ef5a0..3cd1366 100644 --- a/src/types/algebras/relations/IntervalAlgebra.jl +++ b/src/types/algebras/relations/IntervalAlgebra.jl @@ -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}}: diff --git a/src/types/algebras/relations/RCC.jl b/src/types/algebras/relations/RCC.jl index 985f5c5..b80d2dc 100644 --- a/src/types/algebras/relations/RCC.jl +++ b/src/types/algebras/relations/RCC.jl @@ -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}}: diff --git a/src/types/modal-logic.jl b/src/types/modal-logic.jl index 7d7cfab..be2cad7 100644 --- a/src/types/modal-logic.jl +++ b/src/types/modal-logic.jl @@ -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 @@ -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{...} diff --git a/src/utils/algebras/frames/full-dimensional-frame/main.jl b/src/utils/algebras/frames/full-dimensional-frame/main.jl index c5098d3..8b1f0dd 100644 --- a/src/utils/algebras/frames/full-dimensional-frame/main.jl +++ b/src/utils/algebras/frames/full-dimensional-frame/main.jl @@ -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),)) @@ -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