Skip to content

Checking if a model implements a theory leads to MethodNotFound error #174

@kris-brown

Description

@kris-brown

GATlab's approach to runtime checking if a model implements a theory is to use dispatch on ScopeTags.

F = FinMatC{Float64}()
implements(F, ThCategory) # true
implements(F, ThNat) # MethodNotFound error

A method is created by @instance to return something (not true, but something that's not nothing) for a given model type + ScopeTag (wrapped in a Val) for each scope of the theory.

I believe the line

implements(m::Module, ::Type{Val{tag}}) where {tag} = nothing

was intended to be the catch-all case for when a scope is not implemented. However, this line never gets called (perhaps Module was meant to be Model?) Trying to make a simple fix there causes other problems which will need to be debugged.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions