This repo is not current. Development has moved from Hg to Git. For the latest code use the "Source Code" tab above to go to the "Thun" git repo or navigate to:
https://osdn.net/projects/joypy/scm/git/Thun
Revision | b9ffe6340ee16d3c35e260a48edfaccc8245d1b0 (tree) |
---|---|
Time | 2020-04-25 13:27:26 |
Author | ![]() |
Commiter | Simon Forman |
Don't automodule non-existent joy.utils.polytypes module.
@@ -2,14 +2,21 @@ | ||
2 | 2 | Type Inference of Joy Expressions |
3 | 3 | ================================= |
4 | 4 | |
5 | -Two kinds of type inference are provided, a simple inferencer that can handle functions that have a single stack effect (aka "type signature") and that can generate Python code for a limited subset of those functions, and a more complex inferencer/interpreter hybrid that can infer the stack effects of most Joy expressions, including multiple stack effects, unbounded sequences of values, and combinators (if enough information is available.) | |
5 | +Two kinds of type inference are provided, a simple inferencer that can | |
6 | +handle functions that have a single stack effect (aka "type signature") | |
7 | +and that can generate Python code for a limited subset of those | |
8 | +functions, and a more complex inferencer/interpreter hybrid that can | |
9 | +infer the stack effects of most Joy expressions, including multiple stack | |
10 | +effects, unbounded sequences of values, and combinators (if enough | |
11 | +information is available.) | |
6 | 12 | |
7 | 13 | |
8 | 14 | ``joy.utils.types`` |
9 | 15 | ------------------- |
10 | 16 | |
11 | 17 | |
12 | -Curently (asterix after name indicates a function that can be auto-compiled to Python):: | |
18 | +Curently (asterix after name indicates a function that can be | |
19 | +auto-compiled to Python):: | |
13 | 20 | |
14 | 21 | _Tree_add_Ee = ([a4 a5 ...1] a3 a2 a1 -- [a2 a3 ...1]) * |
15 | 22 | _Tree_delete_R0 = ([a2 ...1] a1 -- [a2 ...1] a2 a1 a1) * |
@@ -77,10 +84,19 @@ | ||
77 | 84 | :members: |
78 | 85 | |
79 | 86 | |
80 | -``joy.utils.polytypes`` | |
81 | -------------------------- | |
82 | 87 | |
83 | -Example output of the ``infer()`` function. The first number on each line is the depth of the Python stack. It goes down when the function backtracks. The next thing on each line is the currently-computed stack effect so far. It starts with the empty "identity function" and proceeds through the expression, which is the rest of each line. The function acts like an interpreter but instead of executing the terms of the expression it composes them, but for combinators it *does* execute them, using the output side of the stack effect as the stack. This seems to work fine. With proper definitions for the behavior of the combinators that can have more than one effect (like ``branch`` or ``loop``) the ``infer()`` function seems to be able to handle anything I throw at it so far. | |
88 | +Example output of the ``infer()`` function. The first number on each | |
89 | +line is the depth of the Python stack. It goes down when the function | |
90 | +backtracks. The next thing on each line is the currently-computed stack | |
91 | +effect so far. It starts with the empty "identity function" and proceeds | |
92 | +through the expression, which is the rest of each line. The function | |
93 | +acts like an interpreter but instead of executing the terms of the | |
94 | +expression it composes them, but for combinators it *does* execute them, | |
95 | +using the output side of the stack effect as the stack. This seems to | |
96 | +work fine. With proper definitions for the behavior of the combinators | |
97 | +that can have more than one effect (like ``branch`` or ``loop``) the | |
98 | +``infer()`` function seems to be able to handle anything I throw at it so | |
99 | +far. | |
84 | 100 | |
85 | 101 | :: |
86 | 102 |
@@ -135,7 +151,3 @@ | ||
135 | 151 | (i2 i1 -- f1) |
136 | 152 | (i2 i1 -- i3) |
137 | 153 | |
138 | -.. automodule:: joy.utils.polytypes | |
139 | - :members: | |
140 | - | |
141 | - |