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
impl CompilerExportAdvanced
Sourcepub fn export_hierarchy(
hierarchy: &DomainHierarchy,
) -> HashMap<String, Vec<String>>
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"));Sourcepub fn export_constraints(
table: &SymbolTable,
) -> HashMap<String, PredicateConstraints>
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"));Sourcepub fn export_refinement_types() -> HashMap<String, String>
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.
Sourcepub fn export_dependent_types() -> HashMap<String, String>
pub fn export_dependent_types() -> HashMap<String, String>
Export dependent type information for dimension tracking.
Returns dependent type specifications for compile-time dimension checking.
Sourcepub fn export_linear_types() -> HashMap<String, String>
pub fn export_linear_types() -> HashMap<String, String>
Export linear type resources for lifetime tracking.
Returns linear type specifications for resource management.
Sourcepub fn export_effects() -> HashMap<String, Vec<String>>
pub fn export_effects() -> HashMap<String, Vec<String>>
Export effect information for effect tracking.
Returns effect specifications for compile-time effect checking.
Sourcepub fn export_all_advanced(
table: &SymbolTable,
hierarchy: Option<&DomainHierarchy>,
) -> AdvancedExportBundle
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.