aufbau 0.1.0

Type-aware constrained decoding for LLMs using context-dependent grammars with typing rules
Documentation
use crate::logic::grammar::Grammar;
use crate::logic::partial::parse::Parser;
use crate::logic::typing::core::Context;
use crate::logic::typing::Type;

#[test]
fn test_f_x() {
    crate::set_debug_level(crate::DebugLevel::Trace);
    let spec = std::fs::read_to_string("examples/stlc.auf").unwrap();
    let g = Grammar::load(&spec).unwrap();
    let mut p = Parser::new(g.clone());

    let mut ctx = Context::new();
    ctx.add("f".to_string(), Type::parse("A->B").unwrap());
    ctx.add("x".to_string(), Type::parse("A").unwrap());

    let ast = p.partial("f x").unwrap();

    let typed = ast.typed_ctx(&g, &ctx);
    println!("typed: {:?}", typed);
}