GithubHelp home page GithubHelp logo

ucsd-progsys / liquid-fixpoint Goto Github PK

View Code? Open in Web Editor NEW
130.0 12.0 56.0 5.65 MB

Horn Clause Constraint Solving for Liquid Types

License: BSD 3-Clause "New" or "Revised" License

Haskell 94.82% Makefile 0.01% Shell 0.27% SMT 4.90%

liquid-fixpoint's Introduction

Liquid Fixpoint

Hackage Hackage-Deps CircleCI hlint cabal stack

This package implements a Horn-Clause/Logical Implication constraint solver used for various Liquid Types. The solver uses SMTLIB2 to implement an algorithm similar to:

Requirements

In addition to the .cabal dependencies you require an SMTLIB2 compatible solver binary:

If on Windows, please make sure to place the binary and any associated DLLs somewhere in your path.

How To Build and Install

$ git clone https://github.com/ucsd-progsys/liquid-fixpoint.git
$ cd liquid-fixpoint
$ stack install # alternatively, use `cabal install`.

Test with

$ stack test

Run with

$ stack exec fixpoint -- tests/pos/adt.fq

Using SMTLIB-based SMT Solvers

You can use one of several SMTLIB2 compliant solvers, by:

fixpoint --solver=z3 path/to/file.hs

Currently, we support

* Z3
* CVC4
* MathSat

"Horn" Format

See the examples in tests/horn/{pos, neg} eg

For how to write VCs "by hand".

See this tutorial with accompanying code for an example of how to generate Horn queries.

The main datatypes are described in src/Language/Fixpoint/Horn/Types.hs

Configuration Management

It is very important that the version of Liquid Fixpoint be maintained properly.

Suppose that the current version of Liquid Haskell is A.B.C.D:

  • After a release to hackage is made, if any of the components B, C, or D are missing, they shall be added and set to 0. Then the D component of Liquid Fixpoint shall be incremented by 1. The version of Liquid Fixpoint is now A.B.C.(D + 1)

  • The first time a new function or type is exported from Liquid Fixpoint, if any of the components B, or C are missing, they shall be added and set to 0. Then the C component shall be incremented by 1, and the D component shall stripped. The version of Liquid Fixpoint is now A.B.(C + 1)

  • The first time the signature of an exported function or type is changed, or an exported function or type is removed (this includes functions or types that Liquid Fixpoint re-exports from its own dependencies), if the B component is missing, it shall be added and set to 0. Then the B component shall be incremented by 1, and the C and D components shall be stripped. The version of Liquid Fixpoint is now A.(B + 1)

  • The A component shall be updated at the sole discretion of the project owners.

It is recommended to use the Bumper utility to manage the versioning of Liquid Fixpoint. Bumper will automatically do the correct update to the cabal file. Additionally, it will update any packages that you have the source for that depend on Liquid Fixpoint.

To update Liquid Fixpoint and Liquid Haskell, first clone Liquid Haskell and Liquid Fixpoint to a common location:

git clone https://github.com/ucsd-progsys/liquidhaskell.git
git clone https://github.com/ucsd-progsys/liquid-fixpoint.git

To increment the D component of Liquid Fixpoint:

./path/to/bumper -3 liquid-fixpoint

This will update the D component of Liquid Fixpoint. If necessary, this will update the Build-Depends of Liquid Haskell. If the Build-Depends was updated, Liquid Haskell's D component will be incremented.

To increment the C component of Liquid Fixpoint, and strip the D component:

./path/to/bumper --minor liquid-fixpoint

As before, this will update Liquid Fixpoint and, if necessary, Liquid Haskell.

To increment the B component of Liquid Fixpoint, and strip the D and C components:

./path/to/bumper --major liquid-fixpoint

As before, this will update Liquid Fixpoint and, if necessary, Liquid Haskell

SMTLIB2 Interface

