← Back to the labOne language.
Two Bend backends.
The browser runs the same Python parser and finite grounder as the Xun command-line tool, using Pyodide. It passes the resulting rules to a semantic kernel written in Bend and compiled to JavaScript. The native tool compiles that same kernel to a CPU executable.
Bend propagates constraints, explores choices and validates every answer through reduct closure. JavaScript transports data, reports progress and displays answers. Small examples can also use the original exhaustive kernel. This demo does not call clingo or a remote solver. It is not a GPU benchmark.
Spec draft 0.2 / compiler 0.5.0: use 设 茶 为 饮品. for a fact, 若 B 则设 A. for establishment and 若 B 则寻 P(T). for a conditional choice. Choice heads require predicate notation; bare requirements require 为. Old implicit rule heads are rejected with migration guidance.
The prototype supports finite variables, integer ranges, arithmetic comparisons and one-template bounded choices. It supports distinct-tuple counts and the five full Murdoku and Garden examples. Strong negation, function terms and variable arithmetic in heads remain unsupported. Puzzle search limits: one million nodes, two minutes of solving and 256 returned models; a three-minute overall cutoff also covers compilation. Partial searches never claim unsatisfiability.
Your source is processed locally in a web worker. Unchanged puzzle examples load precompiled rules to skip slow grounding; these files contain no answers. Editing a puzzle invokes the browser compiler and can take substantially longer. The page loads the Python runtime from the jsDelivr CDN on first use; it needs an internet connection and may take a moment. Stopping a run terminates the worker and reloads it. No program text is sent to a solver service.
Bend Apache 2.0 license · Pyodide documentation · Private Xun repository
Bend revision aee1b1f276c78c297bbd5aef6e90afd1eeb7e30e. Kernels generated from Xun’s kernel.bend and search.bend. The browser compiler is experimental.