Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
StringTools[LexOrder] - perform lexicographical order comparison of strings
StringTools[ShortLexOrder] - perform short lexicographical order comparison of strings
StringTools[RevLexOrder] - perform reverse lexicographical order comparison of strings
StringTools[ShortRevLexOrder] - perform short reverse lexicographical order comparison of strings
StringTools[LeftRecursivePathOrder] - perform left recursive path order comparison of strings
StringTools[RightRecursivePathOrder] - perform right recursive path order comparison of strings
Calling Sequence
LexOrder( s1, s2 )
ShortLexOrder( s1, s2 )
RevLexOrder( s1, s2 )
ShortRevLexOrder( s1, s2 )
LeftRecursivePathOrder( s1, s2 )
RightRecursivePathOrder( s1, s2 )
Parameters
s1, s2
-
Maple strings
Description
These six procedures implement various order relations on strings, extended from the numeric order on character code points.
Each procedure takes two strings s1 and s2 as arguments, and returns one of the values , according to the following table.
String Order
Return Value
s1 precedes s2
-1
s1 is identical to s2
0
s1 follows s2
1
The LexOrder(s1, s2) command implements simple lexicographic (dictionary) ordering of strings.
The RevLexOrder(s1, s2) command implements the reverse lexicographic order, which is equivalent to the lexicographic order on the reversed strings.
The ShortLexOrder(s1, s2) and ShortRevLexOrder(s1, s2) commands are similar, but apply the respective ordering relation only to strings of equal length. Strings are first compared according to their lengths, with shorter strings preceeding longer strings. The short variants are important because they are translation-invariant: = , = , = and = ,
The left and right recursive path orders are also translation invariant, and are computed by the LeftRecursivePathOrder(s1, s2) and RightRecursivePathOrder(s1, s2) commands, respectively.
The left and right recursive path orders, manifest in the LeftRecursivePathOrder(s1, s2) and RightRecursivePathOrder(s1, s2) commands and are defined for two strings and , as follows. Characters (strings with length equal to 1) compare according to the numeric order of the corresponding code points.
String precedes string in the left recursive path order if one among the following holds: (1) and precedes ; (2) and precedes ; or (3) and precedes .
String precedes string in the right recursive path order if one among the following holds: (1) and precedes ; (2) and precedes ; or (3) and precedes .
Examples
See Also
lexorder, string, StringTools, StringTools[Compare]
Download Help Document