Open tbolsh opened 6 years ago
After trying to figure out what you want to do here, I suggest you solve this in Prolog. Something like the following will bind just fine:
mId := golog.NewMachine().Consult(`test_unify(X, X).`)
solutions := mId.ProveAll(`W=atom, test_unify(P, W).`)
for _, solution := range solutions {
fmt.Printf("pattern: variable is %s\n", solution.ByName_("P"))
}
If that does not solve your problem, could you give some more background as to why you want to create a machine with prebound variables in it?
Sorry - it might be a rookie error. I am trying to create an interpreter with some variables bound to values. I want this variables to have a name, for example:
I get
If I do not use .WithNames(psm.Set("W", v)). then there is no effect of binding variable to value, because it cannot be found by name (ByName_).
I checked the code and understand why it is happening, but how can I get around it other then creating a text representation of my long list of atoms? Is that possible?