The possible values for InfoName are type or name.
If InfoName unifies with name, the predicate will succeed if the source name of the free variable Var is available and unifies with Value.
If InfoName unifies with type, the predicate will succeed if Value unifies with the type of the variable Var.
The possible types are:
meta an attributed variable (metaterm) free a free variable
Success: ?- suspend:(Var1 > Var2), get_var_info(Var1, Info, Value). Var2 = Var2 Var1 = Var1 Info = name Value = 'Var1' Delayed goals: Var1 > Var2 More? (;) Var2 = Var2 Var1 = Var1 Info = type Value = meta Delayed goals: Var1 > Var2 yes. ?- get_var_info(Var1, type, Type). Var1 = Var1 Type = free yes. ?- set_flag(variable_names,off). yes. ?- get_var_info(Var1, name, Name). no (more) solution. Fail: get_var_info(atom, name, Name). set_flag(variable_names, off), get_var_info(X, name, Name). Error: get_var_info(X, not_an_info, Y). (Error 6) get_var_info(X, type, 123). (Error 5)