caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Ivan Gotovchits <ivg@ieee.org>
To: Ashish Agarwal <agarwal1975@gmail.com>
Cc: Kenneth Adam Miller <kennethadammiller@gmail.com>,
	caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Mathematical Expression Library
Date: Thu, 2 Apr 2015 16:19:58 -0400	[thread overview]
Message-ID: <40B65243-21FC-4F23-ABE7-711F20CC7370@ieee.org> (raw)
In-Reply-To: <CAMu2m2LYqQ69RQoUr6bCH6A=91DeUc12h3Wq5dpiYp9_CZXfOg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2941 bytes --]

Hi Kenneth,

If the expression, that you’re trying to simplify is actually a BAP’s BIL, then there’re some optimizations in the `Bil` module. The most interesting is constant folding and purging unused variables. You can also use fixpoint function to drive the optimization passes. 

In any case, even if it is not a BIL, you can look at BAP’s constant folder class. 

Best wishes
Ivan 

On Apr 2, 2015, at 4:14 PM, Ashish Agarwal <agarwal1975@gmail.com> wrote:

> I don't know much about SMT solvers either, but my guess is that "simplification" would be a negligible part of the overall time since usually what people mean by "simplification" doesn't require any sort of search. This might be a premature optimization, especially since I doubt you'll find a ready to use library.
> 
> On Thu, Apr 2, 2015 at 4:05 PM, Kenneth Adam Miller <kennethadammiller@gmail.com> wrote:
> Well, the concern is that equivalent expressions that might arise in our scenario be more difficult than they need to be. In expression simplification, we keep the equivalent expression that is produced, replacing the original. In this way then next time we feed that expression input, or try to solve on it, we can get results for much less work.
> 
> Am I right? I'm not too too familiar with SMT solvers-it's a different, highly specialized field, so I just need to use them for my purposes.
> 
> On Thu, Apr 2, 2015 at 3:57 PM, Ashish Agarwal <agarwal1975@gmail.com> wrote:
> > need to simplify expressions before I submit them to SMT solvers
> 
> Why? Is the input language of the solver you're using not rich enough for your needs. The notion of "simplify" can be not so simple depending on the language and your needs.
> 
> On Thu, Apr 2, 2015 at 3:47 PM, Kenneth Adam Miller <kennethadammiller@gmail.com> wrote:
> I predominantly need to simplify expressions before I submit them to SMT solvers. I'm quite concerned about not reimplementing a difficult and already solved problem, and I'm pretty sure that this is part of work of the solvers. I'm pretty sure that Z3 provides a simplify function. Would it be better to cache the result of the simplify function?
> 
> On Thu, Apr 2, 2015 at 3:36 PM, Ashish Agarwal <agarwal1975@gmail.com> wrote:
> If you don't find anything else, maybe some of our old code from PADL 2010 can help as a starting point [1]. Probably it'll be easier to put something together from scratch, assuming you don't care about performance or need variables.
> 
> [1] http://ashishagarwal.org/2010/01/18/automating-mp-transformations/
> 
> 
> On Thu, Apr 2, 2015 at 1:16 PM, Kenneth Adam Miller <kennethadammiller@gmail.com> wrote:
> Is there a library somewhere where I can represent and simplify simple bit operation expressions? Add, subtract, exclusive or, or, and, divide, multiply, modulus, composed recursively, and operations on the expression type, such as simplify?
> 
> 
> 
> 
> 


[-- Attachment #2: Type: text/html, Size: 5270 bytes --]

  reply	other threads:[~2015-04-02 20:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-02 17:16 Kenneth Adam Miller
2015-04-02 19:36 ` Ashish Agarwal
2015-04-02 19:47   ` Kenneth Adam Miller
2015-04-02 19:57     ` Ashish Agarwal
2015-04-02 20:05       ` Kenneth Adam Miller
2015-04-02 20:14         ` Ashish Agarwal
2015-04-02 20:19           ` Ivan Gotovchits [this message]
2015-04-02 20:21             ` Kenneth Adam Miller
2015-04-02 21:41     ` Drup
     [not found]       ` <CAK7rcp_yb_gb4uziNkDHMBZFSCt_om85JWZ8p_bi94eDpB1AgA@mail.gmail.com>
     [not found]         ` <CAK7rcp_CT-meuKnqmgeNE-Gj6t4iR+_N829TZibHm7DbX6sh_A@mail.gmail.com>
2015-04-02 22:18           ` Drup
2015-04-07  6:37 ` Markus Weißmann
2015-04-07 14:16   ` Kenneth Adam Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40B65243-21FC-4F23-ABE7-711F20CC7370@ieee.org \
    --to=ivg@ieee.org \
    --cc=agarwal1975@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=kennethadammiller@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).