/* TODO FIXME: use homogenous tuples and L1 prelude use lsts::tlc::TLC; #[test] fn check_tensor_syntax() { let mut tlc = TLC::new(); let si = tlc.import_file(None, "preludes/si.tlc").unwrap(); tlc.check(Some(si), "let a:Number[];").unwrap(); tlc.check(Some(si), "let a:Number[1];").unwrap(); tlc.check(Some(si), "let a:Number[1][2];").unwrap(); tlc.check(Some(si), "let a:Number[1][];").unwrap(); tlc.check(Some(si), "let a:Number[][2];").unwrap(); } #[test] fn check_tensor_sugar() { let mut tlc = TLC::new(); let si = tlc.import_file(None, "preludes/si.tlc").unwrap(); tlc.check(Some(si), "let a:Number[]; a: Tensor;").unwrap(); tlc.check(Some(si), "let a:Number[]; a: Tensor;").unwrap_err(); tlc.check(Some(si), "let a:Number[1]; a: Tensor;").unwrap(); tlc.check(Some(si), "let a:Number[1]; a: Tensor;").unwrap_err(); tlc.check(Some(si), "let a:Number[1][2]; a: Tensor,[1]>;").unwrap(); tlc.check(Some(si), "let a:Number[1][2]; a: Tensor,[2]>;").unwrap_err(); tlc.check(Some(si), "let a:Number[1][]; a: Tensor,[1]>;").unwrap(); tlc.check(Some(si), "let a:Number[1][]; a: Tensor,[2]>;").unwrap_err(); tlc.check(Some(si), "let a:Number[][2]; a: Tensor,?>;").unwrap(); tlc.check(Some(si), "let a:Number[][2]; a: Tensor,?>;").unwrap_err(); } #[test] fn check_tensor_covariance() { let mut tlc = TLC::new(); let si = tlc.import_file(None, "preludes/si.tlc").unwrap(); tlc.check(Some(si), "let a:Number[]; a: Tensor").unwrap_err(); tlc.check(Some(si), "let a:Number[][]; a: Tensor,?>;").unwrap_err(); tlc.check(Some(si), "let a:Number[][]; a: Tensor,[1]>;").unwrap_err(); tlc.check(Some(si), "let a:Number[1][]; a: Tensor,?>;").unwrap_err(); tlc.check(Some(si), "let a:Number[][1]; a: Tensor,[1]>;").unwrap_err(); } #[test] fn check_tensor_invariants() { let mut tlc = TLC::new(); let si = tlc.import_file(None, "preludes/si.tlc").unwrap(); tlc.check(Some(si), "let a:Number[1]; a.length: [1];").unwrap(); tlc.check(Some(si), "let a:Number[2]; a.length: [2];").unwrap(); tlc.check(Some(si), "let a:Number[2]; a.length: [3];").unwrap_err(); tlc.check(Some(si), "let a:Number[1]; a.length==0: [True];").unwrap_err(); tlc.check(Some(si), "let a:Number[1]; a.length==0: [False];").unwrap(); tlc.check(Some(si), "let a:Number[1]; a.length==1: [True];").unwrap(); tlc.check(Some(si), "let a:Number[1]; a.length==1: [False];").unwrap_err(); } */