diff --git a/docs/Derivatives_of_Regular_Expressions.html b/docs/Derivatives_of_Regular_Expressions.html index 72a0866..294a4ee 100644 --- a/docs/Derivatives_of_Regular_Expressions.html +++ b/docs/Derivatives_of_Regular_Expressions.html @@ -12215,11 +12215,7 @@ expressions grow each derivation.

In [11]:
-
# This is the straightforward version with no "compaction".
-# It works fine, but does waaaay too much work because the
-# expressions grow each derivation.
-
-def D(symbol):
+
def D(symbol):
 
     def derv(R):
 
diff --git a/docs/Derivatives_of_Regular_Expressions.md b/docs/Derivatives_of_Regular_Expressions.md
index 9d2cd68..57cf09b 100644
--- a/docs/Derivatives_of_Regular_Expressions.md
+++ b/docs/Derivatives_of_Regular_Expressions.md
@@ -232,10 +232,6 @@ expressions grow each derivation.
 
 
 ```python
-# This is the straightforward version with no "compaction".
-# It works fine, but does waaaay too much work because the
-# expressions grow each derivation.
-
 def D(symbol):
 
     def derv(R):
diff --git a/docs/Derivatives_of_Regular_Expressions.rst b/docs/Derivatives_of_Regular_Expressions.rst
index 6f87ac6..48516f6 100644
--- a/docs/Derivatives_of_Regular_Expressions.rst
+++ b/docs/Derivatives_of_Regular_Expressions.rst
@@ -266,10 +266,6 @@ derivation.
 
 .. code:: ipython2
 
-    # This is the straightforward version with no "compaction".
-    # It works fine, but does waaaay too much work because the
-    # expressions grow each derivation.
-    
     def D(symbol):
     
         def derv(R):
diff --git a/docs/sphinx_docs/_build/html/_images/omg.svg b/docs/sphinx_docs/_build/html/_images/omg.svg
new file mode 100644
index 0000000..a3be69c
--- /dev/null
+++ b/docs/sphinx_docs/_build/html/_images/omg.svg
@@ -0,0 +1,185 @@
+
+
+
+
+
+
+finite_state_machine
+
+
+i
+
+
+i
+
+
+i->i
+
+
+0
+
+
+j
+
+j
+
+
+i->j
+
+
+1
+
+
+h
+
+
+h
+
+
+h->i
+
+
+0
+
+
+h->h
+
+
+1
+
+
+a
+
+a
+
+
+b
+
+b
+
+
+a->b
+
+
+0
+
+
+c
+
+c
+
+
+a->c
+
+
+1
+
+
+b->b
+
+
+0
+
+
+d
+
+d
+
+
+b->d
+
+
+1
+
+
+c->b
+
+
+0
+
+
+e
+
+e
+
+
+c->e
+
+
+1
+
+
+d->b
+
+
+0
+
+
+f
+
+f
+
+
+d->f
+
+
+1
+
+
+e->b
+
+
+0
+
+
+g
+
+g
+
+
+e->g
+
+
+1
+
+
+f->h
+
+
+1
+
+
+f->b
+
+
+0
+
+
+g->i
+
+
+0
+
+
+g->g
+
+
+1
+
+
+j->i
+
+
+0
+
+
+j->h
+
+
+1
+
+
+
diff --git a/docs/sphinx_docs/_build/html/genindex.html b/docs/sphinx_docs/_build/html/genindex.html
index 09d787a..37e4c73 100644
--- a/docs/sphinx_docs/_build/html/genindex.html
+++ b/docs/sphinx_docs/_build/html/genindex.html
@@ -473,6 +473,8 @@
       
  • TracePrinter (class in joy.utils.pretty_print)
  • tuck() (in module joy.utils.generated_library) +
  • +
  • type_check() (in module joy.utils.polytypes)
  • diff --git a/docs/sphinx_docs/_build/html/index.html b/docs/sphinx_docs/_build/html/index.html index 4172f40..ce8501b 100644 --- a/docs/sphinx_docs/_build/html/index.html +++ b/docs/sphinx_docs/_build/html/index.html @@ -147,8 +147,11 @@ interesting aspects. It’s quite a treasure trove.

  • Newton’s method
  • Traversing Datastructures with Zippers
  • The Blissful Elegance of Typing Joy
  • +
  • Type Checking
  • No Updates
  • Categorical Programming
  • +
  • The Four Fundamental Operations of Definite Action
  • +
  • ∂RE
  • diff --git a/docs/sphinx_docs/_build/html/notebooks/Derivatives_of_Regular_Expressions.html b/docs/sphinx_docs/_build/html/notebooks/Derivatives_of_Regular_Expressions.html new file mode 100644 index 0000000..13f339d --- /dev/null +++ b/docs/sphinx_docs/_build/html/notebooks/Derivatives_of_Regular_Expressions.html @@ -0,0 +1,923 @@ + + + + + + + + ∂RE — Thun 0.2.0 documentation + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +

    ∂RE

    +
    +

    Brzozowski’s Derivatives of Regular Expressions

    +

    Legend:

    +
    ∧ intersection
    +∨ union
    +∘ concatenation (see below)
    +¬ complement
    +ϕ empty set (aka ∅)
    +λ singleton set containing just the empty string
    +I set of all letters in alphabet
    +
    +
    +

    Derivative of a set R of strings and a string a:

    +
    ∂a(R)
    +
    +∂a(a) → λ
    +∂a(λ) → ϕ
    +∂a(ϕ) → ϕ
    +∂a(¬a) → ϕ
    +∂a(R*) → ∂a(R)∘R*
    +∂a(¬R) → ¬∂a(R)
    +∂a(R∘S) → ∂a(R)∘S ∨ δ(R)∘∂a(S)
    +∂a(R ∧ S) → ∂a(R) ∧ ∂a(S)
    +∂a(R ∨ S) → ∂a(R) ∨ ∂a(S)
    +
    +∂ab(R) = ∂b(∂a(R))
    +
    +
    +

    Auxiliary predicate function δ (I call it nully) returns either +λ if λ R or ϕ otherwise:

    +
    δ(a) → ϕ
    +δ(λ) → λ
    +δ(ϕ) → ϕ
    +δ(R*) → λ
    +δ(¬R) δ(R)≟ϕ → λ
    +δ(¬R) δ(R)≟λ → ϕ
    +δ(R∘S) → δ(R) ∧ δ(S)
    +δ(R ∧ S) → δ(R) ∧ δ(S)
    +δ(R ∨ S) → δ(R) ∨ δ(S)
    +
    +
    +

    Some rules we will use later for “compaction”:

    +
    R ∧ ϕ = ϕ ∧ R = ϕ
    +
    +R ∧ I = I ∧ R = R
    +
    +R ∨ ϕ = ϕ ∨ R = R
    +
    +R ∨ I = I ∨ R = I
    +
    +R∘ϕ = ϕ∘R = ϕ
    +
    +R∘λ = λ∘R = R
    +
    +
    +

    Concatination of sets: for two sets A and B the set A∘B is defined as:

    +

    {a∘b for a in A for b in B}

    +

    E.g.:

    +

    {‘a’, ‘b’}∘{‘c’, ‘d’} → {‘ac’, ‘ad’, ‘bc’, ‘bd’}

    +
    +
    +

    Implementation

    +
    from functools import partial as curry
    +from itertools import product
    +
    +
    +
    +

    ϕ and λ

    +

    The empty set and the set of just the empty string.

    +
    phi = frozenset()   # ϕ
    +y = frozenset({''}) # λ
    +
    +
    +
    +
    +

    Two-letter Alphabet

    +

    I’m only going to use two symbols (at first) becaase this is enough to +illustrate the algorithm and because you can represent any other +alphabet with two symbols (if you had to.)

    +

    I chose the names O and l (uppercase “o” and lowercase “L”) to +look like 0 and 1 (zero and one) respectively.

    +
    syms = O, l = frozenset({'0'}), frozenset({'1'})
    +
    +
    +
    +
    +

    Representing Regular Expressions

    +

    To represent REs in Python I’m going to use tagged tuples. A regular +expression is one of:

    +
    O
    +l
    +(KSTAR, R)
    +(NOT, R)
    +(AND, R, S)
    +(CONS, R, S)
    +(OR, R, S)
    +
    +
    +

    Where R and S stand for regular expressions.

    +
    AND, CONS, KSTAR, NOT, OR = 'and cons * not or'.split()  # Tags are just strings.
    +
    +
    +

    Because they are formed of frozenset, tuple and str objects +only, these datastructures are immutable.

    +
    +
    +

    String Representation of RE Datastructures

    +
    def stringy(re):
    +    '''
    +    Return a nice string repr for a regular expression datastructure.
    +    '''
    +    if re == I: return '.'
    +    if re in syms: return next(iter(re))
    +    if re == y: return '^'
    +    if re == phi: return 'X'
    +
    +    assert isinstance(re, tuple), repr(re)
    +    tag = re[0]
    +
    +    if tag == KSTAR:
    +        body = stringy(re[1])
    +        if not body: return body
    +        if len(body) > 1: return '(' + body + ")*"
    +        return body + '*'
    +
    +    if tag == NOT:
    +        body = stringy(re[1])
    +        if not body: return body
    +        if len(body) > 1: return '(' + body + ")'"
    +        return body + "'"
    +
    +    r, s = stringy(re[1]), stringy(re[2])
    +    if tag == CONS: return r + s
    +    if tag == OR:   return '%s | %s' % (r, s)
    +    if tag == AND:  return '(%s) & (%s)' % (r, s)
    +
    +    raise ValueError
    +
    +
    +
    +
    +

    I

    +

    Match anything. Often spelled “.”

    +
    I = (0|1)*
    +
    +
    +
    I = (KSTAR, (OR, O, l))
    +
    +
    +
    print stringy(I)
    +
    +
    +
    .
    +
    +
    +
    +
    +

    (.111.) & (.01 + 11*)'

    +

    The example expression from Brzozowski:

    +
    (.111.) & (.01 + 11*)'
    +   a    &  (b  +  c)'
    +
    +
    +

    Note that it contains one of everything.

    +
    a = (CONS, I, (CONS, l, (CONS, l, (CONS, l, I))))
    +b = (CONS, I, (CONS, O, l))
    +c = (CONS, l, (KSTAR, l))
    +it = (AND, a, (NOT, (OR, b, c)))
    +
    +
    +
    print stringy(it)
    +
    +
    +
    (.111.) & ((.01 | 11*)')
    +
    +
    +
    +
    +

    nully()

    +

    Let’s get that auxiliary predicate function δ out of the way.

    +
    def nully(R):
    +    '''
    +    δ - Return λ if λ ⊆ R otherwise ϕ.
    +    '''
    +
    +    # δ(a) → ϕ
    +    # δ(ϕ) → ϕ
    +    if R in syms or R == phi:
    +        return phi
    +
    +    # δ(λ) → λ
    +    if R == y:
    +        return y
    +
    +    tag = R[0]
    +
    +    # δ(R*) → λ
    +    if tag == KSTAR:
    +        return y
    +
    +    # δ(¬R) δ(R)≟ϕ → λ
    +    # δ(¬R) δ(R)≟λ → ϕ
    +    if tag == NOT:
    +        return phi if nully(R[1]) else y
    +
    +    # δ(R∘S) → δ(R) ∧ δ(S)
    +    # δ(R ∧ S) → δ(R) ∧ δ(S)
    +    # δ(R ∨ S) → δ(R) ∨ δ(S)
    +    r, s = nully(R[1]), nully(R[2])
    +    return r & s if tag in {AND, CONS} else r | s
    +
    +
    +
    +
    +

    No “Compaction”

    +

    This is the straightforward version with no “compaction”. It works fine, +but does waaaay too much work because the expressions grow each +derivation.

    +
    def D(symbol):
    +
    +    def derv(R):
    +
    +        # ∂a(a) → λ
    +        if R == {symbol}:
    +            return y
    +
    +        # ∂a(λ) → ϕ
    +        # ∂a(ϕ) → ϕ
    +        # ∂a(¬a) → ϕ
    +        if R == y or R == phi or R in syms:
    +            return phi
    +
    +        tag = R[0]
    +
    +        # ∂a(R*) → ∂a(R)∘R*
    +        if tag == KSTAR:
    +            return (CONS, derv(R[1]), R)
    +
    +        # ∂a(¬R) → ¬∂a(R)
    +        if tag == NOT:
    +            return (NOT, derv(R[1]))
    +
    +        r, s = R[1:]
    +
    +        # ∂a(R∘S) → ∂a(R)∘S ∨ δ(R)∘∂a(S)
    +        if tag == CONS:
    +            A = (CONS, derv(r), s)  # A = ∂a(R)∘S
    +            # A ∨ δ(R) ∘ ∂a(S)
    +            # A ∨  λ   ∘ ∂a(S) → A ∨ ∂a(S)
    +            # A ∨  ϕ   ∘ ∂a(S) → A ∨ ϕ → A
    +            return (OR, A, derv(s)) if nully(r) else A
    +
    +        # ∂a(R ∧ S) → ∂a(R) ∧ ∂a(S)
    +        # ∂a(R ∨ S) → ∂a(R) ∨ ∂a(S)
    +        return (tag, derv(r), derv(s))
    +
    +    return derv
    +
    +
    +
    +
    +

    Compaction Rules

    +
    def _compaction_rule(relation, one, zero, a, b):
    +    return (
    +        b if a == one else  # R*1 = 1*R = R
    +        a if b == one else
    +        zero if a == zero or b == zero else  # R*0 = 0*R = 0
    +        (relation, a, b)
    +        )
    +
    +
    +

    An elegant symmetry.

    +
    # R ∧ I = I ∧ R = R
    +# R ∧ ϕ = ϕ ∧ R = ϕ
    +_and = curry(_compaction_rule, AND, I, phi)
    +
    +# R ∨ ϕ = ϕ ∨ R = R
    +# R ∨ I = I ∨ R = I
    +_or = curry(_compaction_rule, OR, phi, I)
    +
    +# R∘λ = λ∘R = R
    +# R∘ϕ = ϕ∘R = ϕ
    +_cons = curry(_compaction_rule, CONS, y, phi)
    +
    +
    +
    +
    +

    Memoizing

    +

    We can save re-processing by remembering results we have already +computed. RE datastructures are immutable and the derv() functions +are pure so this is fine.

    +
    class Memo(object):
    +
    +    def __init__(self, f):
    +        self.f = f
    +        self.calls = self.hits = 0
    +        self.mem = {}
    +
    +    def __call__(self, key):
    +        self.calls += 1
    +        try:
    +            result = self.mem[key]
    +            self.hits += 1
    +        except KeyError:
    +            result = self.mem[key] = self.f(key)
    +        return result
    +
    +
    +
    +
    +

    With “Compaction”

    +

    This version uses the rules above to perform compaction. It keeps the +expressions from growing too large.

    +
    def D_compaction(symbol):
    +
    +    @Memo
    +    def derv(R):
    +
    +        # ∂a(a) → λ
    +        if R == {symbol}:
    +            return y
    +
    +        # ∂a(λ) → ϕ
    +        # ∂a(ϕ) → ϕ
    +        # ∂a(¬a) → ϕ
    +        if R == y or R == phi or R in syms:
    +            return phi
    +
    +        tag = R[0]
    +
    +        # ∂a(R*) → ∂a(R)∘R*
    +        if tag == KSTAR:
    +            return _cons(derv(R[1]), R)
    +
    +        # ∂a(¬R) → ¬∂a(R)
    +        if tag == NOT:
    +            return (NOT, derv(R[1]))
    +
    +        r, s = R[1:]
    +
    +        # ∂a(R∘S) → ∂a(R)∘S ∨ δ(R)∘∂a(S)
    +        if tag == CONS:
    +            A = _cons(derv(r), s)  # A = ∂a(r)∘s
    +            # A ∨ δ(R) ∘ ∂a(S)
    +            # A ∨  λ   ∘ ∂a(S) → A ∨ ∂a(S)
    +            # A ∨  ϕ   ∘ ∂a(S) → A ∨ ϕ → A
    +            return _or(A, derv(s)) if nully(r) else A
    +
    +        # ∂a(R ∧ S) → ∂a(R) ∧ ∂a(S)
    +        # ∂a(R ∨ S) → ∂a(R) ∨ ∂a(S)
    +        dr, ds = derv(r), derv(s)
    +        return _and(dr, ds) if tag == AND else _or(dr, ds)
    +
    +    return derv
    +
    +
    +
    +
    +
    +

    Let’s try it out…

    +

    (FIXME: redo.)

    +
    o, z = D_compaction('0'), D_compaction('1')
    +REs = set()
    +N = 5
    +names = list(product(*(N * [(0, 1)])))
    +dervs = list(product(*(N * [(o, z)])))
    +for name, ds in zip(names, dervs):
    +    R = it
    +    ds = list(ds)
    +    while ds:
    +        R = ds.pop()(R)
    +        if R == phi or R == I:
    +            break
    +        REs.add(R)
    +
    +print stringy(it) ; print
    +print o.hits, '/', o.calls
    +print z.hits, '/', z.calls
    +print
    +for s in sorted(map(stringy, REs), key=lambda n: (len(n), n)):
    +    print s
    +
    +
    +
    (.111.) & ((.01 | 11*)')
    +
    +92 / 122
    +92 / 122
    +
    +(.01)'
    +(.01 | 1)'
    +(.01 | ^)'
    +(.01 | 1*)'
    +(.111.) & ((.01 | 1)')
    +(.111. | 11.) & ((.01 | ^)')
    +(.111. | 11. | 1.) & ((.01)')
    +(.111. | 11.) & ((.01 | 1*)')
    +(.111. | 11. | 1.) & ((.01 | 1*)')
    +
    +
    +

    Should match:

    +
    (.111.) & ((.01 | 11*)')
    +
    +92 / 122
    +92 / 122
    +
    +(.01     )'
    +(.01 | 1 )'
    +(.01 | ^ )'
    +(.01 | 1*)'
    +(.111.)            & ((.01 | 1 )')
    +(.111. | 11.)      & ((.01 | ^ )')
    +(.111. | 11.)      & ((.01 | 1*)')
    +(.111. | 11. | 1.) & ((.01     )')
    +(.111. | 11. | 1.) & ((.01 | 1*)')
    +
    +
    +
    +
    +

    Larger Alphabets

    +

    We could parse larger alphabets by defining patterns for e.g. each byte +of the ASCII code. Or we can generalize this code. If you study the code +above you’ll see that we never use the “set-ness” of the symbols O +and l. The only time Python set operators (& and |) appear +is in the nully() function, and there they operate on (recursively +computed) outputs of that function, never O and l.

    +

    What if we try:

    +
    (OR, O, l)
    +
    +∂1((OR, O, l))
    +                            ∂a(R ∨ S) → ∂a(R) ∨ ∂a(S)
    +∂1(O) ∨ ∂1(l)
    +                            ∂a(¬a) → ϕ
    +ϕ ∨ ∂1(l)
    +                            ∂a(a) → λ
    +ϕ ∨ λ
    +                            ϕ ∨ R = R
    +λ
    +
    +
    +

    And compare it to:

    +
    {'0', '1')
    +
    +∂1({'0', '1'))
    +                            ∂a(R ∨ S) → ∂a(R) ∨ ∂a(S)
    +∂1({'0')) ∨ ∂1({'1'))
    +                            ∂a(¬a) → ϕ
    +ϕ ∨ ∂1({'1'))
    +                            ∂a(a) → λ
    +ϕ ∨ λ
    +                            ϕ ∨ R = R
    +λ
    +
    +
    +

    This suggests that we should be able to alter the functions above to +detect sets and deal with them appropriately. Exercise for the Reader +for now.

    +
    +
    +

    State Machine

    +

    We can drive the regular expressions to flesh out the underlying state +machine transition table.

    +
    .111. & (.01 + 11*)'
    +
    +
    +

    Says, “Three or more 1’s and not ending in 01 nor composed of all 1’s.”

    +
    +State Machine Diagram
    +

    Start at a and follow the transition arrows according to their +labels. Accepting states have a double outline. (Graphic generated with +Dot from Graphviz.) You’ll see that only +paths that lead to one of the accepting states will match the regular +expression. All other paths will terminate at one of the non-accepting +states.

    +

    There’s a happy path to g along 111:

    +
    a→c→e→g
    +
    +
    +

    After you reach g you’re stuck there eating 1’s until you see a 0, +which takes you to the i→j→i|i→j→h→i “trap”. You can’t reach any +other states from those two loops.

    +

    If you see a 0 before you see 111 you will reach b, which forms +another “trap” with d and f. The only way out is another happy +path along 111 to h:

    +
    b→d→f→h
    +
    +
    +

    Once you have reached h you can see as many 1’s or as many 0’ in a +row and still be either still at h (for 1’s) or move to i (for +0’s). If you find yourself at i you can see as many 0’s, or +repetitions of 10, as there are, but if you see just a 1 you move to +j.

    +
    +

    RE to FSM

    +

    So how do we get the state machine from the regular expression?

    +

    It turns out that each RE is effectively a state, and each arrow points +to the derivative RE in respect to the arrow’s symbol.

    +

    If we label the initial RE a, we can say:

    +
    a --0--> ∂0(a)
    +a --1--> ∂1(a)
    +
    +
    +

    And so on, each new unique RE is a new state in the FSM table.

    +

    Here are the derived REs at each state:

    +
    a = (.111.) & ((.01 | 11*)')
    +b = (.111.) & ((.01 | 1)')
    +c = (.111. | 11.) & ((.01 | 1*)')
    +d = (.111. | 11.) & ((.01 | ^)')
    +e = (.111. | 11. | 1.) & ((.01 | 1*)')
    +f = (.111. | 11. | 1.) & ((.01)')
    +g = (.01 | 1*)'
    +h = (.01)'
    +i = (.01 | 1)'
    +j = (.01 | ^)'
    +
    +
    +

    You can see the one-way nature of the g state and the hij “trap” +in the way that the .111. on the left-hand side of the & +disappears once it has been matched.

    +
    from collections import defaultdict
    +from pprint import pprint
    +from string import ascii_lowercase
    +
    +
    +
    d0, d1 = D_compaction('0'), D_compaction('1')
    +
    +
    +
    +
    +

    explore()

    +
    def explore(re):
    +
    +    # Don't have more than 26 states...
    +    names = defaultdict(iter(ascii_lowercase).next)
    +
    +    table, accepting = dict(), set()
    +
    +    to_check = {re}
    +    while to_check:
    +
    +        re = to_check.pop()
    +        state_name = names[re]
    +
    +        if (state_name, 0) in table:
    +            continue
    +
    +        if nully(re):
    +            accepting.add(state_name)
    +
    +        o, i = d0(re), d1(re)
    +        table[state_name, 0] = names[o] ; to_check.add(o)
    +        table[state_name, 1] = names[i] ; to_check.add(i)
    +
    +    return table, accepting
    +
    +
    +
    table, accepting = explore(it)
    +table
    +
    +
    +
    {('a', 0): 'b',
    + ('a', 1): 'c',
    + ('b', 0): 'b',
    + ('b', 1): 'd',
    + ('c', 0): 'b',
    + ('c', 1): 'e',
    + ('d', 0): 'b',
    + ('d', 1): 'f',
    + ('e', 0): 'b',
    + ('e', 1): 'g',
    + ('f', 0): 'b',
    + ('f', 1): 'h',
    + ('g', 0): 'i',
    + ('g', 1): 'g',
    + ('h', 0): 'i',
    + ('h', 1): 'h',
    + ('i', 0): 'i',
    + ('i', 1): 'j',
    + ('j', 0): 'i',
    + ('j', 1): 'h'}
    +
    +
    +
    accepting
    +
    +
    +
    {'h', 'i'}
    +
    +
    +
    +
    +

    Generate Diagram

    +

    Once we have the FSM table and the set of accepting states we can +generate the diagram above.

    +
    _template = '''\
    +digraph finite_state_machine {
    +  rankdir=LR;
    +  size="8,5"
    +  node [shape = doublecircle]; %s;
    +  node [shape = circle];
    +%s
    +}
    +'''
    +
    +def link(fr, nm, label):
    +    return '  %s -> %s [ label = "%s" ];' % (fr, nm, label)
    +
    +
    +def make_graph(table, accepting):
    +    return _template % (
    +        ' '.join(accepting),
    +        '\n'.join(
    +          link(from_, to, char)
    +          for (from_, char), (to) in sorted(table.iteritems())
    +          )
    +        )
    +
    +
    +
    print make_graph(table, accepting)
    +
    +
    +
    digraph finite_state_machine {
    +  rankdir=LR;
    +  size="8,5"
    +  node [shape = doublecircle]; i h;
    +  node [shape = circle];
    +  a -> b [ label = "0" ];
    +  a -> c [ label = "1" ];
    +  b -> b [ label = "0" ];
    +  b -> d [ label = "1" ];
    +  c -> b [ label = "0" ];
    +  c -> e [ label = "1" ];
    +  d -> b [ label = "0" ];
    +  d -> f [ label = "1" ];
    +  e -> b [ label = "0" ];
    +  e -> g [ label = "1" ];
    +  f -> b [ label = "0" ];
    +  f -> h [ label = "1" ];
    +  g -> i [ label = "0" ];
    +  g -> g [ label = "1" ];
    +  h -> i [ label = "0" ];
    +  h -> h [ label = "1" ];
    +  i -> i [ label = "0" ];
    +  i -> j [ label = "1" ];
    +  j -> i [ label = "0" ];
    +  j -> h [ label = "1" ];
    +}
    +
    +
    +
    +
    +

    Drive a FSM

    +

    There are lots of FSM libraries already. Once you have the state +transition table they should all be straightforward to use. State +Machine code is very simple. Just for fun, here is an implementation in +Python that imitates what “compiled” FSM code might look like in an +“unrolled” form. Most FSM code uses a little driver loop and a table +datastructure, the code below instead acts like JMP instructions +(“jump”, or GOTO in higher-level-but-still-low-level languages) to +hard-code the information in the table into a little patch of branches.

    +
    +

    Trampoline Function

    +

    Python has no GOTO statement but we can fake it with a “trampoline” +function.

    +
    def trampoline(input_, jump_from, accepting):
    +    I = iter(input_)
    +    while True:
    +        try:
    +            bounce_to = jump_from(I)
    +        except StopIteration:
    +            return jump_from in accepting
    +        jump_from = bounce_to
    +
    +
    +
    +
    +

    Stream Functions

    +

    Little helpers to process the iterator of our data (a “stream” of “1” +and “0” characters, not bits.)

    +
    getch = lambda I: int(next(I))
    +
    +
    +def _1(I):
    +    '''Loop on ones.'''
    +    while getch(I): pass
    +
    +
    +def _0(I):
    +    '''Loop on zeros.'''
    +    while not getch(I): pass
    +
    +
    +
    +
    +

    A Finite State Machine

    +

    With those preliminaries out of the way, from the state table of +.111. & (.01 + 11*)' we can immediately write down state machine +code. (You have to imagine that these are GOTO statements in C or +branches in assembly and that the state names are branch destination +labels.)

    +
    a = lambda I: c if getch(I) else b
    +b = lambda I: _0(I) or d
    +c = lambda I: e if getch(I) else b
    +d = lambda I: f if getch(I) else b
    +e = lambda I: g if getch(I) else b
    +f = lambda I: h if getch(I) else b
    +g = lambda I: _1(I) or i
    +h = lambda I: _1(I) or i
    +i = lambda I: _0(I) or j
    +j = lambda I: h if getch(I) else i
    +
    +
    +

    Note that the implementations of h and g are identical ergo +h = g and we could eliminate one in the code but h is an +accepting state and g isn’t.

    +
    def acceptable(input_):
    +    return trampoline(input_, a, {h, i})
    +
    +
    +
    for n in range(2**5):
    +    s = bin(n)[2:]
    +    print '%05s' % s, acceptable(s)
    +
    +
    +
        0 False
    +    1 False
    +   10 False
    +   11 False
    +  100 False
    +  101 False
    +  110 False
    +  111 False
    + 1000 False
    + 1001 False
    + 1010 False
    + 1011 False
    + 1100 False
    + 1101 False
    + 1110 True
    + 1111 False
    +10000 False
    +10001 False
    +10010 False
    +10011 False
    +10100 False
    +10101 False
    +10110 False
    +10111 True
    +11000 False
    +11001 False
    +11010 False
    +11011 False
    +11100 True
    +11101 False
    +11110 True
    +11111 False
    +
    +
    +
    +
    +
    +
    +

    Reversing the Derivatives to Generate Matching Strings

    +

    (UNFINISHED) Brzozowski also shewed how to go from the state machine to +strings and expressions…

    +

    Each of these states is just a name for a Brzozowskian RE, and so, other +than the initial state a, they can can be described in terms of the +derivative-with-respect-to-N of some other state/RE:

    +
    c = d1(a)
    +b = d0(a)
    +b = d0(c)
    +...
    +i = d0(j)
    +j = d1(i)
    +
    +
    +

    Consider:

    +
    c = d1(a)
    +b = d0(c)
    +
    +
    +

    Substituting:

    +
    b = d0(d1(a))
    +
    +
    +

    Unwrapping:

    +
    b = d10(a)
    +
    +
    +

    ‘’‘

    +
    j = d1(d0(j))
    +
    +
    +

    Unwrapping:

    +
    j = d1(d0(j)) = d01(j)
    +
    +
    +

    We have a loop or “fixed point”.

    +
    j = d01(j) = d0101(j) = d010101(j) = ...
    +
    +
    +

    hmm…

    +
    j = (01)*
    +
    +
    +
    +
    + + +
    +
    +
    + +
    +
    + + + + \ No newline at end of file diff --git a/docs/sphinx_docs/_build/html/notebooks/The_Four_Operations.html b/docs/sphinx_docs/_build/html/notebooks/The_Four_Operations.html new file mode 100644 index 0000000..5e6b79e --- /dev/null +++ b/docs/sphinx_docs/_build/html/notebooks/The_Four_Operations.html @@ -0,0 +1,391 @@ + + + + + + + + The Four Fundamental Operations of Definite Action — Thun 0.2.0 documentation + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +

    The Four Fundamental Operations of Definite Action

    +

    All definite actions (computer program) can be defined by four +fundamental patterns of combination:

    +
      +
    1. Sequence
    2. +
    3. Branch
    4. +
    5. Loop
    6. +
    7. Parallel
    8. +
    +
    +

    Sequence

    +

    Do one thing after another. In joy this is represented by putting two +symbols together, juxtaposition:

    +
    foo bar
    +
    +
    +

    Operations have inputs and outputs. The outputs of foo must be +compatible in “arity”, type, and shape with the inputs of bar.

    +
    +
    +

    Branch

    +

    Do one thing or another.

    +
    boolean [F] [T] branch
    +
    +
    +   t [F] [T] branch
    +----------------------
    +          T
    +
    +
    +   f [F] [T] branch
    +----------------------
    +      F
    +
    +
    +branch == unit cons swap pick i
    +
    +boolean [F] [T] branch
    +boolean [F] [T] unit cons swap pick i
    +boolean [F] [[T]] cons swap pick i
    +boolean [[F] [T]] swap pick i
    +[[F] [T]] boolean pick i
    +[F-or-T] i
    +
    +
    +

    Given some branch function G:

    +
    G == [F] [T] branch
    +
    +
    +

    Used in a sequence like so:

    +
    foo G bar
    +
    +
    +

    The inputs and outputs of F and T must be compatible with the +outputs for foo and the inputs of bar, respectively.

    +
    foo F bar
    +
    +foo T bar
    +
    +
    +
    +

    ifte

    +

    Often it will be easier on the programmer to write branching code with +the predicate specified in a quote. The ifte combinator provides +this (T for “then” and E for “else”):

    +
    [P] [T] [E] ifte
    +
    +
    +

    Defined in terms of branch:

    +
    ifte == [nullary not] dip branch
    +
    +
    +

    In this case, P must be compatible with the stack and return a +Boolean value, and T and E both must be compatible with the +preceeding and following functions, as described above for F and +T. (Note that in the current implementation we are depending on +Python for the underlying semantics, so the Boolean value doesn’t have +to be Boolean because Python’s rules for “truthiness” will be used to +evaluate it. I reflect this in the structure of the stack effect comment +of branch, it will only accept Boolean values, and in the definition +of ifte above by including not in the quote, which also has the +effect that the subject quotes are in the proper order for branch.)

    +
    +
    +
    +

    Loop

    +

    Do one thing zero or more times.

    +
    boolean [Q] loop
    +
    +
    +   t [Q] loop
    +----------------
    +   Q [Q] loop
    +
    +
    +   ... f [Q] loop
    +--------------------
    +   ...
    +
    +
    +

    The loop combinator generates a copy of itself in the true branch. +This is the hallmark of recursive defintions. In Thun there is no +equivalent to conventional loops. (There is, however, the x +combinator, defined as x == dup i, which permits recursive +constructs that do not need to be directly self-referential, unlike +loop and genrec.)

    +
    loop == [] swap [dup dip loop] cons branch
    +
    +boolean [Q] loop
    +boolean [Q] [] swap [dup dip loop] cons branch
    +boolean [] [Q] [dup dip loop] cons branch
    +boolean [] [[Q] dup dip loop] branch
    +
    +
    +

    In action the false branch does nothing while the true branch does:

    +
    t [] [[Q] dup dip loop] branch
    +      [Q] dup dip loop
    +      [Q] [Q] dip loop
    +      Q [Q] loop
    +
    +
    +

    Because loop expects and consumes a Boolean value, the Q +function must be compatible with the previous stack and itself with a +boolean flag for the next iteration:

    +
    Q == G b
    +
    +Q [Q] loop
    +G b [Q] loop
    +G Q [Q] loop
    +G G b [Q] loop
    +G G Q [Q] loop
    +G G G b [Q] loop
    +G G G
    +
    +
    +
    +

    while

    +

    Keep doing B while some predicate P is true. This is +convenient as the predicate function is made nullary automatically and +the body function can be designed without regard to leaving a Boolean +flag for the next iteration:

    +
                [P] [B] while
    +--------------------------------------
    +   [P] nullary [B [P] nullary] loop
    +
    +
    +while == swap [nullary] cons dup dipd concat loop
    +
    +
    +[P] [B] while
    +[P] [B] swap [nullary] cons dup dipd concat loop
    +[B] [P] [nullary] cons dup dipd concat loop
    +[B] [[P] nullary] dup dipd concat loop
    +[B] [[P] nullary] [[P] nullary] dipd concat loop
    +[P] nullary [B] [[P] nullary] concat loop
    +[P] nullary [B [P] nullary] loop
    +
    +
    +
    +
    +
    +

    Parallel

    +

    The parallel operation indicates that two (or more) functions do not +interfere with each other and so can run in parallel. The main +difficulty in this sort of thing is orchestrating the recombining +(“join” or “wait”) of the results of the functions after they finish.

    +

    The current implementaions and the following definitions are not +actually parallel (yet), but there is no reason they couldn’t be +reimplemented in terms of e.g. Python threads. I am not concerned with +performance of the system just yet, only the elegance of the code it +allows us to write.

    +
    +

    cleave

    +

    Joy has a few parallel combinators, the main one being cleave:

    +
                   ... x [A] [B] cleave
    +---------------------------------------------------------
    +   ... [x ...] [A] infra first [x ...] [B] infra first
    +---------------------------------------------------------
    +                   ... a b
    +
    +
    +

    The cleave combinator expects a value and two quotes and it executes +each quote in “separate universes” such that neither can affect the +other, then it takes the first item from the stack in each universe and +replaces the value and quotes with their respective results.

    +

    (I think this corresponds to the “fork” operator, the little +upward-pointed triangle, that takes two functions A :: x -> a and +B :: x -> b and returns a function F :: x -> (a, b), in Conal +Elliott’s “Compiling to Categories” paper, et. al.)

    +

    Just a thought, if you cleave two jobs and one requires more time to +finish than the other you’d like to be able to assign resources +accordingly so that they both finish at the same time.

    +
    +
    +

    “Apply” Functions

    +

    There are also app2 and app3 which run a single quote on more +than one value:

    +
                    ... y x [Q] app2
    +---------------------------------------------------------
    +   ... [y ...] [Q] infra first [x ...] [Q] infra first
    +
    +
    +       ... z y x [Q] app3
    +---------------------------------
    +   ... [z ...] [Q] infra first
    +       [y ...] [Q] infra first
    +       [x ...] [Q] infra first
    +
    +
    +

    Because the quoted program can be i we can define cleave in +terms of app2:

    +
    cleave == [i] app2 [popd] dip
    +
    +
    +

    (I’m not sure why cleave was specified to take that value, I may +make a combinator that does the same thing but without expecting a +value.)

    +
    clv == [i] app2
    +
    +   [A] [B] clv
    +------------------
    +     a b
    +
    +
    +
    +
    +

    map

    +

    The common map function in Joy should also be though of as a +parallel operator:

    +
    [a b c ...] [Q] map
    +
    +
    +

    There is no reason why the implementation of map couldn’t distribute +the Q function over e.g. a pool of worker CPUs.

    +
    +
    +

    pam

    +

    One of my favorite combinators, the pam combinator is just:

    +
    pam == [i] map
    +
    +
    +

    This can be used to run any number of programs separately on the current +stack and combine their (first) outputs in a result list.

    +
       [[A] [B] [C] ...] [i] map
    +-------------------------------
    +   [ a   b   c  ...]
    +
    +
    +
    +
    +

    Handling Other Kinds of Join

    +

    The cleave operators and others all have pretty brutal join +semantics: everything works and we always wait for every +sub-computation. We can imagine a few different potentially useful +patterns of “joining” results from parallel combinators.

    +
    +

    first-to-finish

    +

    Thinking about variations of pam there could be one that only +returns the first result of the first-to-finish sub-program, or the +stack could be replaced by its output stack.

    +

    The other sub-programs would be cancelled.

    +
    +
    +

    “Fulminators”

    +

    Also known as “Futures” or “Promises” (by everybody else. “Fulinators” +is what I was going to call them when I was thinking about implementing +them in Thun.)

    +

    The runtime could be amended to permit “thunks” representing the results +of in-progress computations to be left on the stack and picked up by +subsequent functions. These would themselves be able to leave behind +more “thunks”, the values of which depend on the eventual resolution of +the values of the previous thunks.

    +

    In this way you can create “chains” (and more complex shapes) out of +normal-looking code that consist of a kind of call-graph interspersed +with “asyncronous” … events?

    +

    In any case, until I can find a rigorous theory that shows that this +sort of thing works perfectly in Joy code I’m not going to worry about +it. (And I think the Categories can deal with it anyhow? Incremental +evaluation, yeah?)

    +
    +
    +
    +
    + + +
    +
    +
    + +
    +
    + + + + \ No newline at end of file diff --git a/docs/sphinx_docs/_build/html/notebooks/TypeChecking.html b/docs/sphinx_docs/_build/html/notebooks/TypeChecking.html new file mode 100644 index 0000000..cd3ed20 --- /dev/null +++ b/docs/sphinx_docs/_build/html/notebooks/TypeChecking.html @@ -0,0 +1,209 @@ + + + + + + + + Type Checking — Thun 0.2.0 documentation + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +

    Type Checking

    +
    import logging, sys
    +
    +logging.basicConfig(
    +  format='%(message)s',
    +  stream=sys.stdout,
    +  level=logging.INFO,
    +  )
    +
    +
    +
    from joy.utils.polytypes import (
    +    doc_from_stack_effect,
    +    infer,
    +    reify,
    +    unify,
    +    FUNCTIONS,
    +    JoyTypeError,
    +)
    +
    +
    +
    D = FUNCTIONS.copy()
    +del D['product']
    +globals().update(D)
    +
    +
    +
    +

    An Example

    +
    fi, fo = infer(pop, swap, rolldown, rrest, ccons)[0]
    +
    +
    +
    25 (--) ∘ pop swap rolldown rrest ccons
    +28 (a1 --) ∘ swap rolldown rrest ccons
    +31 (a3 a2 a1 -- a2 a3) ∘ rolldown rrest ccons
    +34 (a4 a3 a2 a1 -- a2 a3 a4) ∘ rrest ccons
    +37 ([a4 a5 ...1] a3 a2 a1 -- a2 a3 [...1]) ∘ ccons
    +40 ([a4 a5 ...1] a3 a2 a1 -- [a2 a3 ...1]) ∘
    +
    +
    +
    print doc_from_stack_effect(fi, fo)
    +
    +
    +
    ([a4 a5 ...1] a3 a2 a1 -- [a2 a3 ...1])
    +
    +
    +
    from joy.parser import text_to_expression
    +from joy.utils.stack import stack_to_string
    +
    +
    +
    e = text_to_expression('0 1 2 [3 4]')  # reverse order
    +print stack_to_string(e)
    +
    +
    +
    [3 4] 2 1 0
    +
    +
    +
    u = unify(e, fi)[0]
    +u
    +
    +
    +
    {a1: 0, a2: 1, a3: 2, a4: 3, a5: 4, s2: (), s1: ()}
    +
    +
    +
    g = reify(u, (fi, fo))
    +print doc_from_stack_effect(*g)
    +
    +
    +
    (... [3 4 ] 2 1 0 -- ... [1 2 ])
    +
    +
    +
    +
    +

    Unification Works “in Reverse”

    +
    e = text_to_expression('[2 3]')
    +
    +
    +
    u = unify(e, fo)[0]  # output side, not input side
    +u
    +
    +
    +
    {a2: 2, a3: 3, s2: (), s1: ()}
    +
    +
    +
    g = reify(u, (fi, fo))
    +print doc_from_stack_effect(*g)
    +
    +
    +
    (... [a4 a5 ] 3 2 a1 -- ... [2 3 ])
    +
    +
    +
    +
    +

    Failing a Check

    +
    fi, fo = infer(dup, mul)[0]
    +
    +
    +
    25 (--) ∘ dup mul
    +28 (a1 -- a1 a1) ∘ mul
    +31 (f1 -- f2) ∘
    +31 (i1 -- i2) ∘
    +
    +
    +
    e = text_to_expression('"two"')
    +print stack_to_string(e)
    +
    +
    +
    'two'
    +
    +
    +
    try:
    +    unify(e, fi)
    +except JoyTypeError, err:
    +    print err
    +
    +
    +
    Cannot unify 'two' and f1.
    +
    +
    +
    +
    + + +
    +
    +
    + +
    +
    + + + + \ No newline at end of file diff --git a/docs/sphinx_docs/_build/html/notebooks/index.html b/docs/sphinx_docs/_build/html/notebooks/index.html index 8aae107..6a9a901 100644 --- a/docs/sphinx_docs/_build/html/notebooks/index.html +++ b/docs/sphinx_docs/_build/html/notebooks/index.html @@ -130,8 +130,30 @@
  • Appendix: Joy in the Logical Paradigm
  • +
  • Type Checking +
  • No Updates
  • Categorical Programming
  • +
  • The Four Fundamental Operations of Definite Action +
  • +
  • ∂RE +
  • diff --git a/docs/sphinx_docs/_build/html/objects.inv b/docs/sphinx_docs/_build/html/objects.inv index c2e91b5..aa7fd30 100644 Binary files a/docs/sphinx_docs/_build/html/objects.inv and b/docs/sphinx_docs/_build/html/objects.inv differ diff --git a/docs/sphinx_docs/_build/html/searchindex.js b/docs/sphinx_docs/_build/html/searchindex.js index 943138a..b3151eb 100644 --- a/docs/sphinx_docs/_build/html/searchindex.js +++ b/docs/sphinx_docs/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["index","joy","lib","library","notebooks/Categorical","notebooks/Derivatives_of_Regular_Expressions","notebooks/Developing","notebooks/Generator_Programs","notebooks/Intro","notebooks/Newton-Raphson","notebooks/NoUpdates","notebooks/Ordered_Binary_Trees","notebooks/Quadratic","notebooks/Recursion_Combinators","notebooks/Replacing","notebooks/The_Four_Operations","notebooks/Treestep","notebooks/TypeChecking","notebooks/Types","notebooks/Zipper","notebooks/index","parser","pretty","stack","types"],envversion:52,filenames:["index.rst","joy.rst","lib.rst","library.rst","notebooks/Categorical.rst","notebooks/Derivatives_of_Regular_Expressions.rst","notebooks/Developing.rst","notebooks/Generator_Programs.rst","notebooks/Intro.rst","notebooks/Newton-Raphson.rst","notebooks/NoUpdates.rst","notebooks/Ordered_Binary_Trees.rst","notebooks/Quadratic.rst","notebooks/Recursion_Combinators.rst","notebooks/Replacing.rst","notebooks/The_Four_Operations.rst","notebooks/Treestep.rst","notebooks/TypeChecking.rst","notebooks/Types.rst","notebooks/Zipper.rst","notebooks/index.rst","parser.rst","pretty.rst","stack.rst","types.rst"],objects:{"joy.joy":{joy:[1,1,1,""],repl:[1,1,1,""],run:[1,1,1,""]},"joy.library":{"void":[3,1,1,""],BinaryBuiltinWrapper:[3,1,1,""],DefinitionWrapper:[3,2,1,""],FunctionWrapper:[3,1,1,""],SimpleFunctionWrapper:[3,1,1,""],UnaryBuiltinWrapper:[3,1,1,""],add_aliases:[3,1,1,""],app1:[3,1,1,""],app2:[3,1,1,""],app3:[3,1,1,""],b:[3,1,1,""],branch:[3,1,1,""],choice:[3,1,1,""],clear:[3,1,1,""],cmp_:[3,1,1,""],concat_:[3,1,1,""],cond:[3,1,1,""],dip:[3,1,1,""],dipd:[3,1,1,""],dipdd:[3,1,1,""],divmod_:[3,1,1,""],drop:[3,1,1,""],dupdip:[3,1,1,""],floor:[3,1,1,""],genrec:[3,1,1,""],getitem:[3,1,1,""],help_:[3,1,1,""],i:[3,1,1,""],id_:[3,1,1,""],infra:[3,1,1,""],initialize:[3,1,1,""],inscribe:[3,1,1,""],loop:[3,1,1,""],map_:[3,1,1,""],max_:[3,1,1,""],min_:[3,1,1,""],parse:[3,1,1,""],pm:[3,1,1,""],pred:[3,1,1,""],remove:[3,1,1,""],reverse:[3,1,1,""],select:[3,1,1,""],sharing:[3,1,1,""],shunt:[3,1,1,""],sort_:[3,1,1,""],sqrt:[3,1,1,""],step:[3,1,1,""],succ:[3,1,1,""],sum_:[3,1,1,""],take:[3,1,1,""],times:[3,1,1,""],unique:[3,1,1,""],unstack:[3,1,1,""],warranty:[3,1,1,""],words:[3,1,1,""],x:[3,1,1,""],zip_:[3,1,1,""]},"joy.library.DefinitionWrapper":{add_def:[3,3,1,""],add_definitions:[3,3,1,""],parse_definition:[3,3,1,""]},"joy.parser":{ParseError:[21,4,1,""],Symbol:[21,2,1,""],text_to_expression:[21,1,1,""]},"joy.utils":{generated_library:[3,0,0,"-"],polytypes:[24,0,0,"-"],pretty_print:[22,0,0,"-"],stack:[23,0,0,"-"],types:[24,0,0,"-"]},"joy.utils.generated_library":{ccons:[3,1,1,""],cons:[3,1,1,""],dup:[3,1,1,""],dupd:[3,1,1,""],dupdd:[3,1,1,""],first:[3,1,1,""],first_two:[3,1,1,""],fourth:[3,1,1,""],over:[3,1,1,""],pop:[3,1,1,""],popd:[3,1,1,""],popdd:[3,1,1,""],popop:[3,1,1,""],popopd:[3,1,1,""],popopdd:[3,1,1,""],rest:[3,1,1,""],rolldown:[3,1,1,""],rollup:[3,1,1,""],rrest:[3,1,1,""],second:[3,1,1,""],stack:[3,1,1,""],stuncons:[3,1,1,""],stununcons:[3,1,1,""],swaack:[3,1,1,""],swap:[3,1,1,""],swons:[3,1,1,""],third:[3,1,1,""],tuck:[3,1,1,""],uncons:[3,1,1,""],unit:[3,1,1,""],unswons:[3,1,1,""]},"joy.utils.polytypes":{CombinatorJoyType:[24,2,1,""],FUNCTIONS:[24,5,1,""],FunctionJoyType:[24,2,1,""],IntJoyType:[24,2,1,""],KleeneStar:[24,2,1,""],SymbolJoyType:[24,2,1,""],compose:[24,1,1,""],defs:[24,1,1,""],infer:[24,1,1,""],meta_compose:[24,1,1,""]},"joy.utils.polytypes.KleeneStar":{kind:[24,6,1,""]},"joy.utils.pretty_print":{TracePrinter:[22,2,1,""]},"joy.utils.pretty_print.TracePrinter":{go:[22,7,1,""],viewer:[22,7,1,""]},"joy.utils.stack":{concat:[23,1,1,""],expression_to_string:[23,1,1,""],iter_stack:[23,1,1,""],list_to_stack:[23,1,1,""],pick:[23,1,1,""],stack_to_string:[23,1,1,""]},"joy.utils.types":{AnyJoyType:[24,2,1,""],BooleanJoyType:[24,2,1,""],FloatJoyType:[24,2,1,""],IntJoyType:[24,2,1,""],JoyTypeError:[24,4,1,""],NumberJoyType:[24,2,1,""],StackJoyType:[24,2,1,""],compilable:[24,1,1,""],compile_:[24,1,1,""],compose:[24,1,1,""],defs:[24,1,1,""],delabel:[24,1,1,""],doc_from_stack_effect:[24,1,1,""],reify:[24,1,1,""],relabel:[24,1,1,""],unify:[24,1,1,""]},"joy.utils.types.BooleanJoyType":{accept:[24,6,1,""]},"joy.utils.types.FloatJoyType":{accept:[24,6,1,""]},"joy.utils.types.IntJoyType":{accept:[24,6,1,""]},"joy.utils.types.StackJoyType":{accept:[24,6,1,""]},joy:{joy:[1,0,0,"-"],library:[3,0,0,"-"],parser:[21,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"],"2":["py","class","Python class"],"3":["py","classmethod","Python class method"],"4":["py","exception","Python exception"],"5":["py","data","Python data"],"6":["py","attribute","Python attribute"],"7":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:function","2":"py:class","3":"py:classmethod","4":"py:exception","5":"py:data","6":"py:attribute","7":"py:method"},terms:{"05s":5,"0b11100111011011":6,"23rd":18,"4b4cb6ff86e5":[],"58a8e44e9cba":[],"5bkei":11,"5eb7ac5ad2c2":[],"7fde90b4e88f":[],"\u03b4":5,"\u03b5":9,"abstract":[8,11],"boolean":[2,3,8,11,15],"break":[5,8,18],"byte":[5,6],"case":[2,3,13,15,16,18,23],"char":5,"class":[3,5,8,18,21,22,23,24],"default":[3,7,11,23],"export":[3,21],"final":[2,11,13],"float":[3,8,18,19,21,24],"function":[0,1,4,6,7,10,12,17,19,20,21,22,23,24],"g\u00e9rard":19,"goto":5,"import":[2,5,6,7,9,11,12,13,14,16,17,18,19],"int":[5,7,8,13,18,19,21,23,24],"long":[11,18,20],"new":[2,3,5,7,8,10,13,14,18,24],"p\u00f6ial":20,"p\u00f6ial06typingtool":18,"public":10,"return":[1,3,5,6,8,11,13,14,15,16,18,21,22,23,24],"static":[2,10],"super":18,"switch":[2,18],"throw":[11,24],"true":[2,3,5,6,13,15,18,24],"try":[7,9,12,13,16,17,18],"void":[0,3],"while":[3,5,8,11,18,21,23],AND:[5,18],Adding:[8,14,20],And:[5,6,7,9,11,13,15,18,19,23],But:[0,4,6,7,8,11,14,18],CPS:8,FNs:[],For:[2,3,11,13,14,18,20,23,24],Has:[],Its:3,NOT:5,Not:18,One:[2,8,15,18,20],REs:5,TOS:[2,3],That:[6,11],The:[0,1,2,3,4,5,7,9,10,12,19,20,21,23,24],Then:[2,3,11,12,13,18],There:[5,12,13,15,16,18,23],These:[15,18,20,23,24],Use:[3,9,13],Used:15,Using:[0,9,11,20],With:[9,13,18,20,24],_1000:18,__add__:18,__builtin__:24,__call__:5,__class__:18,__eq__:18,__ge__:18,__hash__:18,__init__:[5,18],__main__:18,__name__:[],__radd__:18,__repr__:18,__str__:22,_and:5,_compaction_rul:5,_con:5,_dictionari:18,_ge:18,_infer:18,_interpret:18,_log:18,_log_it:18,_names_for:18,_or:5,_templat:5,_to_str:18,_tree_add_:11,_tree_add_e:[11,24],_tree_add_p:11,_tree_add_r:11,_tree_add_t:11,_tree_delete_:11,_tree_delete_clear_stuff:[11,24],_tree_delete_del:11,_tree_delete_r0:[11,24],_tree_delete_r1:11,_tree_delete_rightmost:11,_tree_delete_w:11,_tree_get_:[11,24],_tree_get_p:11,_tree_get_r:11,_tree_get_t:11,_tree_iter_order_curr:11,_tree_iter_order_left:11,_tree_iter_order_r:11,_tree_iter_order_right:11,_tree_t:11,_treestep_0:16,_treestep_1:16,_uniqu:18,_within_b:9,_within_p:9,_within_r:9,a10001:18,a10002:18,a10003:18,a10004:18,a1001:[],abbrevi:16,abil:[],abl:[5,15,18,24],about:[0,8,11,15,18,19,23,24],abov:[0,5,6,9,11,13,15,18],abs:9,absolut:8,accept:[1,2,3,5,6,7,8,11,12,14,15,16,18,19,24],accord:5,accordingli:[11,15],accumul:6,act:[5,24],action:[8,14,18,19],actual:[2,6,8,11,15,18],adapt:20,add:[3,5,6,7,8,14,18,22,24],add_alias:3,add_def:3,add_definit:[3,11,16],added:[4,11],adding:[10,18],addit:[0,2,3,6,8,13,14,16],address:20,adjust:[11,24],advantag:18,affect:15,after:[5,6,7,8,13,15,18,24],afterward:8,again:[2,3,6,8,11,13,18,24],against:[18,24],aggreg:19,ahead:18,aka:[5,8,19,24],albrecht:0,algorithm:[5,8,18],alia:[3,24],alias:[3,8],align:[8,22],all:[3,5,6,7,8,11,13,14,15,16,18,22,24],alloc:18,allow:[10,11,15],almost:11,along:[5,8,13,18,24],alphabet:3,alreadi:[5,9,14,18,19],also:[0,5,6,8,11,15,18,23,24],alter:[5,18],altern:[4,18,24],although:[4,11],altogeth:7,alwai:[6,10,13,15],amaz:[],amend:15,among:18,amort:11,analysi:[4,20],anamorph:[8,20],ani:[4,5,6,8,10,11,15,18,19,21,24],annual:8,anonym:11,anoth:[5,11,15,18,23,24],anyhow:[15,18],anyjoytyp:[18,24],anymor:18,anystarjoytyp:18,anyth:[2,3,5,8,18,24],apart:18,api:10,app1:3,app2:[3,8,12,13,14,15],app3:[3,15],app:8,appear:[2,4,5,6,11,24],append:18,appendix:20,appli:[2,3,6,7,11,13,18,24],applic:7,approach:6,appropri:5,approxim:20,archiv:0,aren:19,arg:[2,3],argument:[2,3,8,9,12,13,20,22,23],arithmet:2,ariti:[2,15],around:[6,18,23],arrang:16,arriv:[7,16],arrow:5,articl:[0,4,7,13],ascii:5,ascii_lowercas:5,ask:[4,7,18],aspect:0,assembl:5,assert:[5,18],assign:[15,23],associ:11,assum:9,astar:[],asterisk:16,asterix:[18,24],asyncron:15,attack:8,attempt:[0,1,18],attribut:3,attributeerror:18,author:18,auto:[0,18,24],automat:[4,15,18,24],auxiliari:[5,16],avail:[0,18,24],averag:[8,14],avoid:[11,24],awai:[11,18],awar:2,awkward:[11,13,18],azur:20,back:[11,18],backport:[],backtrack:24,backward:[10,11,12,16],bad:18,bag:8,banana:13,bar:15,barb:13,base:[0,2,3,10,13,16,18],basic:[1,2,3,8,11],basicconfig:[17,18],becaas:5,becaus:[2,3,5,8,11,15,16,18,19,23],becom:[11,16,23],becuas:18,been:[5,9,10,11,18,19],befor:[5,7,8,11],begin:[11,16],behavior:[10,16,24],behaviour:[0,1,18,24],behind:15,being:[0,15,24],below:[2,3,5,6,7,11,18,19],bespok:8,best:0,better:[6,11,13,18],between:[0,6,24],beyond:7,biannual:8,bin:5,binari:[0,7,8,20],binary_search_tre:11,binarybuiltinwrapp:3,bind:8,bingo:19,bit:[5,6,7,11,18],bliss:[0,20],block:6,bodi:[2,5,8,11,15],body_text:3,booktitl:18,bool:[13,18,24],booleanjoytyp:24,borrow:[8,18],both:[2,6,8,12,13,14,15,18,23],bottom:7,bounce_to:5,bracket:[8,18,21],branch:[3,5,6,7,13,18,24],branch_fals:18,branch_tru:18,breakpoint:8,bring:[6,8,18],broken:[],bruijn:18,brutal:15,brzozowski:18,brzozowskian:5,btree:[11,16],buck:11,bug:[0,8],build:[7,8,12,13,19,23],built:[12,18],bundl:[2,3,13],burgeon:8,calculu:4,call:[2,5,8,10,11,13,15,18,22,23],caller:[11,18],can:[0,2,3,4,5,6,7,8,9,10,12,13,14,15,16,18,19,20,23,24],cancel:15,cannot:[17,18],captur:[8,24],card:8,care:[6,23],carefulli:19,carri:[7,11,24],cartesian:4,catamorph:20,categor:[0,20],categori:[4,15],ccc:4,ccon:[3,11,17,18,24],cell:[13,18],certain:[8,23],certainli:11,chain:[3,15],chang:[2,10,11,18,19],charact:[5,19],chat:8,chatter:[0,18],check:[7,9,18],checker:[],child:16,choic:[3,13],choos:10,chop:12,chose:5,cinf:11,circl:5,circuit:4,cite_not:11,classmethod:3,claus:[3,18],clean:18,clear:[3,6,8,24],clear_stuff:11,cleav:[8,12,14],close:[0,1,4],clunki:[6,18],clv:15,cmp:[3,16,20],cmp_:3,code:[0,1,4,5,12,13,15,18,20,24],codireco:[7,9],collaps:13,collect:[4,5,7,8,18],collis:24,combin:[0,3,6,7,8,9,12,15,16,19,20,24],combinatorjoytyp:[18,24],combo:[],come:[8,11,18],command:[8,11,18],comment:[15,24],common:[2,6,15],compar:[3,4,5,18],comparison:[0,11],compat:15,compel:4,compil:[2,4,5,8,11,14,15,20,24],compile_:24,complement:5,complet:4,complex:[3,15,18,19,24],complic:18,compos:[5,24],composit:[18,24],compostit:18,compound:11,comput:[2,4,5,6,8,12,15,18,24],con:[3,5,6,7,8,9,11,12,13,15,16,19,23,24],conal:[4,15],concat:[3,7,8,15,16,18,23],concat_:[3,24],concaten:[0,5],concatin:[0,3,5,23],concern:15,conclus:20,concurr:2,cond:[3,11],condit:[3,8],confer:18,conflict:[11,18,24],conjectur:[],consecut:20,consid:[5,6,7,11,13,16,18,19],consist:[2,7,8,15,16],constant:11,constitu:13,constraint:[],construct:[15,18],consum:[15,18],contain:[0,2,3,5,7,8,13,18],content:18,context:2,conting:11,continu:[0,5,13,18,19],control:8,conveni:[4,15,18],convent:15,convers:18,convert:[13,14,16,18,21,23],cool:11,copi:[2,3,6,11,13,15,16,17,20],copyright:8,correct:[],correspond:[4,15],could:[2,4,5,6,8,10,11,15,18,19],couldn:15,count:[3,18],counter:[6,18],coupl:16,cours:[6,11,18],cover:18,cpu:15,crack:11,crap:[],crash:11,creat:[0,2,3,6,9,11,15,18],creativ:18,crude:[11,18,21,24],cruft:18,crunchi:[],curent:24,currect:[],current:[2,3,8,13,15,16,18,19,22,24],curri:5,custom:10,cycl:[6,7],cython:8,d010101:5,d0101:5,d01:5,d10:5,d_compact:5,dai:8,data:[2,3,5,13],datastructur:[0,2,13,18,20,21,23],datatyp:23,ddee30dbb1a6:[],ddididi:19,deal:[0,5,11,15],dealt:18,debugg:18,decid:11,declar:18,decor:3,decoupl:13,decrement:3,deduc:[6,18],deeper:0,deepli:4,def:[3,5,8,13,14,18,23,24],defaultdict:[5,18],defi:3,defin:[2,3,4,5,6,7,8,9,10,12,13,14,15,18,19,20],definit:[2,3,6,7,8,10,11,13,16,18,20,24],definitionwrapp:[3,11,13,16],defint:15,del:17,delabel:24,deleg:8,delet:20,deliber:18,demo:18,demonstr:4,depend:[3,11,13,15],deposit:16,depth:[18,24],dequot:13,der:11,deriv:[2,3,6,8,9,11,18,20],derv:5,describ:[3,4,5,11,13,15,16,18,21,24],descript:[6,8],descriptor:18,design:[2,3,11,15,20],desir:[8,16],destin:5,destruct:11,detail:[8,11,18],detect:[5,7,11,13,18],determin:20,develop:[0,7,8,18,20],diagram:6,dialect:1,dict:[1,3,5,18,24],dictionari:[0,1,3,8,18,20],did:18,differ:[0,4,6,9,11,12,13,15,23],differenti:4,difficult:18,difficulti:15,dig:[11,19],digit:6,digraph:5,dinfrirst:[8,18,24],dip:[3,6,7,8,9,11,12,13,14,15,16,18,20,24],dip_a:[],dip_t:[],dipd:[3,7,8,11,12,13,15,18,19,24],dipdd:[3,11,24],direco:20,direct:8,directli:[6,15,16,18,23],disappear:[2,5,18,24],discard:[3,7,9,11,13],disciplin:11,disenstacken:8,disk:8,displac:2,displai:18,distiguish:18,distribut:15,ditch:11,div:[3,8,18,24],dive:16,divis:11,divmod:[3,24],divmod_:[3,18],doc:[2,3,8,18,24],doc_from_stack_effect:[17,24],docstr:[18,24],document:[18,20,21,23],doe:[0,1,4,5,7,8,14,15,18,20,22,24],doesn:[6,10,11,15,16,18,23],doing:[4,6,8,15,18,19],domain:[4,18],don:[5,6,8,11,18,24],done:[2,6,8,10,18],dooooc:18,door:8,dot:[5,22],doubl:[5,6,8,18],doublecircl:5,down:[2,5,9,13,19,24],down_to_zero:8,dozen:8,draft:[4,10],dream:8,drive:[7,9],driven:6,driver:[5,7],drop:[3,11],dudipd:8,due:18,dup:[3,6,7,8,9,11,12,13,15,17,19,23,24],dupd:[3,18,24],dupdd:[3,24],dupdip:[3,6,11,12,13,24],duplic:[3,11,13],durat:2,dure:[2,13],each:[2,3,4,5,6,8,13,14,15,16,18,22,24],easi:[0,11,16,18,19],easier:[3,11,15],easili:4,eat:5,edit:20,effect:[2,3,5,8,15,19,20,24],effici:[7,14,19],efg:18,either:[1,2,3,5,11,13,18],elabor:18,eleg:[0,5,8,11,15,20],element:2,elif:18,elimin:[5,18],elliott:[4,15],els:[2,3,5,13,15,18],else_:18,embed:[4,11,19],emit:18,empti:[3,5,8,16,18,23,24],encapsul:8,enclos:8,encod:7,encount:18,end:[5,6,11,13,16,18,23],endless:7,enforc:[2,8],engend:8,enorm:[],enough:[5,8,13,22,24],enstacken:[7,8,18],enter:8,enter_guard:18,entir:23,entri:[3,19,22],enumer:18,ephasi:[],epsilon:9,equal:[6,16,23],equat:[8,9],equival:15,ergo:[5,11],err:[11,17],error:[8,18,21],essai:0,establish:18,etc:[3,16,18,19,21],euler:20,euro:18,eval:[0,18],evalu:[1,2,3,8,9,11,12,13,14,15,16,18],event:15,eventu:[15,18],ever:18,everi:[7,15],everybodi:15,everyth:[3,5,11,12,15,18],evolv:10,examin:13,exampl:[0,3,5,6,18,20,21,23,24],exce:7,except:[5,8,11,17,18,21,24],execut:[0,1,2,3,8,13,14,15,16,18,19,23,24],exend:18,exercis:[5,11],exist:[4,11,18],expand:11,expect:[2,3,15,16,18,23,24],experi:[8,16],explain:18,explan:8,explor:[8,18],express:[0,1,2,3,4,11,13,14,18,19,22,23],expression_to_str:[18,23],extend:18,extra:[6,7],extract:[11,12,20],extrem:8,extrememli:8,f1001:[],f_g:18,f_in:18,f_out:18,f_python:18,facet:0,facil:8,fact:21,factor:[2,6,8,11,18],factori:20,fail:[2,3,11,21],fairli:18,fake:5,fale:[],fall:18,fals:[2,3,5,6,13,15,18,24],falsei:18,far:[9,11,13,18,24],fascin:0,favorit:15,fear:[11,18],few:[6,8,9,12,15,18],fewer:[3,8],fg_in:18,fg_out:18,fib:7,fib_gen:7,fibonacci:20,figur:[2,3,11,13,18],filter:11,fin:6,find:[2,3,5,6,7,15,16,18,20],finder:9,fine:[0,5,6,11,18,24],finite_state_machin:5,first:[3,5,7,8,9,11,12,13,14,16,19,20,24],first_two:[3,11,24],fit:[6,8],five:[6,8,20],fix:[2,3,5,13,18,24],fixm:[5,18],flag:[15,18],flatten:[8,16,18],flesh:5,flexibl:20,floatjoytyp:[18,24],floatstarjoytyp:18,floor:3,floordiv:[6,24],flow:8,follow:[0,2,3,5,8,10,13,15,16,18,19,24],foo:[8,10,11,15,18],foo_ii:10,fork:15,form:[2,3,4,5,6,7,13,16,18,23],forman:8,format:[17,18,20,22],formula:[0,6,20],forth:[8,18],forum:0,forward:18,found:8,foundat:[],four:[2,3,6,7,8,11,20],fourteen:6,fourth:[2,3,11,13,24],fractal:8,fraction0:8,fraction:[2,8],frame:13,framework:8,free:[4,8,11],freeli:2,from:[0,1,2,3,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,23],from_:5,from_iter:[],front:[2,3,13],frozenset:5,fulin:15,full:6,fulli:[],fun:[5,20],func:18,functionjoytyp:[18,24],functionwrapp:3,functool:5,funtion:11,further:[9,18,20],futur:15,g_in:18,g_out:18,garbag:8,gari:11,gcd:8,gener:[0,2,4,13,15,18,20,23,24],generated_librari:3,genrec:[3,8,11,13,15,16,18],geometr:6,get:[2,4,5,6,7,8,12,13,18,20],getch:5,getitem:3,getrecursionlimit:23,getsourc:8,ghc:4,give:[4,6,11,13,16,18,23],given:[2,3,6,7,9,11,13,15,18,19,20],global:[17,18],glue:8,goe:24,going:[5,11,12,15,16,18,19],good:[6,11,18],grab:18,grammar:21,grand:8,graph:15,graphic:5,graphviz:5,great:[0,8,18,20],greater:23,grind:18,grok:[],group:0,grow:5,gsra:9,guard:[11,18,24],had:[5,6,19],haiku:8,half:[6,18,19],hallmark:15,hand:[5,8,14,18,20],handi:[9,18],handl:[11,18,23,24],happen:[8,18],happi:5,hard:[5,18,19],hardwar:4,has:[0,2,5,7,8,9,10,11,13,15,18,19,23],hasattr:18,hash:18,haskel:4,have:[2,3,5,6,7,8,9,10,13,14,15,18,19,20,23,24],haven:[],head:23,heh:18,help:[8,11,13,18],help_:3,helper:[3,5],herd:8,here:[5,6,7,11,16,18,19,24],hide:11,hierarchi:18,higher:[5,8,11,18],highli:8,hij:5,histori:[18,22,24],hit:5,hmm:[5,11],hoist:3,hold:[6,18],hood:11,hope:[0,6,8,20],hopefulli:13,host:20,how:[0,4,5,9,11,13,18,19,20],howev:[13,14,15,18],html:[2,3,7,12,13,20],http:11,huet:19,huge:11,hugh:[9,16],human:8,hybrid:24,hylomorph:20,hypothet:2,id_:3,idea:[4,6,8,18],ident:[3,5,13,18,24],if_not_empti:11,ift:[3,11,13,16,18,24],ignor:[3,11,18],iii:20,illustr:[5,13],imagin:[5,15,19],imap:18,imit:[5,16],immedi:[5,13],immut:[5,8,11],imper:13,implement:[0,1,2,3,4,8,10,11,13,14,15,20,24],implementaion:15,impli:[],implicit:8,improv:18,includ:[4,11,15,16,18,24],inclus:6,incom:23,incompat:10,incorpor:12,increas:6,increment:[3,4,6,10,15],index:[0,8,18,23],indexerror:23,indic:[15,16,18,24],ineffici:18,infer:[0,17],inferenc:24,info:[17,18],inform:[3,5,18,24],infra:[3,7,8,11,12,14,15,16,18,20,24],infrastructur:3,initi:[2,3,5,8,9,11,18],inlin:11,inner:18,inproceed:18,input:[1,9,15,17,18,24],input_:5,inscrib:3,insert:18,insight:13,inspect:8,inspect_stack:18,instal:0,instanc:[18,24],instanti:[4,22],instead:[5,6,7,11,13,18,19,23,24],instruct:5,integ:[2,3,8,13,16,18],integr:3,intend:[0,8],interact:[8,20],interest:[0,6,11,18,20],interfer:15,interlud:20,intermedi:13,intern:[0,18,22,23],interpret:[0,4,10,14,21,22,24],interrupt:8,intersect:5,interspers:15,interv:[4,6],intjoytyp:[18,24],introduc:[10,24],introduct:0,intstarjoytyp:18,intuit:18,invalid:24,invari:3,invent:18,involv:18,ipf:8,ipython:[],isinst:[5,18],isn:[5,11,19],issubclass:18,item:[2,3,8,11,13,15,16,18,20,23],iter:[1,3,5,8,13,15,16,18,20,23],iter_stack:[14,23],iteritem:[5,18],itertool:[5,18],its:[0,2,3,4,6,8,11,13,15,16,18,23],itself:[0,2,8,11,15,18,24],j05cmp:[2,3,13],jaanu:18,jmp:5,job:[15,20],john:[9,16],joi:[2,4,10,11,12,14,15,17],join:[5,18],joypi:[8,19],joytypeerror:[17,24],jump:5,jump_from:5,june:[],junk:18,jupyt:20,just:[0,2,3,5,7,8,10,11,13,15,16,18,19],juxtaposit:15,kav:[],keep:[5,11,12,15,18,19],kei:[5,16,20],kevin:0,key_n:11,keyerror:[5,11,18],kind:[2,4,8,11,13,16,18,24],kinda:18,kjs:[],kleen:[16,18,24],kleenestar:[18,24],kleffner:18,know:[6,11,18],knowledg:18,known:[4,15],kstar:5,l2s:[],l_kei:11,l_left:11,l_right:11,l_valu:11,label:[5,18],lambda:[4,5,18],languag:[4,5,8,10,11,14,18],larg:[5,18],larger:23,largest:3,last:[6,11,13,18],lastli:7,later:[5,8,16,18],law:2,lazi:18,lazili:9,lcm:6,lead:[5,8,18,24],leaf:11,lean:8,learn:0,least:[2,6,13,18,23],least_fract:8,leav:[6,15],left:[5,8,12,13,15,16,18,19,22,23,24],leftov:13,legend:5,len:[5,18],length:[3,6,23],lens:13,less:[6,7,8,13,18,23],let:[7,9,11,12,13,16,18,19],letter:18,level:[4,5,11,17,18],librari:[0,5,14],like:[2,3,5,6,8,15,16,18,20,21,24],limit:[18,24],line:[3,8,11,12,18,22,24],linear:23,link:[0,5,18],linux:0,list:[0,3,5,6,8,9,11,13,15,16,18,19,22,24],list_to_stack:[18,23],lit:[],liter:[1,11,16,18,19,21],literatur:18,littl:[5,7,11,15,18,20],live:20,lkei:16,load:[6,8],local:18,locat:2,locu:22,lof:[],log:[17,18],log_2:11,logic:[0,6,20],longer:[11,18],look:[5,7,8,9,11,12,15,18],lookup:8,loop:[0,1,3,5,6,18,24],lose:18,lot:[5,8,11,18,19],love:6,low:[4,5],lower:6,lowercas:[5,18],lowest:11,lshift:24,machin:0,machineri:[11,18,24],macro:8,made:[0,8,15,18,19],magic:18,mai:[2,13,15],mail:0,main:[0,3,8,12,15,18,19],mainloop:10,maintain:19,major:10,make:[2,3,4,6,8,11,13,14,15,16,18,19,20],make_gener:9,make_graph:5,manfr:[0,2,3,4,13],mani:[0,5,8,18],manipul:18,manner:12,map:[1,3,5,6,8,10,13,16,18],map_:3,marker:8,mask:[6,7],match:[0,1,18],materi:0,math:[0,8,9,11,12,18],mathemat:8,matter:[6,9,11,16],max_:3,maximum:3,mayb:[11,18],mean:[4,6,8,9,11,13,16,18,23,24],meant:[8,11,13,16],mem:5,member:[2,3,13],memo:5,mental:8,mention:2,mercuri:0,mess:18,messag:[17,18],meta:[8,11,14],meta_compos:[18,24],metal:[],method:[0,3,8,18,20,22],midpoint:6,might:[4,5,7,11,18],mike:11,million:7,min_:3,mind:18,minimum:3,minor:11,minu:3,mirror:0,miscellan:0,mismatch:18,mix:[8,18],mod:3,mode:18,model:[4,8],modern:0,modif:[7,18],modifi:[8,11,19],modul:[0,1,3,8,18,21],modulu:[8,24],moment:18,month:8,more:[0,3,4,5,6,7,8,9,13,14,15,16,18,21,23,24],most:[5,18,24],mostli:0,motiv:[],move:[5,11],movement:2,much:[5,6,7,11,13,18],muck:11,mul:[8,12,17,19,22,24],multi:3,multipl:[20,24],must:[2,3,6,10,13,15,16,18],myself:18,n10001:18,n10002:18,n10003:18,n1001:18,n1002:18,n1003:18,name:[1,3,5,8,10,11,13,18,19,20,21,23,24],narr:18,natur:[5,6,7,11,18],navig:19,nearli:18,neat:11,neato:18,necessarili:18,need:[2,3,6,7,9,10,11,13,15,18],neg:[3,12,24],neither:[15,18],ness:5,nest:[3,8,11,19],network:8,never:[5,10,13],new_def:18,new_f:18,new_fo:18,new_kei:11,new_valu:11,newton:[0,20],next:[5,6,15,16,18,24],nice:[0,5,13,23],niether:2,node:[5,16,20],node_kei:11,node_valu:11,non:[5,16,18,24],none:[1,3,18,24],nope:16,nor:5,normal:15,notat:[8,11],note:[2,5,6,9,11,13,15,18,23],notebook:[6,7,8,18,19,20],notebook_preambl:[2,6,7,9,11,12,13,14,16,18,19],noth:[2,11,15],notic:6,now:[5,6,7,8,13,14,16,18,20],nth:[3,23],nullari:[8,11,15,18,24],number:[1,2,3,6,7,9,15,23,24],numberjoytyp:[18,24],numberstarjoytyp:18,numer:18,object:[5,18,21],observ:6,obviou:7,obvious:18,occur:11,odd:[6,7],off:[2,3,6,7,12,18,19],often:[5,15],okai:[],old:[2,14],old_k:11,old_kei:11,old_valu:11,omg:5,omit:[13,18],onc:[3,5,10,11],one:[2,3,5,6,7,11,13,15,16,18,22,23,24],ones:[5,7,18],onli:[2,3,5,6,11,13,15,18,19,23,24],onto:[1,2,3,8,13,23],open:[8,18],oper:[3,5,8,11,13,23],oppos:18,optim:11,option:[1,8,11,18,23],orchestr:15,order:[0,2,3,8,13,15,17,18,20,23],org:[0,11],origin:[0,1,2,3,11,19],other:[0,2,3,4,5,8,11,13,16,18,23,24],otherwis:[3,5,6,7,11,16,18,24],our:[5,6,7,8,9,13,16,18],out:[2,3,4,6,7,8,9,11,12,13,15,18,19],outcom:16,outlin:5,output:[5,9,13,15,17,18,24],outsid:4,over:[3,4,6,7,8,9,11,12,15,16,18,20,24],overhaul:18,overview:18,own:[11,18],pace:[],pack:23,packag:[0,8],page:[0,11,18,23],pair:[2,3,6,7,11,18],palidrom:6,palindrom:6,pam:8,paper:[4,8,13,15,19],paradigm:20,parallel:2,paramet:[1,2,3,13,14,21,22,23],parameter:20,paramorph:13,parenthes:[11,23],pariti:7,pars:[0,3,5,8],parse_definit:3,parseerror:21,parser:[0,17,18],part:[2,3,9,13,16,20],partial:[5,18],particular:19,pass:[0,5,11,18,22,24],patch:5,path:[5,18,20],pattern:[5,6,15,16,20],pe1:[6,7],pe2:7,pearl:19,pend:[3,8,13,18,19,22],peopl:20,per:[8,16],perfectli:15,perform:[5,15,18],perhap:7,period:8,permit:[15,18,23],permut:18,persist:11,phase:2,phi:5,pick:[6,7,15,23],pickl:8,pictur:11,piec:13,pip:0,place:[3,6,8,18],plai:0,plu:3,plug:[7,13,16],point:[4,5,8,11,13,15],pointless:2,poly_typ:[],polytyp:[0,17,18],pool:15,pop:[3,5,6,7,8,11,13,14,16,17,23,24],popd:[3,8,9,11,14,15,18,24],popdd:[3,7,12,18,24],popop:[3,6,7,8,9,11,16,18,24],popopd:[3,24],popopdd:[3,24],posit:[3,6,8,13],possibilit:11,possibl:[11,16,18,20],post:8,poswrd:18,potenti:15,pow:24,power:[8,18],pprint:5,pragmat:6,preambl:9,preceed:15,precis:[0,1],pred:[3,18,24],predic:[2,3,5,7,13,15],prefix:[18,22],preliminari:5,present:18,preserv:[4,16],pretti:[9,11,12,15,16,18,22,23],pretty_print:0,previou:[8,15],primari:[],prime:9,primit:[2,3,18,20],primrec:[3,7,8,9,13],principl:[],print:[0,1,2,3,5,17,18,22,23,24],probabl:[7,8,11,18],problem:[8,18,20],proc_curr:11,proc_left:11,proc_right:11,proce:[6,24],process:[5,8,16,18,22],produc:[6,11,13,16,18],product:[5,7,8,17,18,24],program:[0,2,3,7,8,9,11,13,15,18,19,24],programm:[15,18],progress:15,project:20,prolog:18,promis:15,prompt:8,proper:[2,3,13,15,24],properti:0,provabl:[],proven:[],provid:[0,3,4,8,15,18,24],pun:[0,8],punctuat:18,pure:[0,5],puriti:8,purpos:8,push:[2,3,8,13,19,23],pushback:8,put:[1,2,7,8,15,18,20,23],pypi:0,python:[0,2,3,5,11,13,15,19,20,21,23,24],quadrat:[0,20],queri:[11,16],query_kei:16,queu:13,quit:[0,1,16],quot:[0,3,7,8,11,12,13,15,16,18,19,22,24],quotat:[2,3,13],quotient:3,r_kei:11,r_left:11,r_right:11,r_valu:11,rais:[5,11,18,21,23],rang:[5,8,18],range_revers:13,range_to_zero:8,ranger:13,ranger_revers:13,rankdir:5,raphson:9,rather:[6,8,13,16],ratio:8,reach:[5,6,7,13],read:[0,1,6,7,11,18,19],readabl:14,reader:[5,11],readi:18,real:11,realiz:[4,11],rearrang:[2,11,18],reason:[6,8,15,18],rebuild:[16,19],rec1:[2,3,13],rec2:[2,3,13],recent:[],recogn:21,recombin:15,record:[8,22],recur:[13,18],recurs:[0,2,3,5,7,8,9,15,18,20,23],recus:8,recycl:[],redefin:20,redistribut:[3,8],redo:5,reduc:[2,18],redund:23,refactor:[8,10],refer:[0,2],referenti:15,reflect:15,regard:15,regist:2,regular:[18,21],reifi:[17,24],reimplement:[15,20],relabel:24,relat:[5,18],releas:10,remain:[2,8,10,18],remaind:[3,9],rememb:5,remind:18,remov:[3,11,18,23],render:20,repeat:6,repeatedli:6,repetit:5,repl:[0,1],replac:[0,2,3,7,12,13,15,16,18,19,20,23],repositori:0,repr:[5,18],repres:[2,8,11,15,21,22,24],represent:[23,24],reprod:7,repurpos:18,requir:[15,18,23],res:18,research:18,resembl:8,resolut:15,resourc:15,respect:[5,6,15],rest:[3,6,7,8,11,13,19,20,23,24],rest_two:11,restat:[],restor:2,restrict:[],result:[1,2,3,5,6,11,12,13,15,16,18,19],resum:8,retain:[],retir:2,retri:8,reus:[11,18],revers:[3,6,7,13,18,19,23],revisit:18,rewrit:[3,8,18],rewritten:8,rich:[],rid:11,right:[7,8,12,16,18,20,22,23,24],rightest:11,rightmost:6,rigor:15,risk:18,rkei:16,rob:18,robot:[],roll:[3,9,11,16],roll_dn:18,roll_down:[],roll_up:[],rolldown:[3,17,18,24],rollup:[3,18,24],root:[3,9,12],round:18,row:5,rrest:[3,17,18,24],rshift:24,rule:[15,20],run:[0,1,3,6,8,9,11,12,13,15,16,18,19],runtim:15,runtimeerror:23,s1000:[],s1002:[],s10:[],s23:[],sai:[5,7,11,12,16,18],same:[2,4,6,11,15,18,23],sandwich:[2,3,13],save:[2,5,6,8],scan:3,scanner:[8,21],scenario:19,scope:[7,11],search:[0,11],sec:[18,24],second:[3,8,11,13,16,23,24],section:13,see:[0,5,7,8,9,10,12,13,14,18,19,22],seem:[0,6,8,16,18,24],seen:[18,19,24],select:3,self:[5,15,18],semant:[2,3,8,10,11,15,18],semi:8,send:8,sens:[0,2,6,18,19],separ:[8,15,18],seq:18,sequenc:[0,1,2,3,6,8,11,13,14,19,20,21,24],sequence_to_stack:18,seri:[6,7,11,19],ses:18,set:[2,3,5,13,18,20],seven:[6,7],sever:[0,4,8,13],shape:[5,15],share:[3,8],shelf:2,shew:5,shift:[6,7],shorter:20,shorthand:11,should:[2,3,5,6,11,13,15,18],shouldn:8,show:[4,15,18,19],shunt:[3,19],side:[5,11,17,18,24],signatur:24,signifi:[8,11],similar:[11,16,18],simon:8,simpl:[5,8,13,23,24],simplefunctionwrapp:[3,14,18],simpler:16,simplest:[18,20],simpli:4,simplifi:[6,11,19],sinc:[2,6,11,18],singl:[3,7,8,14,15,18,21,24],singleton:5,situ:11,situat:11,six:[6,7,8],sixti:[6,7],size:[5,8,20],skeptic:8,skip:18,slight:9,slightli:[11,13,18],smallest:3,smart:11,softwar:8,solei:2,solut:[6,7],solvabl:8,some:[2,3,5,7,8,11,13,15,16,18,20,23,24],somehow:[11,18],someth:[2,10,11,18],sometim:11,somewher:[11,20],sort:[3,5,11,15,18],sort_:3,sorta:[],sourc:[0,1,3,18,20,21,22,23,24],space:[6,22],span:6,spawn:18,special:[7,11,20],specif:[0,4],specifi:[11,15,24],speed:14,spell:[5,16],sphinx:[20,23,24],spirit:[0,1,16],split:[5,18,24],sqr:[8,9,12,19],sqrt:[3,9,18,24],squar:[3,9,18,21],squishi:[],stack:[0,1,3,6,7,9,11,12,13,14,15,16,17,19,20,21,22,24],stack_concat:[],stack_effect:18,stack_effect_com:18,stack_to_str:[17,23],stacki:18,stackjoytyp:[18,24],stackstarjoytyp:18,stage:16,stai:[0,1],stand:[4,5,24],standard:[8,11],star:[16,18,24],stare:11,start:[5,6,7,8,9,11,13,16,18,24],state:8,state_nam:5,statement:[3,5],stdout:[17,18],step:[3,6,8,11,14,18,19,20],still:[5,11,18],stop:11,stopiter:5,storag:[6,11],store:[6,13,18],stori:13,str:[1,5,18,21,22,23],straightforward:[1,5,7,9,18,20],stream:[6,17,18],stretch:11,string:[1,2,3,8,18,19,21,22,23,24],stringi:5,strip:[],structur:[8,15,16,18,19,20,23],stuck:5,studi:5,stuff:[11,18],stuncon:[3,24],stununcon:[3,24],style:[0,4,18],sub:[10,15,24],subclass:8,subject:[15,19],subsequ:15,subset:[18,24],substitut:[5,11,18,24],subtract:6,subtyp:20,succ:[3,18,24],succe:18,success:9,suck:18,suffic:18,suffici:11,suffix:18,suggest:[4,5,11],suitabl:[3,4,6],sum:[3,7,8,12,13,14,16,24],sum_:[3,18],summand:6,sumtre:16,suppli:[11,21],support:[8,18,22,23],sure:15,suspect:2,svg:5,swaack:[3,12,14,18,19,24],swap:[3,6,7,8,9,11,13,14,15,16,17,19,24],swarm:[],swon:[3,7,8,13,16,18,19,24],swoncat:[7,8,9,13,16],swuncon:13,sym:5,symbol:[2,3,5,15,18,19,20,21],symboljoytyp:[18,24],symmetr:[6,11],symmetri:5,syntact:8,syntax:[8,23],sys:[17,18,23],system:[8,11,15],tabl:[5,18],tag:[5,18],tail:[11,18,20,23],take:[3,5,6,8,9,11,13,15,18,23],talk:[8,11,18,23],target:19,tast:4,tbd:8,tear:13,technic:2,techniqu:[4,19],technolog:2,temporari:19,ten:6,term:[1,2,5,8,9,13,15,18,20,21,23,24],termin:[2,3,5,13],ternari:8,test:[2,3,13],text:[0,1,3,18],text_to_express:[8,17,21],textual:8,than:[0,3,5,6,7,8,9,13,15,16,18,23,24],thei:[2,5,6,7,8,11,13,15,18,19,21,23,24],them:[2,3,5,6,7,11,13,15,18,19,20,24],themselv:[15,18,24],theori:[2,3,13,15],therefor:7,thi:[0,1,2,3,4,5,6,7,8,9,12,13,15,16,18,19,20,21,22,23,24],thing:[2,7,11,13,15,18,19,21,23,24],think:[2,6,8,11,13,15,16,18],third:[3,7,8,11,24],thirti:6,those:[2,3,5,11,13,18,20,24],though:[6,15],thought:[8,15],thousand:6,thread:[2,15],three:[2,3,5,6,8,11,12,16,18,20],through:[1,6,8,16,18,19,23,24],thun:[2,3,4,10,13,15],thunder:8,thunk:15,time:[3,5,6,8,9,11,13,15,18,19],titl:18,to_check:5,to_set:11,todai:8,todo:[8,21],togeth:[7,8,15,18,20],token:21,toler:20,too:[5,13,18],tool:[8,18],tooo:18,top:[2,3,8,13,18,22,23],total:6,tower:18,trace:[0,8,12,13,19,20,23],traceback:[],traceprint:22,track:[12,18,19],tracker:0,transform:4,transit:5,translat:[4,12,18],trap:5,trash:[],travers:[0,20],treasur:0,treat:[0,2,3,13,18,20],treatment:7,tree:[0,8,20],treegrind:20,treestep:[0,20],tri:6,triangl:15,triangular_numb:13,trick:[6,18],tricki:18,trobe:0,trove:0,truediv:24,truli:[],trust:[],truthi:[3,8,15,18],tuck:[3,8,18,24],tupl:[3,5,8,18,23,24],ture:[],turn:[2,3,5,18,24],twice:[11,13],two:[2,3,6,8,9,11,12,13,15,16,17,18,19,20,23,24],type:[0,1,4,8,11,13,15,20,21,22,23],typeerror:18,typeless:18,typic:[2,3,12,13],unari:8,unarybuiltinwrapp:3,unbalanc:[11,21],unbound:24,unchang:11,uncompil:18,uncon:[3,7,8,11,13,16,19,24],under:[2,3,8,11],underli:[5,15,18],underscor:18,understand:[0,11],undistinguish:11,undocu:8,unend:[],unfinish:5,unfortun:23,unicod:18,unif:18,unifi:[17,24],union:5,uniqu:[3,5,11,18],unit:[3,8,13,15,24],univers:[0,8,15,18,24],unlik:15,unnecessari:20,unnecesssari:18,unpack:[2,3,11,23],unpair:6,unquot:[8,16],unrol:5,unstack:[3,18],unswon:[3,24],untangl:13,until:[5,7,15],unus:6,unusu:11,unwrap:5,updat:[0,17,20,24],uppercas:5,upward:15,usag:8,use:[0,2,3,4,5,6,7,8,9,10,11,12,13,14,16,19,20,23],used:[3,4,8,11,13,15,18,19,21,23,24],useful:[0,15,18],user:16,uses:[2,5,6,13],using:[7,11,12,13,16,19,24],usual:[0,2,13],util:[0,3,14,17,18],valid:18,valu:[0,2,3,6,8,9,12,13,14,15,16,18,20,23,24],value_n:11,valueerror:[5,18,23],variabl:[18,20,24],variant:11,variat:[13,15,20],varieti:[4,8],variou:0,vener:23,verbos:4,veri:[0,1,4,5,8,11,23],verifi:[],versa:[2,18],version:[0,1,2,5,7,10,16,19,20],via:8,vice:[2,18],view:[11,20],viewer:[1,8,10,22],vii:20,visibl:18,von:[0,2,3,4,13],waaaai:5,wai:[0,2,3,4,5,6,8,13,14,15,18],wait:15,want:[2,6,7,9,11,13,18],warranti:[3,8],wash:8,wast:8,web:23,websit:[0,6],welcom:8,well:[0,4,8,9,11,18,21],went:18,were:[8,18,19],what:[2,3,4,5,8,11,13,15,16,18,22],whatev:[2,3,13,16,23],when:[6,7,8,11,13,15,18,19,21,23,24],where:[2,3,5,8,11,13,18,20,23],whether:13,which:[0,1,5,6,8,9,11,13,15,16,18,19,23,24],whole:[2,3,6,13,16,18],whose:7,why:[9,15,16],wiki:11,wikipedia:[0,11,19],wildli:8,wind:8,wire:13,within:[8,11,14,20],without:[2,8,11,12,15,18],won:[11,18,23],word:[0,3,6,8,13,19],work:[0,3,5,6,7,8,9,11,12,13,15,16,19,23,24],worker:15,worri:15,worth:6,would:[2,6,7,8,9,11,13,15,18,19,23,24],wrap:[3,8],wrapper:18,write:[4,5,9,11,13,15,16,18,19,20,23],written:[0,1,9,11,14,18,23],wrong:2,wrote:18,xrang:18,yang:18,yeah:15,year:[8,18],yet:[11,15,18,19],yield:[2,3,13,18,23,24],yin:20,you:[0,2,3,5,6,7,8,10,11,12,13,14,15,16,18,19,22,23],your:[2,3,8,13,18],yourself:[5,8,11],zero:[3,5,11,13,15,16,18,21,23,24],zip:[5,6,18],zip_:3,zipper:[0,20],zstr:19},titles:["Thun 0.2.0 Documentation","Joy Interpreter","Functions Grouped by, er, Function with Examples","Function Reference","Categorical Programming","\u2202RE","Developing a Program in Joy","Using x to Generate Values","Thun: Joy in Python","Newton\u2019s method","No Updates","Treating Trees I: Ordered Binary Trees","Quadratic formula","Recursion Combinators","Replacing Functions in the Dictionary","The Four Fundamental Operations of Definite Action","Treating Trees II: treestep","Type Checking","The Blissful Elegance of Typing Joy","Traversing Datastructures with Zippers","Essays about Programming in Joy","Parsing Text into Joy Expressions","Tracing Joy Execution","Stack or Quote or Sequence or List\u2026","Type Inference of Joy Expressions"],titleterms:{"\u03bb":5,"\u03d5":5,"abstract":[],"case":[9,11],"function":[2,3,5,8,9,11,13,14,15,16,18],"long":14,"new":11,"p\u00f6ial":18,"try":5,"void":2,"while":[2,15],Adding:11,One:[7,11],The:[6,8,11,13,15,16,18],There:8,Using:7,With:[5,16],about:20,action:15,add:[2,11],adding:11,address:19,alphabet:5,altern:16,ana:13,analysi:6,anamorph:[2,13],app1:2,app2:2,app3:2,appendix:[11,13,18],appli:15,approxim:9,argument:18,auto:3,averag:2,base:[9,11],binari:[2,11,16],bliss:18,both:11,branch:[2,11,15],brzozowski:5,can:11,cata:13,catamorph:13,categor:4,chatter:2,check:17,child:11,choic:2,clear:2,cleav:[2,15],cmp:11,code:[8,11],combin:[2,11,13,18],comment:18,compact:5,compar:11,comparison:2,compil:[7,18],compile_:18,compos:18,comput:9,con:[2,18],concat:2,conclus:[13,18],consecut:9,continu:8,current:11,datastructur:[5,8,11,19],deal:18,defin:[11,16],definit:[12,15],delabel:18,delet:11,deriv:[5,12,13,16],design:13,determin:19,develop:6,diagram:5,dialect:0,dictionari:14,dip:[2,19],dipd:2,dipdd:2,direco:7,disenstacken:2,distinguish:18,div:2,doc_from_stack_effect:18,document:0,doe:11,down_to_zero:2,drive:5,drop:2,dup:[2,18],dupd:2,dupdip:2,effect:18,eleg:18,els:11,empti:11,enstacken:2,equal:11,essai:20,euler:[6,7],eval:8,even:7,exampl:[2,8,11,13,16,17],execut:22,explor:5,express:[5,8,21,24],extract:16,factori:13,fail:17,fibonacci:7,filter:6,find:[9,11,13],finish:15,finit:5,first:[2,6,15,18],five:7,flatten:2,flexibl:16,floordiv:2,formula:12,found:11,four:[13,15],fsm:5,fulmin:15,fun:13,fundament:15,further:6,gcd:2,gener:[3,5,6,7,9],genrec:2,get:[11,16],getitem:2,given:16,greater:11,group:2,handl:15,have:[11,16],help:2,highest:11,host:0,how:[6,7],hybrid:18,hylo:13,hylomorph:13,identifi:18,ift:[2,15],iii:18,implement:[5,18],indic:0,infer:[18,24],inferenc:18,inform:0,infra:[2,19],integ:6,interest:7,interlud:11,intern:21,interpret:[1,8,18],item:19,iter:[6,11],joi:[0,1,3,6,8,13,18,19,20,21,22,23,24],join:15,junk:[],just:6,kei:11,kind:15,languag:0,larger:5,least_fract:2,left:11,less:11,let:[5,6],letter:5,librari:[3,8,18],like:11,list:[2,23],literari:8,littl:6,logic:[2,18],loop:[2,8,15],lower:11,lshift:2,machin:5,make:[7,9],mani:6,map:[2,15],match:5,math:2,memoiz:5,method:9,min:2,miscellan:2,mod:2,modifi:18,modulu:2,more:11,most:11,mul:[2,18],multipl:[6,7,18],must:11,name:12,neg:2,newton:9,next:9,node:11,non:11,now:11,nullari:2,nulli:5,number:[13,18],one:8,onli:8,oper:15,order:[11,16],osdn:0,other:15,our:11,out:5,over:2,pack:6,pam:[2,15],para:13,paradigm:18,parallel:15,parameter:[11,16],pars:[2,21],parser:[8,21],part:18,pass:8,path:19,pattern:13,per:11,poly_typ:[],polytyp:24,pop:[2,18],popd:2,popop:2,pow:2,power:7,pred:2,predic:[6,9,11,16],pretty_print:22,primit:13,primrec:2,print:8,problem:[6,7],process:11,product:2,program:[4,6,12,16,20],progress:18,project:[0,6,7],pure:8,put:[11,12,16],python:[8,14,18],quadrat:12,quick:0,quot:[2,23],rang:[2,6,13],range_to_zero:2,read:8,recur:[9,11],recurs:[11,13,16],redefin:[11,16],refactor:[6,11],refer:3,regular:[5,8],reimplement:16,relabel:18,rem:2,remaind:2,remov:2,render:6,repl:8,replac:[11,14],repres:[5,18],represent:5,reset:7,rest:[2,18],revers:[2,5,17],right:[11,19],rightmost:11,roll:[2,18],rolldown:2,rollup:2,rshift:2,rule:[5,18],run:[2,7],second:[2,18],select:2,sequenc:[7,15,18,23],set:[9,11],shorter:14,should:8,shunt:2,simpl:18,simplest:6,size:[2,14],someth:[],sourc:11,special:[13,18],sqr:[2,18],sqrt:[2,12],stack:[2,8,18,23],start:0,state:5,step:[2,13,16],straightforward:12,stream:5,string:5,structur:11,style:8,sub:[2,11],subtyp:18,succ:2,sum:[2,6],swaack:2,swap:[2,18],swon:2,swoncat:2,symbol:[8,13],tabl:0,tail:13,take:2,term:[6,7,16],ternari:2,text:21,than:11,them:12,thi:11,third:[2,18],three:7,thun:[0,8],time:[2,7],togeth:[11,12,16],token:8,toler:9,trace:[14,22],traceprint:8,trampolin:5,travers:[11,16,19],treat:[11,16],tree:[11,16,19],treegrind:16,treestep:16,triangular:13,truediv:2,truthi:2,tuck:2,two:[5,7],type:[17,18,24],unari:2,unbound:18,uncon:[2,18],unif:17,unifi:18,unit:2,unnecessari:6,unquot:2,unstack:2,updat:[10,18],use:18,util:[22,23,24],valu:[7,11],variabl:12,variat:7,version:[6,11,14,18],view:8,vii:18,within:9,word:2,work:[17,18],write:12,xor:2,yin:18,zero:7,zip:2,zipper:19}}) \ No newline at end of file +Search.setIndex({docnames:["index","joy","lib","library","notebooks/Categorical","notebooks/Derivatives_of_Regular_Expressions","notebooks/Developing","notebooks/Generator_Programs","notebooks/Intro","notebooks/Newton-Raphson","notebooks/NoUpdates","notebooks/Ordered_Binary_Trees","notebooks/Quadratic","notebooks/Recursion_Combinators","notebooks/Replacing","notebooks/The_Four_Operations","notebooks/Treestep","notebooks/TypeChecking","notebooks/Types","notebooks/Zipper","notebooks/index","parser","pretty","stack","types"],envversion:52,filenames:["index.rst","joy.rst","lib.rst","library.rst","notebooks/Categorical.rst","notebooks/Derivatives_of_Regular_Expressions.rst","notebooks/Developing.rst","notebooks/Generator_Programs.rst","notebooks/Intro.rst","notebooks/Newton-Raphson.rst","notebooks/NoUpdates.rst","notebooks/Ordered_Binary_Trees.rst","notebooks/Quadratic.rst","notebooks/Recursion_Combinators.rst","notebooks/Replacing.rst","notebooks/The_Four_Operations.rst","notebooks/Treestep.rst","notebooks/TypeChecking.rst","notebooks/Types.rst","notebooks/Zipper.rst","notebooks/index.rst","parser.rst","pretty.rst","stack.rst","types.rst"],objects:{"joy.joy":{joy:[1,1,1,""],repl:[1,1,1,""],run:[1,1,1,""]},"joy.library":{"void":[3,1,1,""],BinaryBuiltinWrapper:[3,1,1,""],DefinitionWrapper:[3,2,1,""],FunctionWrapper:[3,1,1,""],SimpleFunctionWrapper:[3,1,1,""],UnaryBuiltinWrapper:[3,1,1,""],add_aliases:[3,1,1,""],app1:[3,1,1,""],app2:[3,1,1,""],app3:[3,1,1,""],b:[3,1,1,""],branch:[3,1,1,""],choice:[3,1,1,""],clear:[3,1,1,""],cmp_:[3,1,1,""],concat_:[3,1,1,""],cond:[3,1,1,""],dip:[3,1,1,""],dipd:[3,1,1,""],dipdd:[3,1,1,""],divmod_:[3,1,1,""],drop:[3,1,1,""],dupdip:[3,1,1,""],floor:[3,1,1,""],genrec:[3,1,1,""],getitem:[3,1,1,""],help_:[3,1,1,""],i:[3,1,1,""],id_:[3,1,1,""],infra:[3,1,1,""],initialize:[3,1,1,""],inscribe:[3,1,1,""],loop:[3,1,1,""],map_:[3,1,1,""],max_:[3,1,1,""],min_:[3,1,1,""],parse:[3,1,1,""],pm:[3,1,1,""],pred:[3,1,1,""],remove:[3,1,1,""],reverse:[3,1,1,""],select:[3,1,1,""],sharing:[3,1,1,""],shunt:[3,1,1,""],sort_:[3,1,1,""],sqrt:[3,1,1,""],step:[3,1,1,""],succ:[3,1,1,""],sum_:[3,1,1,""],take:[3,1,1,""],times:[3,1,1,""],unique:[3,1,1,""],unstack:[3,1,1,""],warranty:[3,1,1,""],words:[3,1,1,""],x:[3,1,1,""],zip_:[3,1,1,""]},"joy.library.DefinitionWrapper":{add_def:[3,3,1,""],add_definitions:[3,3,1,""],parse_definition:[3,3,1,""]},"joy.parser":{ParseError:[21,4,1,""],Symbol:[21,2,1,""],text_to_expression:[21,1,1,""]},"joy.utils":{generated_library:[3,0,0,"-"],polytypes:[24,0,0,"-"],pretty_print:[22,0,0,"-"],stack:[23,0,0,"-"],types:[24,0,0,"-"]},"joy.utils.generated_library":{ccons:[3,1,1,""],cons:[3,1,1,""],dup:[3,1,1,""],dupd:[3,1,1,""],dupdd:[3,1,1,""],first:[3,1,1,""],first_two:[3,1,1,""],fourth:[3,1,1,""],over:[3,1,1,""],pop:[3,1,1,""],popd:[3,1,1,""],popdd:[3,1,1,""],popop:[3,1,1,""],popopd:[3,1,1,""],popopdd:[3,1,1,""],rest:[3,1,1,""],rolldown:[3,1,1,""],rollup:[3,1,1,""],rrest:[3,1,1,""],second:[3,1,1,""],stack:[3,1,1,""],stuncons:[3,1,1,""],stununcons:[3,1,1,""],swaack:[3,1,1,""],swap:[3,1,1,""],swons:[3,1,1,""],third:[3,1,1,""],tuck:[3,1,1,""],uncons:[3,1,1,""],unit:[3,1,1,""],unswons:[3,1,1,""]},"joy.utils.polytypes":{CombinatorJoyType:[24,2,1,""],FUNCTIONS:[24,5,1,""],FunctionJoyType:[24,2,1,""],IntJoyType:[24,2,1,""],KleeneStar:[24,2,1,""],SymbolJoyType:[24,2,1,""],compose:[24,1,1,""],defs:[24,1,1,""],infer:[24,1,1,""],meta_compose:[24,1,1,""],type_check:[24,1,1,""]},"joy.utils.polytypes.KleeneStar":{kind:[24,6,1,""]},"joy.utils.pretty_print":{TracePrinter:[22,2,1,""]},"joy.utils.pretty_print.TracePrinter":{go:[22,7,1,""],viewer:[22,7,1,""]},"joy.utils.stack":{concat:[23,1,1,""],expression_to_string:[23,1,1,""],iter_stack:[23,1,1,""],list_to_stack:[23,1,1,""],pick:[23,1,1,""],stack_to_string:[23,1,1,""]},"joy.utils.types":{AnyJoyType:[24,2,1,""],BooleanJoyType:[24,2,1,""],FloatJoyType:[24,2,1,""],IntJoyType:[24,2,1,""],JoyTypeError:[24,4,1,""],NumberJoyType:[24,2,1,""],StackJoyType:[24,2,1,""],compilable:[24,1,1,""],compile_:[24,1,1,""],compose:[24,1,1,""],defs:[24,1,1,""],delabel:[24,1,1,""],doc_from_stack_effect:[24,1,1,""],reify:[24,1,1,""],relabel:[24,1,1,""],unify:[24,1,1,""]},"joy.utils.types.BooleanJoyType":{accept:[24,6,1,""]},"joy.utils.types.FloatJoyType":{accept:[24,6,1,""]},"joy.utils.types.IntJoyType":{accept:[24,6,1,""]},"joy.utils.types.StackJoyType":{accept:[24,6,1,""]},joy:{joy:[1,0,0,"-"],library:[3,0,0,"-"],parser:[21,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"],"2":["py","class","Python class"],"3":["py","classmethod","Python class method"],"4":["py","exception","Python exception"],"5":["py","data","Python data"],"6":["py","attribute","Python attribute"],"7":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:function","2":"py:class","3":"py:classmethod","4":"py:exception","5":"py:data","6":"py:attribute","7":"py:method"},terms:{"05s":5,"0b11100111011011":6,"23rd":18,"4b4cb6ff86e5":[],"58a8e44e9cba":[],"5bkei":11,"5eb7ac5ad2c2":[],"7fde90b4e88f":[],"\u03b4":5,"\u03b5":9,"abstract":[8,11],"boolean":[2,3,8,11,15],"break":[5,8,18],"byte":[5,6],"case":[2,3,13,15,16,18,23],"char":5,"class":[3,5,8,18,21,22,23,24],"default":[3,7,11,23],"export":[3,21],"final":[2,11,13],"float":[3,8,18,19,21,24],"function":[0,1,4,6,7,10,12,17,19,20,21,22,23,24],"g\u00e9rard":19,"goto":5,"import":[2,5,6,7,9,11,12,13,14,16,17,18,19],"int":[5,7,8,13,18,19,21,23,24],"long":[11,18,20],"new":[2,3,5,7,8,10,13,14,18,24],"p\u00f6ial":20,"p\u00f6ial06typingtool":18,"public":10,"return":[1,3,5,6,8,11,13,14,15,16,18,21,22,23,24],"static":[2,10],"super":18,"switch":[2,18],"throw":[11,24],"true":[2,3,5,6,13,15,18,24],"try":[7,9,12,13,16,17,18,20],"void":[0,3],"while":[3,5,8,11,18,21,23],AND:[5,18],Adding:[8,14,20],And:[5,6,7,9,11,13,15,18,19,23],But:[0,4,6,7,8,11,14,18],CPS:8,FNs:[],For:[2,3,11,13,14,18,20,23,24],Has:[],Its:3,NOT:5,Not:18,One:[2,8,15,18,20],REs:5,TOS:[2,3],That:[6,11],The:[0,1,2,3,4,5,7,9,10,12,19,20,21,23,24],Then:[2,3,11,12,13,18],There:[5,12,13,15,16,18,23],These:[15,18,20,23,24],Use:[3,9,13],Used:15,Using:[0,9,11,20],With:[9,13,18,20,24],_1000:18,__add__:18,__builtin__:24,__call__:5,__class__:18,__eq__:18,__ge__:18,__hash__:18,__init__:[5,18],__main__:18,__name__:[],__radd__:18,__repr__:18,__str__:22,_and:5,_compaction_rul:5,_con:5,_dictionari:18,_ge:18,_infer:18,_interpret:18,_log:18,_log_it:18,_names_for:18,_or:5,_templat:5,_to_str:18,_tree_add_:11,_tree_add_e:[11,24],_tree_add_p:11,_tree_add_r:11,_tree_add_t:11,_tree_delete_:11,_tree_delete_clear_stuff:[11,24],_tree_delete_del:11,_tree_delete_r0:[11,24],_tree_delete_r1:11,_tree_delete_rightmost:11,_tree_delete_w:11,_tree_get_:[11,24],_tree_get_p:11,_tree_get_r:11,_tree_get_t:11,_tree_iter_order_curr:11,_tree_iter_order_left:11,_tree_iter_order_r:11,_tree_iter_order_right:11,_tree_t:11,_treestep_0:16,_treestep_1:16,_uniqu:18,_within_b:9,_within_p:9,_within_r:9,a10001:18,a10002:18,a10003:18,a10004:18,a1001:[],abbrevi:16,abil:[],abl:[5,15,18,24],about:[0,8,11,15,18,19,23,24],abov:[0,5,6,9,11,13,15,18],abs:9,absolut:8,accept:[1,2,3,5,6,7,8,11,12,14,15,16,18,19,24],accord:5,accordingli:[11,15],accumul:6,act:[5,24],action:[0,8,14,18,19,20],actual:[2,6,8,11,15,18],adapt:20,add:[3,5,6,7,8,14,18,22,24],add_alias:3,add_def:3,add_definit:[3,11,16],added:[4,11],adding:[10,18],addit:[0,2,3,6,8,13,14,16],address:20,adjust:[11,24],advantag:18,affect:15,after:[5,6,7,8,13,15,18,24],afterward:8,again:[2,3,6,8,11,13,18,24],against:[18,24],aggreg:19,ahead:18,aka:[5,8,19,24],albrecht:0,algorithm:[5,8,18],alia:[3,24],alias:[3,8],align:[8,22],all:[3,5,6,7,8,11,13,14,15,16,18,22,24],alloc:18,allow:[10,11,15],almost:11,along:[5,8,13,18,24],alphabet:[3,20],alreadi:[5,9,14,18,19],also:[0,5,6,8,11,15,18,23,24],alter:[5,18],altern:[4,18,24],although:[4,11],altogeth:7,alwai:[6,10,13,15],amaz:[],amend:15,among:18,amort:11,analysi:[4,20],anamorph:[8,20],ani:[4,5,6,8,10,11,15,18,19,21,24],annual:8,anonym:11,anoth:[5,11,15,18,23,24],anyhow:[15,18],anyjoytyp:[18,24],anymor:18,anystarjoytyp:18,anyth:[2,3,5,8,18,24],apart:18,api:10,app1:3,app2:[3,8,12,13,14,15],app3:[3,15],app:8,appear:[2,4,5,6,11,24],append:18,appendix:20,appli:[2,3,6,7,11,13,18,24],applic:7,approach:6,appropri:5,approxim:20,archiv:0,aren:19,arg:[2,3],argument:[2,3,8,9,12,13,20,22,23],arithmet:2,ariti:[2,15],around:[6,18,23],arrang:16,arriv:[7,16],arrow:5,articl:[0,4,7,13],ascii:5,ascii_lowercas:5,ask:[4,7,18],aspect:0,assembl:5,assert:[5,18],assign:[15,23],associ:11,assum:9,astar:[],asterisk:16,asterix:[18,24],asyncron:15,attack:8,attempt:[0,1,18],attribut:3,attributeerror:18,author:18,auto:[0,18,24],automat:[4,15,18,24],auxiliari:[5,16],avail:[0,18,24],averag:[8,14],avoid:[11,24],awai:[11,18],awar:2,awkward:[11,13,18],azur:20,back:[11,18],backport:[],backtrack:24,backward:[10,11,12,16],bad:18,bag:8,banana:13,bar:15,barb:13,base:[0,2,3,10,13,16,18],basic:[1,2,3,8,11],basicconfig:[17,18],becaas:5,becaus:[2,3,5,8,11,15,16,18,19,23,24],becom:[11,16,23],becuas:18,been:[5,9,10,11,18,19],befor:[5,7,8,11],begin:[11,16],behavior:[10,16,24],behaviour:[0,1,18,24],behind:15,being:[0,15,24],below:[2,3,5,6,7,11,18,19],bespok:8,best:0,better:[6,11,13,18],between:[0,6,24],beyond:7,biannual:8,bin:5,binari:[0,7,8,20],binary_search_tre:11,binarybuiltinwrapp:3,bind:8,bingo:19,bit:[5,6,7,11,18],bliss:[0,20],block:6,bodi:[2,5,8,11,15],body_text:3,booktitl:18,bool:[13,18,24],booleanjoytyp:24,borrow:[8,18],both:[2,6,8,12,13,14,15,18,23],bottom:7,bounce_to:5,bracket:[8,18,21],branch:[3,5,6,7,13,18,20,24],branch_fals:18,branch_tru:18,breakpoint:8,bring:[6,8,18],broken:[],bruijn:18,brutal:15,brzozowski:[18,20],brzozowskian:5,btree:[11,16],buck:11,bug:[0,8],build:[7,8,12,13,19,23],built:[12,18],bundl:[2,3,13],burgeon:8,calculu:4,call:[2,5,8,10,11,13,15,18,22,23],caller:[11,18],can:[0,2,3,4,5,6,7,8,9,10,12,13,14,15,16,18,19,20,23,24],cancel:15,cannot:[17,18],captur:[8,24],card:8,care:[6,23],carefulli:19,carri:[7,11,24],cartesian:4,catamorph:20,categor:[0,20],categori:[4,15],ccc:4,ccon:[3,11,17,18,24],cell:[13,18],certain:[8,23],certainli:11,chain:[3,15],chang:[2,10,11,18,19],charact:[5,19],chat:8,chatter:[0,18],check:[0,7,9,18,20,24],checker:[],child:16,choic:[3,13],choos:10,chop:12,chose:5,cinf:11,circl:5,circuit:4,cite_not:11,classmethod:3,claus:[3,18],clean:18,clear:[3,6,8,24],clear_stuff:11,cleav:[8,12,14],close:[0,1,4],clunki:[6,18],clv:15,cmp:[3,16,20],cmp_:3,code:[0,1,4,5,12,13,15,18,20,24],codireco:[7,9],collaps:13,collect:[4,5,7,8,18],collis:24,combin:[0,3,6,7,8,9,12,15,16,19,20,24],combinatorjoytyp:[18,24],combo:[],come:[8,11,18],command:[8,11,18],comment:[15,24],common:[2,6,15],compar:[3,4,5,18],comparison:[0,11],compat:15,compel:4,compil:[2,4,5,8,11,14,15,20,24],compile_:24,complement:5,complet:4,complex:[3,15,18,19,24],complic:18,compos:[5,24],composit:[18,24],compostit:18,compound:11,comput:[2,4,5,6,8,12,15,18,24],con:[3,5,6,7,8,9,11,12,13,15,16,19,23,24],conal:[4,15],concat:[3,7,8,15,16,18,23],concat_:[3,24],concaten:[0,5],concatin:[0,3,5,23],concern:15,conclus:20,concurr:2,cond:[3,11],condit:[3,8],confer:18,conflict:[11,18,24],conjectur:[],consecut:20,consid:[5,6,7,11,13,16,18,19],consist:[2,7,8,15,16],constant:11,constitu:13,constraint:[],construct:[15,18],consum:[15,18],contain:[0,2,3,5,7,8,13,18],content:18,context:2,conting:11,continu:[0,5,13,18,19],control:8,conveni:[4,15,18],convent:15,convers:18,convert:[13,14,16,18,21,23],cool:11,copi:[2,3,6,11,13,15,16,17,20],copyright:8,correct:[],correspond:[4,15],could:[2,4,5,6,8,10,11,15,18,19],couldn:15,count:[3,18],counter:[6,18],coupl:16,cours:[6,11,18],cover:18,cpu:15,crack:11,crap:[],crash:11,creat:[0,2,3,6,9,11,15,18],creativ:18,crude:[11,18,21,24],cruft:18,crunchi:[],curent:24,currect:[],current:[2,3,8,13,15,16,18,19,22,24],curri:5,custom:10,cycl:[6,7],cython:8,d010101:5,d0101:5,d01:5,d10:5,d_compact:5,dai:8,data:[2,3,5,13],datastructur:[0,2,13,18,20,21,23],datatyp:23,ddee30dbb1a6:[],ddididi:19,deal:[0,5,11,15],dealt:18,debugg:18,decid:11,declar:18,decor:3,decoupl:13,decrement:3,deduc:[6,18],deeper:0,deepli:4,def:[3,5,8,13,14,18,23,24],defaultdict:[5,18],defi:3,defin:[2,3,4,5,6,7,8,9,10,12,13,14,15,18,19,20],definit:[0,2,3,6,7,8,10,11,13,16,18,20,24],definitionwrapp:[3,11,13,16],defint:15,del:17,delabel:24,deleg:8,delet:20,deliber:18,demo:18,demonstr:4,depend:[3,11,13,15],deposit:16,depth:[18,24],dequot:13,der:11,deriv:[2,3,6,8,9,11,18,20],derv:5,describ:[3,4,5,11,13,15,16,18,21,24],descript:[6,8],descriptor:18,design:[2,3,11,15,20],desir:[8,16],destin:5,destruct:11,detail:[8,11,18],detect:[5,7,11,13,18],determin:20,develop:[0,7,8,18,20],diagram:6,dialect:1,dict:[1,3,5,18,24],dictionari:[0,1,3,8,18,20],did:18,differ:[0,4,6,9,11,12,13,15,23],differenti:4,difficult:18,difficulti:15,dig:[11,19],digit:6,digraph:5,dinfrirst:[8,18,24],dip:[3,6,7,8,9,11,12,13,14,15,16,18,20,24],dip_a:[],dip_t:[],dipd:[3,7,8,11,12,13,15,18,19,24],dipdd:[3,11,24],direco:20,direct:8,directli:[6,15,16,18,23],disappear:[2,5,18,24],discard:[3,7,9,11,13],disciplin:11,disenstacken:8,disk:8,displac:2,displai:18,distiguish:18,distribut:15,ditch:11,div:[3,8,18,24],dive:16,divis:11,divmod:[3,24],divmod_:[3,18],doc:[2,3,8,18,24],doc_from_stack_effect:[17,24],docstr:[18,24],document:[18,20,21,23],doe:[0,1,4,5,7,8,14,15,18,20,22,24],doesn:[6,10,11,15,16,18,23],doing:[4,6,8,15,18,19],domain:[4,18],don:[5,6,8,11,18,24],done:[2,6,8,10,18],dooooc:18,door:8,dot:[5,22],doubl:[5,6,8,18],doublecircl:5,down:[2,5,9,13,19,24],down_to_zero:8,dozen:8,draft:[4,10],dream:8,drive:[7,9],driven:6,driver:[5,7],drop:[3,11],dudipd:8,due:18,dup:[3,6,7,8,9,11,12,13,15,17,19,23,24],dupd:[3,18,24],dupdd:[3,24],dupdip:[3,6,11,12,13,24],duplic:[3,11,13],durat:2,dure:[2,13],each:[2,3,4,5,6,8,13,14,15,16,18,22,24],easi:[0,11,16,18,19],easier:[3,11,15],easili:4,eat:5,edit:20,effect:[2,3,5,8,15,19,20,24],effici:[7,14,19],efg:18,either:[1,2,3,5,11,13,18],elabor:18,eleg:[0,5,8,11,15,20],element:2,elif:18,elimin:[5,18],elliott:[4,15],els:[2,3,5,13,15,18],else_:18,embed:[4,11,19],emit:18,empti:[3,5,8,16,18,23,24],encapsul:8,enclos:8,encod:7,encount:18,end:[5,6,11,13,16,18,23],endless:7,enforc:[2,8],engend:8,enorm:[],enough:[5,8,13,22,24],enstacken:[7,8,18],enter:[8,24],enter_guard:18,entir:23,entri:[3,19,22],enumer:18,ephasi:[],epsilon:9,equal:[6,16,23],equat:[8,9],equival:15,ergo:[5,11],err:[11,17],error:[8,18,21],essai:0,establish:18,etc:[3,16,18,19,21],euler:20,euro:18,eval:[0,18],evalu:[1,2,3,8,9,11,12,13,14,15,16,18],event:15,eventu:[15,18],ever:18,everi:[7,15],everybodi:15,everyth:[3,5,11,12,15,18],evolv:10,examin:13,exampl:[0,3,5,6,18,20,21,23,24],exce:7,except:[5,8,11,17,18,21,24],execut:[0,1,2,3,8,13,14,15,16,18,19,23,24],exend:18,exercis:[5,11],exist:[4,11,18],expand:11,expect:[2,3,15,16,18,23,24],experi:[8,16],explain:18,explan:8,explor:[8,18],express:[0,1,2,3,4,11,13,14,18,19,20,22,23],expression_to_str:[18,23],extend:18,extra:[6,7],extract:[11,12,20],extrem:8,extrememli:8,f1001:[],f_g:18,f_in:18,f_out:18,f_python:18,facet:0,facil:8,fact:21,factor:[2,6,8,11,18],factori:20,fail:[2,3,11,20,21,24],fairli:18,fake:5,fale:[],fall:18,fals:[2,3,5,6,13,15,18,24],falsei:18,far:[9,11,13,18,24],fascin:0,favorit:15,fear:[11,18],few:[6,8,9,12,15,18],fewer:[3,8],fg_in:18,fg_out:18,fib:7,fib_gen:7,fibonacci:20,figur:[2,3,11,13,18],filter:11,fin:6,find:[2,3,5,6,7,15,16,18,20],finder:9,fine:[0,5,6,11,18,24],finite_state_machin:5,first:[3,5,7,8,9,11,12,13,14,16,19,20,24],first_two:[3,11,24],fit:[6,8],five:[6,8,20],fix:[2,3,5,13,18,24],fixm:[5,18],flag:[15,18],flatten:[8,16,18],flesh:5,flexibl:20,floatjoytyp:[18,24],floatstarjoytyp:18,floor:3,floordiv:[6,24],flow:8,follow:[0,2,3,5,8,10,13,15,16,18,19,24],foo:[8,10,11,15,18],foo_ii:10,fork:15,form:[2,3,4,5,6,7,13,16,18,23],forman:8,format:[17,18,20,22],formula:[0,6,20],forth:[8,18],forum:0,forward:18,found:8,foundat:[],four:[0,2,3,6,7,8,11,20],fourteen:6,fourth:[2,3,11,13,24],fractal:8,fraction0:8,fraction:[2,8],frame:13,framework:8,free:[4,8,11],freeli:2,from:[0,1,2,3,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,23],from_:5,from_iter:[],front:[2,3,13],frozenset:5,fulin:15,full:6,fulli:[],fun:[5,20],func:18,functionjoytyp:[18,24],functionwrapp:3,functool:5,fundament:[0,20],funtion:11,further:[9,18,20],futur:15,g_in:18,g_out:18,garbag:8,gari:11,gcd:8,gener:[0,2,4,13,15,18,20,23,24],generated_librari:3,genrec:[3,8,11,13,15,16,18],geometr:6,get:[2,4,5,6,7,8,12,13,18,20],getch:5,getitem:3,getrecursionlimit:23,getsourc:8,ghc:4,give:[4,6,11,13,16,18,23],given:[2,3,6,7,9,11,13,15,18,19,20],global:[17,18],glue:8,goe:24,going:[5,11,12,15,16,18,19],good:[6,11,18],grab:18,grammar:21,grand:8,graph:15,graphic:5,graphviz:5,great:[0,8,18,20],greater:23,grind:18,grok:[],group:0,grow:5,gsra:9,guard:[11,18,24],had:[5,6,19],haiku:8,half:[6,18,19],hallmark:15,hand:[5,8,14,18,20],handi:[9,18],handl:[11,18,23,24],happen:[8,18],happi:5,hard:[5,18,19],hardwar:4,has:[0,2,5,7,8,9,10,11,13,15,18,19,23],hasattr:18,hash:18,haskel:4,have:[2,3,5,6,7,8,9,10,13,14,15,18,19,20,23,24],haven:24,head:23,heh:18,help:[8,11,13,18],help_:3,helper:[3,5],herd:8,here:[5,6,7,11,16,18,19,24],hide:11,hierarchi:18,higher:[5,8,11,18],highli:8,hij:5,histori:[18,22,24],hit:5,hmm:[5,11],hoist:3,hold:[6,18],hood:11,hope:[0,6,8,20],hopefulli:13,host:20,how:[0,4,5,9,11,13,18,19,20],howev:[13,14,15,18],html:[2,3,7,12,13,20],http:11,huet:19,huge:11,hugh:[9,16],human:8,hybrid:24,hylomorph:20,hypothet:2,id_:3,idea:[4,6,8,18],ident:[3,5,13,18,24],if_not_empti:11,ift:[3,11,13,16,18,24],ignor:[3,11,18],iii:20,illustr:[5,13],imagin:[5,15,19],imap:18,imit:[5,16],immedi:[5,13],immut:[5,8,11],imper:13,implement:[0,1,2,3,4,8,10,11,13,14,15,20,24],implementaion:15,impli:[],implicit:8,improv:18,includ:[4,11,15,16,18,24],inclus:6,incom:23,incompat:10,incorpor:12,increas:6,increment:[3,4,6,10,15],indetermin:24,index:[0,8,18,23],indexerror:23,indic:[15,16,18,24],ineffici:18,infer:[0,17],inferenc:24,info:[17,18],inform:[3,5,18,24],infra:[3,7,8,11,12,14,15,16,18,20,24],infrastructur:3,initi:[2,3,5,8,9,11,18],inlin:11,inner:18,inproceed:18,input:[1,9,15,17,18,24],input_:5,inscrib:3,insert:18,insight:13,inspect:8,inspect_stack:18,instal:0,instanc:[18,24],instanti:[4,22],instead:[5,6,7,11,13,18,19,23,24],instruct:5,integ:[2,3,8,13,16,18],integr:3,intend:[0,8],interact:[8,20],interest:[0,6,11,18,20],interfer:15,interlud:20,intermedi:13,intern:[0,18,22,23],interpret:[0,4,10,14,21,22,24],interrupt:8,intersect:5,interspers:15,interv:[4,6],intjoytyp:[18,24],introduc:[10,24],introduct:0,intstarjoytyp:18,intuit:18,invalid:24,invari:3,invent:18,involv:18,ipf:8,ipython:[],isinst:[5,18],isn:[5,11,19],issubclass:18,item:[2,3,8,11,13,15,16,18,20,23],iter:[1,3,5,8,13,15,16,18,20,23],iter_stack:[14,23],iteritem:[5,18],itertool:[5,18],its:[0,2,3,4,6,8,11,13,15,16,18,23],itself:[0,2,8,11,15,18,24],j05cmp:[2,3,13],jaanu:18,jmp:5,job:[15,20],john:[9,16],joi:[2,4,10,11,12,14,15,17],join:[5,18],joypi:[8,19],joytypeerror:[17,24],jump:5,jump_from:5,june:[],junk:18,jupyt:20,just:[0,2,3,5,7,8,10,11,13,15,16,18,19],juxtaposit:15,kav:[],keep:[5,11,12,15,18,19],kei:[5,16,20],kevin:0,key_n:11,keyerror:[5,11,18],kind:[2,4,8,11,13,16,18,24],kinda:18,kjs:[],kleen:[16,18,24],kleenestar:[18,24],kleffner:18,know:[6,11,18],knowledg:18,known:[4,15],kstar:5,l2s:[],l_kei:11,l_left:11,l_right:11,l_valu:11,label:[5,18],lambda:[4,5,18],languag:[4,5,8,10,11,14,18],larg:[5,18],larger:[20,23],largest:3,last:[6,11,13,18],lastli:7,later:[5,8,16,18],law:2,lazi:18,lazili:9,lcm:6,lead:[5,8,18,24],leaf:11,lean:8,learn:0,least:[2,6,13,18,23],least_fract:8,leav:[6,15],left:[5,8,12,13,15,16,18,19,22,23,24],leftov:13,legend:5,len:[5,18],length:[3,6,23],lens:13,less:[6,7,8,13,18,23],let:[7,9,11,12,13,16,18,19,20],letter:18,level:[4,5,11,17,18],librari:[0,5,14],like:[2,3,5,6,8,15,16,18,20,21,24],limit:[18,24],line:[3,8,11,12,18,22,24],linear:23,link:[0,5,18],linux:0,list:[0,3,5,6,8,9,11,13,15,16,18,19,22,24],list_to_stack:[18,23],lit:[],liter:[1,11,16,18,19,21],literatur:18,littl:[5,7,11,15,18,20],live:20,lkei:16,load:[6,8],local:18,locat:2,locu:22,lof:[],log:[17,18],log_2:11,logic:[0,6,20],longer:[11,18],look:[5,7,8,9,11,12,15,18],lookup:8,loop:[0,1,3,5,6,18,20,24],lose:18,lot:[5,8,11,18,19],love:6,low:[4,5],lower:6,lowercas:[5,18],lowest:11,lshift:24,machin:[0,20],machineri:[11,18,24],macro:8,made:[0,8,15,18,19],magic:18,mai:[2,13,15],mail:0,main:[0,3,8,12,15,18,19],mainloop:10,maintain:19,major:10,make:[2,3,4,6,8,11,13,14,15,16,18,19,20],make_gener:9,make_graph:5,manfr:[0,2,3,4,13],mani:[0,5,8,18],manipul:18,manner:12,map:[1,3,5,6,8,10,13,16,18],map_:3,marker:8,mask:[6,7],match:[0,1,18,20],materi:0,math:[0,8,9,11,12,18],mathemat:8,matter:[6,9,11,16],max_:3,maximum:3,mayb:[11,18],mean:[4,6,8,9,11,13,16,18,23,24],meant:[8,11,13,16],mem:5,member:[2,3,13],memo:5,mental:8,mention:2,mercuri:0,mess:18,messag:[17,18],meta:[8,11,14],meta_compos:[18,24],metal:[],method:[0,3,8,18,20,22],midpoint:6,might:[4,5,7,11,18],mike:11,million:7,min_:3,mind:18,minimum:3,minor:11,minu:3,mirror:0,miscellan:0,mismatch:18,mix:[8,18],mod:3,mode:18,model:[4,8],modern:0,modif:[7,18],modifi:[8,11,19],modul:[0,1,3,8,18,21],modulu:[8,24],moment:18,month:8,more:[0,3,4,5,6,7,8,9,13,14,15,16,18,21,23,24],most:[5,18,24],mostli:0,motiv:[],move:[5,11],movement:2,much:[5,6,7,11,13,18],muck:11,mul:[8,12,17,19,22,24],multi:3,multipl:[20,24],must:[2,3,6,10,13,15,16,18],myself:18,n10001:18,n10002:18,n10003:18,n1001:18,n1002:18,n1003:18,name:[1,3,5,8,10,11,13,18,19,20,21,23,24],narr:18,natur:[5,6,7,11,18],navig:19,nearli:18,neat:11,neato:18,necessarili:18,need:[2,3,6,7,9,10,11,13,15,18],neg:[3,12,24],neither:[15,18],ness:5,nest:[3,8,11,19],network:8,never:[5,10,13],new_def:18,new_f:18,new_fo:18,new_kei:11,new_valu:11,newton:[0,20],next:[5,6,15,16,18,24],nice:[0,5,13,23],niether:2,node:[5,16,20],node_kei:11,node_valu:11,non:[5,16,18,24],none:[1,3,18,24],nope:16,nor:5,normal:15,notat:[8,11],note:[2,5,6,9,11,13,15,18,23],notebook:[6,7,8,18,19,20],notebook_preambl:[2,6,7,9,11,12,13,14,16,18,19],noth:[2,11,15],notic:6,now:[5,6,7,8,13,14,16,18,20],nth:[3,23],nullari:[8,11,15,18,24],number:[1,2,3,6,7,9,15,23,24],numberjoytyp:[18,24],numberstarjoytyp:18,numer:18,object:[5,18,21],observ:6,obviou:7,obvious:18,occur:11,odd:[6,7],off:[2,3,6,7,12,18,19],often:[5,15],okai:[],old:[2,14],old_k:11,old_kei:11,old_valu:11,omg:[],omit:[13,18],onc:[3,5,10,11],one:[2,3,5,6,7,11,13,15,16,18,22,23,24],ones:[5,7,18],onli:[2,3,5,6,11,13,15,18,19,23,24],onto:[1,2,3,8,13,23],open:[8,18],oper:[0,3,5,8,11,13,20,23],oppos:18,optim:11,option:[1,8,11,18,23],orchestr:15,order:[0,2,3,8,13,15,17,18,20,23],org:[0,11],origin:[0,1,2,3,11,19],other:[0,2,3,4,5,8,11,13,16,18,23,24],otherwis:[3,5,6,7,11,16,18,24],our:[5,6,7,8,9,13,16,18],out:[2,3,4,6,7,8,9,11,12,13,15,18,19,20],outcom:16,outlin:5,output:[5,9,13,15,17,18,24],outsid:4,over:[3,4,6,7,8,9,11,12,15,16,18,20,24],overhaul:18,overview:18,own:[11,18],pace:[],pack:23,packag:[0,8],page:[0,11,18,23],pair:[2,3,6,7,11,18],palidrom:6,palindrom:6,pam:8,paper:[4,8,13,15,19],paradigm:20,parallel:[2,20],paramet:[1,2,3,13,14,21,22,23],parameter:20,paramorph:13,parenthes:[11,23],pariti:7,pars:[0,3,5,8],parse_definit:3,parseerror:21,parser:[0,17,18],part:[2,3,9,13,16,20],partial:[5,18],particular:19,pass:[0,5,11,18,22,24],patch:5,path:[5,18,20],pattern:[5,6,15,16,20],pe1:[6,7],pe2:7,pearl:19,pend:[3,8,13,18,19,22],peopl:20,per:[8,16],perfectli:15,perform:[5,15,18],perhap:7,period:8,permit:[15,18,23],permut:18,persist:11,phase:2,phi:5,pick:[6,7,15,23],pickl:8,pictur:11,piec:13,pip:0,place:[3,6,8,18],plai:0,plu:3,plug:[7,13,16],point:[4,5,8,11,13,15],pointless:2,poly_typ:[],polytyp:[0,17,18],pool:15,pop:[3,5,6,7,8,11,13,14,16,17,23,24],popd:[3,8,9,11,14,15,18,24],popdd:[3,7,12,18,24],popop:[3,6,7,8,9,11,16,18,24],popopd:[3,24],popopdd:[3,24],posit:[3,6,8,13],possibilit:11,possibl:[11,16,18,20],post:8,poswrd:18,potenti:15,pow:24,power:[8,18],pprint:5,pragmat:6,preambl:9,preceed:15,precis:[0,1],pred:[3,18,24],predic:[2,3,5,7,13,15,24],prefix:[18,22],preliminari:5,present:18,preserv:[4,16],pretti:[9,11,12,15,16,18,22,23],pretty_print:0,previou:[8,15],primari:[],prime:9,primit:[2,3,18,20],primrec:[3,7,8,9,13],principl:[],print:[0,1,2,3,5,17,18,22,23,24],probabl:[7,8,11,18],problem:[8,18,20],proc_curr:11,proc_left:11,proc_right:11,proce:[6,24],process:[5,8,16,18,22],produc:[6,11,13,16,18],product:[5,7,8,17,18,24],program:[0,2,3,7,8,9,11,13,15,18,19,24],programm:[15,18],progress:15,project:20,prolog:18,promis:15,prompt:8,proper:[2,3,13,15,24],properti:0,provabl:[],proven:[],provid:[0,3,4,8,15,18,24],pun:[0,8],punctuat:18,pure:[0,5],puriti:8,purpos:8,push:[2,3,8,13,19,23],pushback:8,put:[1,2,7,8,15,18,20,23],pypi:0,python:[0,2,3,5,11,13,15,19,20,21,23,24],quadrat:[0,20],queri:[11,16],query_kei:16,queu:13,quit:[0,1,16],quot:[0,3,7,8,11,12,13,15,16,18,19,22,24],quotat:[2,3,13],quotient:3,r_kei:11,r_left:11,r_right:11,r_valu:11,rais:[5,11,18,21,23],rang:[5,8,18],range_revers:13,range_to_zero:8,ranger:13,ranger_revers:13,rankdir:5,raphson:9,rather:[6,8,13,16],ratio:8,reach:[5,6,7,13],read:[0,1,6,7,11,18,19],readabl:14,reader:[5,11],readi:18,real:11,realiz:[4,11],rearrang:[2,11,18],reason:[6,8,15,18],rebuild:[16,19],rec1:[2,3,13],rec2:[2,3,13],recent:[],recogn:21,recombin:15,record:[8,22],recur:[13,18],recurs:[0,2,3,5,7,8,9,15,18,20,23],recus:8,recycl:[],redefin:20,redistribut:[3,8],redo:5,reduc:[2,18],redund:23,refactor:[8,10],refer:[0,2],referenti:15,reflect:15,regard:15,regist:2,regular:[18,20,21],reifi:[17,24],reimplement:[15,20],relabel:24,relat:[5,18],releas:10,remain:[2,8,10,18],remaind:[3,9],rememb:5,remind:18,remov:[3,11,18,23],render:20,repeat:6,repeatedli:6,repetit:5,repl:[0,1],replac:[0,2,3,7,12,13,15,16,18,19,20,23],repositori:0,repr:[5,18],repres:[2,8,11,15,21,22,24],represent:[23,24],reprod:7,repurpos:18,requir:[15,18,23],res:18,research:18,resembl:8,resolut:15,resourc:15,respect:[5,6,15],rest:[3,6,7,8,11,13,19,20,23,24],rest_two:11,restat:[],restor:2,restrict:[],result:[1,2,3,5,6,11,12,13,15,16,18,19],resum:8,retain:[],retir:2,retri:8,reus:[11,18],revers:[3,6,7,13,18,19,20,23],revisit:18,rewrit:[3,8,18],rewritten:8,rich:[],rid:11,right:[7,8,12,16,18,20,22,23,24],rightest:11,rightmost:6,rigor:15,risk:18,rkei:16,rob:18,robot:[],roll:[3,9,11,16,24],roll_dn:18,roll_down:[],roll_up:[],rolldown:[3,17,18,24],rollup:[3,18,24],root:[3,9,12],round:18,row:5,rrest:[3,17,18,24],rshift:24,rule:[15,20],run:[0,1,3,6,8,9,11,12,13,15,16,18,19],runtim:15,runtimeerror:23,s1000:[],s1002:[],s10:[],s23:[],sai:[5,7,11,12,16,18],same:[2,4,6,11,15,18,23],sandwich:[2,3,13],save:[2,5,6,8],scan:3,scanner:[8,21],scenario:19,scope:[7,11],search:[0,11],sec:[18,24],second:[3,8,11,13,16,23,24],section:13,see:[0,5,7,8,9,10,12,13,14,18,19,22],seem:[0,6,8,16,18,24],seen:[18,19,24],select:3,self:[5,15,18],semant:[2,3,8,10,11,15,18],semi:8,send:8,sens:[0,2,6,18,19],separ:[8,15,18],seq:18,sequenc:[0,1,2,3,6,8,11,13,14,19,20,21,24],sequence_to_stack:18,seri:[6,7,11,19],ses:18,set:[2,3,5,13,18,20],seven:[6,7],sever:[0,4,8,13],shape:[5,15],share:[3,8],shelf:2,shew:5,shift:[6,7],shorter:20,shorthand:11,should:[2,3,5,6,11,13,15,18],shouldn:8,show:[4,15,18,19],shunt:[3,19],side:[5,11,17,18,24],signatur:24,signifi:[8,11],similar:[11,16,18],simon:8,simpl:[5,8,13,23,24],simplefunctionwrapp:[3,14,18],simpler:16,simplest:[18,20],simpli:4,simplifi:[6,11,19],sinc:[2,6,11,18],singl:[3,7,8,14,15,18,21,24],singleton:5,situ:11,situat:11,six:[6,7,8],sixti:[6,7],size:[5,8,20],skeptic:8,skip:18,slight:9,slightli:[11,13,18],smallest:3,smart:11,softwar:8,solei:2,solut:[6,7],solvabl:8,some:[2,3,5,7,8,11,13,15,16,18,20,23,24],somehow:[11,18],someth:[2,10,11,18],sometim:11,somewher:[11,20],sort:[3,5,11,15,18],sort_:3,sorta:[],sourc:[0,1,3,18,20,21,22,23,24],space:[6,22],span:6,spawn:18,special:[7,11,20],specif:[0,4],specifi:[11,15,24],speed:14,spell:[5,16],sphinx:[20,23,24],spirit:[0,1,16],split:[5,18,24],sqr:[8,9,12,19],sqrt:[3,9,18,24],squar:[3,9,18,21],squishi:[],stack:[0,1,3,6,7,9,11,12,13,14,15,16,17,19,20,21,22,24],stack_concat:[],stack_effect:18,stack_effect_com:18,stack_to_str:[17,23],stacki:18,stackjoytyp:[18,24],stackstarjoytyp:18,stage:16,stai:[0,1],stand:[4,5,24],standard:[8,11],star:[16,18,24],stare:11,start:[5,6,7,8,9,11,13,16,18,24],state:[8,20],state_nam:5,statement:[3,5],stdout:[17,18],step:[3,6,8,11,14,18,19,20],still:[5,11,18],stop:11,stopiter:5,storag:[6,11],store:[6,13,18],stori:13,str:[1,5,18,21,22,23],straightforward:[1,5,7,9,18,20],stream:[6,17,18],stretch:11,string:[1,2,3,8,18,19,20,21,22,23,24],stringi:5,strip:[],structur:[8,15,16,18,19,20,23],stuck:5,studi:5,stuff:[11,18],stuncon:[3,24],stununcon:[3,24],style:[0,4,18],sub:[10,15,24],subclass:8,subject:[15,19],subsequ:15,subset:[18,24],substitut:[5,11,18,24],subtract:6,subtyp:20,succ:[3,18,24],succe:18,success:9,suck:18,suffic:18,suffici:11,suffix:18,suggest:[4,5,11],suitabl:[3,4,6],sum:[3,7,8,12,13,14,16,24],sum_:[3,18],summand:6,sumtre:16,suppli:[11,21],support:[8,18,22,23],sure:15,suspect:2,svg:[],swaack:[3,12,14,18,19,24],swap:[3,6,7,8,9,11,13,14,15,16,17,19,24],swarm:[],swon:[3,7,8,13,16,18,19,24],swoncat:[7,8,9,13,16],swuncon:13,sym:5,symbol:[2,3,5,15,18,19,20,21],symboljoytyp:[18,24],symmetr:[6,11],symmetri:5,syntact:8,syntax:[8,23],sys:[17,18,23],system:[8,11,15],tabl:[5,18],tag:[5,18],tail:[11,18,20,23],take:[3,5,6,8,9,11,13,15,18,23],talk:[8,11,18,23],target:19,tast:4,tbd:8,tear:13,technic:2,techniqu:[4,19],technolog:2,temporari:19,ten:6,term:[1,2,5,8,9,13,15,18,20,21,23,24],termin:[2,3,5,13],ternari:8,test:[2,3,13],text:[0,1,3,18],text_to_express:[8,17,21],textual:8,than:[0,3,5,6,7,8,9,13,15,16,18,23,24],thei:[2,5,6,7,8,11,13,15,18,19,21,23,24],them:[2,3,5,6,7,11,13,15,18,19,20,24],themselv:[15,18,24],theori:[2,3,13,15],therefor:7,thi:[0,1,2,3,4,5,6,7,8,9,12,13,15,16,18,19,20,21,22,23,24],thing:[2,7,11,13,15,18,19,21,23,24],think:[2,6,8,11,13,15,16,18],third:[3,7,8,11,24],thirti:6,those:[2,3,5,11,13,18,20,24],though:[6,15],thought:[8,15],thousand:6,thread:[2,15],three:[2,3,5,6,8,11,12,16,18,20],through:[1,6,8,16,18,19,23,24],thun:[2,3,4,10,13,15],thunder:8,thunk:15,time:[3,5,6,8,9,11,13,15,18,19],titl:18,to_check:5,to_set:11,todai:8,todo:[8,21],togeth:[7,8,15,18,20],token:21,toler:20,too:[5,13,18],tool:[8,18],tooo:18,top:[2,3,8,13,18,22,23],total:6,tower:18,trace:[0,8,12,13,19,20,23],traceback:[],traceprint:22,track:[12,18,19],tracker:0,transform:4,transit:5,translat:[4,12,18],trap:5,trash:[],travers:[0,20],treasur:0,treat:[0,2,3,13,18,20],treatment:7,tree:[0,8,20],treegrind:20,treestep:[0,20],tri:6,triangl:15,triangular_numb:13,trick:[6,18],tricki:18,trinari:24,trobe:0,trove:0,truediv:24,truli:[],trust:[],truthi:[3,8,15,18,24],tuck:[3,8,18,24],tupl:[3,5,8,18,23,24],ture:[],turn:[2,3,5,18,24],twice:[11,13],two:[2,3,6,8,9,11,12,13,15,16,17,18,19,20,23,24],type:[0,1,4,8,11,13,15,20,21,22,23],type_check:24,typeerror:18,typeless:18,typic:[2,3,12,13],unari:8,unarybuiltinwrapp:3,unbalanc:[11,21],unbound:24,unchang:11,uncompil:18,uncon:[3,7,8,11,13,16,19,24],under:[2,3,8,11],underli:[5,15,18],underscor:18,understand:[0,11],undistinguish:11,undocu:8,unend:[],unfinish:5,unfortun:23,unicod:18,unif:[18,20],unifi:[17,24],union:5,uniqu:[3,5,11,18],unit:[3,8,13,15,24],univers:[0,8,15,18,24],unlik:15,unnecessari:20,unnecesssari:18,unpack:[2,3,11,23],unpair:6,unquot:[8,16],unrol:5,unstack:[3,18],unswon:[3,24],untangl:13,until:[5,7,15],unus:6,unusu:11,unwrap:5,updat:[0,17,20,24],uppercas:5,upward:15,usag:8,use:[0,2,3,4,5,6,7,8,9,10,11,12,13,14,16,19,20,23],used:[3,4,8,11,13,15,18,19,21,23,24],useful:[0,15,18],user:16,uses:[2,5,6,13],using:[7,11,12,13,16,19,24],usual:[0,2,13],util:[0,3,14,17,18],valid:18,valu:[0,2,3,6,8,9,12,13,14,15,16,18,20,23,24],value_n:11,valueerror:[5,18,23],variabl:[18,20,24],variant:11,variat:[13,15,20],varieti:[4,8],variou:0,vener:23,verbos:4,veri:[0,1,4,5,8,11,23],verifi:[],versa:[2,18],version:[0,1,2,5,7,10,16,19,20],via:8,vice:[2,18],view:[11,20],viewer:[1,8,10,22],vii:20,visibl:18,von:[0,2,3,4,13],waaaai:5,wai:[0,2,3,4,5,6,8,13,14,15,18],wait:15,want:[2,6,7,9,11,13,18],warranti:[3,8],wash:8,wast:8,web:23,websit:[0,6],welcom:8,well:[0,4,8,9,11,18,21],went:18,were:[8,18,19],what:[2,3,4,5,8,11,13,15,16,18,22],whatev:[2,3,13,16,23],when:[6,7,8,11,13,15,18,19,21,23,24],where:[2,3,5,8,11,13,18,20,23],whether:13,which:[0,1,5,6,8,9,11,13,15,16,18,19,23,24],whole:[2,3,6,13,16,18],whose:7,why:[9,15,16],wiki:11,wikipedia:[0,11,19],wildli:8,wind:8,wire:13,within:[8,11,14,20],without:[2,8,11,12,15,18],won:[11,18,23],word:[0,3,6,8,13,19],work:[0,3,5,6,7,8,9,11,12,13,15,16,19,20,23,24],worker:15,worri:15,worth:6,would:[2,6,7,8,9,11,13,15,18,19,23,24],wrap:[3,8],wrapper:18,write:[4,5,9,11,13,15,16,18,19,20,23],written:[0,1,9,11,14,18,23],wrong:2,wrote:18,xrang:18,yang:18,yeah:15,year:[8,18],yet:[11,15,18,19,24],yield:[2,3,13,18,23,24],yin:20,you:[0,2,3,5,6,7,8,10,11,12,13,14,15,16,18,19,22,23],your:[2,3,8,13,18],yourself:[5,8,11],zero:[3,5,11,13,15,16,18,21,23,24],zip:[5,6,18],zip_:3,zipper:[0,20],zstr:19},titles:["Thun 0.2.0 Documentation","Joy Interpreter","Functions Grouped by, er, Function with Examples","Function Reference","Categorical Programming","\u2202RE","Developing a Program in Joy","Using x to Generate Values","Thun: Joy in Python","Newton\u2019s method","No Updates","Treating Trees I: Ordered Binary Trees","Quadratic formula","Recursion Combinators","Replacing Functions in the Dictionary","The Four Fundamental Operations of Definite Action","Treating Trees II: treestep","Type Checking","The Blissful Elegance of Typing Joy","Traversing Datastructures with Zippers","Essays about Programming in Joy","Parsing Text into Joy Expressions","Tracing Joy Execution","Stack or Quote or Sequence or List\u2026","Type Inference of Joy Expressions"],titleterms:{"\u03bb":5,"\u03d5":5,"abstract":[],"case":[9,11],"function":[2,3,5,8,9,11,13,14,15,16,18],"long":14,"new":11,"p\u00f6ial":18,"try":5,"void":2,"while":[2,15],Adding:11,One:[7,11],The:[6,8,11,13,15,16,18],There:8,Using:7,With:[5,16],about:20,action:15,add:[2,11],adding:11,address:19,alphabet:5,altern:16,ana:13,analysi:6,anamorph:[2,13],app1:2,app2:2,app3:2,appendix:[11,13,18],appli:15,approxim:9,argument:18,auto:3,averag:2,base:[9,11],binari:[2,11,16],bliss:18,both:11,branch:[2,11,15],brzozowski:5,can:11,cata:13,catamorph:13,categor:4,chatter:2,check:17,child:11,choic:2,clear:2,cleav:[2,15],cmp:11,code:[8,11],combin:[2,11,13,18],comment:18,compact:5,compar:11,comparison:2,compil:[7,18],compile_:18,compos:18,comput:9,con:[2,18],concat:2,conclus:[13,18],consecut:9,continu:8,current:11,datastructur:[5,8,11,19],deal:18,defin:[11,16],definit:[12,15],delabel:18,delet:11,deriv:[5,12,13,16],design:13,determin:19,develop:6,diagram:5,dialect:0,dictionari:14,dip:[2,19],dipd:2,dipdd:2,direco:7,disenstacken:2,distinguish:18,div:2,doc_from_stack_effect:18,document:0,doe:11,down_to_zero:2,drive:5,drop:2,dup:[2,18],dupd:2,dupdip:2,effect:18,eleg:18,els:11,empti:11,enstacken:2,equal:11,essai:20,euler:[6,7],eval:8,even:7,exampl:[2,8,11,13,16,17],execut:22,explor:5,express:[5,8,21,24],extract:16,factori:13,fail:17,fibonacci:7,filter:6,find:[9,11,13],finish:15,finit:5,first:[2,6,15,18],five:7,flatten:2,flexibl:16,floordiv:2,formula:12,found:11,four:[13,15],fsm:5,fulmin:15,fun:13,fundament:15,further:6,gcd:2,gener:[3,5,6,7,9],genrec:2,get:[11,16],getitem:2,given:16,greater:11,group:2,handl:15,have:[11,16],help:2,highest:11,host:0,how:[6,7],hybrid:18,hylo:13,hylomorph:13,identifi:18,ift:[2,15],iii:18,implement:[5,18],indic:0,infer:[18,24],inferenc:18,inform:0,infra:[2,19],integ:6,interest:7,interlud:11,intern:21,interpret:[1,8,18],item:19,iter:[6,11],joi:[0,1,3,6,8,13,18,19,20,21,22,23,24],join:15,junk:[],just:6,kei:11,kind:15,languag:0,larger:5,least_fract:2,left:11,less:11,let:[5,6],letter:5,librari:[3,8,18],like:11,list:[2,23],literari:8,littl:6,logic:[2,18],loop:[2,8,15],lower:11,lshift:2,machin:5,make:[7,9],mani:6,map:[2,15],match:5,math:2,memoiz:5,method:9,min:2,miscellan:2,mod:2,modifi:18,modulu:2,more:11,most:11,mul:[2,18],multipl:[6,7,18],must:11,name:12,neg:2,newton:9,next:9,node:11,non:11,now:11,nullari:2,nulli:5,number:[13,18],one:8,onli:8,oper:15,order:[11,16],osdn:0,other:15,our:11,out:5,over:2,pack:6,pam:[2,15],para:13,paradigm:18,parallel:15,parameter:[11,16],pars:[2,21],parser:[8,21],part:18,pass:8,path:19,pattern:13,per:11,poly_typ:[],polytyp:24,pop:[2,18],popd:2,popop:2,pow:2,power:7,pred:2,predic:[6,9,11,16],pretty_print:22,primit:13,primrec:2,print:8,problem:[6,7],process:11,product:2,program:[4,6,12,16,20],progress:18,project:[0,6,7],pure:8,put:[11,12,16],python:[8,14,18],quadrat:12,quick:0,quot:[2,23],rang:[2,6,13],range_to_zero:2,read:8,recur:[9,11],recurs:[11,13,16],redefin:[11,16],refactor:[6,11],refer:3,regular:[5,8],reimplement:16,relabel:18,rem:2,remaind:2,remov:2,render:6,repl:8,replac:[11,14],repres:[5,18],represent:5,reset:7,rest:[2,18],revers:[2,5,17],right:[11,19],rightmost:11,roll:[2,18],rolldown:2,rollup:2,rshift:2,rule:[5,18],run:[2,7],second:[2,18],select:2,sequenc:[7,15,18,23],set:[9,11],shorter:14,should:8,shunt:2,simpl:18,simplest:6,size:[2,14],someth:[],sourc:11,special:[13,18],sqr:[2,18],sqrt:[2,12],stack:[2,8,18,23],start:0,state:5,step:[2,13,16],straightforward:12,stream:5,string:5,structur:11,style:8,sub:[2,11],subtyp:18,succ:2,sum:[2,6],swaack:2,swap:[2,18],swon:2,swoncat:2,symbol:[8,13],tabl:0,tail:13,take:2,term:[6,7,16],ternari:2,text:21,than:11,them:12,thi:11,third:[2,18],three:7,thun:[0,8],time:[2,7],togeth:[11,12,16],token:8,toler:9,trace:[14,22],traceprint:8,trampolin:5,travers:[11,16,19],treat:[11,16],tree:[11,16,19],treegrind:16,treestep:16,triangular:13,truediv:2,truthi:2,tuck:2,two:[5,7],type:[17,18,24],unari:2,unbound:18,uncon:[2,18],unif:17,unifi:18,unit:2,unnecessari:6,unquot:2,unstack:2,updat:[10,18],use:18,util:[22,23,24],valu:[7,11],variabl:12,variat:7,version:[6,11,14,18],view:8,vii:18,within:9,word:2,work:[17,18],write:12,xor:2,yin:18,zero:7,zip:2,zipper:19}}) \ No newline at end of file diff --git a/docs/sphinx_docs/_build/html/types.html b/docs/sphinx_docs/_build/html/types.html index e65bec7..d2335dc 100644 --- a/docs/sphinx_docs/_build/html/types.html +++ b/docs/sphinx_docs/_build/html/types.html @@ -291,7 +291,7 @@ guard against being used on invalid types.

    -joy.utils.polytypes.FUNCTIONS = {'_Tree_add_Ee': _Tree_add_Ee, '_Tree_delete_R0': _Tree_delete_R0, '_Tree_delete_clear_stuff': _Tree_delete_clear_stuff, '_Tree_get_E': _Tree_get_E, 'add': add, 'and': and, 'b': b, 'bool': bool, 'branch': branch, 'ccons': ccons, 'clear': clear, 'concat_': concat_, 'cons': cons, 'dip': dip, 'dipd': dipd, 'dipdd': dipdd, 'div': div, 'divmod': divmod, 'dup': dup, 'dupd': dupd, 'dupdd': dupdd, 'dupdip': dupdip, 'eq': eq, 'first': first, 'first_two': first_two, 'floordiv': floordiv, 'fourth': fourth, 'ge': ge, 'gt': gt, 'i': i, 'infra': infra, 'le': le, 'loop': loop, 'lshift': lshift, 'lt': lt, 'modulus': modulus, 'mul': mul, 'ne': ne, 'neg': neg, 'not': not, 'nullary': nullary, 'over': over, 'pm': pm, 'pop': pop, 'popd': popd, 'popdd': popdd, 'popop': popop, 'popopd': popopd, 'popopdd': popopdd, 'pow': pow, 'pred': pred, 'product': product, 'rest': rest, 'rolldown': rolldown, 'rollup': rollup, 'rrest': rrest, 'rshift': rshift, 'second': second, 'sqrt': sqrt, 'stack': stack, 'stuncons': stuncons, 'stununcons': stununcons, 'sub': sub, 'succ': succ, 'sum': sum, 'swaack': swaack, 'swap': swap, 'swons': swons, 'third': third, 'truediv': truediv, 'tuck': tuck, 'uncons': uncons, 'unit': unit, 'unswons': unswons, 'x': x}
    +joy.utils.polytypes.FUNCTIONS = {'!=': ne, '&': and, '*': mul, '+': add, '++': succ, '-': sub, '--': pred, '/': truediv, '<': lt, '<<': lshift, '<=': le, '<>': ne, '=': eq, '>': gt, '>=': ge, '>>': rshift, '_Tree_add_Ee': _Tree_add_Ee, '_Tree_delete_R0': _Tree_delete_R0, '_Tree_delete_clear_stuff': _Tree_delete_clear_stuff, '_Tree_get_E': _Tree_get_E, 'add': add, 'and': and, 'b': b, 'bool': bool, 'branch': branch, 'ccons': ccons, 'clear': clear, 'concat_': concat_, 'cons': cons, 'dip': dip, 'dipd': dipd, 'dipdd': dipdd, 'div': div, 'divmod': divmod, 'dup': dup, 'dupd': dupd, 'dupdd': dupdd, 'dupdip': dupdip, 'eq': eq, 'first': first, 'first_two': first_two, 'floordiv': floordiv, 'fourth': fourth, 'ge': ge, 'gt': gt, 'i': i, 'infra': infra, 'le': le, 'loop': loop, 'lshift': lshift, 'lt': lt, 'modulus': modulus, 'mul': mul, 'ne': ne, 'neg': neg, 'not': not, 'nullary': nullary, 'over': over, 'pop': pop, 'popd': popd, 'popdd': popdd, 'popop': popop, 'popopd': popopd, 'popopdd': popopdd, 'pow': pow, 'pred': pred, 'product': product, 'rest': rest, 'roll<': rolldown, 'roll>': rollup, 'rolldown': rolldown, 'rollup': rollup, 'rrest': rrest, 'rshift': rshift, 'second': second, 'sqrt': sqrt, 'stack': stack, 'stuncons': stuncons, 'stununcons': stununcons, 'sub': sub, 'succ': succ, 'sum': sum, 'swaack': swaack, 'swap': swap, 'swons': swons, 'third': third, 'truediv': truediv, 'truthy': bool, 'tuck': tuck, 'uncons': uncons, 'unit': unit, 'unswons': unswons, 'x': x}

    Docstring for functions in Sphinx?

    @@ -372,6 +372,14 @@ expression is carried along and updated and yielded.

    effects. An expression is carried along and updated and yielded.

    +
    +
    +joy.utils.polytypes.type_check(name, stack)[source]
    +

    Trinary predicate. True if named function type-checks, False if it +fails, None if it’s indeterminate (because I haven’t entered it into +the FUNCTIONS dict yet.)

    +
    +
    diff --git a/docs/sphinx_docs/notebooks/Derivatives_of_Regular_Expressions.rst b/docs/sphinx_docs/notebooks/Derivatives_of_Regular_Expressions.rst index da66e21..a629254 100644 --- a/docs/sphinx_docs/notebooks/Derivatives_of_Regular_Expressions.rst +++ b/docs/sphinx_docs/notebooks/Derivatives_of_Regular_Expressions.rst @@ -266,10 +266,6 @@ derivation. .. code:: ipython2 - # This is the straightforward version with no "compaction". - # It works fine, but does waaaay too much work because the - # expressions grow each derivation. - def D(symbol): def derv(R): @@ -539,9 +535,8 @@ machine transition table. Says, "Three or more 1's and not ending in 01 nor composed of all 1's." .. figure:: omg.svg - :alt: omg.svg + :alt: State Machine Diagram - omg.svg Start at ``a`` and follow the transition arrows according to their labels. Accepting states have a double outline. (Graphic generated with diff --git a/docs/sphinx_docs/notebooks/index.rst b/docs/sphinx_docs/notebooks/index.rst index dc390b9..c14aafa 100644 --- a/docs/sphinx_docs/notebooks/index.rst +++ b/docs/sphinx_docs/notebooks/index.rst @@ -18,6 +18,9 @@ These essays are adapted from Jupyter notebooks. I hope to have those hosted so Newton-Raphson Zipper Types + TypeChecking NoUpdates Categorical + The_Four_Operations + Derivatives_of_Regular_Expressions