Giter VIP home page Giter VIP logo

dowsing's People

Contributors

c-cube avatar clef-men avatar drup avatar fardalem avatar kit-ty-kate avatar lauregonnord avatar paulinegarelli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dowsing's Issues

dowsindex save fails with "uncaught exception: IndexTypes.Bad_format"

$ dowsindex save
dowsindex: internal error, uncaught exception:
           IndexTypes.Bad_format("/Users/kit_ty_kate/.opam/default/lib/dose3-extra/dose_extra.cmt")
# opam config report
# opam-version         2.2.0~alpha~dev (c8f8f74b45e14379cff9811a9aefbbf1770d0da4)
# self-upgrade         no
# system               arch=arm64 os=macos os-distribution=homebrew os-version=12.0
# solver               builtin-mccs+glpk
# install-criteria     -removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed
# upgrade-criteria     -removed,-count[avoid-version,changed],-count[version-lag,solution],-count[missing-depexts,changed],-new
# jobs                 7
# repositories         1 (local), 2 (version-controlled)
# pinned               10 (git), 1 (rsync)
# current-switch       default
# ocaml:native         true
# ocaml:native-tools   true
# ocaml:native-dynlink true
# ocaml:stubsdir       /Users/kit_ty_kate/.opam/default/lib/ocaml/stublibs:/Users/kit_ty_kate/.opam/default/lib/ocaml
# ocaml:preinstalled   false
# ocaml:compiler       4.13.0~beta1

The Stdlib packed module isn't shown

$ dowsindex search "string -> string -> string" | grep "^Stdlib"
Stdlib__String.cat : string -> string -> string
Stdlib__Pervasives.(^) : string -> string -> string
Stdlib__Filename.concat : string -> string -> string
Stdlib__StringLabels.cat : string -> string -> string
Stdlib__Filename.chop_suffix : string -> string -> string
Stdlib__Pervasives.max : 'a -> 'a -> 'a
Stdlib__Pervasives.min : 'a -> 'a -> 'a
Stdlib__Fun.const : 'a -> 'b -> 'a
Stdlib__Pervasives.fst : 'a * 'b -> 'a
Stdlib__Pervasives.snd : 'a * 'b -> 'b
Stdlib__Obj.magic : 'a -> 'b
Stdlib__Pervasives.failwith : string -> 'a
Stdlib__Pervasives.invalid_arg : string -> 'a

I would have expected to see every functions duplicated with their corresponding Stdlib.<Module> instead of just Stdlib__<Module> (see #13)

Filter out modules with double underscores

Given most libraries nowadays use dune and are packed, every functions will be technically available twice:

  • once with the full flatten name
  • once with the wrapped module

e.g.

$ dowsindex search "string -> string -> string" | grep "Js_of_ocaml_compiler"
Js_of_ocaml_compiler.Stdlib.String.cat : string -> string -> string
Js_of_ocaml_compiler__Stdlib.String.cat : string -> string -> string
Js_of_ocaml_compiler.Stdlib.Filename.concat : string -> string -> string
Js_of_ocaml_compiler__Stdlib.Filename.concat : string -> string -> string
Js_of_ocaml_compiler.Stdlib.Filename.chop_suffix : string -> string -> string
Js_of_ocaml_compiler__Stdlib.Filename.chop_suffix :

Realistically only the second one is ever used so it would be very handy to detect duplicates and only show the wrapped modules. (an optional argument can be available for users who want the unfiltered output)

TODO List

Software engineering

  • Add tests
  • Implement a proper notion of printing environment
  • Use proper logging
  • Plug together the unification and the database again

Science

  • Make sure the returned unifiers are minimal
  • Add rigid variables

Indexation:

Unification invalide

Les types « 'a -> 'a list -> 'a » et « 'x -> 'x -> 'x » ne devraient pas être unifiables (en l'état, le programme prétend y arriver avec { 'a = 'a list ; 'x = 'a list }).

Défaillance de l'axiome (Ass-0)

Par l'axiome (Ass-0) et curryfication, les types "a -> 'a -> b" et "a -> b" devraient être unifiables avec { 'a = unit } ; de même pour "a -> 'a -> 'b" et "a -> b". Ce n'est pas le cas en l'état.

Database format / Serialization

In your README.md you say:
"Database format
Serialization
To speed up database deserialization, we could use a format that allows random access in an mmap datastructure."
Why don't you use Berkely DB or something like this (a persistent on disk hash table) instead of mem maping a data structure?

Boucle unification

L'unification boucle toujours, en particulier sur un « fold » ("('a -> 'b -> 'b) -> 'a list -> 'b -> 'b") mais aussi sur "int list -> 'a -> unit".

Investigate performances of unification

There are cases where we have to fall down to proper unification. In this cases, it would be nice if it was fast.
Ideally, the stat function would have an option to give us a "hall of fame" of the slowest queries. There are cases where it's expected, but I think we should collect examples that are really out of line.

  • 'X * int -> 'X
    'a * 'b * 'c * ('a -> 'd) * ('b -> 'e) * ('c -> 'f) -> ('d * 'e * 'f)

The normal form is not robust. Substitution breaks an invariant of the normal form.

Currently, the normal form is not stable by substitution. Tuples are represented as sorted arrays, this property is not preserved by substitution. There are 3 possible ways to fix it:

  1. Change the normal form and remove the constraint on the array to be sorted. This solution has an impact on the equivalence test, which currently relies on this property.
  2. Do the sorting after the substitution. Could have an impact on speed
  3. Use another representation that preserves the equivalence modulo AC.

Also, one need to check that replacing a variable in the head position by an arrow is currently correctly handle.

Boucle unification

L'unification boucle encore avec, par exemple, le type « 'a -> a -> 'a ».

Défaillance (Ass-0)

Par l'isomorphisme (Ass-0), les types "unit * a" et "a" devraient être unifiables. La normalisation des deux types donne "(a)" (singleton) et "a", qui ne sont pas unifiés actuellement. On peut s'en sortir en traitant spécifiquement le cas d'un singleton dans [Type.make_tuple].

Refine unifiers

Currently, the handling of unifiers is a bit rough:

  1. Unifier simplification simply "inlines" all the unnamed variables. It could do a bit more, like simplify alpha-conversions.
  2. Unnamed variables should be given fresh names before printing.
  3. The size function only counts the number of variables to be substituted, not the real size of the substitution.

Benchmarking

To understand better the behaviour of the program, several parts of the program should be benchmarked.

  • the complete unification procedure
  • each part of the unification loop
    • the normalisation
    • the solver
    • the reinjection of the solution
  • the Hullot tree

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.