-
Notifications
You must be signed in to change notification settings - Fork 5
Add an argset chainer #11
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
base: main
Are you sure you want to change the base?
Conversation
This is a chainer that works on functions that have a set as an argument while allowing for partial application.
… storage and lookup
…mproved recursion
… improve error handling
experimental/argset-chaining/dgen.py
Outdated
@@ -0,0 +1,138 @@ | |||
import random | |||
|
|||
def random_subset(fact_list, min_count=0, max_count=1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might be interested to know that since 3.10, Python supports a rich type annotation language out-of-the-box.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know but that file actually wasn't supposed to be in that folder. I just deleted it in the latest version. That also contains some minor fixes.
|
||
;; Define <= | ||
(: <= (-> $a $a Bool)) | ||
(= (<= $x $y) (or (< $x $y) (== $x $y))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<=
is in the standard library of MeTTa so you don't need to define it anymore.
This is a chainer that works on functions that have a set as an argument while allowing for partial application.