in context.apply_morphism() now use find_morphism_path() to automatically find chained morphisms to create projections in ReprTree

This commit is contained in:
Michael Sippel 2024-08-06 16:20:02 +02:00
parent ffeb4b8e73
commit 6e2b82585e
Signed by: senvas
GPG key ID: F96CF119C34B64A6
13 changed files with 395 additions and 861 deletions
examples/tty-02-digit/src

View file

@ -69,16 +69,19 @@ async fn main() {
/* furthermore, setup projections to and from u8 value,
* this synchronizes the buffers
*/
ctx.read().unwrap().morphisms.apply_morphism(
rt_digit.clone(),
&Context::parse(&ctx, "<Digit 16>~Char"),
&Context::parse(&ctx, "<Digit 16>~_2^64~machine.UInt64")
ctx.read().unwrap().apply_morphism(
&rt_digit,
&laddertypes::MorphismType {
src_type: Context::parse(&ctx, "<Digit 16>~Char"),
dst_type: Context::parse(&ctx, "<Digit 16>~_2^64~machine.UInt64")
}
);
ctx.read().unwrap().morphisms.apply_morphism(
rt_digit.clone(),
&Context::parse(&ctx, "<Digit 16>~Char"),
&Context::parse(&ctx, "<Digit 16>~EditTree")
ctx.read().unwrap().apply_morphism(
&rt_digit,
&laddertypes::MorphismType {
src_type: Context::parse(&ctx, "<Digit 16>~Char"),
dst_type: Context::parse(&ctx, "<Digit 16>~EditTree")
}
);
/* setup TTY-Display for DigitEditor