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`
PatternBytecodeInformation
​
PatternBytecodeInformation
[bc]
returns an
Association
with meta information about the bytecode structure.
​
Details and Options
Examples  
(2)
Basic Examples  
(2)
Get compilation metadata for a simple pattern:
In[1]:=
bytecode=
CompilePatternToBytecode
[_Integer];​​
PatternBytecodeInformation
[bytecode]
Out[1]=
InstructionCount9,LabelCount3,ExprRegisterCount1,BoolRegisterCount1,BlockCount1,MaxBlockDepth1,JumpCount1,BacktrackPointCount0,LexicalBindings
​
Compare complexity of different patterns:
In[1]:=
patterns={_Integer,f[x_],f[x_,x_],_Integer|_Real};​​info=
PatternBytecodeInformation

CompilePatternToBytecode
[#]&/@patterns;
In[2]:=
Row[MapThread[Labeled[Dataset[#2],#1,Top]&,{patterns,info}]," "]
Out[2]=
_Integer
InstructionCount
9
LabelCount
3
ExprRegisterCount
1
BoolRegisterCount
1
BlockCount
1
MaxBlockDepth
1
JumpCount
1
BacktrackPointCount
0
LexicalBindings

f[x_]
InstructionCount
21
LabelCount
8
ExprRegisterCount
4
BoolRegisterCount
1
BlockCount
2
MaxBlockDepth
2
JumpCount
4
BacktrackPointCount
0
LexicalBindings
Global`x3
f[x_,x_]
InstructionCount
30
LabelCount
11
ExprRegisterCount
5
BoolRegisterCount
2
BlockCount
2
MaxBlockDepth
2
JumpCount
6
BacktrackPointCount
0
LexicalBindings
Global`x3
_Integer|_Real
InstructionCount
15
LabelCount
7
ExprRegisterCount
1
BoolRegisterCount
1
BlockCount
1
MaxBlockDepth
1
JumpCount
3
BacktrackPointCount
1
LexicalBindings

SeeAlso
PatternBytecode
 
▪
PatternBytecodeDisassemble
 
▪
CompilePatternToBytecode
RelatedGuides
▪
A Virtual Machine for the Pattern Matcher
""

© 2026 Wolfram. All rights reserved.

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