adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.06.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.06/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
pmetzger has quit []
shinnya has joined #ocaml
jao has joined #ocaml
troulouliou_div2 has joined #ocaml
<troulouliou_div2> hi how to disable error msflike those : Could not find the .cmi file for interface
<troulouliou_div2> toolchain/clang/bindings/ocaml/llvm/llvm.mli ...
<troulouliou_div2> i dont get it
govg has quit [Ping timeout: 240 seconds]
raazdaan has joined #ocaml
govg has joined #ocaml
jao has quit [Remote host closed the connection]
nomicflux has joined #ocaml
govg has quit [Ping timeout: 276 seconds]
jao has joined #ocaml
cbot has joined #ocaml
Haudegen has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 256 seconds]
jao has quit [Remote host closed the connection]
ziyourenxiang has joined #ocaml
mfp has quit [Ping timeout: 268 seconds]
pierpa has joined #ocaml
raazdaan has quit [Ping timeout: 252 seconds]
minn has joined #ocaml
jao has joined #ocaml
silver has quit [Read error: Connection reset by peer]
troulouliou_div2 has quit [Quit: Leaving]
zv has quit [Quit: WeeChat 1.9]
lopex has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
nomicflux has quit [Quit: nomicflux]
nomicflux has joined #ocaml
cbot has quit [Ping timeout: 240 seconds]
nomicflux has quit [Quit: nomicflux]
nomicflux has joined #ocaml
govg has joined #ocaml
cbot has joined #ocaml
jao has quit [Ping timeout: 256 seconds]
nomicflux has quit [Quit: nomicflux]
nomicflux has joined #ocaml
nomicflux has quit [Client Quit]
rpcope has quit [Ping timeout: 252 seconds]
rpcope has joined #ocaml
BitPuffin has joined #ocaml
<def`> anybody knows how to choose a set of C flags depending on the OS with jbuilder/dune?
<def`> (specifically I want to add the appropriate -framework ... under macOS)
<companion_cube> you probably want to have a custom ocaml script that generates the flags :3
<def`> Indeed. Do you happen to know a project that does that? (I am not even sure how to check that it is running on macOS, probably tests uname :P)
<companion_cube> no idea, perhaps lwt? :/
<companion_cube> have you checked whether the jbuilder spec has os-dependent flags?
<def`> I checked the documentation but haven't found anything relevant.
<def`> thanks for lwt hints, that's smart :)
spew has joined #ocaml
<companion_cube> ah right, it's just {unix,cygwin,win32} in sys
<companion_cube> well good luck :/
<def`> lwt seems to be very well made, I will learn from it
<def`> (lwt* build)
spew has quit [Read error: Connection reset by peer]
iitalics has joined #ocaml
govg has quit [Quit: leaving]
pierpa has quit [Quit: Page closed]
groovy2shoes has quit [Ping timeout: 252 seconds]
groovy2shoes has joined #ocaml
govg has joined #ocaml
jimmyrcom has quit [Ping timeout: 260 seconds]
mk9 has joined #ocaml
iitalics has quit [Ping timeout: 240 seconds]
mk9 has quit [Quit: mk9]
bartholin has joined #ocaml
barcabuona has joined #ocaml
argent_smith has joined #ocaml
mk9 has joined #ocaml
dportin_ has joined #ocaml
minn has quit [Ping timeout: 248 seconds]
mk9 has quit [Ping timeout: 256 seconds]
Haudegen has joined #ocaml
cbot has quit [Quit: Leaving]
xfbs has joined #ocaml
mengu has joined #ocaml
argent_smith has quit [Quit: Leaving.]
mfp has joined #ocaml
groovy2shoes has quit [Ping timeout: 276 seconds]
kakadu has joined #ocaml
mk9 has joined #ocaml
mk9 has quit [Client Quit]
mk9 has joined #ocaml
zolk3ri has joined #ocaml
jnavila has joined #ocaml
mk9 has quit [Ping timeout: 276 seconds]
jnavila has quit [Ping timeout: 256 seconds]
dportin_ has quit [Ping timeout: 256 seconds]
lopex has joined #ocaml
silver has joined #ocaml
jnavila has joined #ocaml
mk9 has joined #ocaml
slash^ has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
atchoum has joined #ocaml
<atchoum> hi: I got problem while building: http://vpaste.net/T1bod
<atchoum> How can I fix it ? (especially if you don't want to click that link, the problem is that I cannot build ocamlfind with opam because of an `unbound module TopLoop` error). I run on archlinux + ocaml 4.06.0.
<octachron> atchoum, you probably need the ocaml-compiler-libs package since it seems that archlinux splits compiler-libs from the compiler package
<atchoum> Tthank you a lot octachron.
<atchoum> yes indeed
<atchoum> I have that error now `Unbound module Topkg_result`
<octachron> Do you have a reason to use a system switch? Letting opam handles all dependendencies tends to be easier (with opam switch 4.06.0 for opam.1 or opam switch create 4.06.0 for opam.2)
<atchoum> that's what I want to do
<atchoum> but my system doesn't let me do it
<atchoum> so you say I should remove all the ocaml related package of my system and start fresh with opam ?
<atchoum> ok I'll do it.
<atchoum> 4.06.0 is the recommended compiler to have ?
<octachron> you don't need to remove your distribution package; just creating a new switch from opam should work fine
<octachron> 4.06 seems stable enough now
<octachron> (even if there is a 4.06.1 release around the corner)
govg has quit [Ping timeout: 240 seconds]
govg has joined #ocaml
shinnya has joined #ocaml
spip has joined #ocaml
mk9 has quit [Quit: mk9]
<spip> in the REPL, can we do an 'unopen/close/whatever Foo' after an 'open Foo'?
<def`> in caml light only :P
<spip> Damn... And an '#unrequire "foo"'?
<def`> not even sure what that would mean :)
<zolk3ri> :o
<def`> (but I think the main answer to your problem is "no you can't" :P)
<def`> with a few hacks it should be possible to restore a previous version of the environment
<def`> a "#push/#pop" primitives.
jnavila has joined #ocaml
shinnya has quit [Ping timeout: 240 seconds]
spew has joined #ocaml
FreeBirdLjj has joined #ocaml
<adrien> was the issue with very long package remova during upgrades to opam2 beta5 known?
<companion_cube> def`: funny you mention that, we have #push/#pop at my company :D
sigjuice has left #ocaml ["Textual IRC Client: www.textualapp.com"]
<def`> :)
<atchoum> i'm trying to learn ocaml. Is there an easy tutorial around ?
groovy2shoes has joined #ocaml
<sonologico> atchoum: check out realworldocaml.org
mengu has quit [Quit: Leaving...]
<atchoum> I am trying to write a higher order function : let polynome a b c = function x -> ( a .* (x. ** 2) + b *. x +. c);;
<atchoum> it doesn't work.
<atchoum> Something I don't understand about scope I think.
<octachron> atchoum, the point is after the operator in floating operators
<atchoum> let polynome a b c = function x -> ( a *. (x ** 2) + b *. x +. c);;
<reynir> the + should be +.
<atchoum> well done
<atchoum> why don't you have type inference or a Num Typeclass in ocaml like in Haskell ?
spew has quit [Ping timeout: 248 seconds]
<reynir> there is type inference
<octachron> atchoum, it can be useful to define "module K = struct let (+) = (+.) … end" and use local open with numerical computation heavy-code
<reynir> Hm, why the name 'K'
<Drup> reynir: why knot ?
<reynir> haaah
<octachron> reynir, because 𝕂 is not a valid module name?
barcabuona has quit [Ping timeout: 240 seconds]
mk9 has joined #ocaml
<octachron> and because algebraic fields were named Körper by Richard Dedekind.
ziyourenxiang has quit [Ping timeout: 256 seconds]
<reynir> Ah
kakadu_ has joined #ocaml
kakadu has quit [Ping timeout: 264 seconds]
nullifidian has quit [Remote host closed the connection]
rostero has joined #ocaml
nullifidian has joined #ocaml
kakadu_ has quit [Read error: Connection reset by peer]
kakadu_ has joined #ocaml
FreeBirdLjj has quit []
FreeBirdLjj has joined #ocaml
bartholin has quit [Remote host closed the connection]
jimmyrcom has joined #ocaml
nomicflux has joined #ocaml
jao has joined #ocaml
rwmjones|FOSDEM has quit [Ping timeout: 246 seconds]
BitPuffin has quit [Remote host closed the connection]
rwmjones has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
mfp has quit [Ping timeout: 240 seconds]
mfp has joined #ocaml
orbifx has joined #ocaml
mk9 has quit [Quit: mk9]
zv has joined #ocaml
<orbifx> hello all
<orbifx> anyone coding?
nullifidian has quit [Ping timeout: 260 seconds]
<companion_cube> yeah…
whoman has joined #ocaml
barcabuona has joined #ocaml
nullifidian has joined #ocaml
<orbifx> companion_cube: what are you working on?
<companion_cube> SMT
<companion_cube> weird research stuff, anyway
<orbifx> SMT stands for ?
<zv> we talking SMT here
<zv> orbifx: satisfiability modulo theory
<zv> bitblasting a bunch of SAT instances to solve problems over integers/reals/arrays/etc!
<companion_cube> yep
<companion_cube> well, not bitblasting…
<zv> yeah, there's a bunch of continuous solutions but i've never seen the point.
<zv> i want answers over bitvectors not "integers in general"
<companion_cube> well depends on the use case
<zv> is there some 32-bit value I can feed to a function to cause memory corruption/stack overflow
<zv> etc. etc.
<companion_cube> other people care about arbitrary precision arithmetic
<zv> "synthesize me some algorithm that does such and such"
<zv> companion_cube: what are you using it for?
<companion_cube> I'm more writing it than using it ^^
<companion_cube> but, research, and in my company we use z3 for verifying stuff
<zv> cool, i had to write a solver as well.
<zv> highly recommend knuth's latest fasc. on the topic "Satisfiability"
<orbifx> Isn't the answer to these kind of problems, generally, 42?
<companion_cube> zv: ah, I thought it was on SAT solving?
<companion_cube> so you wrote a bitblasting solver?
<zv> Comm. Logic/Annals of Auto. Reasoning/etc. are too concerned with proving compactness results etc.
<zv> you couldn't learn the state of the art in implementation from them.
<companion_cube> there are some papers about implementation tho
<zv> companion_cube: yes to both questions
<companion_cube> ok, so I get where you come from
<zv> companion_cube: sure, but you won't find them in the top-tier "computer logic" journals
<companion_cube> I'm not really into eager methods
<companion_cube> well it's more conferences than journals anyway ^^
<zv> (whatever that designation might imply)
<zv> if you have an academic background in the topic you might be more receptive to these kinds of things
<companion_cube> clearly, I also know the publishing side a bit
<companion_cube> so is a eager solver easy to write?
jbrown has joined #ocaml
<zv> what level of eagerness? eager meaning eagerly resolve unit propagation? eager literal & variable resolution?
<companion_cube> eager conversion of theories to SAT
<companion_cube> (ie bitblasting)
<zv> pretty easy
<companion_cube> (btw I don't know any channel where people discuss this kind of things, do you?)
<companion_cube> good to know…
<zv> my channel is "/highlight * SAT,SMT,z3"
<companion_cube> :D
<zv> then i just come in and hijack the conversation, very much like right now.
<companion_cube> heh
<zv> i'll talk anyones ear off about the topic, no matter their level of interest
<zv> computer scientists, programmers, journalists, politicians, the homeless - doesn't matter
<zv> i'll talk about SAT solvers
<companion_cube> cool, but really, SMT solvers are more interesting ;-)
<zv> occassionally people talk in #haskell, but they are mostly conversations about "wuts smt" and "can someone help me use sbv"
<Drup> zv: remind me not to be stuck between you and zozozo at dinner
<Drup> :D
<companion_cube> :D
<companion_cube> with me on the other side of the table
<zv> companion_cube: sure, SMT is what people "actually" want
<companion_cube> even implementation wise, I mean
<zv> unless you are some kind of chip designer with the need to verify huge, simple circuits
<companion_cube> yeah, ofc
<companion_cube> even then you might want sth higher level than dimacs
<zv> sure, very few SMT problems can be bitblasted obv.
<zv> sure
<zv> there actually is a subset language within SMTLIB that can define these kind of things
<companion_cube> so how does your solver compare to boolector? :p
<zv> e.g a particular circuit has some functionality, etc.
<zv> sortof like defining a function
<zv> companion_cube: not very well
<zv> i used it for one purpose and one purpose only
<zv> to find bugs in the erlang vm
<companion_cube> cool
<zv> it ended up being too slow and I went back to z3
<companion_cube> cool too ^^
<zv> i did end up finding a remotely exploitable heap overflow in the erlang string processing code tho: https://www.cvedetails.com/cve/CVE-2016-10253/
<companion_cube> it's hard to beat man-years of effort in implementing these things
<zozozo> +1
<zv> companion_cube: yeah, there's quite a bit to z3 that is pretty much just manual optimization spread out over years
<zv> especially if you are "lifting" the logic of x86 instructions to some symbolic representation, you need that kind of optimization
<zv> it would be cool if there was some kindof sat/smt discussion forum
<Drup> well, there is one, it's called TACAS
<Drup> :3
<companion_cube> you mean the SMT workshop? ^^
<companion_cube> or the SAT conference? or CADE?
<companion_cube> but I get the point, there should be sth on IRC ;p
<zv> yeah
<zv> i hear something like TACAS and I think "singapore" when what i'm looking for is the "kowloon walled city". if you know what i mean.
<Drup> one thing that always surprised me is the relatively few people interested in writing max-sat/smt solvers
<Drup> lot's of people seem really super happy to write billions of sat solvers that have the same expressive power and a oh-so-very-slightly different perf behavior
<zv> I've never heard of a "max-sat" solver
<Drup> but max-sat/smt is crazy useful for lot's of problems and has, like, 2 usable solvers
<Drup> well, max-smt has 2
slash^ has quit [Read error: Connection reset by peer]
rostero has quit [Quit: Connection closed for inactivity]
<zv> Drup: what is the difference between a max-sat and a more familiar sat solver?
Haudegen has quit [Remote host closed the connection]
<Drup> (arguably, I'm only interested by max-smt, though)
<zv> Drup: i guess I just can't see how any solver could be "more powerful" than a sat solver
<zv> i've read donald knuth on satisfiability and that is it and he doesn't really address the problem
<zv> isn't a 3-sat solver essentially universally powerful?
<zv> any equation, any number of unknowns can be encoded into a conjunction of sat instances, right?
<zv> i honestly don't know tho
jao has quit [Ping timeout: 268 seconds]
<zv> i guess I see a little bit how it could be more expressive
<Drup> zv: that's for decision problems. Optimization under constraints isn't a decision problem. I don't ask "yes or no", I ask "what's the max ?"
<Drup> and regardless, the ability to encode one problem into the other doesn't mean you can solve actual instances with the encoding
<Drup> (case in point: I can encode regex equivalence into ocaml typechecking, but that doesn't run well :D)
<zv> i see, so encoding this into sat would quickly grow huge, because you would have to essentially solve every combination of clauses upto the total.
bartholin has joined #ocaml
<zv> e.g a solving 4 clauses quickly turns into 24 sat instances
<zv> that is cool, thank you Drup
<fds> zv: If you start ##satisfiability, I'll join. ;-)
<bartholin> I don't know what you're talking about, but I'll post this here: https://en.wikipedia.org/wiki/Tseytin_transformation
<zv> done
<fds> Now we can start a project to write a max-sat solver in OCaml!
<zv> bartholin: i actually got a knuth check for a correction about Tseytin transformation
<zv> well ##satisfiability is started, i will consider the channel a lifetime achievement if a dozen people join.
<Drup> fds: extend zozozo's thing to do optim under constraints :D
<zozozo> fds: as Drup said, you are welcome to extend mSAT
<zozozo> ^^
Haudegen has joined #ocaml
<fds> You mean this: https://github.com/Gbury/mSAT ?
<zozozo> Yup
<zozozo> Any comment welcome, :)
* orbifx smirks the discussion spawned. [one just never knows]
<companion_cube> apparently z3 does max-smt in terms of normal smt
<companion_cube> as a theory
<Drup> companion_cube: that, plus some simplex
<zv> companion_cube: what is the logic name?
<Drup> well, simplex + a loop to jump between regions that are not connected
<zv> Drup: how do you apply simplex to a DPLL or CDCL tree?
<zv> rather, is there a solver that demonstrates this?
<Drup> well, z3 :D
<Drup> I don't understand a single thing about sat/smt solving, so you'll need to read papers :p
jimmyrcom has quit [Ping timeout: 248 seconds]
<zozozo> zv: from what I know it's not that complicated, except if you want some kind of fancy backtracking
<zozozo> And even then the complexity is more how to efficiently backtrack the simplex state
spew has joined #ocaml
cbot has joined #ocaml
iitalics has joined #ocaml
pierpa has joined #ocaml
nomicflux has quit [Quit: nomicflux]
dtornabene has joined #ocaml
iitalics has quit [Quit: WeeChat 2.0.1]
jbrown has quit [Quit: Leaving]
spew has quit [Ping timeout: 256 seconds]
<kakadu_> I recently started looking for approach to convert negative information to positive for algebraic datatypes. Basically, when type t = A|B|C I want to convert (x<>A) && (x<>B) to (x==C)
<kakadu_> Any well-known papers about something like this?
<thizanne> kakadu_: that looks very similar to pattern matching exhaustivity check
<kakadu_> I didn't thought about it in this way, thanks :)
jnavila has quit [Remote host closed the connection]
jimmyrcom has joined #ocaml
<Drup> you could also just call an smt solver :p
zolk3ri has quit [Quit: Lost terminal]
ocaml697 has joined #ocaml
zolk3ri has joined #ocaml
zolk3ri has quit [Client Quit]
<ocaml697> How do I create a mutable list ? I can create a list - let foo = ([]:float list) ;; But when I then try and alter the list - foo := 1.0::foo;; I get Error: This expression has type float list but an expression was expected of type 'a ref. Thanks
zolk3ri has joined #ocaml
zolk3ri has quit [Client Quit]
<pierpa> AFAIK, there's not a built in mutable list data structure. You must write your own.
zolk3ri has joined #ocaml
<pierpa> or, even better, reconsider your choice about data structures
<companion_cube> type 'a mutlist = Nil | Cons of {mutable hd: 'a; mutable tl: 'a mutlist}
<pierpa> no wait, from the example, it looks like you don't want a mutable list, but a mutable reference to a list. Correct?
<pierpa> if so, then just let foo = ref (...)
ocaml697 has quit [Ping timeout: 260 seconds]
zmt00 has quit [Ping timeout: 240 seconds]
zmt00 has joined #ocaml
jimmyrcom has quit [Ping timeout: 256 seconds]
nullifidian_ has joined #ocaml
zolk3ri has quit [Quit: leaving]
nullifidian has quit [Ping timeout: 240 seconds]
jimmyrcom has joined #ocaml
sillyotter has joined #ocaml
nomicflux has joined #ocaml
sh0t has joined #ocaml
sillyotter has quit [Quit: WeeChat 1.9.1]
jimmyrcom has quit [Ping timeout: 256 seconds]
kakadu_ has quit [Remote host closed the connection]
dtornabene has quit [Quit: Leaving]
jimmyrcom has joined #ocaml
cbot has quit [Ping timeout: 260 seconds]
andreas_ has quit [Quit: Connection closed for inactivity]