stitch_core
Functions
|
Builds command line argument version of a Python argument, so for example: - build_arg("max_arity",3) -> "--max-arity=3" - build_arg("silent",True) -> "--silent" - build_arg("silent",False) -> "" |
|
Runs abstraction learning on a list of programs, optimizing for a compression objective (see Compression Objectives). |
|
|
|
Translates a program or list of programs from dreamcoder format to stitch format using the name_mapping obtained from name_mapping_dreamcoder() or name_mapping_stitch(). |
|
Takes a dreamcoder-style json dictionary and returns a dictionary of arguments to pass as kwargs to compress() or rewrite(). |
|
Takes a dreamcoder-style json dictionary and returns a list of tuples of the form (name, anonymous_abstraction) where name is the name of the abstraction (like "fn_0") and anonymous_abstraction is the dreamcoder-format anonymous abstraction like "#(lambda (foo (#(lambda bar $0))))". |
|
Same as name_mapping_dreamcoder() but when starting from a stitch output json, such as the .json field of CompressionResult. |
|
Parses a string into an s-expression. |
|
Replaces all instances of prim in program with new. |
|
Rewrites a set of programs with a list of abstractions. |
|
|
|
|
|
Translates a program or list of programs from stitch format to dreamcoder format using the name_mapping obtained from name_mapping_dreamcoder() or name_mapping_stitch(). |
|
Classes
|
A functional abstraction |
|
The result of calling compress(). |
|
The result of calling rewrite(). |
Exceptions
|
|
|
|
Raised when the Stitch's Rust backend panics |