State-machine query operators in ModelingToolkitTearing throw UndefVarError for wrap

Aperta
#170 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@baggepinnen ci sta già lavorando.

Dal 20/10/2026.

  • #171 di @baggepinnen — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
julia
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Julia
Stelle
8
Fork
14
Merge medio
2g 14h
PR unite (30g)
4

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di JuliaComputing/StateSelection.jl

Tutte le issue di JuliaComputing/StateSelection.jl

Issue simili

Altre issue su Julia

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.