Skip to main content

CompilerExportAdvanced

Struct CompilerExportAdvanced 

Source
pub struct CompilerExportAdvanced;
Expand description

Advanced export utilities for compiler integration with type systems.

This extends the basic CompilerExport with support for advanced type system features including refinement types, dependent types, linear types, and effects.

Implementations§

Source§

impl CompilerExportAdvanced

Source

pub fn export_hierarchy( hierarchy: &DomainHierarchy, ) -> HashMap<String, Vec<String>>

Export domain hierarchy information for subtype checking.

Returns the complete subtype relationships from the hierarchy.

§Example
use tensorlogic_adapters::{DomainHierarchy, CompilerExportAdvanced};

let mut hierarchy = DomainHierarchy::new();
hierarchy.add_subtype("Student", "Person");
hierarchy.add_subtype("Person", "Agent");

let relationships = CompilerExportAdvanced::export_hierarchy(&hierarchy);
assert!(relationships.contains_key("Student"));
Source

pub fn export_constraints( table: &SymbolTable, ) -> HashMap<String, PredicateConstraints>

Export predicate constraints for validation and optimization.

Returns a map of predicate names to their constraint specifications.

§Example
use tensorlogic_adapters::{SymbolTable, DomainInfo, PredicateInfo, PredicateConstraints, CompilerExportAdvanced};

let mut table = SymbolTable::new();
table.add_domain(DomainInfo::new("Person", 100)).unwrap();

let mut pred = PredicateInfo::new("age", vec!["Person".to_string()]);
pred.constraints = Some(PredicateConstraints::new());
table.add_predicate(pred).unwrap();

let constraints = CompilerExportAdvanced::export_constraints(&table);
assert!(constraints.contains_key("age"));
Source

pub fn export_refinement_types() -> HashMap<String, String>

Export refinement types for compile-time validation.

Returns refinement type specifications that can be used for static analysis and runtime validation.

Source

pub fn export_dependent_types() -> HashMap<String, String>

Export dependent type information for dimension tracking.

Returns dependent type specifications for compile-time dimension checking.

Source

pub fn export_linear_types() -> HashMap<String, String>

Export linear type resources for lifetime tracking.

Returns linear type specifications for resource management.

Source

pub fn export_effects() -> HashMap<String, Vec<String>>

Export effect information for effect tracking.

Returns effect specifications for compile-time effect checking.

Source

pub fn export_all_advanced( table: &SymbolTable, hierarchy: Option<&DomainHierarchy>, ) -> AdvancedExportBundle

Create a complete advanced export bundle.

Returns all advanced type system information in a single structure.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.