How foreverhaibara/triple-sos works
Triples accepts polynomial inequalities through a Python API or a GUI, parses and models the problem, then searches for a readable SOS certificate. The documented proof search applies symbolic transformations or invokes StructuralSOS, LinearSOS, or SDPSOS; numerical LP/SDP results are rationalized into exact proofs. The graph preserves these solver branches and the SDP backend layer. Some relationships are based on README descriptions and the source index; unsampled modules are represented only where documented capabilities support them.
Main entry points: dispatch.py Solver dispatch · web_main.py GUI server · gradio.app.py Gradio app · node.py Proof tree
Components 17
User interfaces
- GUI server
web_main.py - Gradio app
gradio.app.py - Text parser
triples/utils/text_process.py - GUI manager
triples/gui/sos_manager.py
Proof search
- SOS API
triples/core/sum_of_squares.py - Inequality model
triples/core/problem.py - Proof tree
triples/core/node.py - Problem transforms
triples/core/preprocess - Solver dispatch
triples/core/dispatch.py - Proof result
triples/core/solution.py
SOS solvers
- Structural SOS
triples/core/structsos - Linear SOS
triples/core/linsos/linsos.py - SDP SOS
triples/core/sdpsos/sdpsos.py
SDP engine
- SDP formulation
triples/sdp/dual.py - Solver backends
triples/sdp/backends/caller.py - Exact rationalization
triples/sdp/rationalize.py
Other components
- User
Connections 21
- User → GUI server: enters inequality
- User → Gradio app: enters inequality
- User → SOS API: submits expression
- GUI server → Text parser: parses input
web_main.py - Gradio app → Text parser: parses input
gradio.app.py - GUI server → GUI manager: uses
web_main.py - Gradio app → GUI manager: uses
gradio.app.py - GUI manager → SOS API: solves problem
triples/gui/sos_manager.py - SOS API → Inequality model: models input
triples/core/__init__.py - Inequality model → Proof tree: creates proof search
triples/core/problem.py - Proof tree → Problem transforms: transforms subgoals
triples/core/node.py - Proof tree → Solver dispatch: selects solver
- Solver dispatch → Structural SOS: invokes
triples/core/dispatch.py - Solver dispatch → Linear SOS: invokes
triples/core/dispatch.py - Solver dispatch → SDP SOS: invokes
triples/core/dispatch.py - Linear SOS → Proof result: returns certificate
triples/core/linsos/linsos.py - SDP SOS → SDP formulation: builds SDP
triples/core/sdpsos/sdpsos.py - SDP formulation → Solver backends: solves program
triples/sdp/dual.py - Solver backends → Exact rationalization: rationalizes result
- SDP SOS → Proof result: returns certificate
triples/core/sdpsos/sdpsos.py - Structural SOS → Proof result: returns certificate