• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
    • RDF quality heuristics
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

/usr/lib/swipl/library/clp/clpb.pl
AllApplicationManualNameSummaryHelp

  • library
    • clp
      • clpfd.pl -- CLP(FD): Constraint Logic Programming over Finite Domains
      • clpb.pl -- CLP(B): Constraint Logic Programming over Boolean Variables
        • sat/1
        • taut/2
        • labeling/1
        • sat_count/2
        • random_labeling/2
        • weighted_maximum/3
 sat_count(+Expr, -Count) is det
Count the number of admissible assignments. Count is the number of different assignments of truth values to the variables in the Boolean expression Expr, such that Expr is true and all posted constraints are satisfiable.

A common form of invocation is sat_count(+[1|Vs], Count): This counts the number of admissible assignments to Vs without imposing any further constraints.

Examples:

?- sat(A =< B), Vs = [A,B], sat_count(+[1|Vs], Count).
Vs = [A, B],
Count = 3,
sat(A=:=A*B).

?- length(Vs, 120),
   sat_count(+Vs, CountOr),
   sat_count(*(Vs), CountAnd).
Vs = [...],
CountOr = 1329227995784915872903807060280344575,
CountAnd = 1.
ClioPatria (version V3.1.1-40-g9d9e003)