Documentation

Cvc.Typed.Theory.Regex

Regular expressions, typed #

def Cvc.Typed.Term.reLoop [Ω] (lo hi : Nat) (re : Term Regex) :

Between lo and hi repetitions, both included.

Equations
Instances For

    The regular expression matching every string.

    Equations
    Instances For

      Union.

      Equations
      Instances For

        The regular expression matching nothing.

        Equations
        Instances For

          Any one character from lo to hi included; matches nothing unless both are one character.

          Equations
          Instances For

            One or more repetitions.

            Equations
            Instances For

              Zero or one repetition.

              Equations
              Instances For

                The regular expression matching every one-character string.

                Equations
                Instances For

                  Concatenation.

                  Equations
                  Instances For
                    def Cvc.Typed.Term.reConcatN [Ω] (terms : Terms Regex) (atLeastTwoElements : 2 ≤ Array.size terms := by (try grind) <;> fail "failed to prove term array has at least two elements") :

                    reConcat over two or more terms.

                    Equations
                    Instances For

                      Difference: the strings matching lft but not rgt.

                      Equations
                      Instances For
                        def Cvc.Typed.Term.reRepeat [Ω] (count : Nat) (re : Term Regex) :

                        Exactly the given number of repetitions.

                        Equations
                        Instances For

                          Kleene star.

                          Equations
                          Instances For

                            Intersection.

                            Equations
                            Instances For
                              def Cvc.Typed.Term.reUnionN [Ω] (terms : Terms Regex) (atLeastTwoElements : 2 ≤ Array.size terms := by (try grind) <;> fail "failed to prove term array has at least two elements") :

                              reUnion over two or more terms.

                              Equations
                              Instances For
                                def Cvc.Typed.Term.reInterN [Ω] (terms : Terms Regex) (atLeastTwoElements : 2 ≤ Array.size terms := by (try grind) <;> fail "failed to prove term array has at least two elements") :

                                reInter over two or more terms.

                                Equations
                                Instances For

                                  Takes a term apart one level, at its sort, if Regex owns its operator and the term's sort fits it.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    inductive Cvc.Typed.View.Regex [Ω] :
                                    Typ → Type

                                    Regex's operators, taken apart one level, indexed by the sort each produces.

                                    Instances For

                                      Regex's operators with a result of sort Regex.

                                      Instances For

                                        Values #

                                        A regular expression has no Lean value: cvc5 exposes no accessor for the language a constant regex denotes, so Regex has no value conversions. Read a model's regex as a term, with Solver.getValueTerm.

                                        regex! #

                                        regex! "ab" ['0'-'9']+ | .* writes a regular expression in the usual notation, as an Env (Term Regex). A regex term in scope, or a ![…] escape, must be a Term Regex.

                                        A regular expression in the usual notation, as an Env (Term Regex): regex! "a"+ | .*.

                                        Equations
                                        Instances For