Skip to main content

A generator of fusion functions for Semantic Fusion (YinYang).

Project description

fusion-function-generator (ffg)

CI

Automatic generation of Fusion Functions used by yinyang fuzzer for Semantic Fusion.

Lib structure

The package is divided into 4 folders:

  • gen
  • operators
  • visitors
  • emitter

The folder gen contains the code which is used to generate the whole operators folder, the configuration file exposing some api to control which operators to use during the generation of the tree as well as some constants for the options to the generation algorithm. the file tree_generation instead contains the main tree generation algorithm.

operators contains the basic definition of the operators classes.

visitors folder contains useful api to print, export to DOT format and rewrite the trees to their inverses.

Finally, emitter includes the code needed to export fusion functions to the format understood by YinYang. It also contains an emitter that outputs fusion functions and its inverses to DOT file.

Cookbook

Use only a subset of the theories in the generation:

ffg.gen.gen_configuration.set_available_theories(['bool', 'real'])

Get the available theories:

ffg.gen.gen_configuration.get_theories()

Generate a fusion function of two variables (as a tree):

tree, _ = ffg.gen.tree_generation.generate_tree(root_type, size, ['x', 'y'], 'z')

Emit the fusion function to YinYang format as a string:

output = io.StringIO()
emit_function(tree, output, wrap=False)
ff = output.getvalue()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ffg-0.1.2.tar.gz (22.9 kB view hashes)

Uploaded Source

Built Distribution

ffg-0.1.2-py3-none-any.whl (46.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page