2024-06-17 00:21:18 +02:00
|
|
|
use serde::Deserialize;
|
|
|
|
use crate::expressions::truth_table::{Hide, Sort};
|
|
|
|
use crate::utils::serialize::{ret_true, deserialize_bool};
|
|
|
|
|
|
|
|
#[derive(Deserialize)]
|
|
|
|
pub struct SimplifyOptions {
|
|
|
|
#[serde(
|
|
|
|
default = "ret_true",
|
|
|
|
deserialize_with = "deserialize_bool"
|
|
|
|
)]
|
|
|
|
pub simplify: bool,
|
|
|
|
#[serde(default = "ret_true")]
|
|
|
|
pub case_sensitive: bool, // TODO: Implement case sensitivity
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Deserialize, Default)]
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
pub struct TruthTableOptions {
|
|
|
|
#[serde(default)]
|
|
|
|
pub sort: Sort,
|
|
|
|
#[serde(default)]
|
|
|
|
pub hide: Hide,
|
2024-06-17 23:04:47 +02:00
|
|
|
#[serde(default, deserialize_with = "deserialize_bool")]
|
|
|
|
pub hide_intermediate_steps: bool,
|
2024-06-17 00:21:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Deserialize)]
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
pub struct SimplifyAndTableOptions {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub simplify_options: SimplifyOptions,
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub table_options: TruthTableOptions,
|
|
|
|
}
|