"""MNT fiction framework.

This file is part of the MNT fiction framework released under the MIT license.
See https://github.com/cda-tum/fiction for more information.
"""

import os
import sys
from pathlib import Path

if sys.platform == "win32":
    if "Z3_ROOT" in os.environ:
        lib_path = Path(os.environ["Z3_ROOT"]) / "lib"
        if lib_path.exists():
            os.add_dll_directory(str(lib_path))
        bin_path = Path(os.environ["Z3_ROOT"]) / "bin"
        if bin_path.exists():
            os.add_dll_directory(str(bin_path))
    if "ALGLIB_DIR" in os.environ:
        os.add_dll_directory(str(os.environ["ALGLIB_DIR"]))

from .pyfiction import (  # type: ignore[import-not-found]
    __compiled_date__,
    __compiled_time__,
    __repo__,
    __version__,
    a_star,
    a_star_distance,
    ## path_finding
    a_star_params,
    all_standard_2_input_functions,
    all_standard_3_input_functions,
    all_supported_standard_functions,
    and_or_not,
    and_or_not_maj,
    apply_bestagon_library,
    ## physical_design
    apply_qca_one_library,
    apply_topolinano_library,
    # Technology
    area,
    automatic_base_number_detection,
    bdl_input_iterator_100,
    bdl_input_iterator_111,
    bdl_input_iterator_params,
    bdl_pair,
    bdl_wire_100,
    bdl_wire_111,
    bdl_wire_selection,
    calculate_energy_and_state_type_with_kinks_accepted,
    calculate_energy_and_state_type_with_kinks_rejected,
    can_positive_charges_occur,
    cartesian_gate_layout,
    # Layouts
    cartesian_layout,
    cartesian_obstruction_layout,
    charge_configuration_to_string,
    charge_distribution_mode,
    charge_distribution_surface,
    charge_distribution_surface_100,
    charge_distribution_surface_111,
    charge_index_mode,
    charge_state_to_sign,
    chebyshev_distance,
    check_simulation_results_for_equivalence,
    clear_routing,
    clocked_cartesian_layout,
    clocked_hexagonal_layout,
    clocked_shifted_cartesian_layout,
    clustercomplete,
    clustercomplete_params,
    color_mode,
    color_routing,
    color_routing_params,
    convert_layout_to_siqad_coordinates,
    create_and3_tt,
    create_and_tt,
    create_and_xor_tt,
    create_crossing_wire_tt,
    create_dot_tt,
    create_double_wire_tt,
    create_fan_out_tt,
    create_gamble_tt,
    create_ge_tt,
    create_gt_tt,
    create_half_adder_tt,
    create_id_tt,
    create_ite_tt,
    create_le_tt,
    create_lt_tt,
    create_maj_tt,
    create_nand_tt,
    create_nor_tt,
    create_not_tt,
    create_onehot_tt,
    create_or_and_tt,
    create_or_tt,
    create_xnor_tt,
    create_xor3_tt,
    create_xor_and_tt,
    create_xor_tt,
    ## properties
    critical_path_length_and_throughput,
    critical_temperature_domain,
    critical_temperature_domain_contour_tracing,
    critical_temperature_domain_flood_fill,
    critical_temperature_domain_grid_search,
    critical_temperature_domain_random_sampling,
    critical_temperature_gate_based,
    critical_temperature_non_gate_based,
    critical_temperature_params,
    critical_temperature_stats,
    cube_area,
    cube_coordinate,
    cube_volume,
    defect_extent,
    dependent_cell_mode,
    design_sidb_gates,
    design_sidb_gates_mode,
    design_sidb_gates_params,
    detect_bdl_pairs,
    detect_bdl_pairs_params,
    detect_bdl_wires_100,
    detect_bdl_wires_111,
    detect_bdl_wires_params,
    determine_displacement_robustness_domain_100,
    determine_displacement_robustness_domain_111,
    dimer_displacement_policy,
    displacement_analysis_mode,
    displacement_robustness_domain_100,
    displacement_robustness_domain_111,
    displacement_robustness_domain_params,
    displacement_robustness_domain_stats,
    dynamic_truth_table,
    energy_calculation,
    energy_distribution,
    enumerate_all_paths,
    enumerate_all_paths_params,
    eq_type,
    equivalence_checking,
    equivalence_checking_stats,
    euclidean_distance,
    exact_cartesian,
    exact_hexagonal,
    exact_params,
    exact_shifted_cartesian,
    exact_sidb_simulation_engine,
    exact_stats,
    exhaustive_ground_state_simulation,
    extract_routing_objectives,
    fanout_substitution,
    fanout_substitution_params,
    # Inout
    fgl_parsing_error,
    ## verfication
    gate_level_drv_params,
    gate_level_drvs,
    generate_multiple_random_sidb_layouts,
    generate_random_sidb_layout,
    generate_random_sidb_layout_params,
    get_name,
    gold_cost_objective,
    gold_effort_mode,
    graph_coloring_engine,
    graph_oriented_layout_design,
    graph_oriented_layout_design_params,
    graph_oriented_layout_design_stats,
    ground_state_space_reporting,
    groundstate_from_simulation_result,
    has_high_degree_fanin_nodes,
    heuristic_sidb_simulation_engine,
    hexagonal_gate_layout,
    hexagonal_layout,
    hexagonal_obstruction_layout,
    hexagonalization,
    high_degree_fanin_exception,
    inml_layout,
    inml_technology,
    # Algorithms
    ## iter
    input_bdl_configuration,
    is_balanced,
    is_charged_defect_type,
    is_crossable_wire,
    is_fanout_substituted,
    is_ground_state,
    is_kink_induced_non_operational,
    is_negatively_charged_defect,
    is_neutral_defect_type,
    is_neutrally_charged_defect,
    is_operational,
    is_operational_params,
    is_positively_charged_defect,
    kink_induced_non_operational_input_patterns,
    manhattan_distance,
    # maximum_defect_influence_distance_params,
    # maximum_defect_influence_position_and_distance,
    minimum_energy,
    network_balancing,
    network_balancing_params,
    normalize_layout_coordinates,
    # Utils
    num_adjacent_coordinates,
    occupation_probability_gate_based,
    occupation_probability_non_gate_based,
    offset_area,
    offset_coordinate,
    offset_volume,
    operational_analysis_strategy,
    operational_condition,
    operational_domain,
    operational_domain_contour_tracing,
    operational_domain_flood_fill,
    operational_domain_grid_search,
    operational_domain_params,
    operational_domain_random_sampling,
    operational_domain_ratio,
    operational_domain_ratio_params,
    operational_domain_stats,
    operational_domain_value_range,
    operational_input_patterns,
    operational_status,
    orthogonal,
    orthogonal_params,
    orthogonal_stats,
    out_of_cell_names_exception,
    parameter_point,
    physical_population_stability_100,
    physical_population_stability_111,
    physical_population_stability_params,
    physically_valid_parameters,
    physically_valid_parameters_domain,
    place,
    population_stability_information_100,
    population_stability_information_111,
    positive_charges,
    post_layout_optimization,
    post_layout_optimization_params,
    post_layout_optimization_stats,
    potential_to_distance_conversion,
    qca_layout,
    qca_technology,
    quickexact,
    quickexact_params,
    quicksim,
    quicksim_params,
    random_coordinate,
    read_cartesian_fgl_layout,
    read_fqca_layout,
    read_hexagonal_fgl_layout,
    read_shifted_cartesian_fgl_layout,
    read_sqd_layout_100,
    read_sqd_layout_111,
    read_technology_network,
    reserve_input_nodes,
    route_path,
    # write_location_and_ground_state,
    sample_writing_mode,
    set_name,
    shifted_cartesian_gate_layout,
    shifted_cartesian_layout,
    shifted_cartesian_obstruction_layout,
    sidb_100_lattice,
    sidb_111_lattice,
    sidb_charge_state,
    sidb_defect,
    sidb_defect_type,
    sidb_lattice_mode,
    sidb_layout,
    sidb_nm_distance_100,
    sidb_nm_distance_111,
    sidb_nm_position,
    sidb_simulation_engine,
    sidb_simulation_engine_name,
    sidb_simulation_parameters,
    sidb_simulation_result_100,
    sidb_simulation_result_111,
    sidb_technology,
    sign_to_charge_state,
    ### logic
    simulate,
    siqad_area,
    siqad_coordinate,
    siqad_volume,
    sqd_parsing_error,
    squared_euclidean_distance,
    ## network_transformation
    substitution_strategy,
    sweep_parameter,
    technology_constraints,
    technology_mapping,
    technology_mapping_params,
    technology_mapping_stats,
    # Networks
    technology_network,
    time_to_solution,
    time_to_solution_for_given_simulation_results,
    time_to_solution_params,
    time_to_solution_stats,
    to_cube_coord,
    to_offset_coord,
    to_siqad_coord,
    ## simulation
    ### sidb
    transition_type,
    twoddwave_distance,
    undefined_cell_label_exception,
    unrecognized_cell_definition_exception,
    unsupported_character_exception,
    wiring_reduction,
    wiring_reduction_params,
    wiring_reduction_stats,
    write_critical_temperature_domain,
    write_critical_temperature_domain_to_string,
    write_dot_layout,
    write_dot_network,
    write_fgl_layout,
    write_fqca_layout,
    write_fqca_layout_params,
    write_operational_domain,
    write_operational_domain_params,
    write_operational_domain_to_string,
    write_qca_layout,
    write_qca_layout_params,
    write_qca_layout_svg,
    write_qca_layout_svg_params,
    write_qcc_layout,
    write_qll_layout,
    write_sidb_layout_svg,
    write_sidb_layout_svg_params,
    write_sidb_layout_svg_to_string,
    write_sqd_layout,
    write_sqd_sim_result,
    yen_k_shortest_paths,
    yen_k_shortest_paths_params,
)

