SoleData
Welcome to the documentation for SoleData.
SoleData.BASE_FEATURE_FUNCTIONS_ALIASES
SoleLogics.IA_L
SoleData.AbstractCondition
SoleData.AbstractFeature
SoleData.AbstractFullMemoset
SoleData.AbstractMemoset
SoleData.AbstractModalLogiset
SoleData.AbstractOneStepMemoset
SoleData.AbstractScalarOneStepRelationalMemoset
SoleData.AbstractUnivariateFeature
SoleData.ExplicitFeature
SoleData.Feature
SoleData.FullMemoset
SoleData.FunctionalCondition
SoleData.MultiFormula
SoleData.MultiLogiset
SoleData.MultivariateFeature
SoleData.ObliqueScalarCondition
SoleData.PropositionalLogiset
SoleData.ScalarChainedMemoset
SoleData.ScalarCondition
SoleData.ScalarMetaCondition
SoleData.ScalarOneStepMemoset
SoleData.SupportedLogiset
SoleData.UnivariateFeature
SoleData.UnivariateNamedFeature
SoleData.UnivariateScalarAlphabet
SoleData.ValueCondition
SoleData.VarFeature
SoleData.VariableMax
SoleData.VariableMin
SoleData.VariableSoftMax
SoleData.VariableSoftMin
SoleData.VariableValue
SoleLogics.AbstractFrame
SoleLogics.AbstractWorld
SoleLogics.Atom
SoleLogics.Interval
SoleLogics.Interval2D
SoleData.computefeature
SoleData.computeunivariatefeature
SoleData.featvaltype
SoleData.minify
SoleData.parsecondition
SoleData.parsefeature
SoleData.parsefeature
SoleData.representatives
SoleData.variable_name
SoleLogics.accessibles
SoleLogics.alphabet
SoleLogics.syntaxstring
Logical foundations
See SoleLogics for more.
SoleLogics.Atom
— Typestruct Atom{V} <: SyntaxLeaf
+Home · SoleData.jl SoleData
Welcome to the documentation for SoleData.
SoleData.BASE_FEATURE_FUNCTIONS_ALIASES
SoleLogics.IA_L
SoleData.AbstractCondition
SoleData.AbstractFeature
SoleData.AbstractFullMemoset
SoleData.AbstractMemoset
SoleData.AbstractModalLogiset
SoleData.AbstractOneStepMemoset
SoleData.AbstractScalarOneStepRelationalMemoset
SoleData.AbstractUnivariateFeature
SoleData.ExplicitFeature
SoleData.Feature
SoleData.FullMemoset
SoleData.FunctionalCondition
SoleData.MultiFormula
SoleData.MultiLogiset
SoleData.MultivariateFeature
SoleData.ObliqueScalarCondition
SoleData.PropositionalLogiset
SoleData.ScalarChainedMemoset
SoleData.ScalarCondition
SoleData.ScalarMetaCondition
SoleData.ScalarOneStepMemoset
SoleData.SupportedLogiset
SoleData.UnivariateFeature
SoleData.UnivariateNamedFeature
SoleData.UnivariateScalarAlphabet
SoleData.ValueCondition
SoleData.VarFeature
SoleData.VariableMax
SoleData.VariableMin
SoleData.VariableSoftMax
SoleData.VariableSoftMin
SoleData.VariableValue
SoleLogics.AbstractFrame
SoleLogics.AbstractWorld
SoleLogics.Atom
SoleLogics.Interval
SoleLogics.Interval2D
SoleData.computefeature
SoleData.computeunivariatefeature
SoleData.featvaltype
SoleData.minify
SoleData.parsecondition
SoleData.parsefeature
SoleData.parsefeature
SoleData.representatives
SoleData.variable_name
SoleLogics.accessibles
SoleLogics.alphabet
SoleLogics.syntaxstring
Logical foundations
See SoleLogics for more.
SoleLogics.Atom
— Typestruct Atom{V} <: SyntaxLeaf
value::V
end
An atom, sometimes called an atomic proposition, propositional letter (or simply letter), of type Atom{V}
wraps a value::V
representing a fact which truth can be assessed on a logical interpretation.
Atoms are nullary tokens (i.e, they are at the leaves of a syntax tree); note that their atoms cannot be Atom
s.
See also AbstractInterpretation
, atoms
, check
, SyntaxToken
.
sourceSoleLogics.AbstractWorld
— Typeabstract type AbstractWorld end
Abstract type for the nodes of an annotated accessibility graph (Kripke structure). This is used, for example, in modal logic, where the truth of formulas is relativized to worlds, that is, nodes of a graph.
Implementing
When implementing a new world type, the logical semantics should be defined via accessibles
methods; refer to the help for accessibles
.
See also AbstractKripkeStructure
, AbstractFrame
.
sourceSoleLogics.Interval
— Typestruct Interval{T} <: GeometricalWorld
x :: T
@@ -98,58 +98,58 @@
r::GlobalRel,
) where {W<:AbstractWorld}
allworlds(fr)
-end
In general, it should be true that collect(accessibles(fr, w, r)) isa AbstractWorlds{W}
.
See also AbstractWorld
, AbstractRelation
, AbstractMultiModalFrame
.
sourceSoleData.minify
— Functionminify(dataset::D1)::Tuple{D2,Function} where {D1,D2}
Return a minified version of a dataset, as well as a backmap for reverting to the original dataset. Dataset minification remaps each scalar values in the dataset to a new value such that the overall order of the values is preserved; the output dataset is smaller in size, since it relies on values of type UInt8, UInt16, UInt32, etc.
See also isminifiable
.
sourceLogisets
SoleData.BASE_FEATURE_FUNCTIONS_ALIASES
— ConstantSyntaxstring aliases for standard features, such as "min", "max", "avg".
sourceSoleData.AbstractFeature
— Typeabstract type AbstractFeature end
Abstract type for features of worlds of [Kripke structures](https://en.wikipedia.org/wiki/Kripkestructure(model_checking).
See also VarFeature
, featvaltype
, SoleLogics.AbstractWorld
.
sourceSoleData.AbstractUnivariateFeature
— Typeabstract type AbstractUnivariateFeature <: VarFeature end
A dimensional feature represented by the application of a function to a single variable of a dimensional channel. For example, it can wrap a scalar function computing how much red a Interval2D
world, when interpreted on an image, contains.
See also SoleLogics.Interval
, SoleLogics.Interval2D
, UnivariateFeature
, VarFeature
, AbstractFeature
.
sourceSoleData.ExplicitFeature
— Typestruct ExplicitFeature{T} <: AbstractFeature
+end
In general, it should be true that collect(accessibles(fr, w, r)) isa AbstractWorlds{W}
.
See also AbstractWorld
, AbstractRelation
, AbstractMultiModalFrame
.
sourceSoleData.minify
— Functionminify(dataset::D1)::Tuple{D2,Function} where {D1,D2}
Return a minified version of a dataset, as well as a backmap for reverting to the original dataset. Dataset minification remaps each scalar values in the dataset to a new value such that the overall order of the values is preserved; the output dataset is smaller in size, since it relies on values of type UInt8, UInt16, UInt32, etc.
See also isminifiable
.
sourceLogisets
SoleData.BASE_FEATURE_FUNCTIONS_ALIASES
— ConstantSyntaxstring aliases for standard features, such as "min", "max", "avg".
sourceSoleData.AbstractFeature
— Typeabstract type AbstractFeature end
Abstract type for features of worlds of [Kripke structures](https://en.wikipedia.org/wiki/Kripkestructure(model_checking).
See also VarFeature
, featvaltype
, SoleLogics.AbstractWorld
.
sourceSoleData.AbstractUnivariateFeature
— Typeabstract type AbstractUnivariateFeature <: VarFeature end
A dimensional feature represented by the application of a function to a single variable of a dimensional channel. For example, it can wrap a scalar function computing how much red a Interval2D
world, when interpreted on an image, contains.
See also SoleLogics.Interval
, SoleLogics.Interval2D
, UnivariateFeature
, VarFeature
, AbstractFeature
.
sourceSoleData.ExplicitFeature
— Typestruct ExplicitFeature{T} <: AbstractFeature
name::String
featstruct
-end
A feature encoded explicitly, for example, as a slice of DimensionalDatasets.UniformFullDimensionalLogiset
's feature structure.
See also AbstractFeature
.
sourceSoleData.Feature
— Typestruct Feature{A} <: AbstractFeature
+end
A feature encoded explicitly, for example, as a slice of DimensionalDatasets.UniformFullDimensionalLogiset
's feature structure.
See also AbstractFeature
.
sourceSoleData.Feature
— Typestruct Feature{A} <: AbstractFeature
atom::A
-end
A feature solely identified by an atom (e.g., a string with its name, a tuple of strings, etc.)
See also AbstractFeature
.
sourceSoleData.MultivariateFeature
— Typestruct MultivariateFeature{U} <: VarFeature
+end
A feature solely identified by an atom (e.g., a string with its name, a tuple of strings, etc.)
See also AbstractFeature
.
sourceSoleData.MultivariateFeature
— Typestruct MultivariateFeature{U} <: VarFeature
f::Function
-end
A dimensional feature represented by the application of a function to a dimensional channel. For example, it can wrap a scalar function computing how much a Interval2D
world, when interpreted on an image, resembles a horse. Note that the image has a number of spatial variables (3, for the case of RGB), and "resembling a horse" may require a computation involving all variables.
See also SoleLogics.Interval
, SoleLogics.Interval2D
, AbstractUnivariateFeature
, VarFeature
, AbstractFeature
.
sourceSoleData.UnivariateFeature
— Typestruct UnivariateFeature{U} <: AbstractUnivariateFeature
+end
A dimensional feature represented by the application of a function to a dimensional channel. For example, it can wrap a scalar function computing how much a Interval2D
world, when interpreted on an image, resembles a horse. Note that the image has a number of spatial variables (3, for the case of RGB), and "resembling a horse" may require a computation involving all variables.
See also SoleLogics.Interval
, SoleLogics.Interval2D
, AbstractUnivariateFeature
, VarFeature
, AbstractFeature
.
sourceSoleData.UnivariateFeature
— Typestruct UnivariateFeature{U} <: AbstractUnivariateFeature
i_variable::Integer
f::Function
-end
A dimensional feature represented by the application of a generic function f
to a single variable of a dimensional channel. For example, it can wrap a scalar function computing how much red a Interval2D
world, when interpreted on an image, contains.
See also SoleLogics.Interval
, SoleLogics.Interval2D
, AbstractUnivariateFeature
, VarFeature
, AbstractFeature
.
sourceSoleData.UnivariateNamedFeature
— Typestruct UnivariateNamedFeature{U} <: AbstractUnivariateFeature
+end
A dimensional feature represented by the application of a generic function f
to a single variable of a dimensional channel. For example, it can wrap a scalar function computing how much red a Interval2D
world, when interpreted on an image, contains.
See also SoleLogics.Interval
, SoleLogics.Interval2D
, AbstractUnivariateFeature
, VarFeature
, AbstractFeature
.
sourceSoleData.UnivariateNamedFeature
— Typestruct UnivariateNamedFeature{U} <: AbstractUnivariateFeature
i_variable::Integer
name::String
-end
A univariate feature solely identified by its name and reference variable.
See also SoleLogics.Interval
, SoleLogics.Interval2D
, AbstractUnivariateFeature
, VarFeature
, AbstractFeature
.
sourceSoleData.VarFeature
— Typeabstract type VarFeature <: AbstractFeature end
Abstract type for feature functions that can be computed on (multi)variate data. Instances of multivariate datasets have values for a number of variables, which can be used to define logical features.
For example, with dimensional data (e.g., multivariate time series, digital images and videos), features can be computed as the minimum value for a given variable on a specific interval/rectangle/cuboid (in general, a `SoleLogics.GeometricalWorld).
As an example of a dimensional feature, consider min[V1], which computes the minimum for variable 1 for a given world. ScalarCondition
s such as min[V1] >= 10 can be, then, evaluated on worlds.
See also scalarlogiset
, featvaltype
, computefeature
, SoleLogics.Interval
.
sourceSoleData.VariableMax
— Typestruct VariableMax <: AbstractUnivariateFeature
+end
A univariate feature solely identified by its name and reference variable.
See also SoleLogics.Interval
, SoleLogics.Interval2D
, AbstractUnivariateFeature
, VarFeature
, AbstractFeature
.
sourceSoleData.VarFeature
— Typeabstract type VarFeature <: AbstractFeature end
Abstract type for feature functions that can be computed on (multi)variate data. Instances of multivariate datasets have values for a number of variables, which can be used to define logical features.
For example, with dimensional data (e.g., multivariate time series, digital images and videos), features can be computed as the minimum value for a given variable on a specific interval/rectangle/cuboid (in general, a `SoleLogics.GeometricalWorld).
As an example of a dimensional feature, consider min[V1], which computes the minimum for variable 1 for a given world. ScalarCondition
s such as min[V1] >= 10 can be, then, evaluated on worlds.
See also scalarlogiset
, featvaltype
, computefeature
, SoleLogics.Interval
.
sourceSoleData.VariableMax
— Typestruct VariableMax <: AbstractUnivariateFeature
i_variable::Integer
-end
Notable univariate feature computing the maximum value for a given variable.
See also SoleLogics.Interval
, SoleLogics.Interval2D
, AbstractUnivariateFeature
, VariableMin
, VarFeature
, AbstractFeature
.
sourceSoleData.VariableMin
— Typestruct VariableMin <: AbstractUnivariateFeature
+end
Notable univariate feature computing the maximum value for a given variable.
See also SoleLogics.Interval
, SoleLogics.Interval2D
, AbstractUnivariateFeature
, VariableMin
, VarFeature
, AbstractFeature
.
sourceSoleData.VariableMin
— Typestruct VariableMin <: AbstractUnivariateFeature
i_variable::Integer
-end
Notable univariate feature computing the minimum value for a given variable.
See also SoleLogics.Interval
, SoleLogics.Interval2D
, AbstractUnivariateFeature
, VariableMax
, VarFeature
, AbstractFeature
.
sourceSoleData.VariableSoftMax
— Typestruct VariableSoftMax{T<:AbstractFloat} <: AbstractUnivariateFeature
+end
Notable univariate feature computing the minimum value for a given variable.
See also SoleLogics.Interval
, SoleLogics.Interval2D
, AbstractUnivariateFeature
, VariableMax
, VarFeature
, AbstractFeature
.
sourceSoleData.VariableSoftMax
— Typestruct VariableSoftMax{T<:AbstractFloat} <: AbstractUnivariateFeature
i_variable::Integer
alpha::T
-end
Univariate feature computing a "softened" version of the maximum value for a given variable.
See also SoleLogics.Interval
, SoleLogics.Interval2D
, AbstractUnivariateFeature
, VariableMax
, VarFeature
, AbstractFeature
.
sourceSoleData.VariableSoftMin
— Typestruct VariableSoftMin{T<:AbstractFloat} <: AbstractUnivariateFeature
+end
Univariate feature computing a "softened" version of the maximum value for a given variable.
See also SoleLogics.Interval
, SoleLogics.Interval2D
, AbstractUnivariateFeature
, VariableMax
, VarFeature
, AbstractFeature
.
sourceSoleData.VariableSoftMin
— Typestruct VariableSoftMin{T<:AbstractFloat} <: AbstractUnivariateFeature
i_variable::Integer
alpha::T
-end
Univariate feature computing a "softened" version of the minimum value for a given variable.
See also SoleLogics.Interval
, SoleLogics.Interval2D
, AbstractUnivariateFeature
, VariableMin
, VarFeature
, AbstractFeature
.
sourceSoleData.VariableValue
— Typestruct VariableValue <: AbstractUnivariateFeature
+end
Univariate feature computing a "softened" version of the minimum value for a given variable.
See also SoleLogics.Interval
, SoleLogics.Interval2D
, AbstractUnivariateFeature
, VariableMin
, VarFeature
, AbstractFeature
.
sourceSoleData.VariableValue
— Typestruct VariableValue <: AbstractUnivariateFeature
i_variable::Union{Integer,Symbol}
-end
A simple feature, equal the value of a scalar variable.
See also SoleLogics.Interval
, SoleLogics.Interval2D
, AbstractUnivariateFeature
, VarFeature
, AbstractFeature
.
sourceSoleData.computefeature
— Methodcomputefeature(f::VarFeature, featchannel; kwargs...)
Compute a feature on a featchannel (i.e., world reading) of an instance.
See also VarFeature
.
sourceSoleData.computeunivariatefeature
— Methodcomputeunivariatefeature(f::AbstractUnivariateFeature, varchannel; kwargs...)
Compute a feature on a variable channel (i.e., world reading) of an instance.
See also AbstractUnivariateFeature
.
sourceSoleData.featvaltype
— Methodfeatvaltype(dataset, f::VarFeature)
Return the type of the values returned by feature f
on logiseed dataset
.
See also VarFeature
.
sourceSoleData.parsefeature
— Methodparsefeature(FT::Type{<:AbstractFeature}, expr::String; kwargs...)
Parse a feature of type FT
from its syntaxstring
representation. Depending on FT
, specifying keyword arguments such as featvaltype::Type
may be required or recommended.
See also parsecondition
.
sourceSoleData.parsefeature
— Methodparsefeature(FT::Type{<:VarFeature}, expr::String; kwargs...)
Parse a VarFeature
of type FT
from its syntaxstring
representation.
Keyword Arguments
featvaltype::Union{Nothing,Type} = nothing
: the feature's featvaltype (recommended for some features, e.g., UnivariateFeature
);opening_parenthesis::String = "["
: the string signaling the opening of an expression block (e.g., "min[V2]"
);closing_parenthesis::String = "]"
: the string signaling the closing of an expression block (e.g., "min[V2]"
);additional_feature_aliases = Dict{String,Base.Callable}()
: A dictionary mapping strings to callables, useful when parsing custom-made, non-standard features. By default, features such as "avg" or "min" are provided for (see SoleData.BASE_FEATURE_FUNCTIONS_ALIASES
); note that, in case of clashing string
s, the provided additional aliases will override the standard ones;variable_names_map::Union{Nothing,AbstractDict,AbstractVector} = nothing
: mapping from variable name to variable index, useful when parsing from syntaxstring
s with variable names (e.g., "min[Heart rate]"
);variable_name_prefix::String = "V"
: prefix used with variable indices (e.g., "V10").
Note that at most one argument in variable_names_map
and variable_name_prefix
should be provided.
Note The default parentheses, here, differ from those of `SoleLogics.parseformula, since features are typically wrapped into Atom
s, and parseformula
does not allow parenthesis characters in atoms' syntaxstring
s.
See also VarFeature
, featvaltype
, parsecondition
.
sourceSoleData.variable_name
— Methodvariable_name(
+end
A simple feature, equal the value of a scalar variable.
See also SoleLogics.Interval
, SoleLogics.Interval2D
, AbstractUnivariateFeature
, VarFeature
, AbstractFeature
.
sourceSoleData.computefeature
— Methodcomputefeature(f::VarFeature, featchannel; kwargs...)
Compute a feature on a featchannel (i.e., world reading) of an instance.
See also VarFeature
.
sourceSoleData.computeunivariatefeature
— Methodcomputeunivariatefeature(f::AbstractUnivariateFeature, varchannel; kwargs...)
Compute a feature on a variable channel (i.e., world reading) of an instance.
See also AbstractUnivariateFeature
.
sourceSoleData.featvaltype
— Methodfeatvaltype(dataset, f::VarFeature)
Return the type of the values returned by feature f
on logiseed dataset
.
See also VarFeature
.
sourceSoleData.parsefeature
— Methodparsefeature(FT::Type{<:AbstractFeature}, expr::String; kwargs...)
Parse a feature of type FT
from its syntaxstring
representation. Depending on FT
, specifying keyword arguments such as featvaltype::Type
may be required or recommended.
See also parsecondition
.
sourceSoleData.parsefeature
— Methodparsefeature(FT::Type{<:VarFeature}, expr::String; kwargs...)
Parse a VarFeature
of type FT
from its syntaxstring
representation.
Keyword Arguments
featvaltype::Union{Nothing,Type} = nothing
: the feature's featvaltype (recommended for some features, e.g., UnivariateFeature
);opening_parenthesis::String = "["
: the string signaling the opening of an expression block (e.g., "min[V2]"
);closing_parenthesis::String = "]"
: the string signaling the closing of an expression block (e.g., "min[V2]"
);additional_feature_aliases = Dict{String,Base.Callable}()
: A dictionary mapping strings to callables, useful when parsing custom-made, non-standard features. By default, features such as "avg" or "min" are provided for (see SoleData.BASE_FEATURE_FUNCTIONS_ALIASES
); note that, in case of clashing string
s, the provided additional aliases will override the standard ones;variable_names_map::Union{Nothing,AbstractDict,AbstractVector} = nothing
: mapping from variable name to variable index, useful when parsing from syntaxstring
s with variable names (e.g., "min[Heart rate]"
);variable_name_prefix::String = "V"
: prefix used with variable indices (e.g., "V10").
Note that at most one argument in variable_names_map
and variable_name_prefix
should be provided.
Note The default parentheses, here, differ from those of `SoleLogics.parseformula, since features are typically wrapped into Atom
s, and parseformula
does not allow parenthesis characters in atoms' syntaxstring
s.
See also VarFeature
, featvaltype
, parsecondition
.
sourceSoleData.variable_name
— Methodvariable_name(
f::AbstractUnivariateFeature;
variable_names_map::Union{Nothing,AbstractDict,AbstractVector} = nothing,
variable_name_prefix::Union{Nothing,String} = "V",
-)::String
Return the name of the variable targeted by a univariate feature. By default, an variable name is a number prefixed by "V"; however, variable_names_map
or variable_name_prefix
can be used to customize variable names. The prefix can be customized by specifying variable_name_prefix
. Alternatively, a mapping from string to integer (either via a Dictionary or a Vector) can be passed as variable_names_map
. Note that only one in variable_names_map
and variable_name_prefix
should be provided.
See also parsecondition
, ScalarCondition
, syntaxstring
.
sourceSoleData.AbstractCondition
— Typeabstract type AbstractCondition{FT<:AbstractFeature} end
Abstract type for representing conditions that can be interpreted and evaluated on worlds of instances of a logical dataset. In logical contexts, these are wrapped into Atom
s.
See also Atom
, syntaxstring
, ScalarMetaCondition
, ScalarCondition
.
sourceSoleData.FunctionalCondition
— Typestruct FunctionalCondition{FT<:AbstractFeature} <: AbstractCondition{FT}
+)::String
Return the name of the variable targeted by a univariate feature. By default, an variable name is a number prefixed by "V"; however, variable_names_map
or variable_name_prefix
can be used to customize variable names. The prefix can be customized by specifying variable_name_prefix
. Alternatively, a mapping from string to integer (either via a Dictionary or a Vector) can be passed as variable_names_map
. Note that only one in variable_names_map
and variable_name_prefix
should be provided.
See also parsecondition
, ScalarCondition
, syntaxstring
.
sourceSoleData.AbstractCondition
— Typeabstract type AbstractCondition{FT<:AbstractFeature} end
Abstract type for representing conditions that can be interpreted and evaluated on worlds of instances of a logical dataset. In logical contexts, these are wrapped into Atom
s.
See also Atom
, syntaxstring
, ScalarMetaCondition
, ScalarCondition
.
sourceSoleData.FunctionalCondition
— Typestruct FunctionalCondition{FT<:AbstractFeature} <: AbstractCondition{FT}
feature::FT
f::FT
-end
A condition which yields a truth value equal to the value of a function.
See also AbstractFeature
.
sourceSoleData.ObliqueScalarCondition
— TypeObliqueScalarCondition(features, b, u, test_operator)
An oblique scalar condition (see oblique decision trees), such as $((features - b) ⋅ u) ≥ 0$, where features
is a set of $m$ features, and $b,u ∈ ℝ^m$.
See also AbstractCondition
, ScalarCondition
.
sourceSoleData.ScalarCondition
— Typestruct ScalarCondition{U,FT<:AbstractFeature,M<:ScalarMetaCondition{FT}} <: AbstractCondition{FT}
+end
A condition which yields a truth value equal to the value of a function.
See also AbstractFeature
.
sourceSoleData.ObliqueScalarCondition
— TypeObliqueScalarCondition(features, b, u, test_operator)
An oblique scalar condition (see oblique decision trees), such as $((features - b) ⋅ u) ≥ 0$, where features
is a set of $m$ features, and $b,u ∈ ℝ^m$.
See also AbstractCondition
, ScalarCondition
.
sourceSoleData.ScalarCondition
— Typestruct ScalarCondition{U,FT<:AbstractFeature,M<:ScalarMetaCondition{FT}} <: AbstractCondition{FT}
metacond::M
a::U
-end
A scalar condition comparing a computed feature value (see ScalarMetaCondition
) and a threshold value a
. It can be evaluated on a world of an instance of a logical dataset.
For example: $min[V1] ≥ 10$, which translates to "Within this world, the minimum of variable 1 is greater or equal than 10." In this case, the feature a VariableMin
object.
See also AbstractCondition
, ScalarMetaCondition
.
sourceSoleData.ScalarMetaCondition
— Typestruct ScalarMetaCondition{FT<:AbstractFeature,O<:TestOperator} <: AbstractCondition{FT}
+end
A scalar condition comparing a computed feature value (see ScalarMetaCondition
) and a threshold value a
. It can be evaluated on a world of an instance of a logical dataset.
For example: $min[V1] ≥ 10$, which translates to "Within this world, the minimum of variable 1 is greater or equal than 10." In this case, the feature a VariableMin
object.
See also AbstractCondition
, ScalarMetaCondition
.
sourceSoleData.ScalarMetaCondition
— Typestruct ScalarMetaCondition{FT<:AbstractFeature,O<:TestOperator} <: AbstractCondition{FT}
feature::FT
test_operator::O
-end
A metacondition representing a scalar comparison method. Here, the feature
is a scalar function that can be computed on a world of an instance of a logical dataset. A test operator is a binary mathematical relation, comparing the computed feature value and an external threshold value (see ScalarCondition
). A metacondition can also be used for representing the infinite set of conditions that arise with a free threshold (see UnboundedScalarAlphabet
): ${min[V1] ≥ a, a ∈ ℝ}$.
See also AbstractCondition
, ScalarCondition
.
sourceSoleData.UnivariateScalarAlphabet
— Typestruct UnivariateScalarAlphabet <: AbstractAlphabet{ScalarCondition}
+end
A metacondition representing a scalar comparison method. Here, the feature
is a scalar function that can be computed on a world of an instance of a logical dataset. A test operator is a binary mathematical relation, comparing the computed feature value and an external threshold value (see ScalarCondition
). A metacondition can also be used for representing the infinite set of conditions that arise with a free threshold (see UnboundedScalarAlphabet
): ${min[V1] ≥ a, a ∈ ℝ}$.
See also AbstractCondition
, ScalarCondition
.
sourceSoleData.UnivariateScalarAlphabet
— Typestruct UnivariateScalarAlphabet <: AbstractAlphabet{ScalarCondition}
featcondition::Vector{UnivariateScalarAlphabet}
-end
A finite alphabet of conditions, grouped by (a finite set of) metaconditions.
See also UnboundedScalarAlphabet
, ScalarCondition
, ScalarMetaCondition
.
sourceSoleData.ValueCondition
— Typestruct ValueCondition{FT<:AbstractFeature} <: AbstractCondition{FT}
+end
A finite alphabet of conditions, grouped by (a finite set of) metaconditions.
See also UnboundedScalarAlphabet
, ScalarCondition
, ScalarMetaCondition
.
sourceSoleData.ValueCondition
— Typestruct ValueCondition{FT<:AbstractFeature} <: AbstractCondition{FT}
feature::FT
-end
A condition which yields a truth value equal to the value of a feature.
See also AbstractFeature
.
sourceSoleData.parsecondition
— Methodparsecondition(C::Type{<:AbstractCondition}, expr::String; kwargs...)
Parse a condition of type C
from its syntaxstring
representation. Depending on C
, specifying keyword arguments such as featuretype::Type{<:AbstractFeature}
, and featvaltype::Type
may be required or recommended.
See also parsefeature
.
sourceSoleData.representatives
— Methodrepresentatives(
+end
A condition which yields a truth value equal to the value of a feature.
See also AbstractFeature
.
sourceSoleData.parsecondition
— Methodparsecondition(C::Type{<:AbstractCondition}, expr::String; kwargs...)
Parse a condition of type C
from its syntaxstring
representation. Depending on C
, specifying keyword arguments such as featuretype::Type{<:AbstractFeature}
, and featvaltype::Type
may be required or recommended.
See also parsefeature
.
sourceSoleData.representatives
— Methodrepresentatives(
fr::AbstractFrame{W},
S::W,
::AbstractRelation,
::AbstractCondition
-) where {W<:AbstractWorld}
Return an iterator to the (few) representative accessible worlds that are necessary for computing and propagating truth values through existential modal connectives. When this optimization is possible (e.g., when checking specific formulas on scalar conditions), it allows to further boost "one-step" optimizations (see AbstractOneStepMemoset
).
For example, consider a Kripke structure with a 1-dimensional FullDimensionalFrame
of length 100, and the problem of checking a formula "⟨L⟩(max[V1] ≥ 10)" on a SoleLogics.Interval
SoleLogics.Interval{Int64}(1, 2)
(with L
being Allen's "Later" relation, see SoleLogics.IA_L
). Comparing 10 with the (maximum) "max[V1]" computed on all worlds is the naïve strategy to check the formula. However, in this case, comparing 10 to the "max[V1]" computed on the single Interval
SoleLogics.Interval{Int64}(2, 101) suffice to establish whether the structure satisfies the formula. Similar cases arise depending on the relation, feature and test operator (or, better, its aggregator).
Note that this method fallsback to accessibles
.
See also SoleLogics.accessibles
, ScalarCondition
, SoleLogics.AbstractFrame
.
sourceSoleData.MultiFormula
— Typestruct MultiFormula{F<:Formula} <: AbstractSyntaxStructure
+) where {W<:AbstractWorld}
Return an iterator to the (few) representative accessible worlds that are necessary for computing and propagating truth values through existential modal connectives. When this optimization is possible (e.g., when checking specific formulas on scalar conditions), it allows to further boost "one-step" optimizations (see AbstractOneStepMemoset
).
For example, consider a Kripke structure with a 1-dimensional FullDimensionalFrame
of length 100, and the problem of checking a formula "⟨L⟩(max[V1] ≥ 10)" on a SoleLogics.Interval
SoleLogics.Interval{Int64}(1, 2)
(with L
being Allen's "Later" relation, see SoleLogics.IA_L
). Comparing 10 with the (maximum) "max[V1]" computed on all worlds is the naïve strategy to check the formula. However, in this case, comparing 10 to the "max[V1]" computed on the single Interval
SoleLogics.Interval{Int64}(2, 101) suffice to establish whether the structure satisfies the formula. Similar cases arise depending on the relation, feature and test operator (or, better, its aggregator).
Note that this method fallsback to accessibles
.
See also SoleLogics.accessibles
, ScalarCondition
, SoleLogics.AbstractFrame
.
sourceSoleData.MultiFormula
— Typestruct MultiFormula{F<:Formula} <: AbstractSyntaxStructure
modforms::Dict{Int,F}
-end
A symbolic antecedent that can be checked on a MultiLogiset
, associating antecedents to modalities.
sourceSoleData.MultiLogiset
— Typestruct MultiLogiset{L<:AbstractLogiset}
+end
A symbolic antecedent that can be checked on a MultiLogiset
, associating antecedents to modalities.
sourceSoleData.MultiLogiset
— Typestruct MultiLogiset{L<:AbstractLogiset}
modalities :: Vector{L}
-end
A logical dataset composed of different modalities); this structure is useful for representing multimodal datasets in logical terms.
See also AbstractLogiset
, minify
.
sourceSoleData.PropositionalLogiset
— TypePropositionalLogiset(table)
A logiset of propositional interpretations, wrapping a Tables' table of real/string/categorical values.
Examples
This structure can be used to check propositional formulas:
using SoleData, MLJBase
+end
A logical dataset composed of different modalities); this structure is useful for representing multimodal datasets in logical terms.
See also AbstractLogiset
, minify
.
sourceSoleData.PropositionalLogiset
— TypePropositionalLogiset(table)
A logiset of propositional interpretations, wrapping a Tables' table of real/string/categorical values.
Examples
This structure can be used to check propositional formulas:
using SoleData, MLJBase
X = PropositionalLogiset(MLJBase.load_iris())
@@ -163,24 +163,24 @@
satmask = check(φ, X) # Check the formula on the whole dataset
slicedataset(X, satmask)
-slicedataset(X, (!).(satmask))
See also AbstractLogiset
, AbstractAssignment
.
sourceSoleData.SupportedLogiset
— TypeA logiset, associated to a number of cascading full or one-step memoization structures, that are used for optimizing the checking of formulas.
See also SupportedLogiset
, AbstractFullMemoset
, AbstractOneStepMemoset
, AbstractModalLogiset
.
sourceSoleLogics.alphabet
— Functionalphabet(X::PropositionalLogiset, sorted=true;
+slicedataset(X, (!).(satmask))
See also AbstractLogiset
, AbstractAssignment
.
sourceSoleData.SupportedLogiset
— TypeA logiset, associated to a number of cascading full or one-step memoization structures, that are used for optimizing the checking of formulas.
See also SupportedLogiset
, AbstractFullMemoset
, AbstractOneStepMemoset
, AbstractModalLogiset
.
sourceSoleLogics.alphabet
— Functionalphabet(X::PropositionalLogiset, sorted=true;
test_operators::Union{Nothing,AbstractVector{<:TestOperator},Base.Callable}=nothing,
discretizedomain=false, y::Union{Nothing, AbstractVector}=nothing
-)::UnionAlphabet{ScalarCondition,UnivariateScalarAlphabet}
Constructs an alphabet based on the provided PropositionalLogiset
X
, with optional parameters:
sorted
: whether to sort the atoms in the sub-alphabets (i.e., the threshold domains), by a truer-first policy (default: true)test_operators
: test operators to use (defaulted to [≤, ≥]
for real-valued features, and [(==), (≠)]
for other features, e.g., categorical)discretizedomain
: whether to discretize the domain (default: false)y
: vector used for discretization (required if discretizedomain
is true)
Returns a UnionAlphabet
containing ScalarCondition
and UnivariateScalarAlphabet
.
sourceSoleData.AbstractFullMemoset
— TypeAbstract type for full memoization structures for checking generic formulas.
These structures can be stacked and coupled with one-step memoization structures (see SupportedLogiset
).
sourceSoleData.AbstractMemoset
— Typeabstract type AbstractMemoset{
+)::UnionAlphabet{ScalarCondition,UnivariateScalarAlphabet}
Constructs an alphabet based on the provided PropositionalLogiset
X
, with optional parameters:
sorted
: whether to sort the atoms in the sub-alphabets (i.e., the threshold domains), by a truer-first policy (default: true)test_operators
: test operators to use (defaulted to [≤, ≥]
for real-valued features, and [(==), (≠)]
for other features, e.g., categorical)discretizedomain
: whether to discretize the domain (default: false)y
: vector used for discretization (required if discretizedomain
is true)
Returns a UnionAlphabet
containing ScalarCondition
and UnivariateScalarAlphabet
.
sourceSoleData.AbstractFullMemoset
— TypeAbstract type for full memoization structures for checking generic formulas.
These structures can be stacked and coupled with one-step memoization structures (see SupportedLogiset
).
sourceSoleData.AbstractMemoset
— Typeabstract type AbstractMemoset{
W<:AbstractWorld,
U,
FT<:AbstractFeature,
FR<:AbstractFrame,
-} <: AbstractModalLogiset{W,U,FT,FR} end
Abstract type for memoization structures to be used when checking formulas on logisets.
See also FullMemoset
, SupportedLogiset
, AbstractModalLogiset
.
sourceSoleData.AbstractOneStepMemoset
— TypeAbstract type for one-step memoization structures for checking formulas of type ⟨R⟩p
; with these formulas, so-called "one-step" optimizations can be performed.
These structures can be stacked and coupled with full memoization structures (see SupportedLogiset
).
See ScalarOneStepMemoset
, AbstractFullMemoset
, representatives
.
sourceSoleData.FullMemoset
— TypeA generic, full memoization structure that works for any crisp logic; For each instance of a dataset, this structure associates formulas to the set of worlds where the formula holds; it was introduced by Emerson-Clarke for the well-known model checking algorithm for CTL*.
See also SupportedLogiset
, AbstractMemoset
, AbstractModalLogiset
.
sourceSoleData.ScalarChainedMemoset
— TypeA full memoization structure used for checking formulas of scalar conditions on datasets with scalar features. This structure is the equivalent to FullMemoset
, but with scalar features some important optimizations can be done.
See also FullMemoset
, SupportedLogiset
, AbstractModalLogiset
.
sourceSoleData.AbstractModalLogiset
— Typeabstract type AbstractModalLogiset{
+} <: AbstractModalLogiset{W,U,FT,FR} end
Abstract type for memoization structures to be used when checking formulas on logisets.
See also FullMemoset
, SupportedLogiset
, AbstractModalLogiset
.
sourceSoleData.AbstractOneStepMemoset
— TypeAbstract type for one-step memoization structures for checking formulas of type ⟨R⟩p
; with these formulas, so-called "one-step" optimizations can be performed.
These structures can be stacked and coupled with full memoization structures (see SupportedLogiset
).
See ScalarOneStepMemoset
, AbstractFullMemoset
, representatives
.
sourceSoleData.FullMemoset
— TypeA generic, full memoization structure that works for any crisp logic; For each instance of a dataset, this structure associates formulas to the set of worlds where the formula holds; it was introduced by Emerson-Clarke for the well-known model checking algorithm for CTL*.
See also SupportedLogiset
, AbstractMemoset
, AbstractModalLogiset
.
sourceSoleData.ScalarChainedMemoset
— TypeA full memoization structure used for checking formulas of scalar conditions on datasets with scalar features. This structure is the equivalent to FullMemoset
, but with scalar features some important optimizations can be done.
See also FullMemoset
, SupportedLogiset
, AbstractModalLogiset
.
sourceSoleData.AbstractModalLogiset
— Typeabstract type AbstractModalLogiset{
W<:AbstractWorld,
U,
FT<:AbstractFeature,
FR<:AbstractFrame{W},
-} <: AbstractLogiset end
Abstract type for logisets, that is, logical datasets for symbolic learning where each instance is a Kripke structure associating feature values to each world. Conditions (see AbstractCondition
), and logical formulas with conditional letters can be checked on worlds of instances of the dataset.
See also AbstractCondition
, AbstractFeature
, SoleLogics.AbstractKripkeStructure
, SoleLogics.AbstractInterpretationSet
.
sourceSoleData.AbstractScalarOneStepRelationalMemoset
— TypeAbstract type for one-step memoization structures for checking formulas of type ⟨R⟩ (f ⋈ t)
, for a generic relation R
that is not the global relation (SoleLogics.globalrel
). We refer to these structures as relational memosets.
sourceSoleData.ScalarOneStepMemoset
— TypeOne-step memoization structures for optimized check of formulas of type ⟨R⟩p
, where p
wraps a scalar condition, such as MyFeature ≥ 10
. With such formulas, scalar one-step optimization can be performed.
For example, checking ⟨R⟩(MyFeature ≥ 10)
on a world w
of a Kripke structure involves comparing the maximum MyFeature across w
s accessible worlds with 10; but the same maximum value can be reused to check sibling formulas such as ⟨R⟩(MyFeature ≥ 100)
. This sparks the idea of storing and reusing scalar aggregations (e.g., minimum/maximum) over the feature values. Each value refers to a specific world, and an object of type ⟨R⟩(f ⋈ ?)
, called a "scalar metacondition".
Similar cases arise depending on the relation and the test operator (or, better, its aggregator), and further optimizations can be applied for specific feature types (see representatives
).
An immediate special case, however, arises when R
is the global relation G
since, in such case, a single aggregate value is enough for all worlds within the Kripke structure. Therefore, we differentiate between generic, relational memosets (see AbstractScalarOneStepRelationalMemoset
), and global memosets (see AbstractScalarOneStepGlobalMemoset
), which are usually much smaller.
Given a logiset X
, a ScalarOneStepMemoset
covers a set of relations
and metaconditions
, and it holds both a relational and a global memoset. It can be instantiated via:
ScalarOneStepMemoset(
+} <: AbstractLogiset end
Abstract type for logisets, that is, logical datasets for symbolic learning where each instance is a Kripke structure associating feature values to each world. Conditions (see AbstractCondition
), and logical formulas with conditional letters can be checked on worlds of instances of the dataset.
See also AbstractCondition
, AbstractFeature
, SoleLogics.AbstractKripkeStructure
, SoleLogics.AbstractInterpretationSet
.
sourceSoleData.AbstractScalarOneStepRelationalMemoset
— TypeAbstract type for one-step memoization structures for checking formulas of type ⟨R⟩ (f ⋈ t)
, for a generic relation R
that is not the global relation (SoleLogics.globalrel
). We refer to these structures as relational memosets.
sourceSoleData.ScalarOneStepMemoset
— TypeOne-step memoization structures for optimized check of formulas of type ⟨R⟩p
, where p
wraps a scalar condition, such as MyFeature ≥ 10
. With such formulas, scalar one-step optimization can be performed.
For example, checking ⟨R⟩(MyFeature ≥ 10)
on a world w
of a Kripke structure involves comparing the maximum MyFeature across w
s accessible worlds with 10; but the same maximum value can be reused to check sibling formulas such as ⟨R⟩(MyFeature ≥ 100)
. This sparks the idea of storing and reusing scalar aggregations (e.g., minimum/maximum) over the feature values. Each value refers to a specific world, and an object of type ⟨R⟩(f ⋈ ?)
, called a "scalar metacondition".
Similar cases arise depending on the relation and the test operator (or, better, its aggregator), and further optimizations can be applied for specific feature types (see representatives
).
An immediate special case, however, arises when R
is the global relation G
since, in such case, a single aggregate value is enough for all worlds within the Kripke structure. Therefore, we differentiate between generic, relational memosets (see AbstractScalarOneStepRelationalMemoset
), and global memosets (see AbstractScalarOneStepGlobalMemoset
), which are usually much smaller.
Given a logiset X
, a ScalarOneStepMemoset
covers a set of relations
and metaconditions
, and it holds both a relational and a global memoset. It can be instantiated via:
ScalarOneStepMemoset(
X :: AbstractModalLogiset{W,U},
metaconditions :: AbstractVector{<:ScalarMetaCondition},
relations :: AbstractVector{<:AbstractRelation};
precompute_globmemoset :: Bool = true,
precompute_relmemoset :: Bool = false,
print_progress :: Bool = false,
-)
If precompute_relmemoset
is false
, then the relational memoset is simply initialized as an empty structure, and memoization is performed on it upon checking formulas. precompute_globmemoset
works similarly.
See SupportedLogiset
, ScalarMetaCondition
, AbstractOneStepMemoset
.
sourceScalar Logisets
Scalar Dimensional Logisets
Multimodal Logisets
Settings
This document was generated with Documenter.jl version 1.5.0 on Friday 5 July 2024. Using Julia version 1.9.4.
+)
If precompute_relmemoset
is false
, then the relational memoset is simply initialized as an empty structure, and memoization is performed on it upon checking formulas. precompute_globmemoset
works similarly.
See SupportedLogiset
, ScalarMetaCondition
, AbstractOneStepMemoset
.