]> Repositorios git - scryer-prolog.git/log
scryer-prolog.git
6 years agoadd prefixes to gensym keys
Mark Thom [Tue, 14 Jan 2020 04:01:09 +0000 (21:01 -0700)]
add prefixes to gensym keys

6 years agoadd simple gensym library
Mark Thom [Tue, 14 Jan 2020 03:30:58 +0000 (20:30 -0700)]
add simple gensym library

6 years agoadd listing sources to modules
Mark Thom [Tue, 14 Jan 2020 03:17:22 +0000 (20:17 -0700)]
add listing sources to modules

6 years agoMerge branch 'master' of https://github.com/mthom/rusty-wam
Mark Thom [Fri, 3 Jan 2020 07:47:56 +0000 (00:47 -0700)]
Merge branch 'master' of https://github.com/mthom/rusty-wam

6 years agoimplement less defaulty interface in cont.pl
Mark Thom [Mon, 23 Dec 2019 19:19:18 +0000 (12:19 -0700)]
implement less defaulty interface in cont.pl

6 years agoremove l* languages
Mark Thom [Mon, 23 Dec 2019 18:49:20 +0000 (11:49 -0700)]
remove l* languages

6 years agopush of preliminary delimited continuations library cont.pl (#136)
Mark Thom [Sat, 21 Dec 2019 05:27:49 +0000 (22:27 -0700)]
push of preliminary delimited continuations library cont.pl (#136)

6 years agomerge with master
Mark Thom [Fri, 20 Dec 2019 00:04:30 +0000 (20:04 -0400)]
merge with master

6 years agopreliminary cont work
Mark Thom [Fri, 20 Dec 2019 00:02:10 +0000 (20:02 -0400)]
preliminary cont work

6 years agouse Addr::StackCell(0,0) to indicate non-live local variables
Mark Thom [Fri, 13 Dec 2019 03:34:50 +0000 (20:34 -0700)]
use Addr::StackCell(0,0) to indicate non-live local variables

6 years agoexpand goals inside (\+)/1
Mark Thom [Thu, 12 Dec 2019 04:42:15 +0000 (21:42 -0700)]
expand goals inside (\+)/1

6 years agochange goal and term expansions, change call/N to use goal expansions
Mark Thom [Wed, 11 Dec 2019 04:36:02 +0000 (21:36 -0700)]
change goal and term expansions, change call/N to use goal expansions

6 years agocorrect odd accidental change to clpb.pl
Mark Thom [Sun, 8 Dec 2019 18:44:01 +0000 (11:44 -0700)]
correct odd accidental change to clpb.pl

6 years agoremove zeroing out from Stack::truncate
Mark Thom [Sun, 8 Dec 2019 18:43:22 +0000 (11:43 -0700)]
remove zeroing out from Stack::truncate

6 years agorevert arithmetic code
Mark Thom [Sun, 8 Dec 2019 07:17:55 +0000 (00:17 -0700)]
revert arithmetic code

6 years agoupdate tests
Mark Thom [Sun, 8 Dec 2019 02:21:09 +0000 (19:21 -0700)]
update tests

6 years agoreconcile latest changes against stack changes
Mark Thom [Sun, 8 Dec 2019 01:59:03 +0000 (18:59 -0700)]
reconcile latest changes against stack changes

6 years agoadd backtracking of attributed variable data
Mark Thom [Sat, 7 Dec 2019 00:52:40 +0000 (20:52 -0400)]
add backtracking of attributed variable data

6 years agoresolve panic caused by lingering attribute goals (#253)
Mark Thom [Fri, 6 Dec 2019 19:22:28 +0000 (15:22 -0400)]
resolve panic caused by lingering attribute goals (#253)

6 years agoprint equations between variables (#228, #252)
Mark Thom [Fri, 6 Dec 2019 14:30:16 +0000 (10:30 -0400)]
print equations between variables (#228, #252)

6 years agobinding attributed variables more eagerly after each implementation of verify_attribu...
Mark Thom [Thu, 5 Dec 2019 07:33:46 +0000 (00:33 -0700)]
binding attributed variables more eagerly after each implementation of verify_attributes/3 has been called (#248)

6 years agopop AND stack frames after unwinding the trail (#250)
Mark Thom [Wed, 4 Dec 2019 06:11:57 +0000 (23:11 -0700)]
pop AND stack frames after unwinding the trail (#250)

6 years agocorrect attributed variables bugs
Mark Thom [Wed, 4 Dec 2019 05:59:51 +0000 (22:59 -0700)]
correct attributed variables bugs

6 years agofix copy_term/3 infinite looping on cyclic terms
Mark Thom [Wed, 4 Dec 2019 05:01:38 +0000 (22:01 -0700)]
fix copy_term/3 infinite looping on cyclic terms

6 years agoMerge branch 'master' of https://github.com/mthom/rusty-wam
Mark Thom [Tue, 3 Dec 2019 02:38:15 +0000 (19:38 -0700)]
Merge branch 'master' of https://github.com/mthom/rusty-wam

6 years agoMerge branch 'master' of https://github.com/mthom/scryer-prolog
Mark Thom [Mon, 2 Dec 2019 21:06:28 +0000 (17:06 -0400)]
Merge branch 'master' of https://github.com/mthom/scryer-prolog

6 years agocorrect copying of cyclic lists in copier.rs
Mark Thom [Mon, 2 Dec 2019 21:06:12 +0000 (17:06 -0400)]
correct copying of cyclic lists in copier.rs

6 years agocorrect misprinting of attributed variables done by printer
Mark Thom [Mon, 2 Dec 2019 04:46:04 +0000 (21:46 -0700)]
correct misprinting of attributed variables done by printer

6 years agoadd predicates to lists.pl
Mark Thom [Mon, 2 Dec 2019 02:30:40 +0000 (19:30 -0700)]
add predicates to lists.pl

6 years agofix list copying
Mark Thom [Sun, 1 Dec 2019 22:28:47 +0000 (15:28 -0700)]
fix list copying

6 years agodelete freeze attribute in freeze::attribute_goals//1
Mark Thom [Sun, 1 Dec 2019 21:43:27 +0000 (14:43 -0700)]
delete freeze attribute in freeze::attribute_goals//1

6 years agoproperly copy attributed variables (#247)"
Mark Thom [Sun, 1 Dec 2019 21:42:59 +0000 (14:42 -0700)]
properly copy attributed variables (#247)"

6 years agoclear ball before setting it (#246)
Mark Thom [Sun, 1 Dec 2019 10:04:01 +0000 (03:04 -0700)]
clear ball before setting it (#246)

6 years agoadd sumlist/2 to lists.pl
Mark Thom [Sat, 30 Nov 2019 21:26:15 +0000 (14:26 -0700)]
add sumlist/2 to lists.pl

6 years agoadd sumlist/2 to lists.pl
Mark Thom [Sat, 30 Nov 2019 21:22:59 +0000 (14:22 -0700)]
add sumlist/2 to lists.pl

6 years agocompress the definition of freeze:attribute_goals//1
Mark Thom [Sat, 30 Nov 2019 21:12:33 +0000 (14:12 -0700)]
compress the definition of freeze:attribute_goals//1

6 years agopop AND frames when safe to do so, suspend resizing of AND frames until a proper...
Mark Thom [Sat, 30 Nov 2019 21:08:02 +0000 (14:08 -0700)]
pop AND frames when safe to do so, suspend resizing of AND frames until a proper GC is implemented (#244)

6 years agobacktrack attributed variable bindings after failure (#242)
Mark Thom [Fri, 29 Nov 2019 17:47:22 +0000 (13:47 -0400)]
backtrack attributed variable bindings after failure (#242)

6 years agocreate a list of module-prefixed goals in copy_term/3
Mark Thom [Fri, 29 Nov 2019 14:59:20 +0000 (10:59 -0400)]
create a list of module-prefixed goals in copy_term/3

6 years agoclone attribute goals from copy_term/3, fetch attribute goals should be a move
Mark Thom [Fri, 29 Nov 2019 07:59:31 +0000 (00:59 -0700)]
clone attribute goals from copy_term/3, fetch attribute goals should be a move

6 years agoadd copy_term/3 (#232)
Mark Thom [Fri, 29 Nov 2019 07:44:23 +0000 (00:44 -0700)]
add copy_term/3 (#232)

6 years agoreset attributed variable state between toplevel queries (#242)
Mark Thom [Fri, 29 Nov 2019 02:08:08 +0000 (19:08 -0700)]
reset attributed variable state between toplevel queries (#242)

6 years agomerge latest commit
Mark Thom [Fri, 29 Nov 2019 01:22:59 +0000 (21:22 -0400)]
merge latest commit

6 years agounsafe stack transition
Mark Thom [Fri, 29 Nov 2019 01:22:03 +0000 (21:22 -0400)]
unsafe stack transition

6 years agopreserve heap contents in between goal expansions (#240, #241)
Mark Thom [Thu, 28 Nov 2019 07:45:13 +0000 (00:45 -0700)]
preserve heap contents in between goal expansions (#240, #241)

6 years agoterms containing attributed variables are not ground (#239)
Mark Thom [Wed, 27 Nov 2019 18:13:18 +0000 (14:13 -0400)]
terms containing attributed variables are not ground (#239)

6 years agouse in situ code directory from metacall if conventional lookup fails (#238)
Mark Thom [Wed, 27 Nov 2019 07:52:30 +0000 (00:52 -0700)]
use in situ code directory from metacall if conventional lookup fails (#238)

6 years agoadd (:)/{3..12} to enable metacalls on module-prefixed predicates
Mark Thom [Wed, 27 Nov 2019 03:51:59 +0000 (20:51 -0700)]
add (:)/{3..12} to enable metacalls on module-prefixed predicates

6 years agoadd ambiguity check for period printing, remove extraneous space between last goal...
Mark Thom [Wed, 27 Nov 2019 02:38:43 +0000 (19:38 -0700)]
add ambiguity check for period printing, remove extraneous space between last goal and period (#237)

6 years agoadd operator exports to module declarations, treat them separately from predicate...
Mark Thom [Tue, 26 Nov 2019 06:09:49 +0000 (23:09 -0700)]
add operator exports to module declarations, treat them separately from predicate exports (#230)"

6 years agogenerate module-level expansion code along with rest of module code
Mark Thom [Sun, 24 Nov 2019 22:47:34 +0000 (15:47 -0700)]
generate module-level expansion code along with rest of module code

6 years agorecord module-level term_expansion and goal_expansion as inner predicates (#228)
Mark Thom [Sun, 24 Nov 2019 19:50:53 +0000 (12:50 -0700)]
record module-level term_expansion and goal_expansion as inner predicates (#228)

6 years agocorrect bug, dead code in toplevel.pl
Mark Thom [Sat, 23 Nov 2019 03:38:03 +0000 (20:38 -0700)]
correct bug, dead code in toplevel.pl

6 years agoMerge branch 'master' of https://github.com/mthom/rusty-wam
Mark Thom [Fri, 22 Nov 2019 01:05:09 +0000 (18:05 -0700)]
Merge branch 'master' of https://github.com/mthom/rusty-wam

6 years agoMerge branch 'master' of https://github.com/mthom/scryer-prolog
Mark Thom [Thu, 21 Nov 2019 20:26:13 +0000 (16:26 -0400)]
Merge branch 'master' of https://github.com/mthom/scryer-prolog

6 years agoadd conditional bracketing to equations printed by toplevel
Mark Thom [Thu, 21 Nov 2019 20:26:00 +0000 (16:26 -0400)]
add conditional bracketing to equations printed by toplevel

6 years agoMerge branch 'master' of https://github.com/mthom/rusty-wam
Mark Thom [Thu, 21 Nov 2019 06:50:54 +0000 (23:50 -0700)]
Merge branch 'master' of https://github.com/mthom/rusty-wam

6 years agosmall test updates
Mark Thom [Thu, 21 Nov 2019 06:50:51 +0000 (23:50 -0700)]
small test updates

6 years agoMerge pull request #226 from malbarbo/num
Mark Thom [Thu, 21 Nov 2019 03:51:55 +0000 (23:51 -0400)]
Merge pull request #226 from malbarbo/num

Add feature num to use num crate in place of rug.

6 years agoAdd feature num to use num crate in place of rug.
Marco A L Barbosa [Thu, 1 Aug 2019 11:25:24 +0000 (08:25 -0300)]
Add feature num to use num crate in place of rug.

6 years agoavoid overwriting IndexPtr's for clauses already declared dynamic (#227)
Mark Thom [Wed, 20 Nov 2019 14:50:33 +0000 (10:50 -0400)]
avoid overwriting IndexPtr's for clauses already declared dynamic (#227)

6 years agoMerge pull request #234 from XVilka/patch-2
Mark Thom [Wed, 20 Nov 2019 00:14:00 +0000 (20:14 -0400)]
Merge pull request #234 from XVilka/patch-2

Fix README formatting

6 years agoMerge branch 'master' of https://github.com/mthom/rusty-wam
Mark Thom [Wed, 20 Nov 2019 03:09:44 +0000 (20:09 -0700)]
Merge branch 'master' of https://github.com/mthom/rusty-wam

6 years agobump prolog_parser to version 0.8.35
Mark Thom [Wed, 20 Nov 2019 03:09:28 +0000 (20:09 -0700)]
bump prolog_parser to version 0.8.35

6 years agocommit Cargo.lock
Mark Thom [Wed, 20 Nov 2019 03:08:52 +0000 (20:08 -0700)]
commit Cargo.lock

6 years agoremove tests.rs module from main.rs
Mark Thom [Tue, 19 Nov 2019 14:13:59 +0000 (10:13 -0400)]
remove tests.rs module from main.rs

6 years agoFix README formatting
Anton Kochkov [Tue, 19 Nov 2019 10:48:46 +0000 (18:48 +0800)]
Fix README formatting

6 years agoadd setup_call_cleanup tests, expand builtins tests
Mark Thom [Tue, 19 Nov 2019 06:17:56 +0000 (23:17 -0700)]
add setup_call_cleanup tests, expand builtins tests

6 years agorollback changes in snapshot handling
Mark Thom [Mon, 18 Nov 2019 01:07:16 +0000 (21:07 -0400)]
rollback changes in snapshot handling

6 years agocorrect failure to observe last call position in queries'
Mark Thom [Mon, 18 Nov 2019 00:18:11 +0000 (20:18 -0400)]
correct failure to observe last call position in queries'

6 years agoupdate version number v0.8.116
Mark Thom [Sun, 17 Nov 2019 02:18:41 +0000 (19:18 -0700)]
update version number

6 years agobegin migrating tests to pure prolog, correct bug in toplevel
Mark Thom [Sun, 17 Nov 2019 02:15:07 +0000 (19:15 -0700)]
begin migrating tests to pure prolog, correct bug in toplevel

6 years agoquote values and goals in equations, eliminate dead code, correct retract/1
Mark Thom [Sun, 17 Nov 2019 00:15:25 +0000 (17:15 -0700)]
quote values and goals in equations, eliminate dead code, correct retract/1

6 years agoMerge branch 'master' of https://github.com/mthom/scryer-prolog
Mark Thom [Sat, 16 Nov 2019 23:53:29 +0000 (19:53 -0400)]
Merge branch 'master' of https://github.com/mthom/scryer-prolog

6 years agotransition to unsafe and/or stack
Mark Thom [Sat, 16 Nov 2019 23:51:53 +0000 (19:51 -0400)]
transition to unsafe and/or stack

6 years agomove more of the toplevel from rust into prolog
Mark Thom [Sat, 16 Nov 2019 07:26:15 +0000 (00:26 -0700)]
move more of the toplevel from rust into prolog

6 years agoadd warnings when initialization goals fail (#168)
Mark Thom [Wed, 30 Oct 2019 06:25:17 +0000 (00:25 -0600)]
add warnings when initialization goals fail (#168)

6 years agohandle asserts in modules a little better (#223, #224)
Mark Thom [Wed, 30 Oct 2019 06:14:36 +0000 (00:14 -0600)]
handle asserts in modules a little better (#223, #224)

6 years agoinstall asserted predicates into modules from initialization directives (#222)
Mark Thom [Tue, 29 Oct 2019 06:06:51 +0000 (00:06 -0600)]
install asserted predicates into modules from initialization directives (#222)

6 years agoreplace \n\r and \r\n by \n (#221)
Mark Thom [Mon, 28 Oct 2019 02:50:21 +0000 (20:50 -0600)]
replace \n\r and \r\n by \n (#221)

6 years agofinish #214, add needed ambiguity checks if 0 is the final character
Mark Thom [Mon, 28 Oct 2019 01:23:35 +0000 (19:23 -0600)]
finish #214, add needed ambiguity checks if 0 is the final character

6 years agocorrect sign/1 (#216)
Mark Thom [Sun, 27 Oct 2019 20:18:32 +0000 (14:18 -0600)]
correct sign/1 (#216)

6 years agoupdate to prolog_parser v0.8.34 with increased MAX_ARITY (#218)
Mark Thom [Sun, 27 Oct 2019 19:10:32 +0000 (13:10 -0600)]
update to prolog_parser v0.8.34 with increased MAX_ARITY (#218)

6 years agoadd sign/1 (#216) and gcd/2 (#217) as evaluable functors, update the README
Mark Thom [Sun, 27 Oct 2019 19:05:05 +0000 (13:05 -0600)]
add sign/1 (#216) and gcd/2 (#217) as evaluable functors, update the README

6 years agocorrect #215 by fixing bug in ambiguity_check
Mark Thom [Sun, 27 Oct 2019 18:32:18 +0000 (12:32 -0600)]
correct #215 by fixing bug in ambiguity_check

6 years agoadd consult/1 and shorthand for consult/1 (#214)
Mark Thom [Sun, 27 Oct 2019 17:33:49 +0000 (11:33 -0600)]
add consult/1 and shorthand for consult/1 (#214)

6 years agoremove module from toplevel in unqualified use_module
Mark Thom [Sat, 26 Oct 2019 18:39:42 +0000 (12:39 -0600)]
remove module from toplevel in unqualified use_module

6 years agoremove all mention of [clear] from the README
Mark Thom [Sat, 26 Oct 2019 07:35:26 +0000 (01:35 -0600)]
remove all mention of [clear] from the README

6 years agoreload files properly (re: #213)
Mark Thom [Sat, 26 Oct 2019 07:34:41 +0000 (01:34 -0600)]
reload files properly (re: #213)

6 years agoremove scratch comments from clpb.pl
Mark Thom [Wed, 23 Oct 2019 03:19:01 +0000 (21:19 -0600)]
remove scratch comments from clpb.pl

6 years agofix attributed variables bug causing weighted_maximum/3 example to omit a variable... v0.8.115
Mark Thom [Sun, 20 Oct 2019 20:50:46 +0000 (14:50 -0600)]
fix attributed variables bug causing weighted_maximum/3 example to omit a variable binding

6 years agoadd order preserving tidy_trail, fix random_labeling/2 v0.8.114
Mark Thom [Sat, 19 Oct 2019 06:29:50 +0000 (00:29 -0600)]
add order preserving tidy_trail, fix random_labeling/2

6 years agoadd randomness predicates, small but consequential changes to TrailRef v0.8.113
Mark Thom [Thu, 17 Oct 2019 06:21:21 +0000 (00:21 -0600)]
add randomness predicates, small but consequential changes to TrailRef

6 years agoMerge pull request #206 from triska/master
Mark Thom [Wed, 16 Oct 2019 19:17:05 +0000 (16:17 -0300)]
Merge pull request #206 from triska/master

weighted_maximum/3 now works

6 years agoweighted_maximum/3 now works
Markus Triska [Wed, 16 Oct 2019 17:17:03 +0000 (19:17 +0200)]
weighted_maximum/3 now works

6 years agosupport must_be(var, ...)
Markus Triska [Wed, 16 Oct 2019 17:13:59 +0000 (19:13 +0200)]
support must_be(var, ...)

6 years agoeliminate lingering attribute goals v0.8.112
Mark Thom [Wed, 16 Oct 2019 14:38:33 +0000 (11:38 -0300)]
eliminate lingering attribute goals

6 years agobump toml version number to package clpb on crates v0.8.111
Mark Thom [Wed, 16 Oct 2019 12:59:41 +0000 (09:59 -0300)]
bump toml version number to package clpb on crates

6 years agoMerge pull request #204 from triska/master
Mark Thom [Wed, 16 Oct 2019 05:45:21 +0000 (02:45 -0300)]
Merge pull request #204 from triska/master

ADDED: CLP(B), Constraint Logic Programming over Boolean Variables

6 years agoADDED: CLP(B), Constraint Logic Programming over Boolean Variables
Markus Triska [Wed, 16 Oct 2019 04:53:34 +0000 (06:53 +0200)]
ADDED: CLP(B), Constraint Logic Programming over Boolean Variables

library(clpb) provides CLP(B), Constraint Logic Programming over
Boolean variables. It is a SAT solver that seamlessly integrates into
Prolog in the sense that logic variables are used to state constraints
and report solutions. This library can be used to model and solve many
combinatorial problems such as verification, allocation and covering
tasks.

CLP(B) is an instance of the general CLP(X) scheme, extending logic
programming with reasoning over specialised domains.

The implementation is based on reduced and ordered Binary Decision
Diagrams (BDDs).

Usage examples of this library are available in a public git
repository:

    https://github.com/triska/clpb

For more information, benchmarks and publications visit:

    https://www.metalevel.at/clpb/

The interface of this library is consciously kept compatible with the
CLP(B) solver of SICStus Prolog, which served as the main inspiration
of this library. Many thanks to Mats Carlsson for his elegant example!

It is my hope that library(clpb) will allow a port of cTI, and —
eventually — of Ulrich Neumerkel's GUPU to Scryer Prolog.

                         Boolean expressions
                         ===================

A Boolean expression is one of:

     0                 false
     1                 true
     variable          unknown truth value
     atom              universally quantified variable
     ~ Expr            logical NOT
     Expr + Expr       logical OR
     Expr * Expr       logical AND
     Expr # Expr       exclusive OR
     Var ^ Expr        existential quantification
     Expr =:= Expr     equality
     Expr =\= Expr     disequality (same as #)
     Expr =< Expr      less or equal (implication)
     Expr >= Expr      greater or equal
     Expr < Expr       less than
     Expr > Expr       greater than
     card(Is,Exprs)    see below
     +(Exprs)          see below
     *(Exprs)          see below

where Expr again denotes a Boolean expression.

The Boolean expression card(Is,Exprs) is true iff the number of true
expressions in the list Exprs is a member of the list Is of
integers and integer ranges of the form From-To.

+(Exprs) and *(Exprs) denote, respectively, the disjunction and
conjunction of all elements in the list Exprs of Boolean
expressions.

Atoms denote parametric values that are universally quantified. All
universal quantifiers appear implicitly in front of the entire
expression. In residual goals, universally quantified variables always
appear on the right-hand side of equations. Therefore, they can be
used to express functional dependencies on input variables.

                         Interface predicates
                         ====================

The most frequently used CLP(B) predicates are:

    * sat(+Expr)
      True iff the Boolean expression Expr is satisfiable.

    * taut(+Expr, -T)
      If Expr is a tautology with respect to the posted constraints, succeeds
      with T = 1. If Expr cannot be satisfied, succeeds with T = 0.
      Otherwise, it fails.

    * labeling(+Vs)
      Assigns truth values to the variables Vs such that all constraints
      are satisfied.

The unification of a CLP(B) variable X with a term T is equivalent
to posting the constraint sat(X=:=T).

                               Examples
                               ========

Here is an example session with a few queries and their answers:

    ?- use_module(library(clpb)).
    true.

    ?- sat(X*Y).
    X = Y, Y = 1.

    ?- sat(X * ~X).
    false.

    ?- taut(X * ~X, T).
    T = 0,
    sat(X=:=X).

    ?- sat(X^Y^(X+Y)).
    sat(X=:=X),
    sat(Y=:=Y).

    ?- sat(X*Y + X*Z), labeling([X,Y,Z]).
    X = Z, Z = 1, Y = 0 ;
    X = Y, Y = 1, Z = 0 ;
    X = Y, Y = Z, Z = 1.

    ?- sat(X =< Y), sat(Y =< Z), taut(X =< Z, T).
    T = 1,
    sat(X=:=X*Y),
    sat(Y=:=Y*Z).

    ?- sat(1#X#a#b).
    sat(X=:=a#b).

The pending residual goals constrain remaining variables to Boolean
expressions and are declaratively equivalent to the original query.
The last example illustrates that when applicable, remaining variables
are expressed as functions of universally quantified variables.

                            Obtaining BDDs
                            ==============

By default, CLP(B) residual goals appear in (approximately) algebraic
normal form (ANF). This projection is often computationally expensive.

Assert the fact clpb:clpb_residuals(bdd) to see the BDD representation
of all constraints. This results in faster projection to residual
goals, and is also useful for learning more about BDDs.

For example:

    ?- asserta(clpb:clpb_residuals(bdd)).
    true.

    ?- sat(X#Y).
    node(3)- (v(X, 0)->node(2);node(1)),
    node(1)- (v(Y, 1)->true;false),
    node(2)- (v(Y, 1)->false;true).

Note that this representation cannot be pasted back on the toplevel,
and its details are subject to change. Use copy_term/3 to obtain
such answers as Prolog terms.

The variable order of the BDD is determined by the order in which the
variables first appear in constraints. To obtain different orders,
you can for example use:

    ?- sat(+[1,Y,X]), sat(X#Y).
    node(3)- (v(Y, 0)->node(2);node(1)),
    node(1)- (v(X, 1)->true;false),
    node(2)- (v(X, 1)->false;true).

                           Monotonic CLP(B)
                           ================

In the default execution mode, CLP(B) constraints are not monotonic.
This means that adding constraints can yield new solutions. For
example:

    ?-          sat(X=:=1), X = 1+0.
    false.

    ?- X = 1+0, sat(X=:=1), X = 1+0.
    X = 1+0.

This behaviour is highly problematic from a logical point of view, and
it may render declarative debugging techniques inapplicable (see
https://www.metalevel.at/prolog/debugging for more information).

Assert the fact clpb:monotonic to make CLP(B) monotonic. If this
mode is enabled, then you must wrap CLP(B) variables with the functor
v/1. For example:

    ?- asserta(clpb:monotonic).
    true.

    ?- sat(v(X)=:=1#1).
    X = 0.

Enjoy!