On this page:
regexp?
empty-regexp?
singleton-regexp?
union-regexp?
concat-regexp?
kleenestar-regexp?
printable-regexp
singleton-regexp-a
union-regexp-r1
union-regexp-r2
concat-regexp-r1
concat-regexp-r2
kleenestar-regexp-r1
gen-regexp-word
gen-concat-word
gen-ks-word
extract-concat-regexps
extract-union-regexps
pick-regexp
pick-reps
convert-singleton

14 Regular Expression Observers🔗

procedure

(regexp? r)  Boolean

  r : regexp
Predicate for regular expressions.

procedure

(empty-regexp? r)  Boolean

  r : regexp
Predicate for the empty regular expression.

procedure

(singleton-regexp? r)  Boolean

  r : regexp
Predicate for a singleton regular expression.

procedure

(union-regexp? r)  Boolean

  r : regexp
Predicate for a union regular expression.

procedure

(concat-regexp? r)  Boolean

  r : regexp
Predicate for a concat regular expression.

procedure

(kleenestar-regexp? r)  Boolean

  r : regexp
Predicate for a Kleene star regular expression.

procedure

(printable-regexp r)  string

  r : regexp
Converts the given regular expression to a string.

procedure

(singleton-regexp-a r)  string

  r : singelton-regexp
Extracts the string in the given singleton-regexp.

procedure

(union-regexp-r1 r)  regexp

  r : union-regexp
Extracts the first regular expression in the given union-regexp.

procedure

(union-regexp-r2 r)  regexp

  r : union-regexp
Extracts the second regular expression in the given union-regexp.

procedure

(concat-regexp-r1 r)  regexp

  r : concat-regexp
Extracts the first regular expression in the given concat-regexp.

procedure

(concat-regexp-r2 r)  regexp

  r : concat-regexp
Extracts the second regular expression in the given concat-regexp.

procedure

(kleenestar-regexp-r1 r)  regexp

  r : kleenestar-regexp
Extracts the regular expression in the given kleenestar-regexp.

procedure

(gen-regexp-word r)  word

  r : regexp
(gen-regexp-word r n)  word
  r : regexp
  n : natural?
Nondeterministically generate a word in the language of the given regexp. The maximum nuber of repetitions for a Kleene star is the the optional natural number if provided. Otherwise, it is 20.

procedure

(gen-concat-word r f n)  word

  r : concat-regexp
  f : (regexp --> word)
  n : natnum
Generate a word by concatenating words generated from the sub regular expressions in the given concat-regexp using the given word-generating function. The given natnum is used to limit the number of repetitions generated for nested Kleene star regular expressions (if any).

procedure

(gen-ks-word n r f)  word

  n : natural?
  r : regexp
  f : (regexp --> word)
Generate a word in the language of the given Kleene star regular expression using the given word-generation function. The number of concatenated words generated using r is in [0..n+1].

procedure

(extract-concat-regexps r)  (listof regexp)

  r : concat-regexp
Extract all the nested concatenated sub-regexps in the given concat-regexp. This includes any nested concat-regexps in r.

procedure

(extract-union-regexps r)  (listof regexp)

  r : union-regexp
Extract all the nested unioned sub-regexps in the given union-regexp. This includes any nested union-regexps in r.

procedure

(pick-regexp r)  regexp

  r : union-regexp
Nondeterministically return a nested sub-regexp from the given union-regexp. This includes any nested union-regexps in r.

procedure

(pick-reps n)  natnum

  n : natural?
Nondeterministically return a natural number in [0..n].

procedure

(convert-singleton r)  word

  r : singleton-regexp
Convert the given singleton-regexp to a word of length 1 containing r’s nested symbol or number.