Managing concept properties in ConceptEvaluator

This commit is contained in:
2019-11-16 18:11:29 +01:00
parent 3a1dea19e8
commit 7fa509555d
13 changed files with 808 additions and 57 deletions
+74 -1
View File
@@ -396,4 +396,77 @@ I must choose between expressing my ideas in this blog and coding.
I have plenty of ideas that I would like to express, sometimes just to put the idea down,
but I lack of time. It would be great if I can find a tool that will allow me to just to
dictate my words. I know that there are plenty out there, I need to spend some time to test
them and choose one.
them and choose one.
2019-11-15
**********
Managing concepts resolutions
"""""""""""""""""""""""""""""
I am a little stuck on the algorithm I must use to derive (resolve) concepts. This is
one of this day I strongly regret to have someone I can discuss with :-(
Let's write the problem down, sometimes, it helps figure out the best approach.
::
def concept one as 1
one
The concept is first define (it returns the number 1), and then it's called.
During the call
1. During parsing,
Both Python parser and concept parser will recognize 'one'
2. During Evaluation,
* Python Evaluator will fail (one is not know by python)
* Concept Evaluator will success. My question is what should it return ?
The two option are:
1. Python node, to let the Python Evaluator work and return one, in the next row
2. Returns '1' directly
I as write it down, it is obvious that it must return 1, since the purpose of any
evaluation is to give a result, not the path to find the result.
Plus, if don"t resolve the body in the Concept Evaluator, I will loose where the
'1' comes from.
I don't know if I was clear. I don't even know if I will be able to re-read myself.
But I think that I have my solution.
2019-11-16
**********
ExactConceptParser limitation
"""""""""""""""""""""""""""""
From the beginning, my simplest example is to show that addition can be simply
explained to Sheerka
::
def concept a plus b as a + b
def concept one as 1
def concept two as 2
one plus two
The :code:`one plus two` is perfectly recognized, and the result is 3.
:code:`two plus one` also work (with the correct response).
But I was quite surprised to see that :code:`one plus one` was not recognized !!
Indeed, the **ExactConceptParser** looks for :code:`__var0__ plus __var1__`. So
the first operand and the second have to be different.
It's unexpected :-(
Do I need to enhance the parser to recognize it, or no I need to build another parser ?
If I tell the parser that :code:`a plus b`, how do I handle the cases where 'a 'and 'b'
MUST be different ? How I handle when the explicitly have to be the same ?
I seems that the purpose of the **ExactConceptParser** is to find exact match.
I need another way to express that 'a' and 'b' can be the same.