Skip to main content

oxilean_codegen/coq_backend/
coqfixpointdef_traits.rs

1//! # CoqFixpointDef - Trait Implementations
2//!
3//! This module contains trait implementations for `CoqFixpointDef`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Display`
8//!
9//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
10
11use super::types::CoqFixpointDef;
12use std::fmt;
13
14impl std::fmt::Display for CoqFixpointDef {
15    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16        let params: Vec<String> = self
17            .params
18            .iter()
19            .map(|(n, t)| format!("({} : {})", n, t))
20            .collect();
21        write!(f, "Fixpoint {} {}", self.name, params.join(" "))?;
22        if let Some(st) = &self.struct_arg {
23            write!(f, " {{struct {}}}", st)?;
24        }
25        write!(f, " : {} :=\n  {}.", self.return_type, self.body)
26    }
27}