You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The question is
how to implement omissible function in the most MeTTa-like way to automatically check if an agent has 2 or more skills and mark all of them but one (which one?) as omissible?
Well, I'm not precisely sure what do you mean by "mark". You are not putting info into the space, right? But I suppose that you mean that omissible function will return True for all the agent skill except one of them.
"which one?" is the question to the domain semantics. Apparently, you either should have one non-omissible skill, or skills should be omissible conditionally. Maybe, the latter cannot be described in the representation of this logic - I don't know.
I'm also not sure what (experience $e $m) means. Is it a function, or a constructor? If it's a constructor, I'd propose to follow some naming conventions to distinguish them from functions, e.g. Experience. Also (= (permissible economics) True) might be better as (= (permissible (Skill economics)) True), but it depends...
There is a pretty simple way to get all agent skills:
If you want to mark these skills by putting the corresponding equalities into the space, it will be quite straightforward to do. You may want to check if this is not yet added to the space, though. But if you want to have omissible function without side effects, then it looks a little bit less straightforward. If I guessed your notations right, then it can look like this
It will return Empty in the last case (not False). If we put just (== $skill $om-skl) instead of (if (== $skill $om-skl) True Empty)), there will be too many False. So, if you really need False instead of Empty, one more wrapper function is needed.
I don't like this solution too much, because it will collect all the skills and check if the given skill is in the truncated list. But maybe it's ok. There is also no guarantee that agent-skills will always return skills in the same order. It kinda works now, but returning the list (or nondeterministic set) of omissible skills would be more efficient and solid than checking omissible individually without putting results in the space. But what is preferable depends on a more general context.
Activity
Necr0x0Der commentedon Jan 30, 2025
Well, I'm not precisely sure what do you mean by "mark". You are not putting info into the space, right? But I suppose that you mean that
omissiblefunction will returnTruefor all the agent skill except one of them."which one?" is the question to the domain semantics. Apparently, you either should have one non-omissible skill, or skills should be omissible conditionally. Maybe, the latter cannot be described in the representation of this logic - I don't know.
I'm also not sure what
(experience $e $m)means. Is it a function, or a constructor? If it's a constructor, I'd propose to follow some naming conventions to distinguish them from functions, e.g.Experience. Also(= (permissible economics) True)might be better as(= (permissible (Skill economics)) True), but it depends...There is a pretty simple way to get all agent skills:
Then, this will give you the agent skill list omitting the first skill as a tuple:
If you want to mark these skills by putting the corresponding equalities into the space, it will be quite straightforward to do. You may want to check if this is not yet added to the space, though. But if you want to have
omissiblefunction without side effects, then it looks a little bit less straightforward. If I guessed your notations right, then it can look like thisIt will return
Emptyin the last case (notFalse). If we put just(== $skill $om-skl)instead of(if (== $skill $om-skl) True Empty)), there will be too manyFalse. So, if you really needFalseinstead ofEmpty, one more wrapper function is needed.I don't like this solution too much, because it will collect all the skills and check if the given skill is in the truncated list. But maybe it's ok. There is also no guarantee that
agent-skillswill always return skills in the same order. It kinda works now, but returning the list (or nondeterministic set) of omissible skills would be more efficient and solid than checkingomissibleindividually without putting results in the space. But what is preferable depends on a more general context.