MCPcopy Create free account
hub / github.com/SWI-Prolog/packages-jpl / getSubst

Method getSubst

src/main/java/org/jpl7/Variable.java:155–162  ·  view source on GitHub ↗

This can be used to get the current solution binding of the Variable instance. So we are calling when the goal is in a solution This method returns nothing but modifies the argument mappings, by filling them with the current solution binding of the Variable instance. If Variable instance is anon

(Map<String, Term> varnames_to_Terms, Map<term_t, Variable> vars_to_Vars)

Source from the content-addressed store, hash-verified

153 * A Map from Prolog variables to JPL Variables.
154 */
155 protected final void getSubst(Map<String, Term> varnames_to_Terms, Map<term_t, Variable> vars_to_Vars) {
156 // NB a Variable.name cannot be "" i.e. of 0 length
157 // if (!(this.name.charAt(0) == '_') && varnames_to_Terms.get(this.name)
158 // == null) {
159 if (tellThem() && varnames_to_Terms.get(this.name) == null) {
160 varnames_to_Terms.put(this.name, Term.getTerm(vars_to_Vars, this.term_));
161 }
162 }
163
164 /* (non-Javadoc)
165 * @see org.jpl7.Term#hasFunctor(java.math.BigInteger, int)

Callers

nothing calls this directly

Calls 3

tellThemMethod · 0.95
getTermMethod · 0.95
putMethod · 0.80

Tested by

no test coverage detected