Prolog uses IMMUTABLE variables.
My question is : when you “extend” a list , internally the Origin list get copied as a new list OR it is just extended.
What I want to understand is how exactly/specifically the variable immutability helps Prolog ?
And what is the mechanism ?
Let me explain why I ask this. Currently learning Rust and it has a complex semantics on handling mutability and scope , which is rather interwoven.
I was thinking if I follow Prolog like IMMUTABILITY semantics can work in place of using the full Rust-move|borrow semantics?