There is a new SMTLIB2 interface directly from Haskell:

  • Language.Fixpoint.SmtLib2

See tests/smt2/{Smt.hs, foo.smt2} for an example of how to use it.

Command Line for SMT2 interface

You can use the .smt2 interface from the command-line as follows:

Use --stdin to read files from stdin

$ more tests/horn/pos/test01.smt2 | fixpoint --stdin

Liquid-Fixpoint Copyright 2013-21 Regents of the University of California.
All Rights Reserved.

Working 166% [===============================================================]
Safe ( 2  constraints checked)

Use -q to disable all output (banner, progress bar etc.)

$ more tests/horn/pos/test01.smt2 | fixpoint -q --stdin

Use --json to get the output as a JSON object (rendered to stdout)

$ more tests/horn/pos/abs02-re.smt2 | stack exec -- fixpoint -q --json --stdin
{"contents":{"numIter":3,"numCstr":3,"numChck":3,"numBrkt":3,"numVald":3},"tag":"Safe"}

Options

--higherorder allows higher order binders into the environment

--extsolver runs the deprecated external solver.

--parts Partitions an FInfo into a [FInfo] and emits a bunch of files. So:

$ fixpoint -n -p path/to/foo.fq

will now emit files:

path/to/.liquid/foo.1.fq
path/to/.liquid/foo.2.fq
. . .
path/to/.liquid/foo.k.fq

and also a dot file with the constraint dependency graph:

path/to/.liquid/foo.fq.dot

FInfo Invariants

Binders

This is the field

     , bs       :: !BindEnv         -- ^ Bind  |-> (Symbol, SortedReft)

or in the .fq files as

bind 1 x : ...
bind 2 y : ...
  • Each BindId must be a distinct Int,
  • Each BindId that appears in a constraint environment i.e. inside any IBindEnv must appear inside the bs

Environments

  • Each constraint's environment is a set of BindId which must be defined in the bindInfo. Furthermore

  • Each constraint should not have duplicate names in its environment, that is if you have two binders

  bind 1 x : ...
  bind 12 x : ...

Then a single IBindEnv should only mention at most one of 1 or 12.

  • There is also a "tree-shape" property that its a bit hard to describe ... TODO

LHS

Each slhs of a constraint is a SortedReft.

  • Each SortredReft is basically a Reft -- a logical predicate. The important bit is that a KVar i.e. terms of the formalized
     $k1[x1:=y1][x2:=y2]...[xn:=yn]

That is represented in the Expr type as

  | PKVar  !KVar !Subst

must appear only at the top-level that is not under any other operators, i.e. not as a sub-Expr of other expressions.

  • This is basically a predicate that needs to be "well sorted" with respect to the BindId, intuitively
    x:int, y:int |- x + y : int

is well sorted. but

    x:int  |- x + y : int

is not, and

    x:int, y: list |- x + y : int

is not. The exact definition is formalized in Language.Fixpoint.SortCheck

RHS

Similarly each rhs of a SubC must either be a single $k[...] or an plain $k-free Expr.

Global vs. Distinct Literals

     , gLits    :: !(SEnv Sort)               -- ^ Global Constant symbols
     , dLits    :: !(SEnv Sort)       

The global literals gLits are symbols that are in scope everywhere i.e. need not be separately defined in individual environments. These include things like

  • uninterpreted measure functions len, height,
  • uninterpreted data constructor literals True, False

Suppose you have an enumerated type like:

data Day = Sun | Mon | Tue | Wed | ... | Sat

You can model the above values in fixpoint as:

constant lit#Sun : Day
constant lit#Mon : Day
constant lit#Tue : Day
constant lit#Wed : Day

The distinct literals are a subset of the above where we want to tell the SMT solver that the values are distinct i.e. not equal to each other, for example, you can additionally specify this as:

distinct lit#Sun : Day
distinct lit#Mon : Day
distinct lit#Tue : Day
distinct lit#Wed : Day

