State-machine query operators in ModelingToolkitTearing throw UndefVarError for wrap

オープン
#170 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@baggepinnen がすでに取り組んでいます。

2026年10月20日 から。

  • #171 @baggepinnen による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
julia
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Julia
スター
8
フォーク
14
平均マージ
8日 8時間
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

JuliaComputing/StateSelection.jl のほかの issue

JuliaComputing/StateSelection.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。