Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

PatternMatcher

Guides

  • A Virtual Machine for the Pattern Matcher

Symbols

  • CompilePatternToBytecode
  • CreatePatternMatcherVirtualMachine
  • PatternBytecodeDisassemble
  • PatternBytecodeInformation
  • PatternBytecode
  • PatternBytecodeQ
  • PatternMatcherEnableTrace
  • PatternMatcherExecute
  • PatternMatcherMatch
  • PatternMatcherMatchQ
  • PatternMatcherReplace
  • PatternMatcherStep
  • PatternMatcherTraceEnabled
  • PatternMatcherTraceEnabledQ
  • PatternMatcherVirtualMachine
  • PatternToMatchFunction
DanielS`PatternMatcher`
PatternMatcherEnableTrace
​
PatternMatcherEnableTrace
[bool]
enables or disables trace output globally for all pattern matching execution.
​
Details and Options
Examples  
(1)
Basic Examples  
(1)
Enable step-by-step execution for all pattern matching functions:
In[1]:=
PatternMatcherEnableTrace
[True]
Out[1]=
True
See the tracing of a match:
In[2]:=
PatternMatcherExecute
[{x_Integer,y_Real},{5,4.2}]
⋮ BEGIN_BLOCK L0 depth = 1
⋮ BEGIN_BLOCK L3 depth = 2
☑ MATCH_LENGTH
SUCCESS
%e0 len = 2 expected = 2
☑ MATCH_HEAD
SUCCESS
%e0 == List
 MOVE %e 1←%e 0 = {5, 4.2}
» GET_PART %e2 := part(%e 0,1)
 MOVE %e 0←%e 2 = 5
☑ MATCH_HEAD
SUCCESS
%e0 == Integer
 MOVE %e 3←%e 0 = 5
↧ BIND_VAR Global`x←%e 3 = 5 (no trail)
→ JUMP L6 pc = 12
 MOVE %e 0←%e 1 = {5, 4.2}
» GET_PART %e4 := part(%e 0,2)
 MOVE %e 0←%e 4 = 4.2
☑ MATCH_HEAD
SUCCESS
%e0 == Real
 MOVE %e 5←%e 0 = 4.2
↧ BIND_VAR Global`y←%e 5 = 4.2 (no trail)
→ JUMP L8 pc = 20
 MOVE %e 0←%e 1 = {5, 4.2}
 SAVE_BINDINGS 2 bindings copied
⋮ END_BLOCK L3 depth = 1 (merged)
→ JUMP L2 pc = 27
 SAVE_BINDINGS 2 bindings copied
 EXPORT_BINDINGS saved 2bindings
 LOAD_IMM %b 0←True
 HALT stopping executioncycles = 24
Out[2]=
ResultTrue,CyclesExecuted24,BindingsGlobal`y4.2,Global`x5
The tracing is enabled globally:
In[3]:=
PatternMatcherTraceEnabledQ
[]
Out[3]=
True
Disable the trace:
In[4]:=
PatternMatcherEnableTrace
[False]
Out[4]=
False
In[5]:=
PatternMatcherExecute
[{x_Integer,y_Real},{5,4.2}]
Out[5]=
ResultTrue,CyclesExecuted24,BindingsGlobal`y4.2,Global`x5
SeeAlso
PatternMatcherTraceEnabledQ
 
▪
PatternMatcherExecute
 
▪
PatternMatcherVirtualMachine
RelatedGuides
▪
A Virtual Machine for the Pattern Matcher
""

© 2026 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com