PySAT Documentation

repository·master·Indexed 19 days ago

https://github.com/pysathq/pysat

A toolkit for SAT-based problem solving featuring core modules for engines, formulas, and solvers, including C/C++ Python wrappers. The library provides implementations for MaxSAT solvers (such as RC2 and Fu&Malik), MUS extractors, and MCS enumerators, as well as interfaces to third-party tools like ApproxMCv4 via the .allies package.

Tokens
2.1K
Snippets
8
Records
20
Agent score
66%

What's inside PySAT

  1. Overview of PySAT core modules

    master

    The PySAT toolkit is organized into seven core modules. These are divided into two categories based on their implementation:

    Pure Python Modules

    These modules are implemented entirely in Python:

    • .engines
    • .formula
    • .integer

    C/C++ Python Wrappers

    These modules provide Python interfaces to high-performance code originally implemented in C/C++:

    • .card
    • .pb (a wrapper for PyPBLib functionality)
    • .process
    • .solvers
  2. Manage news posts and single-page news

    master

    Standard News

    • The first post in /content/en/news is automatically highlighted on the front page. To disable this, remove the /content/en/news folder.
    • News items link to the /news category page by default. To change this, set newsLink in the post's preamble.

    Single Page News

    Instead of using a folder for posts, you can list all news items on a single page using /news.md. To ensure the front page banner is populated, set the newsHeader parameter in the preamble of /news.md.

  3. Explore PySAT examples and practical scripts

    master

    The .examples package contains scripts designed to demonstrate practical problem-solving using the toolkit. It includes implementations for:

    • Formula generation
    • MaxSAT solvers (including RC2)
    • (S)MUS extractors and enumerators
    • MCS enumerators
  4. PySAT Release Model and Upgrading

    master

    PySAT uses a rolling release model. Instead of infrequent major releases, the toolkit receives many small, frequent updates. To ensure you have the latest bug fixes, solver support, and performance improvements, it is recommended to upgrade your installation periodically.

    Refer to the installation guide for specific upgrade instructions.

  5. Use the PySAT allies package for third-party tools

    master
    The .allies module provides interfaces to external tools important for SAT-based problem solving. While the module is intended to grow, it currently provides access to tools like ApproxMCv4.
  6. Install the Scientific Python Hugo Theme

    master

    To set up a new website using the Scientific Python Hugo Theme, follow these steps:

    1. Prerequisites: Ensure Hugo is installed and available in your system path.
    2. Template Setup: Download the theme ZIP file, extract it, and copy the doc folder to your new project directory.
    3. Git Submodule: Initialize a git repository in your project and add the theme as a submodule to manage updates.
    4. Launch: Use make serve to start a local development server.
    # 1. Copy the doc folder as a template
    cp -r scientific-python-hugo-theme-main/doc ./my-website
    cd my-website
    
    # 2. Initialize git and add the theme as a submodule
    git init
    git submodule add https://github.com/scientific-python/scientific-python-hugo-theme themes/scientific-python-hugo-theme
    
    # 3. Build and serve the site
    make serve
  7. Generate a team gallery from GitHub

    master

    The tools/team_query.py script fetches team member data from GitHub.

    Requirements:

    • Set the GH_TOKEN environment variable to a valid GitHub personal access token.

    Usage: Run the script to generate a Markdown file containing team information, which can then be rendered using team and team_member shortcodes.

    python team_query.py --org scientific-python --team spec-steering-committee --title "Spec Steering Committee" > content/en/teams/spec-steering-committee.md
    python team_query.py --org scientific-python --team spec-steering-committee --title "Spec Steering Committee" > content/en/teams/spec-steering-committee.md