Giter Club home page Giter Club logo

Comments (10)

bobot avatar bobot commented on May 14, 2024 2

It is for COLIBRI, we have an OCaml to Prolog bridge, so since our previous prolog parser was flaky, using dolmen is more than a bliss.

Thanks for the advices @Gbury!

from dolmen.

c-cube avatar c-cube commented on May 14, 2024

I think it's safe to say @Gbury isn't working on it 🙂
Are you writing SMT solvers in OCaml, still, @bobot ?

from dolmen.

Gbury avatar Gbury commented on May 14, 2024

I can confirm that I'm not working on it, so if you have the time and motivation, that's great !

For writing the theory, I would give the following advices:

  • get inspiration from the other theories written for smtlib
  • add together with the theory implementation the reference description of the theory from smtlib (i.e. the fp.smt2 file describing the theory). It helps having it directly next to the implementation and when/if it changes, diffing the new version will help upgrading the theory.
  • but most of all, give attention to the error cases, as can be seen in other theories, the code handling the error cases takes quite a lot of place (and time to write), but it is very important, hence why there are quite a lot of helper functions in the base.ml file that you can probably re-use as much as possible (for checking arity, dealing with associative and/or chainable operations, etc...).

The fact that builtins are not exported in Dolmen.Expr is clearly a mistake. As you say, the goal is indeed to match on these builtins as much as possible (rather than testing equality of declared symbols). I'll try and fix it asap, ^^

from dolmen.

c-cube avatar c-cube commented on May 14, 2024

Good to hear. Is colibri amenable to be re-written in OCaml, or is it too big a stretch? :p

from dolmen.

bobot avatar bobot commented on May 14, 2024

Not in OCaml too easy, in Why3 it is better 😉

from dolmen.

Gbury avatar Gbury commented on May 14, 2024

@bobot I just pushed bbbe607 which exports and documents the builtins in Dolmen.Expr. Don't hesitate to make any remarks about it, ^^

from dolmen.

Gbury avatar Gbury commented on May 14, 2024

Additionally, do you think dolmen should to export the following function (It basically tries and match the type of a term with a bitvector type and if successful extracts the length of the bitvector), or do you think it is simple enough that users can re-implement their variant of it (returning an option, or some other error) ?

dolmen/src/standard/expr.ml

Lines 2109 to 2112 in bbbe607

let match_bitv_type t =
match ty t with
| { descr = App ({ builtin = Bitv i; _ }, _); _ } -> i
| _ -> raise (Wrong_type (t, Ty.bitv 0))

from dolmen.

bobot avatar bobot commented on May 14, 2024

I think it is not necessary, because I think in most use cases one will match on all the possible builtin at the same time.

from dolmen.

bobot avatar bobot commented on May 14, 2024

The MR #31 should implement the theory.

from dolmen.

bobot avatar bobot commented on May 14, 2024

I have some small fixes that I will MR in bulk once when COLIBRI+dolmen works fully.

from dolmen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.