Commit Graph

1003 Commits

Author SHA1 Message Date
Thomas E. Hansen
d25db9e353 [ papers ] Add implementation of Dekker's algorithm
This completes the implementation of the examples in the paper
"Applications of Applicative Proof Search" (Liam O'Connor, 2016).
Unfortunately, the final example is an example of something that _can_
be expressed, but _cannot_ be model-checked by the approach in the
paper.

(Side note on `petersonsCorrect`: The paper mentions that it checks in
~3 minutes on a 2013 MacBook Pro. Assuming they mean "type-checks", this
is roughly consistent with our observations of just short of 2 minutes.
I doubt that they evaluated it, since an attempt at doing this on a
reasonably modern server (Intel Xeon Gold 5220R, 502 GB of RAM) was
killed after just over 3 hours, producing the following resource log:

  Command exited with non-zero status 255
  Time: 11320.46s user, 35.12s system, 3h09m46s elapsed, 99%CPU
  Memory: 57644016 Kbytes RAM

)
2022-10-05 14:30:08 +02:00
Thomas E. Hansen
260d9ecb58 [ papers ] Comment out petersonsCorrect for performance reasons
On average across 10 runs on an Intel Core i7-8750H with 15.2GB of
available system memory (16GB installed in system), type-checking
`libs/papers/Search/GCL.idr` WITH `petersonsCorrect` takes:

  * 1 minute  48.7 seconds, consuming 3.92GB of RAM

By contrast, commenting `petersonsCorrect` out results in type-checking
taking on average (same #runs, same config):

  * 0 minutes  1.2 seconds, consuming 0.25GB of RAM

And good luck trying to evaluate the thing!
(This might be a good performance test at some point, but uh, we're not
there yet...)
2022-10-05 14:30:08 +02:00
Thomas E. Hansen
c5b114209e [ papers ] Tidy the Peterson's Prop type
Inspired by `Search/Properties.Pythagoras.formula`, having the CSP as
its own type allows for some better docs+understanding than `Prop ? ?`.
2022-10-05 14:30:08 +02:00
Thomas E. Hansen
d5c9253e7e [ papers ] Fix impl.n s.t. model-checking Peterson's works
Thanks to the debug info supplied by #2673, I was able to spot which
functions were blocking and `public import` the relevant files in
`papers/Search/Properties.idr`.

As a result the GCL file now type-checks, albeit extremely slowly!
I stopped an evaluation of `petersonsCorrect` at the REPL after 15
minutes and ~14GB of RAM consumed.
2022-10-05 14:30:08 +02:00
Thomas E. Hansen
36554eb56f [ papers ] Make ops total, implement termination mc
* Currying the `ops` function makes the totality checker spot that it
  _is_ actually total.
* Instance arguments are heavily abused in the paper, along with
  implicit `open` magic, but Idris allows no such ~~luxury~~
  obfuscation, so we have to pass things explicitly.
* `decSo` is not `public export`ed, so we have to define `IsTT` by
  pattern-matching (which is fine).

Currently, it gets stuck on checking `petersonsCorrect` for some,
currently unknown, reason. (And the log output is loooooong O.O)

Once again, this would not have been possible without gallais insigths.
Many thanks!

Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-10-05 14:30:08 +02:00
Thomas E. Hansen
8c76118f2f [ papers ] Finish Search.CTL
* Switch to `Inf` to actually use codata/corecursion.
* Add `%hint`s to mark the interface implementations as such, despite
  use of a record for `DepthInv` (this is necessary for other stuff).
* Pass in `Oh` to `reaches10.evidence` in order for things to work.

With huge thanks to gallais for helping me put the final things in
place!

Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-10-05 14:30:08 +02:00
Thomas E. Hansen
0d72964f21 [ papers ] Missed some public exports 2022-10-05 14:30:08 +02:00
Thomas E. Hansen
eb4749d381 [ papers ] Figure out types, start termination check
Termination checking needs figuring out. There is some funky stuff going
on with the half-deciders and their constructors. Other than that, I
**think** it's nearly done. God knows how much RAM it'll take though...
2022-10-05 14:30:08 +02:00
Thomas E. Hansen
6421973282 [ papers ] Add mutex and starv-free properties 2022-10-05 14:30:08 +02:00
Thomas E. Hansen
5742afe3a5 [ papers ] Set the stage for mc-ing Peterson's alg 2022-10-05 14:30:08 +02:00
Thomas E. Hansen
8ca48e0033 [ papers ] Implement reaches10 proof
Seems to be very slow though...
And Idris is unable to find the depth-inv instance for `r10Proof`.
Could be that auto-search is not as strong as Agda's? Or more likely,
I've set things up slightly wrong...
2022-10-05 14:30:08 +02:00
Thomas E. Hansen
5f48fbe857 [ papers ] Add derived GCL control structures 2022-10-05 14:30:08 +02:00
Thomas E. Hansen
92ed8607e3 [ papers ] Start implementing GCL
I am upset about the amount of computation done in that view...
2022-10-05 14:30:08 +02:00
Thomas E. Hansen
b3a8d344e4 [ papers ] Implement proof-search for EF, AF, EG, AG
This also caught an implementation error in the Global formula
definitions:
AG f = A[ f U (f AND' Completed) ]
and **not**
AG f = A[ (f U f) AND' Completed ]
(both of which are valid parsings of the original
 AG f = A[ f u f AND' Completed]
 )
2022-10-05 14:30:08 +02:00
Thomas E. Hansen
f96b25a3d7 [ papers ] Keep AF, EF, AG, EG naming consistent 2022-10-05 14:30:08 +02:00
Thomas E. Hansen
81df879c77 [ papers ] Define Finally operators 2022-10-05 14:30:08 +02:00
Thomas E. Hansen
58b6ccdaf3 [ papers ] Change to LazyList for Computation Tree
This makes more sense in terms of `EU` being efficient and only
evaluating as much as it needs to. However, I'm not sure `model.follow`
is implemented correctly (Agda delays the call to `model.followAll`,
which I'm unsure if we can do (and if so, how to do it) in Idris)...
2022-10-05 14:30:08 +02:00
Thomas E. Hansen
68f8e69ea2 [ papers ] Impl.t proof-search for AU and EU
This reveals an unfortunate problem/misunderstanding: For `ExistsUntil`
to make sense, in terms of evaluation speedups, the list needs to be
lazy. Which is _not_ what `Lazy (List a)` does /!\
I need to switch to LazyList...
2022-10-05 14:30:08 +02:00
Thomas E. Hansen
40780c8f85 [ papers ] Figure out isCompleted by trial and error
And here's a good case against allowing custom unicode syntax:
〈$〉 is `<$>`, i.e. the infix notation for `map`. That's fine; If you
happen to know it!
ESPECIALLY, if your paper defines 〈_〉 as custom notation for a guarded
expression! Then there is **no way** to tell that the expression 〈$〉
is not a guarded expression over `$`, but is instead the alias for
`map`!! You just have to magically know this beforehand!

We also need an explicit `Lazy` annotation for Idris to be happy with
the implicit `ms` in the `IsCompleted` constructor.
2022-10-05 14:30:08 +02:00
Thomas E. Hansen
67218e3eac [ papers ] Move LTE' outside parameters block 2022-10-05 14:30:08 +02:00
Thomas E. Hansen
3e0d5acfa4 [ papers ] Map depth-invariant prfs for AU and EU
The proofs of depth-invariance for Always Until and Exists Until require
mapping the proofs over the Formulae's internal `All` and `Any`
respectively. Idris provides some functions for this, but they erase the
list and so don't quite work. Instead we need to implement our own,
which don't erase the list.
2022-10-05 14:30:08 +02:00
Thomas E. Hansen
40e1a53ab2 [ papers ] Cleaned things up a bit; utterly confused
Don't you love when papers introduce syntax and functions which you've
never seen before and don't seem to match the types of the existing
stuff?

P.S. YEET! (aka. that's probably enough for today ^^)
2022-10-05 14:30:08 +02:00
Thomas E. Hansen
db30dd8d4a [ papers ] Fix things by adding a parameter block
The original Agda code declares the module with L and Sigma (Lbls and
Sts) with type Set. This is apparently close to a parameter block, which
solves the unification error I was having with `now`! Huge thanks to
gallais for showing me that!
2022-10-05 14:30:08 +02:00
Thomas E. Hansen
0c72f83fe8 [ papers ] Start implem.g the model-checking part of Liam's paper
I should have put this under version-control WAAAAAY sooner than this!
Oh well, better late than never...

There are some fun problems to solve in terms of type-mismatch and
erasure, but that's for another day.
2022-10-05 14:30:08 +02:00
Thomas E. Hansen
a90fe03ff7 Add DOI to Liam's search paper stuff 2022-10-05 14:30:08 +02:00
G. Allais
1f3809c49a
[ re #2675 ] Do not build libs/{contribs,papers} during bootstrap (#2677)
Co-authored-by: Ben Hormann <benhormann@users.noreply.github.com>
2022-10-04 13:37:45 +01:00
Zoe Stafford
138452273c
Merge pull request #2701 from stefan-hoeck/snocfold
[ performance ] efficient foldr and foldMap for SnocList
2022-10-04 12:52:39 +01:00
stefan-hoeck
0e956249cc [ performance ] efficient foldr and foldMap for SnocList 2022-10-04 12:19:32 +02:00
Sam Phillips
ba34b64c68 Remove note about differing behavior 2022-10-04 10:24:27 +02:00
0xd34df00d
c2dd824c58 [ base ] Implement Uninhabited for impossible Pointwise equalities 2022-10-02 21:41:26 +01:00
Denis Buzdalov
f58a96e420 [ papers ] Move a postulate to a required parameter 2022-10-01 15:11:26 +01:00
hilary888
9eaff9f728 Fix typo in documentation string 2022-09-30 22:35:36 +01:00
Stefan Höck
7eebeff905
[ fix ] natToFinLt is O(n) (#2689) 2022-09-29 14:36:32 +01:00
Denis Buzdalov
1402194f14 [ golden ] Split runner to be able to run with custom options 2022-09-27 22:05:12 +01:00
André Videla
162d9e942b
Merge pull request #2686 from dunhamsteve/lexer-issue
[ fix ] Lexer reports incorrect column numbers
2022-09-27 16:00:27 +01:00
stefan-hoeck
de216d3ced [ fix ] drop first command-line arg on node 2022-09-27 08:19:14 +02:00
G. Allais
81ea363ae8
[ base ] deriving Traversable (#2678) 2022-09-24 12:43:49 +01:00
Guillaume Allais
5631608782 [ base ] deriving Foldable 2022-09-24 10:20:25 +01:00
Denis Buzdalov
ac9e03d7e3 [ base ] Add a variant of System.run allowing processing on the fly 2022-09-22 14:01:03 +01:00
wwww
38db7c3d22
[ fix ] showTime pads nanoseconds properly (#2650) 2022-09-22 12:18:26 +01:00
Stefan Höck
08f24e79fd
[ performance ] constant folding for all integral expressions (#2662) 2022-09-21 10:05:02 +01:00
Joel Berkeley
c0153e72cd
[ base ] implement decEq for SnocList (#2630)
Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
2022-09-20 15:46:15 +01:00
G. Allais
d1ae9d9fd5
[ papers ] Computing with Generic Trees (#2661) 2022-09-16 11:40:09 +01:00
G. Allais
55926f30c5
[ fix #2655 ] Add support for DataOpts in records (#2658) 2022-09-14 14:57:04 +01:00
Yupanqui
93b0f9c7b8 Fix for lexer colums 2022-09-05 13:47:41 -07:00
0xd34df00d
b3c80e0765 [ base ] Add finToNatEqualityAsPointwise, an inverse of finToNatQuotient 2022-09-05 12:45:28 +01:00
Steve Dunham
351b5ba720 [ parser ] Fix issue where Alt drops incoming commit tag 2022-09-05 12:44:02 +01:00
Adowrath
1914606d40 Fix connect in linear module and add bytes-specific functions 2022-09-01 12:23:29 +01:00
Denis Buzdalov
5266a2bc22 [ base ] Implement MonadError () for MaybeT 2022-09-01 10:48:15 +01:00
Guillaume Allais
6891490ed2 [ fix ] support for implicits in Deriving.Functor
A lot of refactoring to bring these. That's hopefully the last
feature that was needed...
2022-08-29 18:35:24 +01:00