use crate::{serde::bytecode, ConstraintBytecode, StateReadBytecode};
use serde::{Deserialize, Serialize};
#[cfg(feature = "schema")]
use schemars::JsonSchema;
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
#[cfg_attr(feature = "schema", derive(JsonSchema))]
pub struct Predicate {
#[serde(
serialize_with = "bytecode::serialize_vec",
deserialize_with = "bytecode::deserialize_vec"
)]
pub state_read: Vec<StateReadBytecode>,
#[serde(
serialize_with = "bytecode::serialize_vec",
deserialize_with = "bytecode::deserialize_vec"
)]
pub constraints: Vec<ConstraintBytecode>,
pub directive: Directive,
}
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
#[cfg_attr(feature = "schema", derive(JsonSchema))]
pub enum Directive {
Satisfy,
Maximize(ConstraintBytecode),
Minimize(ConstraintBytecode),
}