The above two are represented programmatically by generating suitable Symbol values (for the literals see litSymbol) and Sort values as FTC FTycon and then making an SEnv from the [(Symbol, Sort)].

Sorts

What's the difference between an FTC and an FObj?

In early versions of fixpoint, there was support for three sorts for expressions (Expr) that were sent to the SMT solver:

  1. int
  2. bool
  3. "other"

The FObj sort was introduced to represent essentially all non-int and non-bool values (e.g. tuples, lists, trees, pointers...)

However, we later realized that it is valuable to keep more precise information for Exprs and so we introduced the FTC (fixpoint type constructor), which lets us represent the above respectively as:

  • FTC "String" [] -- in Haskell String
  • FTC "Tuple" [FInt, Bool] -- in Haskell (Int, Bool)
  • FTC "List" [FTC "List" [FInt]] -- in Haskell [[Int]]

There is a comment that says FObj's are uninterpretted types; so probably a type the SMT solver doesn't know about? Does that then make FTC types that the SMT solver does know about (bools, ints, lists, sets, etc.)?

The SMT solver knows about bool, int and set (also bitvector and map) but all other types are currently represented as plain Int inside the SMT solver. However, we will be changing this to make use of SMT support for ADTs ...

To sum up: the FObj is there for historical reasons; it has been subsumed by FTC which is what I recomend you use. However FObj is there if you want a simple "unitype" / "any" type for terms that are not "interpreted".

Qualifier Patterns

λ> doParse' (qualParamP sortP) "" "z as (mon . $1) : int"
QP {qpSym = "z", qpPat = PatPrefix "mon" 1, qpSort = FInt}
λ> doParse' (qualParamP sortP) "" "z as ($1 . mon) : int"
QP {qpSym = "z", qpPat = PatSuffix 1 "mon", qpSort = FInt}
λ> doParse' (qualParamP sortP) "" "z as mon : int"
QP {qpSym = "z", qpPat = PatExact "mon", qpSort = FInt}
λ> doParse' (qualParamP sortP) "" "z : int"
QP {qpSym = "z", qpPat = PatNone, qpSort = FInt}

liquid-fixpoint's People

Contributors

adinapoli avatar alanz avatar andrewthad avatar atondwal avatar benjamincosman avatar christetreault avatar clayrat avatar curiousleo avatar facundominguez avatar fizzixnerd avatar googleson78 avatar gridaphobe avatar michaelborkowski avatar mkolosick avatar nikivazou avatar panagosg7 avatar peti avatar philderbeast avatar plredmond avatar qaristote avatar ranjitjhala avatar robinwebbers avatar rolph-recto avatar serras avatar shingarov avatar spinda avatar tbidne avatar waivio avatar yiyunliu avatar zgrannan 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar

liquid-fixpoint's Issues

[cutsolver] failing tests

@bmcfluff I have tweaked the make test so that all the .fq tests are run with -e (and also the ones particular to --eliminate). There are a couple of tests that fail with --eliminate, namely:

  • tests/pos/test3.fq
  • tests/elim/test2.fq

Can you take a look?

fixpoint.native compile fails

From travis

Last 10 lines of the build log ( /home/travis/.cabal/logs/liquid-fixpoint-0.2.2.0.log ):
/usr/bin/ocamllex -q fixLex.mll
/usr/bin/ocamldep -modules fixLex.ml > fixLex.ml.depends
/usr/bin/ocamlyacc fixParse.mly
+ /usr/bin/ocamlyacc fixParse.mly
File "fixParse.mly", line 279: $3 is unbound

"You probably have a stale fixpoint.native"

The scenario: some new feature lands, and you want to try it out. Oh No! Calamity! Nothing works, it's all burning to the ground!

Hours later, it turns out that fixpoint.native decided not to rebuild itself, despite the fact that you recreated your sandbox and did a cabal clean.