__all__ = [
    "__compiled_date__",
    "__compiled_time__",
    "__repo__",
    "__version__",
    "a_star",
    "a_star_distance",
    ## path_finding
    "a_star_params",
    "all_standard_2_input_functions",
    "all_standard_3_input_functions",
    "all_supported_standard_functions",
    "and_or_not",
    "and_or_not_maj",
    "apply_bestagon_library",
    ## physical_design
    "apply_qca_one_library",
    "apply_topolinano_library",
    # Technology
    "area",
    "automatic_base_number_detection",
    "bdl_input_iterator_100",
    "bdl_input_iterator_111",
    "bdl_input_iterator_params",
    "bdl_pair",
    "bdl_wire_100",
    "bdl_wire_111",
    "bdl_wire_selection",
    "calculate_energy_and_state_type_with_kinks_accepted",
    "calculate_energy_and_state_type_with_kinks_rejected",
    "can_positive_charges_occur",
    "cartesian_gate_layout",
    # Layouts
    "cartesian_layout",
    "cartesian_obstruction_layout",
    "charge_configuration_to_string",
    "charge_distribution_mode",
    "charge_distribution_surface",
    "charge_distribution_surface_100",
    "charge_distribution_surface_111",
    "charge_index_mode",
    "charge_state_to_sign",
    "chebyshev_distance",
    "check_simulation_results_for_equivalence",
    "clear_routing",
    "clocked_cartesian_layout",
    "clocked_hexagonal_layout",
    "clocked_shifted_cartesian_layout",
    "clustercomplete",
    "clustercomplete_params",
    "color_mode",
    "color_routing",
    "color_routing_params",
    "convert_layout_to_siqad_coordinates",
    "create_and3_tt",
    "create_and_tt",
    "create_and_xor_tt",
    "create_crossing_wire_tt",
    "create_dot_tt",
    "create_double_wire_tt",
    "create_fan_out_tt",
    "create_gamble_tt",
    "create_ge_tt",
    "create_gt_tt",
    "create_half_adder_tt",
    "create_id_tt",
    "create_ite_tt",
    "create_le_tt",
    "create_lt_tt",
    "create_maj_tt",
    "create_nand_tt",
    "create_nor_tt",
    "create_not_tt",
    "create_onehot_tt",
    "create_or_and_tt",
    "create_or_tt",
    "create_xnor_tt",
    "create_xor3_tt",
    "create_xor_and_tt",
    "create_xor_tt",
    ## properties
    "critical_path_length_and_throughput",
    "critical_temperature_domain",
    "critical_temperature_domain_contour_tracing",
    "critical_temperature_domain_flood_fill",
    "critical_temperature_domain_grid_search",
    "critical_temperature_domain_random_sampling",
    "critical_temperature_gate_based",
    "critical_temperature_non_gate_based",
    "critical_temperature_params",
    "critical_temperature_stats",
    "cube_area",
    "cube_coordinate",
    "cube_volume",
    "defect_extent",
    "dependent_cell_mode",
    "design_sidb_gates",
    "design_sidb_gates_mode",
    "design_sidb_gates_params",
    "detect_bdl_pairs",
    "detect_bdl_pairs_params",
    "detect_bdl_wires_100",
    "detect_bdl_wires_111",
    "detect_bdl_wires_params",
    "determine_displacement_robustness_domain_100",
    "determine_displacement_robustness_domain_111",
    "dimer_displacement_policy",
    "displacement_analysis_mode",
    "displacement_robustness_domain_100",
    "displacement_robustness_domain_111",
    "displacement_robustness_domain_params",
    "displacement_robustness_domain_stats",
    "dynamic_truth_table",
    "energy_calculation",
    "energy_distribution",
    "enumerate_all_paths",
    "enumerate_all_paths_params",
    "eq_type",
    "equivalence_checking",
    "equivalence_checking_stats",
    "euclidean_distance",
    "exact_cartesian",
    "exact_hexagonal",
    "exact_params",
    "exact_shifted_cartesian",
    "exact_sidb_simulation_engine",
    "exact_stats",
    "exhaustive_ground_state_simulation",
    "extract_routing_objectives",
    "fanout_substitution",
    "fanout_substitution_params",
    # Inout
    "fgl_parsing_error",
    ## verfication
    "gate_level_drv_params",
    "gate_level_drvs",
    "generate_multiple_random_sidb_layouts",
    "generate_random_sidb_layout",
    "generate_random_sidb_layout_params",
    "get_name",
    "gold_cost_objective",
    "gold_effort_mode",
    "graph_coloring_engine",
    "graph_oriented_layout_design",
    "graph_oriented_layout_design_params",
    "graph_oriented_layout_design_stats",
    "ground_state_space_reporting",
    "groundstate_from_simulation_result",
    "has_high_degree_fanin_nodes",
    "heuristic_sidb_simulation_engine",
    "hexagonal_gate_layout",
    "hexagonal_layout",
    "hexagonal_obstruction_layout",
    "hexagonalization",
    "high_degree_fanin_exception",
    "inml_layout",
    "inml_technology",
    # Algorithms
    ## iter
    "input_bdl_configuration",
    "is_balanced",
    "is_charged_defect_type",
    "is_crossable_wire",
    "is_fanout_substituted",
    "is_ground_state",
    "is_kink_induced_non_operational",
    "is_negatively_charged_defect",
    "is_neutral_defect_type",
    "is_neutrally_charged_defect",
    "is_operational",
    "is_operational_params",
    "is_positively_charged_defect",
    "kink_induced_non_operational_input_patterns",
    "manhattan_distance",
    # "maximum_defect_influence_distance_params",
    # "maximum_defect_influence_position_and_distance",
    "minimum_energy",
    "network_balancing",
    "network_balancing_params",
    "normalize_layout_coordinates",
    # Utils
    "num_adjacent_coordinates",
    "occupation_probability_gate_based",
    "occupation_probability_non_gate_based",
    "offset_area",
    "offset_coordinate",
    "offset_volume",
    "operational_analysis_strategy",
    "operational_condition",
    "operational_domain",
    "operational_domain_contour_tracing",
    "operational_domain_flood_fill",
    "operational_domain_grid_search",
    "operational_domain_params",
    "operational_domain_random_sampling",
    "operational_domain_ratio",
    "operational_domain_ratio_params",
    "operational_domain_stats",
    "operational_domain_value_range",
    "operational_input_patterns",
    "operational_status",
    "orthogonal",
    "orthogonal_params",
    "orthogonal_stats",
    "out_of_cell_names_exception",
    "parameter_point",
    "physical_population_stability_100",
    "physical_population_stability_111",
    "physical_population_stability_params",
    "physically_valid_parameters",
    "physically_valid_parameters_domain",
    "place",
    "population_stability_information_100",
    "population_stability_information_111",
    "positive_charges",
    "post_layout_optimization",
    "post_layout_optimization_params",
    "post_layout_optimization_stats",
    "potential_to_distance_conversion",
    "qca_layout",
    "qca_technology",
    "quickexact",
    "quickexact_params",
    "quicksim",
    "quicksim_params",
    "random_coordinate",
    "read_cartesian_fgl_layout",
    "read_fqca_layout",
    "read_hexagonal_fgl_layout",
    "read_shifted_cartesian_fgl_layout",
    "read_sqd_layout_100",
    "read_sqd_layout_111",
    "read_technology_network",
    "reserve_input_nodes",
    "route_path",
    # "write_location_and_ground_state",
    "sample_writing_mode",
    "set_name",
    "shifted_cartesian_gate_layout",
    "shifted_cartesian_layout",
    "shifted_cartesian_obstruction_layout",
    "sidb_100_lattice",
    "sidb_111_lattice",
    "sidb_charge_state",
    "sidb_defect",
    "sidb_defect_type",
    "sidb_lattice_mode",
    "sidb_layout",
    "sidb_nm_distance_100",
    "sidb_nm_distance_111",
    "sidb_nm_position",
    "sidb_simulation_engine",
    "sidb_simulation_engine_name",
    "sidb_simulation_parameters",
    "sidb_simulation_result_100",
    "sidb_simulation_result_111",
    "sidb_technology",
    "sign_to_charge_state",
    ### logic
    "simulate",
    "siqad_area",
    "siqad_coordinate",
    "siqad_volume",
    "sqd_parsing_error",
    "squared_euclidean_distance",
    ## network_transformation
    "substitution_strategy",
    "sweep_parameter",
    "technology_constraints",
    "technology_mapping",
    "technology_mapping_params",
    "technology_mapping_stats",
    # Networks
    "technology_network",
    "time_to_solution",
    "time_to_solution_for_given_simulation_results",
    "time_to_solution_params",
    "time_to_solution_stats",
    "to_cube_coord",
    "to_offset_coord",
    "to_siqad_coord",
    ## simulation
    ### sidb
    "transition_type",
    "twoddwave_distance",
    "undefined_cell_label_exception",
    "unrecognized_cell_definition_exception",
    "unsupported_character_exception",
    "wiring_reduction",
    "wiring_reduction_params",
    "wiring_reduction_stats",
    "write_critical_temperature_domain",
    "write_critical_temperature_domain_to_string",
    "write_dot_layout",
    "write_dot_network",
    "write_fgl_layout",
    "write_fqca_layout",
    "write_fqca_layout_params",
    "write_operational_domain",
    "write_operational_domain_params",
    "write_operational_domain_to_string",
    "write_qca_layout",
    "write_qca_layout_params",
    "write_qca_layout_svg",
    "write_qca_layout_svg_params",
    "write_qcc_layout",
    "write_qll_layout",
    "write_sidb_layout_svg",
    "write_sidb_layout_svg_params",
    "write_sidb_layout_svg_to_string",
    "write_sqd_layout",
    "write_sqd_sim_result",
    "yen_k_shortest_paths",
    "yen_k_shortest_paths_params",
]
