---
title: Valentin - Page 2
---
<style>
:root{--main-gray:#222;--secondary-gray:#323232;--main-blue:#54acee;--comments-color:#ff9fe5;--comments-author-color:#888;--h1-border-color:#666}.ui-content,body,html{background-color:var(--main-gray);color:#fff}.markdown-body .highlight pre,.markdown-body pre{background-color:var(--secondary-gray);color:#fff}.markdown-body h1{text-align:center;border-color:var(--h1-border-color);border-width:.01em;background-color:var(--secondary-gray);color:#fff;border-radius:5px 5px 5px 5px;box-shadow: 0px 2px 4px #121212;text-shadow: 0px 1px 3px black}.markdown-body h2{border-bottom-color:transparent}.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{background-color:transparent;color:#fff}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{color:#fff}.markdown-body img{background-color:transparent}.ui-toc-dropdown .nav>.active:focus>a,.ui-toc-dropdown .nav>.active:hover>a,.ui-toc-dropdown .nav>.active>a{color:#fff;border-left:3px solid var(--main-blue)}.back-to-top:focus,.back-to-top:hover,.expand-toggle:focus,.expand-toggle:hover,.go-to-bottom:focus,.go-to-bottom:hover{color:#fff}.ui-toc-dropdown{background-color:transparent}.ui-toc-label.btn{color:#fff}.ui-toc-dropdown .nav>li>a:focus,.ui-toc-dropdown .nav>li>a:hover{color:#fff;border-left:3px solid var(--main-blue)}.markdown-body blockquote{color:var(--comments-color)}.markdown-body code,.markdown-body tt{background-color:var(--secondary-gray)}.open-files-container li.selected a,a{color:var(--main-blue)}.alert-info{background-color:var(--secondary-gray);border-color:transparent}blockquote .small,blockquote footer,blockquote small{color:var(--comments-author-color)}.markdown-body hr{background-color:var(--secondary-gray);border-radius:5px 5px 5px 5px}.hljs-keyword,.hljs-selector-tag,.hljs-type{color:#f92472}.hljs-number,.hljs-literal,.hljs-symbol,.hljs-bullet,.hljs-attribute{color:#8c80ff}.hljs-comment,.hljs-meta{color:#74705d}.hljs-string,.hljs-variable,.hljs-template-variable,.hljs-strong,.hljs-emphasis,.hljs-quote{color:#e7db6a}.hljs-built_in,.hljs-builtin-name{color:#67d8ef}table{color: black;}
.page-container
{
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.page-element
{
color: var(--main-blue);
text-align: center;
background-color:var(--secondary-gray);
border-radius:5px 5px 5px 5px;
padding: 0px 5px 5px 5px;
margin-left: 5px;
box-shadow: 0px 1.5px 1px black;
user-select: none;
}
.page-title
{
text-align: center;
color: #fff;
font-size: 2em;
text-shadow: 0px 1px 5px black;
}
</style>
:::info
**<p class="page-title">Valentin's Documentation<br>Page 2</p>**
:::
# Pages.
<html>
<div class="page-container">
<div class="page-element">↠</div>
<a href="https://hackmd.io/LeL-co7mQQuUp0m89WB75g" target="_self" class="page-element">1</a>
<a href="https://hackmd.io/CYqY5kUUQBa44UZraXbZSA" target="_self" class="page-element">2</a>
<div class="page-element">↞</div>
</div>
</html>
# BUGS and TO-DO.
Here is listed everything that must be done on my work to fix/improve it.
- Renaming (the functions + all parameters/var name in the rest of the code that would be impacted by the changes):
* list_of_list_of_tree -> list_of_expr
* string_of_cstname -> string_of_expr
- Condition System:
* When building the feedback, randomly generated one feedback index per type of error.
* Create one unified function to build the condition feedback.
* Remove the layer between the condition function and the base function used in the condition (the feedback type encapsulation layer). Example: to compute a membership condition, 3 functions are required: the function that does the logical computation (is_expr_in_set), the function that encapsulates the call to the logical function and returns the appropriate result for feedback (cond_membership) and the function that is actually used in the condition system and that does all required data preprocessing (cond_func_membership). The idea is to find a way to delete the second step (cond_membership). This should be done automatically for unary/binary/n-ary condition logical function result.
* Add precision options for comparisons.
- Arithmetic module:
* Encapsulate in a module "Arithmetic".
* Fix the division by zero bug and the sign of NaN
* a+ib -> complex node in numeric simplify
* update i/pi/e
* Implement addList and multList with neutral element of operation.
* After truncating the result in numeric simplify, check if real can become an integer.
* Remove natural node from numeric simplify and use integer node instead
* As a consequence of the previous point -> Update the condition system to work with naturals that are encoded as positive integers.
* Implement NaN and infinity in numeric simplify
* Bug -> 0/0 gives "Belongs to C" (will be fixed if the division by 0 is fixed).
- Grammar additions/renaming:
* number_i
* number_pi
* number_e
* nan
* infinity
* complex
- Print_library:
* Simplify tree_of_expr (remove useless Symbtrans grammar and use name_and_list_node instead of IND(...)).
- expr_to_string:
* Add an option to enable/disable the printing of unary/binary/n-ary nodes + Add record for the options like with flush ??
- Brute force function:
* The function is already present as a placeholder in every metarule and only needs its body to be implemented.
* To be able to use the brute force case, we need to find a way to make the case of the ar_verif_process fail, which is not possible for now. It always succeeds, because there is always at least the Identity rule which always succeeds in PASS_2, even if not in PASS_1.
- Refactor valentin_functions in modules in separated files.
- Update grammar in converter in/out (for trigo and complex nodes).
- Also fix the issues with the minus sign if it used with a list like ["-" [1;2;3]] doesn't work for now.
- Bug in the angular-component exercise answer:
* When you received a piece of feedback for an exercise and clicked on the yellow button to display it, if you then click on the edit as JSON button, or any other button that would hide the feedback component while staying in the exercise-answer component, and then come back, the feedback is not displayed and you need to reclick on the yellow button. This is because the guppy editor that was used to display the feedback was removed to only use an html div where the text of the feedback is displayed. One must now change in the code every show/hide behaviour with this new html div to fix this issue. The file in question is "userInterfaces/src/app/exercise/exercise-answer/exercise-answer.component.ts". The new div is declared at the line 828, but it is an implicit declaration, which is the main problem. Several changes in the code must be done to fix this issue (only in this file) but requires a basic understanding of how angular and this specific component works, which I don't at the moment.
- The function "is_expr_number":
* This function is mainly used by the numeric evaluation case to determine if 'o' is a number. This function needs to be updated to be able to at least detect complex numbers. Then, a thinking process must establish what to do with fractions and irrational numbers. The main problem is that in the case of an evaluation like a/b + c/d = e/f, we cannot produce a rule that can encode such transformation. Therefore, e/f should probably be seen as the fraction resulting of the evaluation of a/b + c/d, and so e/f is also a number in that case, represented as a fraction, and should be detected by "is_expr_number". We could say that a fraction in a node frac with only numbers as leaves, but what about irrational numbers that use another unary operation like square root in one of the leaves? And all the other possibilities that I don't know about? It should also not be confused with a division since that would be an operation and not the representation of a number, which is a problem in tools like guppy that changes every division to a fraction whenever it cans.
# Concrete Rule query strategies (when creating exercises).
- Redaction -> write down the strategies:
* using keywords
* searching by group of rwvar with elastic search
* manual
- Search if we can have a rwvar principle in elasticsearch.
# Important question.
Regarding Human psychology, is different feedback for same mistakes a good thing, or should we have strict consistency regarding our messages for a given mistake?
# Hypothesis.
- When we build the feedback, the expressions that we combine in the sentences are small expressions. We cannot show a big tree in a sentence, this will be too dense for the reader. We should instead create a proportional snapshot of the tree by defining a ratio (like 2x3 or 3x2 with width * depth of nodes).
# Guidelines.
- We use the snake_case at all time, if it's not in snake_case then we know it is from Symbtrans or old EBoP.
- When using variants, always start a constructor with an uppercase letter. Then only use lowercase letters if you create construcors for a type (like a tree with constructors Leaf, Node, etc..) and only use uppercase letters if you create an enum (like OPTION_0, OPTION_1, etc..)
Example:
type tree =
| Leaf of string
| Node of (string * tree list)
;;
but
"OPTION_0"
"OPTION_1"
"OPTION_2"
Why: Enums are a standard feature across many languages and they're always defined using uppercase snake_case as the default case, even in languages like Java, C or C++ that do not use this case in the code itself.
# Install Script.
- EBoP's database currently only work with ElasticSearch 7.7.0.
- Related pip pckgs are:
* Django 4.0.10
* django-cors-headers 3.11.0
* django-elasticsearch-dsl 7.2.2
* django-import-export 2.7.1
* django-nose 1.4.7
* elasticsearch 7.7.1
* elasticsearch-dsl 7.2.1
- Rename install_dev_once to install_dev_once_V20 and update readme according to this.
- Update my V22 and push it as install_dev_once to git.
- Update the doc where it says "The recommended Linux system is Ubuntu 20.04 LTS. The former recommended version was Ubuntu 18.04, its related installation files are suffixed with V18." to follow the changes.