Ideally, fixpoint.native would rebuilt itself when needed. However, if cabal clean would execute cd external/fixpoint && make clean and always build fixpoint.native in a new sandbox, that would be an improvement.

Type Variables and Sort Checking

@nikivazou see tests/todo/RG.hs.fq which is a shortened form of the .fq file obtained from:

module RG where
data RGRef a
{-@ measure tv :: RGRef a -> a @-}
{-@ qualif TERMINALVALUE(r:RGRef a): (tv r) @-}

The enhancements to the polymorphic inference introduced
in commit: 9608cb6
named "another hack to fix sortchecking: refreshing type variables"
allow unification of the sort-variable for a with bool (or prop).

This is a bug, because well, the a is "rigid" i.e. a monomorphic
type at this point, and so should not be further unified with anything
(let alone bool).

The code in that commit lets liquid-fixpoint think that the qualifier
TERMINALVALUE is well-sorted, which then crashes Z3
because all values of sort a are embedded as int and not bool.

(Note that the parent commit seems fine -- I'm guessing its because
the earlier "more conservative" polymorphic instantiation mechanism
rejected this qualifier is ill-formed out of hand.)

To reproduce;

$ fixpoint.native -v 1 -notruekvars -refinesort -nosimple -strictsortcheck -sortedquals -no-gen-qual-sorts -smtsolver z3 -out ./.liquid/RG.hs.fqout RG.hs.fq 

Need --maxpartsize flag in fixpoint and liquid

Suppose we set minpartsize=500 for some file. We then partition that file into 4 partitions, and we get the following sizes: 499, 500, 500, 500

At this point, partitionN will combine the two smallest partition into: 999, 500, 500, and the end result is we've turned 4 perfectly balanced partitions into 2 balanced, and one very unbalanced partitions.

We should add a maxpartsize flag such that the behavior of partitonN becomes:

  1. partitionN will create N partitions, were N = [cores flag value].
  2. If |partitions| <= 1 goto 6
  3. if |smallest partition| > |minpartsize| goto 6
  4. if |smallest partition| + |second smallest partition| > |maxpartsize| goto 6
  5. combine the two smallest partitions, goto 2
  6. done

Implement parallel FInfo solver

Given that we have functions to partition an FInfo into a list of FInfos, it makes sense to implement a parallel version of solveExt; solvePar.

Work will be done in the branch: https://github.com/ucsd-progsys/liquid-fixpoint/tree/cores
any related functionality in liquidhaskell will be done in: https://github.com/ucsd-progsys/liquidhaskell/tree/cores

NOTE: I'm opening this issue to have a central location to post updates. This we aren't sending emails randomly throughout the group.

Nonconsecutive BindIds

See:

https://github.com/ucsd-progsys/liquid-fixpoint/blob/5909e1a2ef03f4a228a67292279179e20076a286/tests/todo/nonconsec-bindids.fq

It passes if you rename bind 3 (and its use site) to say 2 or 5.

