Closed Multisubstitutions.
A``pattern'' is string possibly including the special symbol *, which stay for any list of 0 or more characters. This map checks if a string y, or a pattern y, occurs in a string x. We ignore the difference between upper and lower case.
In[115]:=
We define two maps computing the beginning and the end of the first occurrence of y in x, if any exists.
In[116]:=
Out[116]=
We define two maps removing all characters until the first occurrence of y (included), or from the first occurence of y (included).
In[117]:=
In[118]:=
Moving a term from the language of arithmetic to the language of Mathematica only require to switch round and square brackets.
In[119]:=
In[120]:=
In[121]:=
We can split a list of terms "t1, t2, ..., tn" into "t1" and "t2, ..., tn". We first move the term list to the Mathematica language, then we compute the length n of the first correct term. "t1" are first n characters. "t2, ..., tn" are the string with the first n character removed, and one more character removed (the comma) if any is left.
In[122]:=
In[123]:=
In[124]:=
In[125]:=
Some examples.
In[126]:=
Out[126]=
Out[127]=
Out[128]=
Out[129]=
Selecting the head and the argument list of a predicate.
In[130]:=
Some examples.
In[132]:=
Out[132]=
In[133]:=
Out[133]=
The arguments of a multisubstitution are a formula, a list of variables, and a list of closed terms for these variables.
In[134]:=
In[135]:=
Out[135]=
Created by Mathematica (October 17, 2006)