Library Reference
Base.Dict
— MethodDict(x::AbstractTerm)
to register your type with JSON3, you need to overload JSON3.write to use this Dict approach. we only overload the Dict function for our type Formula, so this is not piracy.
StructTypes.StructType
— MethodStructTypes.StructType
This is how you tell StructTypes to use an interface for you.
SyntacticModels.SyntacticModelsBase.AbstractTerm
— TypeAbstractTerm
The super type for all SyntacticModels types. This abstract type exists so that we can write generic methods that work on any term in any of the domain specific syntaxes. For example, serializing to a Dictionary uses some reflection snippet that works for arbitrary types, but we only want to apply it to things that should be serialized like a Term.
JSON3.write
— MethodJSON3.write
Now JSON3.write(f) puts the type information in our reserved field.
StructTypes.subtypekey
— MethodStructTypes.subtypekey
This is how you tell StructTypes where to look for the name of a type when reading the type back in from JSON.
SyntacticModels.SyntacticModelsBase._dict
— Method_dict(x::T) where T <: AbstractTerm
We are going to convert our structs to Dict before we call JSON3.write and add the type information in a generic construction. This uses some reflection to ask the julia type for its fieldnames and then use those as the keys in the Dict. We use splatting, so don't make a struct with more than 32 fields if you want to go fast. We use this _dict function to avoid an "I'm the captain now" level of type piracy.
SyntacticModels.SyntacticModelsBase.typename_last
— Methodtypename_last(T::Type)
Truncate a type name keeping only the last components of the FQTN.
UWDs
SyntacticModels.ASKEMUWDs.UWDTerm
— TypeUWDTerm
Term specifying UWD.
Subtypes
- UWDModel: A header and UWD Expr
- UWDExpr: A Context of variables and a list of statements defining a UWD
- Statement: R(x,y,z) a relation that acts on its arguments (which are Vars)
Example
To specify the following relation macro:
@relation (x:X, z:Z) where y:Y begin
+Library Reference · SyntacticModels.jl Library Reference
Base.Dict
— MethodDict(x::AbstractTerm)
to register your type with JSON3, you need to overload JSON3.write to use this Dict approach. we only overload the Dict function for our type Formula, so this is not piracy.
sourceStructTypes.StructType
— MethodStructTypes.StructType
This is how you tell StructTypes to use an interface for you.
sourceSyntacticModels.SyntacticModelsBase.AbstractTerm
— TypeAbstractTerm
The super type for all SyntacticModels types. This abstract type exists so that we can write generic methods that work on any term in any of the domain specific syntaxes. For example, serializing to a Dictionary uses some reflection snippet that works for arbitrary types, but we only want to apply it to things that should be serialized like a Term.
sourceJSON3.write
— MethodJSON3.write
Now JSON3.write(f) puts the type information in our reserved field.
sourceStructTypes.subtypekey
— MethodStructTypes.subtypekey
This is how you tell StructTypes where to look for the name of a type when reading the type back in from JSON.
sourceSyntacticModels.SyntacticModelsBase._dict
— Method_dict(x::T) where T <: AbstractTerm
We are going to convert our structs to Dict before we call JSON3.write and add the type information in a generic construction. This uses some reflection to ask the julia type for its fieldnames and then use those as the keys in the Dict. We use splatting, so don't make a struct with more than 32 fields if you want to go fast. We use this _dict function to avoid an "I'm the captain now" level of type piracy.
sourceSyntacticModels.SyntacticModelsBase.typename_last
— Methodtypename_last(T::Type)
Truncate a type name keeping only the last components of the FQTN.
sourceUWDs
SyntacticModels.ASKEMUWDs.UWDTerm
— TypeUWDTerm
Term specifying UWD.
Subtypes
- UWDModel: A header and UWD Expr
- UWDExpr: A Context of variables and a list of statements defining a UWD
- Statement: R(x,y,z) a relation that acts on its arguments (which are Vars)
Example
To specify the following relation macro:
@relation (x:X, z:Z) where y:Y begin
R(x,y)
S(y,z)
T(z,y,u)
@@ -11,8 +11,8 @@
s = [Statement(:R, [v1,v2]),
Statement(:S, [v2,v3]),
Statement(:T, [v3,v2, v4])]
-u = UWDExpr(c, s)
sourceSyntacticModels.ASKEMUWDs.Var
— TypeVar
Variables of a UWD. Types are the domain types, ScalarField, VectorField, Dual1Form, Primal2Form NOT Float64,Complex128
Subtypes include:
- Untyped(var::Symbol)
- Typed(var::Symbol, type::Symbol)
which are used for representing typed or untyped variables.
sourceBase.show
— Methodshow(io::IO, s::UWDTerm)
generates a human readable string of the UWDTerm
(or any sub-term).
sourceSyntacticModels.ASKEMUWDs.construct
— Methodconstruct(::Type{RelationDiagram}, ex::UWDExpr)
Builds a RelationDiagram from a UWDExpr like the @relation
macro does for Julia Exprs.
sourceDecapodes
SyntacticModels.ASKEMDecapodes.ASKEMDeca
— TypeASKEMDeca
Stores a Decapode with the model metadata for ASKEM AMR conformance.
sourceSyntacticModels.ASKEMDecapodes.ASKEMDecaExpr
— MethodASKEMDecaExpr
Stores the syntactic expression of a Decapode Expression with the model metadata for ASKEM AMR conformance.
sourceSyntacticModels.ASKEMDecapodes.ASKEMDecapode
— MethodASKEMDecapode
Stores the combinatorial representation of a Decapode with the model metadata for ASKEM AMR conformance.
sourceComposites
SyntacticModels.Composites.CompositeModel
— TypeCompositeModel
@data CompositeModel <: AbstractTerm begin
+u = UWDExpr(c, s)
sourceSyntacticModels.ASKEMUWDs.Var
— TypeVar
Variables of a UWD. Types are the domain types, ScalarField, VectorField, Dual1Form, Primal2Form NOT Float64,Complex128
Subtypes include:
- Untyped(var::Symbol)
- Typed(var::Symbol, type::Symbol)
which are used for representing typed or untyped variables.
sourceBase.show
— Methodshow(io::IO, s::UWDTerm)
generates a human readable string of the UWDTerm
(or any sub-term).
sourceSyntacticModels.ASKEMUWDs.construct
— Methodconstruct(::Type{RelationDiagram}, ex::UWDExpr)
Builds a RelationDiagram from a UWDExpr like the @relation
macro does for Julia Exprs.
sourceDecapodes
SyntacticModels.ASKEMDecapodes.ASKEMDeca
— TypeASKEMDeca
Stores a Decapode with the model metadata for ASKEM AMR conformance.
sourceSyntacticModels.ASKEMDecapodes.ASKEMDecaExpr
— MethodASKEMDecaExpr
Stores the syntactic expression of a Decapode Expression with the model metadata for ASKEM AMR conformance.
sourceSyntacticModels.ASKEMDecapodes.ASKEMDecapode
— MethodASKEMDecapode
Stores the combinatorial representation of a Decapode with the model metadata for ASKEM AMR conformance.
sourceComposites
SyntacticModels.Composites.CompositeModel
— TypeCompositeModel
@data CompositeModel <: AbstractTerm begin
OpenModel(model::ASKEMDecapodes.ASKEMDecaExpr, interface::Vector{Symbol})
OpenDecapode(model::ASKEMDecapodes.ASKEMDecapode, interface::Vector{Symbol})
CompositeModelExpr(header::Header, composition_pattern::UWDExpr, components::Vector{CompositeModel})
-end
sourceCatlab.WiringDiagrams.WiringDiagramAlgebras.oapply
— MethodCatlab.oapply(m::CompositeModel)
CompositeModels can be flattened into a single level of model with the oapply function.
Warning Because the oapply algorithm operates on the compute graph representation of the equations, it does not produce syntactic equations. Calls to oapply produce instances of OpenDecapode and not DecaExpr. Software that expects to consume decapodes should plan to interact with both forms.
sourceSyntacticModels.Composites.interface
— Methodinterface(m::CompositeModel)
Extract the interface of a composite model. If the model is open, then it is the feet of the cospan. If it is a Composite, then it is the context of the uwd.
sourceSettings
This document was generated with Documenter.jl version 1.2.1 on Friday 2 February 2024. Using Julia version 1.10.0.
+end
Catlab.WiringDiagrams.WiringDiagramAlgebras.oapply
— MethodCatlab.oapply(m::CompositeModel)
CompositeModels can be flattened into a single level of model with the oapply function.
Because the oapply algorithm operates on the compute graph representation of the equations, it does not produce syntactic equations. Calls to oapply produce instances of OpenDecapode and not DecaExpr. Software that expects to consume decapodes should plan to interact with both forms.
SyntacticModels.Composites.interface
— Methodinterface(m::CompositeModel)
Extract the interface of a composite model. If the model is open, then it is the feet of the cospan. If it is a Composite, then it is the context of the uwd.