Wolfram Language
Paclet Repository
Community-contributed installable additions to the Wolfram Language
Primary Navigation
Categories
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
Create a Paclet
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`
P
a
t
t
e
r
n
M
a
t
c
h
e
r
M
a
t
c
h
P
a
t
t
e
r
n
M
a
t
c
h
e
r
M
a
t
c
h
[
v
m
,
e
x
p
r
]
t
e
s
t
w
h
e
t
h
e
r
t
h
e
e
x
p
r
e
s
s
i
o
n
e
x
p
r
m
a
t
c
h
e
s
t
h
e
p
a
t
t
e
r
n
s
p
e
c
i
f
i
e
d
b
y
t
h
e
v
i
r
t
u
a
l
m
a
c
h
i
n
e
v
m
.
D
e
t
a
i
l
s
a
n
d
O
p
t
i
o
n
s
Examples
(
3
)
Basic Examples
(
1
)
Convert a pattern into bytecode object:
I
n
[
1
]
:
=
p
a
t
t
=
C
o
m
p
i
l
e
P
a
t
t
e
r
n
T
o
B
y
t
e
c
o
d
e
[
f
[
_
]
]
O
u
t
[
1
]
=
P
a
t
t
e
r
n
B
y
t
e
c
o
d
e
P
a
t
t
e
r
n
:
f
[
_
]
B
y
t
e
c
o
d
e
:
T
E
S
T
_
L
E
N
G
T
H
1
C
H
E
C
K
_
A
B
O
R
T
G
E
T
_
H
E
A
D
P
U
S
H
_
E
X
P
R
f
S
A
M
E
Q
C
H
E
C
K
_
A
B
O
R
T
G
E
T
_
P
A
R
T
1
B
L
A
N
K
The pattern bytecode can be used to create a virtual machine:
I
n
[
2
]
:
=
v
m
=
C
r
e
a
t
e
P
a
t
t
e
r
n
M
a
t
c
h
e
r
V
i
r
t
u
a
l
M
a
c
h
i
n
e
[
p
a
t
t
]
O
u
t
[
2
]
=
P
a
t
t
e
r
n
M
a
t
c
h
e
r
V
i
r
t
u
a
l
M
a
c
h
i
n
e
H
a
l
t
e
d
:
F
a
l
s
e
P
r
o
g
r
a
m
c
o
u
n
t
e
r
:
1
S
t
a
c
k
:
{
}
P
a
t
t
e
r
n
b
y
t
e
c
o
d
e
:
P
a
t
t
e
r
n
B
y
t
e
c
o
d
e
P
a
t
t
e
r
n
:
f
[
_
]
B
o
u
n
d
v
a
r
i
a
b
l
e
s
:
C
y
c
l
e
s
:
0
Use the virtual machine to test whether an expression matches the pattern:
I
n
[
3
]
:
=
P
a
t
t
e
r
n
M
a
t
c
h
e
r
M
a
t
c
h
[
v
m
,
f
[
1
]
]
O
u
t
[
3
]
=
P
a
t
t
e
r
n
M
a
t
c
h
e
r
V
i
r
t
u
a
l
M
a
c
h
i
n
e
H
a
l
t
e
d
:
T
r
u
e
P
r
o
g
r
a
m
c
o
u
n
t
e
r
:
9
S
t
a
c
k
:
{
T
r
u
e
}
P
a
t
t
e
r
n
b
y
t
e
c
o
d
e
:
P
a
t
t
e
r
n
B
y
t
e
c
o
d
e
P
a
t
t
e
r
n
:
f
[
_
]
B
o
u
n
d
v
a
r
i
a
b
l
e
s
:
C
y
c
l
e
s
:
8
The result of the matching will be the last value in the stack:
I
n
[
4
]
:
=
T
r
u
e
Q
[
L
a
s
t
[
v
m
[
"
S
t
a
c
k
"
]
[
"
E
l
e
m
e
n
t
s
"
]
]
]
O
u
t
[
4
]
=
T
r
u
e
S
c
o
p
e
(
1
)
P
r
o
p
e
r
t
i
e
s
&
R
e
l
a
t
i
o
n
s
(
1
)
S
e
e
A
l
s
o
P
a
t
t
e
r
n
M
a
t
c
h
e
r
V
i
r
t
u
a
l
M
a
c
h
i
n
e
▪
P
a
t
t
e
r
n
M
a
t
c
h
e
r
S
t
e
p
▪
C
r
e
a
t
e
P
a
t
t
e
r
n
M
a
t
c
h
e
r
V
i
r
t
u
a
l
M
a
c
h
i
n
e
▪
P
a
t
t
e
r
n
B
y
t
e
c
o
d
e
▪
C
o
m
p
i
l
e
P
a
t
t
e
r
n
T
o
B
y
t
e
c
o
d
e
R
e
l
a
t
e
d
G
u
i
d
e
s
▪
T
h
e
P
a
t
t
e
r
n
M
a
t
c
h
e
r
V
i
r
t
u
a
l
M
a
c
h
i
n
e
"
"