Skip to content
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

How to limit the invention to have a full function form? #182

Open
citceae opened this issue Nov 1, 2024 · 0 comments
Open

How to limit the invention to have a full function form? #182

citceae opened this issue Nov 1, 2024 · 0 comments

Comments

@citceae
Copy link

citceae commented Nov 1, 2024

Tested on Stitch API Python3.11.5

**_programs = [
"(str.substr $0 0 (+ -1 1))",
"(str.substr $0 0 5)",
"(str.substr $0 0 9)",
]

from stitch_core import compress

res = compress(programs, iterations=1, max_arity=3, silent = False)_**

The invention would be fn_0 arity=1: (str.substr #0 0), and the programs rewritted would be

(str.substr $0 0 (+ -1 1))---------(fn_0 $0 (+ -1 1))
(str.substr $0 0 5)---------(fn_0 $0 5)
(str.substr $0 0 9)---------(fn_0 $0 9)

There is an utility of 101.

However, the operator str.substr requires three parameters. To make the invention become a legal function, the correct form should be fn_0 arity=2: (str.substr #0 0 #1). The utility should be 0.

Is there a way to limit the invention to be a legal function instead of a function fragment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant