List Info

Thread: Re: "ocaml_beginners"::[] How to convert a boolean expression to a string




Re: "ocaml_beginners"::[] How to convert a boolean expression to a string
country flaguser name
United States
2008-06-07 12:43:43

Thank you for your suggestion. I think BDD is good solution for me,
because I also need to compare two boolean exprssion.
And I aslo want to thank all people replied my question. Really
appreciate it.

Best,

--- In ocaml_beginners%40yahoogroups.com">ocaml_beginnersyahoogroups.com, "Jim Grundy&quot; <Jim.Grundy...>
wrote:
>
&gt; If I understand you correctly, you want to be able to pose boolean
> problems with variables (or symbolic constants) and simply those.
For
&gt; example, you might want to the system to show that "a or (not a)"
is
> "true".
&gt;
> There are a couple of technologies that work well for this kind of
> problems. Ordered BDDs (Binary Decision Diagrams) are a canonical
> representation of Boolean expressions. These systems are great for
> determining the equivalence of boolean expressions. There is an
OCaml
> interface to the well-known CUDD package for BDDs that may help you
> here. Google for OCaml and BDD and you'll find what you need.
&gt;
> Alternatively, if you want to answer satisfiability and validity
> questions (is there an assignment to the variables in this boolean
> expression that makes it true, or is there no assignment that makes
&gt; it's negation true) then you want at SAT solver. The DPT system
&gt; includes a SAT solver in OCaml. You can read about it here:
&gt;
> http://dpt.sourceforge.net/
>
> In either case you won't be using values of type bool to represent
> your problem, but values of a separate type of symbolic
expressions.
> If you actually want to use use values of type "foo&quot; to reason
&gt; symbolically about expressions of type "foo&quot; then you'll need a
> language that supports some kind of reflection. You could look at
> languages like MetaOCaml, Omega and reFLect, but I expect you would
be
&gt; better served looking at BDD and SAT packages.
>
> All the best
>;
> Jim Grundy
&gt;
>
>
>
> --- In ocaml_beginners%40yahoogroups.com">ocaml_beginnersyahoogroups.com, "kechenghao"; <kecheng>
wrote:
> >
>; > Hi ,
> >
> > I'm wondering whether OCaml support symbolic simulation.
> > My "symbolic simulation" means to I want to assign a bool
variable a
> > symbol instead of "true" or "false".
> > For instance, I want:
> > let a=A;;
&gt; > a::bool.
> >
> > Thanks
&gt; >
> > --- In ocaml_beginners%40yahoogroups.com">ocaml_beginnersyahoogroups.com, Florent Monnier
> > <fmonnier> wrote:
&gt; > >
>; > > > No, I only expect it return the boolean variable's name.
&gt; > >
> > > If the topic is to set names to variables (maybe for debuging
> > purpose) you can
> > > do this whatever its type is, a boolean or something else (so
we
> > use 'a), you
> > > could do for example with this type:
&gt; > >
> > > type 'a named_var = { var: 'a; name: string }
> > >
> > > let s = { var= true; name= "s&quot; }
> > >
> > > # s.var ;;
> > > - : bool = true
>; > >
> > > # s.name ;;
> > > - : string = "s&quot;
> > >
> > >
> > > --
> > >
>; >
>;

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )