State-machine query operators in ModelingToolkitTearing throw UndefVarError for wrap

Abierto
#170 0 comentarios 0 reacciones 0 asignados Ver en GitHub

@baggepinnen ya está trabajando en esto.

Desde el 20/10/2026.

  • #171 de @baggepinnen — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
julia
Área
backend

Línea de trabajo

The failing query operators are generated by the loop at lib/ModelingToolkitTearing/src/clock_inference/state_machines.jl:71-83; start by reading those methods and the reported wrap error. Check the corresponding tests, since the issue says this file appears uncovered. Done means the four query operators work without UndefVarError; linked pull request #171 is already open.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Goal

I am adding Modelica-style state machines to SynchToolkit (JuliaComputing/SynchToolkit.jl#252). The state machines are declared with the operators in lib/ModelingToolkitTearing/src/clock_inference/state_machines.jl. Transition conditions and equations refer to the state of a machine through the query operators activeState, ticksInState, timeInState and entry.

What fails

Every method of these four operators throws on ModelingToolkitTearing 1.20.7, and the code on main is the same:

using ModelingToolkit
using ModelingToolkit: t_nounits as t
import ModelingToolkit.MTKTearing as MTKT

@named s1 = System(Equation[], t, [], [])
MTKT.activeState(s1)
ERROR: UndefVarError: `wrap` not defined in `ModelingToolkitTearing`
Suggestion: check for spelling errors or missing imports.
Hint: a global variable of this name also exists in Symbolics.
Stacktrace:
 [1] activeState(x::System)
   @ ModelingToolkitTearing ~/.julia/packages/ModelingToolkitTearing/gRDNi/src/clock_inference/state_machines.jl:77

The zero-argument methods (ticksInState(), timeInState(), entry()) fail in the same way. transition and initial_state work.

The methods are generated by the loop at state_machines.jl:71-83 and call wrap(term($s, x)). wrap is not exported by Symbolics 7. The file does not appear to be covered by tests.

Workaround

SynchToolkit defines its own activeState, ticksInState, timeInState and entry, which construct the terms with Symbolics.wrap(SymbolicUtils.term(f, s; type, shape)).


Host: demeter2 · Session: https://claude.ai/code/session_01S12pk8C416QqoxphWRcPz8 · Working directory: ~/.julia/dev/SynchToolkit/.claude/worktrees/ancient-waddling-spindle

Lenguaje dominante
Julia
Estrellas
8
Forks
14
Merge medio
8 d 8 h
PR fusionados (30 d)
1

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de JuliaComputing/StateSelection.jl

Todos los issues de JuliaComputing/StateSelection.jl

Issues similares

Más issues de Julia

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.