×ばつ callback/generator). Useful for pattern matching with extraction, constraint search, type inference, planners, expert systems, and policy checks. ESM, single runtime dependency (deep6). - solvers async · uhop/yopl Wiki"> ×ばつ callback/generator). Useful for pattern matching with..." /> ×ばつ callback/generator). Useful for pattern matching with..." />×ばつ callback/generator). Useful for pattern matching with..." />
Skip to content

Navigation Menu

Sign in
Sign up

solvers async

Eugene Lazutkin edited this page Apr 7, 2026 · 2 revisions

solvers-async

Asynchronous callback-style solver. Use this driver when goal predicates need to await (e.g. I/O-bound rules).

Import

import asyncSolve from 'yopl/solvers/async.js';

Signature

asyncSolve(rules, name, args, callback): Promise<void>

Same shape as solve, but the callback may return a Promise and the solver awaits it before backtracking.

Example

import {variable} from 'deep6/env.js';
import assemble from 'deep6/traverse/assemble.js';
import asyncSolve from 'yopl/solvers/async.js';
const rules = {one: () => [{args: [1]}]};
const X = variable('X');
await asyncSolve(rules, 'one', [X], async env => {
 console.log(assemble(X, env)); // 1
});

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /