Skip to content

Add documentation for loops #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/md/README_3_NON-DET.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ order. Click on a name to see how it is used.
## What can you do in Source §3 Non-Det?

You can use all features of
<a href="../source_3/">Source §3</a>, with the exception of loops, and all
<a href="../source_3/">Source §3</a> and all
features that are introduced in
<a href="https://sicp.comp.nus.edu.sg/chapters/85">chapter 4.3</a> of the
textbook.
Expand Down
4 changes: 3 additions & 1 deletion docs/specs/source_3_nondet.tex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ \section*{Changes}

In the Source Academy implementation, the Source \S 3 Non-Det evaluator can only process one program at a time. If the evaluator is given a new program \textbf{before} all the outcomes of an existing program have been processed, then all remaining outcomes will be ignored. \newline

Unlike Source \S 3, Source \S 3 Non-Det currently does not support loops.
Unlike the implementations of Source \S 3, the implementation of Source \S 3 Non-Det does not use a constant amount of memory for loops. Instead, memory usage increases linearly with the number of iterations. This is because each iteration can be nondeterministic. Each iteration's state must be kept in memory so that the language processor can backtrack to every iteration. Similarly, no tail call optimization is done, because every function application's state must be kept in memory to allow backtracking.


\input source_bnf.tex
Expand All @@ -33,6 +33,8 @@ \section*{Changes}

\input source_boolean_operators

\input source_loops

\input source_return_3

\input source_names
Expand Down
100 changes: 0 additions & 100 deletions docs/specs/source_3_nondet_bnf.tex

This file was deleted.