From 8b39f54165601e810e1a847371dff02342ee2d87 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Thu, 30 Sep 2021 10:10:23 -0700 Subject: [PATCH] [RFC] Move inlining examples to background section. --- docs/rfc/002-bounded-recursion.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/docs/rfc/002-bounded-recursion.md b/docs/rfc/002-bounded-recursion.md index 7a7d9c7c7f..ca868851de 100644 --- a/docs/rfc/002-bounded-recursion.md +++ b/docs/rfc/002-bounded-recursion.md @@ -18,10 +18,11 @@ otherwise, an informative message is shown to the user, who can try and increase the limit. Compilation may also fail if a circularity is detected before exceeding the limit. + Future analyses may also recognize cases in which the recursion terminates, informing the user and setting or suggesting a sufficient limit. -A similar approach could be also used for loops. +A similar approach could be also used for loops in the future. User-configurable limits may be also appropriate for other compiler transformations that are known to terminate but could result in a very large number of R1CS constraints. @@ -74,7 +75,7 @@ function main(a: u32) -> u32 { ### Constants and Variables A Leo program has two kinds of inputs: constants and variables; -both come from input files (which represent blockchain records). +both come from input files. They are passed as arguments to the `main` functions: the parameters marked with `const` receive the constant inputs, while the other parameters receive the variable inputs. @@ -125,14 +126,6 @@ it is the case that, due to the aforementioned partial evaluation, the `const` arguments of function calls have known values when the flattening transformations are carried out. -## Design - -After exemplifying how inlining of recursive functions may terminate or not, -we discuss our approach to avoid non-termination. -Then we discuss future optimizations, -and how the approach to avoid non-termination of recursion -may be used for other features of the Leo language. - ### Inlining Recursive Functions In the presence of recursion, @@ -340,6 +333,8 @@ function main() { ... ``` +## Design + ### Configurable Limit Our proposed approach to avoid non-termination