Currently, insertBindEnv assumes BindIds have been assigned consecutively, and so its users (in our case, Validate's renameVV) may trample some binders when they're not consecutive. Do we modify insertBindEnv, or do we enforce the consecutive invariant (which would at least involve modifying the other Validate passes that drop binders)?

Bug in sort checking

If you run

fixpoint.native -v 1 -notruekvars -refinesort -nosimple -strictsortcheck -sortedquals -no-gen-qual-sorts -smtsolver z3 tests/Poly1.fq

on the following file

tests/Poly1.fq

you get an error (Z3RelTypeError) as sortcheck_pred of v = append([Nil; v]) returns false.

I will update the sort checker so that the above example passes.

Unknown flag: -f

While attempting to test my new parallel fixpoint, I kept getting this error: Unknown flag: -f

Assuming I broke something, I tried the master fixpoint, and get the same error. fixpoint from hackage works as advertised.

Output of fixpoint --verbose produced by the master fixpoint:

$ fixpoint --verbose
Liquid-Fixpoint Copyright 2009-13 Regents of the University of California.
All Rights Reserved.

Options: Config {inFile = "", outFile = "out", srcFile = "", solver = z3, genSorts = GQS False, ueqAllSorts = UAS False, native = False, real = False, eliminate = False, metadata = False, stats = False, parts = False}
EXEC: LD_LIBRARY_PATH=/home/chris/dmp/ucsd/liquid/ref-fixpoint/dist/build/fixpoint.native/ /home/chris/dmp/ucsd/liquid/ref-fixpoint/dist/build/fixpoint.native/fixpoint.native -v 1  -notruekvars -refinesort -nosimple -strictsortcheck -sortedquals -no-gen-qual-sorts -smtsolver z3 -out out 

**** START: fixpoint ***********************************************************

Unknown flag: -f

**** DONE:  fixpoint ***********************************************************

EXIT: ExitFailure 1

Output produced by fixpoint from hackage:

$ fixpoint --verbose
Liquid-Fixpoint Copyright 2009-13 Regents of the University of California.
All Rights Reserved.

Options: Config {inFile = "", outFile = "out", srcFile = "", solver = z3, genSorts = GQS False, ueqAllSorts = UAS False, native = False, real = False, eliminate = False}
EXEC: LD_LIBRARY_PATH=/home/chris/dmp/ucsd/liquid/hack-liquid/.cabal-sandbox/bin/ /home/chris/dmp/ucsd/liquid/hack-liquid/.cabal-sandbox/bin/fixpoint.native -v 1  -notruekvars -refinesort -nosimple -strictsortcheck -sortedquals -no-gen-qual-sorts -smtsolver z3 -out out 

**** START: fixpoint ***********************************************************



========================================================
© Copyright 2009 Regents of the University of California.

--- stuff ---

**** DONE:  fixpoint ***********************************************************

EXIT: ExitSuccess

Calling fixpoint via liquid has this same behavior.

Z3 Version: 4.4.0
GHC Version: 7.10.1.20150710
cabal-install Version: 1.22.2.0
OS: Ubuntu 15.04 64 bit, kernel: 3.19.0-21-generic

Should we clean up old branches?

There are 17 of them. At the very least, should we remove some of the following branches that have been fully merged into master?

bitvector
cores
list_parsing
smt-refactor
sorts
stats
tmp_fix1

(same goes even more so for liquidhaskell - 29 branches, with fully merged:

cores
cutsolver
ghc-7.10
non_applied_tycons
paths
pprinting
sorts
test-liquid-opts
tiny-travis-fix
travis_retry
type-class

)

Crash on Untyped Qualifiers

The following code

qualif Auto1(VV : FAppTy SumFst.L  a_apx): ((? barr([VV])) <=> true) // "tests/pos/fixme.hs" (line 3, column 12)
qualif Auto2(VV : FAppTy SumFst.L  a_apx): (bar([VV]) = 0) // "tests/pos/fixme.hs" (line 3, column 12)

constant bar : func(0, [FAppTy SumFst.L  int; int])
constant barr : func(0, [FAppTy SumFst.L  int; bool])

Crashes with

No type for barr([VV])z3Pred: error converting (barr(VV) <=> true)
Fatal error: exception Assert_failure("tpGen.ml", 355, 24)

I.e. the Auto1 qualifier is untyped. But these is no such issue for the Auto2 qualifiers.
So, @ranjitjhala do we allow unsorted qualifiers or not?

The above error is created from the following liquidHaskell code

data L a = Nil

{-@ measure bar :: L Int -> Int
    bar Nil = 0
  @-}   

{-@ measure barr :: L Int -> Prop
    barr Nil = true
  @-}     

Where the qualifiers are stripped from the type of Nil

Nil :: {v:L a | bar v == 0 && barr v <=> true} 

Replace String with Text

We use Strings all over the place, especially as Symbols. This is super inefficient, which becomes apparent once you start treating liquidhaskell/fixpoint as more than a pre-processor for the ocaml fixpoint binary.

We should just use Text instead. @ranjitjhala, btw is lazy text really necesary in L.F.SmtLib2? I think we'd be fine sticking to the strict version, any individual smt command/response ought to be fairly small.

FInfo monoid instance broken for fileName field

When mappending two FInfo objects, mappend is called for all fields, inclusing fileName. This will end up producing a filename such as the following:

tests/pos/.liquid/listSetDemo.hs.4tests/pos/.liquid/listSetDemo.hs.1tests/pos/.liquid/listSetDemo.hs.3tests/pos/.liquid/listSetDemo.hs.22tests/pos/.liquid/listSetDemo.hs.21tests/pos/.liquid/listSetDemo.hs.20tests/pos/.liquid/listSetDemo.hs.19tests/pos/.liquid/listSetDemo.hs.18tests/pos/.liquid/listSetDemo.hs.17tests/pos/.liquid/listSetDemo.hs.16tests/pos/.liquid/listSetDemo.hs.15tests/pos/.liquid/listSetDemo.hs.14tests/pos/.liquid/listSetDemo.hs.13tests/pos/.liquid/listSetDemo.hs.12tests/pos/.liquid/listSetDemo.hs.10tests/pos/.liquid/listSetDemo.hs.11.fq

Clearly this is Not What We Want.

Since these filePaths are arbitrary, I propose we always accept the left hand side, so mappend will look like this:

instance Monoid (FInfo a) where
  mappend i1 i2 = FI { cm       = mappend (cm i1)       (cm i2)
                       -- stuff
                     , fileName = fileName i1
                     }

If management concurs, I'll go ahead and implement this.

mappend on non-trivial BindEnvs

While attempting to implement partitionN using the Monoid instance of FInfo, I recieved the following error.

**** ERROR *********************************************************************
**** ERROR *********************************************************************
**** ERROR *********************************************************************
mappend on non-trivial BindEnvs
**** ERROR *********************************************************************
**** ERROR *********************************************************************
**** ERROR *********************************************************************

This is caused by the Monoid instance for BindEnv. From https://github.com/ucsd-progsys/liquid-fixpoint/blob/master/src/Language/Fixpoint/Types.hs#L1472

instance Monoid BindEnv where
  mempty = BE 0 M.empty
  mappend (BE 0 _) b = b
  mappend b (BE 0 _) = b
  mappend _ _        = errorstar "mappend on non-trivial BindEnvs"

It seems that BindEnv just contains a hash map. Since HashMap has a Monoid instance, why not define mappend like this:

  mappend (BE s m) (BE t n) = BE (s + t) (m `mappend` n)

Failing that, is there some other way to combine two BindEnv objects so that the FInfo Monoid instance can work?

partition' fails for various files with error: PARTITION: wfGroupNothing

For the following liquidhaskell test suite files:

  • pos/Holes.hs
  • pos/absref-crash0.hs
  • pos/alphaconvert-List.hs
  • pos/LocalTermExpr.hs
  • pos/LocalHole.hs

The call to partition' is throwing this exception:

**** ERROR *********************************************************************
**** ERROR *********************************************************************
**** ERROR *********************************************************************
PARTITION: wfGroupNothing
**** ERROR *********************************************************************
**** ERROR *********************************************************************
**** ERROR *********************************************************************

This behavior can be reproduced using the latest build from the cores branch. These files will return Sat using the singlethreaded solver liquid [file].hs but will throw when calling evaluating the list returned by partition' when solving with multiple threads liquid --cores=4 [file].hs

partition' returns empty list for various files

For various files, partition' is returning []. Due to this, I am seeing the following test failures when using the multithreaded solver:

Tests
  Unit
    pos
      kmpIO.hs:                   FAIL (1.02s)
        Wrong exit code
        expected: ExitSuccess
         but got: ExitFailure 1
      Bar.hs:                     FAIL (0.73s)
        Wrong exit code
        expected: ExitSuccess
         but got: ExitFailure 1
      ResolveA.hs:                FAIL (0.74s)
        Wrong exit code
        expected: ExitSuccess
         but got: ExitFailure 1
      bar.hs:                     FAIL (0.77s)
        Wrong exit code
        expected: ExitSuccess
         but got: ExitFailure 1
      profcrasher.hs:             FAIL (0.79s)
        Wrong exit code
        expected: ExitSuccess
         but got: ExitFailure 1
      Measures1.hs:               FAIL (0.80s)
        Wrong exit code
        expected: ExitSuccess
         but got: ExitFailure 1
      ResolveB.hs:                FAIL (0.78s)
        Wrong exit code
        expected: ExitSuccess
         but got: ExitFailure 1
      datacon-inv.hs:             FAIL (0.73s)
        Wrong exit code
        expected: ExitSuccess
         but got: ExitFailure 1
      PlugHoles.hs:               FAIL (0.73s)
        Wrong exit code
        expected: ExitSuccess
         but got: ExitFailure 1
      Foo.hs:                     FAIL (0.81s)
        Wrong exit code
        expected: ExitSuccess
         but got: ExitFailure 1
      pragma0.hs:                 FAIL (0.69s)
        Wrong exit code
        expected: ExitSuccess
         but got: ExitFailure 1
      Measures.hs:                FAIL (0.72s)
        Wrong exit code
        expected: ExitSuccess
         but got: ExitFailure 1
    parser/pos
      TokensAsPrefixes.hs:        FAIL (0.74s)
        Wrong exit code
        expected: ExitSuccess
         but got: ExitFailure 1

Additionally, it is very likely that this is happening for negative tests as well, seeing false ExitFailure 1 that is caused by this issue, rather than the actual issue being tested for.

liquid-fixpoint-0.2.1.1 build failure

Citing from http://hydra.cryp.to/build/536618/nixlog/1/raw:

Linking dist/build/fixpoint/fixpoint ...
/bin/sh: ./configure: /bin/bash: bad interpreter: No such file or directory
EXEC: ./configure
Setup: cmd: ./configure failure code 126

I believe the most portable way to refer to bash is to start it as /usr/bin/env bash. /bin/bash does not exist on many system, i.e. most BSD Unices don't have that. Neither does NixOS, which is what I'm running.

Fixpoint parser produces a different result than liquid

The FInfo that fixpoint produces when reading in a .fq file is not the same as the FInfo that liquid produces when reading in a .hs file. This is causing issues for many files in the liquid test suite.

Given the following input:

fixpoint +RTS -N4 -RTS --cores=4 ../liquidhaskell/tests/pos/.liquid/RBTree-col-height.hs.fq

A massive error is returned.

Much discussion of this issue has happened in the thread for issue #90:

#90 (comment) by Chris
... through ...
#90 (comment) by Chris

Polymorphic instantiation

The following seems to cause a "Bad Constraint", as the return type of offset does not get instantiated correctly.

constant offset : func(1, [int; @(1)])

constraint:
  env []
  grd true
  lhs {v : int | [v = 1; (offset([1]) = 0)]}
  rhs {v : int | [v = 1 ]}
  id 1 

The following make the error go away:

  • Defining offset as constant offset : func(0, [int; int])
  • Using offset([1]) ~~ 0 & the -u flag, instead of offset([1]) = 0

Re-enable linking against z3?

Now that Z3 has been released under the MIT license (https://github.com/Z3Prover/z3) it might be worth dusting off the z3mem version of fixpoint. We could statically link fixpoint against z3 and remove the runtime dependency (as well as providing a sizeable performance boost).

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.