From nad at cse.gu.se Wed Jan 3 19:41:22 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Wed, 3 Jan 2018 19:41:22 +0100 Subject: [Agda] Bounties for Agda features In-Reply-To: References: Message-ID: <62cf96df-6e21-ee5c-fefb-5a40e8cdf75b@cse.gu.se> On 2012-05-07 19:06, Daniel Peebles wrote: > *Only reload changed parts of the source in the interactive environment* > > I'd prefer this to be implemented generally, as I think the > interaction machinery is trying to move away from strict > emacs-specific behavior. Basically, C-c C-l currently always reloads > the entire file when you run it, even if you've only changed a tiny > piece of it. > > I can think of two approaches to this, but I don't really care how > it's done as long as it works. One approach is to parse and then run > some sort of a clever diff on the parse tree before typechecking. The > other is to run a textual diff and do something similar. The latter > approach would likely work at the declaration level. Given the weird > non-local behavior of constraints (I think this has decreased now, but > back in the day you could write a really specific proof about a > function and leave the function to be inferred by the constraints > solver), determining how much would change given an AST-level change > might be tricky. We've had something like this for a while now (--caching). I think Andrea Vezzosi was the main implementor of this feature. > Bounty: 100 BTC :) -- /NAD From wouter.swierstra at protonmail.com Thu Jan 4 09:02:32 2018 From: wouter.swierstra at protonmail.com (Wouter Swierstra) Date: Thu, 04 Jan 2018 03:02:32 -0500 Subject: [Agda] 6 Assistant Professor positions at the University of Utrecht Message-ID: <7jdBFBHdER5uXuKK5PMwzbchT9UI0hkyDP5nR9MeYoldr2Sn_vjnpJyIQ3XvsXAvYwun7eAE4c1687sVRrBqwG1bXzKENeDbK09FRBK1RfU=@protonmail.com> We are currently advertising vacancies for 6 talented Assistant Professors in Information and Computing Sciences (Tenure Track 0.8 - 1.0 FTE) # Job description We are searching for motivated, excellent candidates, on the Assistant Professor level. You must have expertise in Computing and Information Sciences, preferably in the areas of Information Science, Games, Artificial Intelligence or Data Science. Excellent candidates with other areas of expertise related to our current research groups and teaching programmes are also invited to apply. You have proven ambition and talent for research. As teaching is an important and satisfying part of our work, we are searching for people with a demonstrable motivation to teach. The department is expanding and provides a dynamic work environment. If you are excited to actively participate in shaping the department, you are very welcome to apply. Due to our successful teaching programmes and our ambitions in research the Department is expanding. We are therefore actively searching for 6 talented Research and Teaching Assistant Professors in Information and Computing Sciences. Please note that positions offered will vary, depending on experience and expertise. # Qualifications ## Research * PhD in Computer Science, Information Science or another relevant discipline; * track record of international publications in leading conferences and journals; * experience with or good prospects for acquiring external research funds; * vision on future research directions in own area of expertise; * experience with or readiness to supervise PhD projects; * active role in international scientific communities. ## Teaching * experience with and enthusiasm for teaching and student supervision; * ability to teach in departmental BSc and MSc programmes; * well-developed didactic skills; * excellent command of the English language; * experience with or willingness to use innovative teaching methods and (e-learning) technologies; * vision on teaching and your own contribution to teaching. Please note that we are also interested in candidates with a focus on teaching. ## Leadership: * play an active and cooperative role in the department and the university; * willingness to organize scientific events, such as research seminars or teaching seminars; * willingness to partake in departmental committees. The department finds gender balance specifically and diversity in a broader sense very important. In recent procedures we attracted a significant number of women (three out of five positions). We are very keen on appointing more female scientists and therefore strongly encourage qualified women to apply. # Offer The candidate will be offered a tenure track position, depending on experience (0.8 / 1.0 FTE). Salary depends on qualifications and experience, and ranges between 3,111 and 5,405 euro (scale 10 - 12 Collective Labour Agreement Dutch Universities) gross per month for a full-time employment. The salary is supplemented with a holiday bonus of 8% and an end-of-year bonus of 8.3% per year. We offer flexible employment conditions, working-from-home facilities, partially paid parental leave, a pension scheme, and collective insurance schemes. Facilities for sports and child care are available on our campus, which is only 15 minutes away from the historical city center of Utrecht. We offer you the possibility to develop towards a Basic Teaching Qualification, supported with educational development programs offered by the University. We also offer candidates the possibility to travel to conferences. # About the organization A better future for everyone. This ambition motivates our scientists in executing their leading research and inspiring teaching. At Utrecht University, colleagues from various disciplines collaborate intensively towards major societal themes. Our focus is on Dynamics of Youth, Institutions for Open Societies, Life Sciences and Sustainability. The city of Utrecht is one of the oldest cities in the Netherlands, with a charming old center and an internationally oriented culture that is strongly influenced by its century-old university. Utrecht city has been consistently ranked as one of the most livable cities in the Netherlands. The Faculty of Science consists of six departments: Biology, Pharmaceutical Sciences, Information and Computing Sciences, Physics and Astronomy, Chemistry and Mathematics. The Faculty is home to 5,900 students and nearly 1,600 staff and is internationally renowned for the quality of its research. The Faculty's academic programmes reflect developments in today's society. The Department of Information and Computing Sciences is nationally and internationally renowned for its research in Computing Science and Information Science. Current research groups are Algorithmic Data Analysis, Algorithms and Complexity, Decision Support Systems, Intelligent Systems, Simulation of Complex Systems, Multimedia, Interaction, Geometric Computing, Organization and Information, Software Technology, and Software Technology of Learning and Teaching. Relevant areas of interdisciplinary research include Game Research, Foundations of Complex Systems, Applied Data Science and Integrative Bioinformatics. The Department has, among others, close collaborations with the University Medical Center, the Departments of Physics and Mathematics, and the Faculties of Humanities and Geosciences. The Department offers Bachelor programmes in Computer Science and Information Science, and four English language research Master programmes in Artificial Intelligence, Business Informatics, Computing Science, and Game and Media Technology. The Department is developing Master programmes in Data Science. High enrolment figures and good student ratings make the education very successful. The Department currently comprises 9 full-time chairs and 100 other scientific staff, including postdocs and PhD- students. # More information https://www.uu.nl/en https://www.uu.nl/en/organisation/faculty-of-science https://www.uu.nl/en/organisation/department-of-information-and-computing-sciences https://www.uu.nl/en/organisation/working-at-utrecht-university/terms-of-employment https://www.uu.nl/en/organisation/working-at-utrecht-university # Additional information Would you like additional information about the vacancy? This can be obtained from Prof M. van Kreveld, (M.J.vanKreveld at uu.nl), Research Director or Marloes Reichardt-Buijs (M.S.Reichardt-Buijs at uu.nl), HR officer for the department. # Apply Please apply through https://www.uu.nl/en/organisation/working-at-utrecht-university/jobs. Please attach a letter of motivation, Curriculum Vitae and (email) addresses of two references. If you prefer a part-time appointment, you are also invited to apply, preferably stating the desired part-time ratio. The application deadline is 01/02/2018. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mannyromero at mail.com Fri Jan 5 19:44:34 2018 From: mannyromero at mail.com (Manny Romero) Date: Fri, 5 Jan 2018 19:44:34 +0100 Subject: [Agda] Show/Solve constraints (C-c C-= and C-c C-s) stopped working Message-ID: I'm very new on Emacs. (And everything else, for that matter!) While doing various Agda tutorials (not messing about with Emacs or anything) I'd noticed lately that sometimes the "solve constraints" command (C-c C-s in a hole) wouldn't work when the tutorial said it should. Sometimes I'd find the problem would go away in a future Emacs session, but it has returned and doesn't seem to be going away. To be sure about it, I started a new Emacs session and opened a new file where I wrote: --------------- data One : Set where <> : One idOne : One -> One idOne <> = ? ---------------- and loaded to create the hole at "?". Then I go in the hole, and C-c C-s doesn't work! Neither does C-c C-=. All other commands seem to work. I can use C-c C-f and C-c C-b to navigate into the hole; I can use C-c C-, and C-c C-. to give me information. I used C-c C-c in the first place on "idOne x = {!!}" to case split on x and get the present program. I can even, indeed, use C-c C-r on the present program to fill the hole automatically (as well as C-c C-SPC to fill it manually). And so forth. But I just can't get C-c C-s or C-c C-= to work (or the corresponding dropdown menu options), under this or any circumstance! What might be going on? How might I troubleshoot? From Jesper at sikanda.be Fri Jan 5 21:13:51 2018 From: Jesper at sikanda.be (Jesper Cockx) Date: Fri, 5 Jan 2018 21:13:51 +0100 Subject: [Agda] Show/Solve constraints (C-c C-= and C-c C-s) stopped working In-Reply-To: References: Message-ID: Hi Manny, "Solve constraints" (C-c C-s) only works when Agda can see that there is a *unique* solution for a given hole. But the meaning of 'unique' here is a bit subtle: it considers `<>` to be different from, say, `if b then <> else <>`, even though the latter will evaluate to `<>` for any value of b. Technically speaking, Agda requires the solution to be unique up to definitional equality. If you define One as a record type instead of as a datatype, then Agda will replace any value of type One (such as `if b then <> else <>`) by `<>`. This is called the eta rule for One. Agda has eta-rules built-in for record types but not for datatypes. So the following should work: --------------- record One : Set where constructor <> idOne : One -> One idOne <> = ? ---------------- I assume the tutorials you read used the definition of One as a record type instead of as a datatype, which is why C-c C-s works in their case. I hope this helps! cheers, Jesper On Fri, Jan 5, 2018 at 7:44 PM, Manny Romero wrote: > I'm very new on Emacs. (And everything else, for that matter!) While doing > various Agda tutorials (not messing about with Emacs or anything) I'd > noticed lately that sometimes the "solve constraints" command (C-c C-s in a > hole) wouldn't work when the tutorial said it should. Sometimes I'd find > the problem would go away in a future Emacs session, but it has returned > and doesn't seem to be going away. > > To be sure about it, I started a new Emacs session and opened a new file > where I wrote: > > --------------- > > data One : Set where > <> : One > > idOne : One -> One > idOne <> = ? > > ---------------- > > and loaded to create the hole at "?". Then I go in the hole, and C-c C-s > doesn't work! Neither does C-c C-=. All other commands seem to work. I can > use C-c C-f and C-c C-b to navigate into the hole; I can use C-c C-, and > C-c C-. to give me information. I used C-c C-c in the first place on "idOne > x = {!!}" to case split on x and get the present program. I can even, > indeed, use C-c C-r on the present program to fill the hole automatically > (as well as C-c C-SPC to fill it manually). And so forth. But I just can't > get C-c C-s or C-c C-= to work (or the corresponding dropdown menu > options), under this or any circumstance! > > What might be going on? How might I troubleshoot? > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergo at erdi.hu Sat Jan 6 07:22:22 2018 From: gergo at erdi.hu (Dr. ERDI Gergo) Date: Sat, 6 Jan 2018 14:22:22 +0800 (+08) Subject: [Agda] Converting All2 to All Message-ID: I've written the following function for Data.Vect.All (but it would apply just the same for Data.List.All): all?? : ? {a b} {A : Set a} {B : Set b} {P : A ? Set} {n} {xs : Vec A n} {ys : Vec B n} ? All? (? x y ? P x) xs ys ? All P xs all?? [] = [] all?? (p ? ps) = p ? all?? ps My questions are: 1. What would be a good name for this function? (I am fairly certain all?? is not one:)) 2. Should I add it to the stdlib? Thanks, Gergo From gergo at erdi.hu Sat Jan 6 07:26:49 2018 From: gergo at erdi.hu (Dr. ERDI Gergo) Date: Sat, 6 Jan 2018 14:26:49 +0800 (+08) Subject: [Agda] Converting All2 to All In-Reply-To: References: Message-ID: On Sat, 6 Jan 2018, Dr. ERDI Gergo wrote: > all?? : ? {a b} {A : Set a} {B : Set b} {P : A ? Set} > {n} {xs : Vec A n} {ys : Vec B n} ? > All? (? x y ? P x) xs ys ? All P xs > all?? [] = [] > all?? (p ? ps) = p ? all?? ps Of course there's a symmetric all?? with (? x y ? P y)as well. From matthewdaggitt at gmail.com Sat Jan 6 12:54:30 2018 From: matthewdaggitt at gmail.com (Matthew Daggitt) Date: Sat, 6 Jan 2018 11:54:30 +0000 Subject: [Agda] Fwd: Converting All2 to All In-Reply-To: References: Message-ID: Hi Gergo, So the first thing to say is that due to an oversight, the functionality of `All?` in `Data.Vec.All` is actually a duplicate of the existing datatype `Relation.Binary.Vec.Pointwise`. In the upcoming release of the library at the end of January, we're deprecating `All?` and moving `Relation.Binary.Vec.Pointwise` to `Data.Vec.Relation.InductivePointwise` and `Data.Vec.Relation.ExtensionalPointwise`. Feel free to have a look at the CHANGELOG in standard library repository for a more detailed explanation. That's not to say your proofs wouldn't be a welcome contribution to the library! The natural place for it in v0.15 will be in the new module `Data.Vec.Relation.InductivePointwise`. I would probably name them something like `pointwise??all` and `pointwise??all`, and possibly add their counterparts `all?pointwise?` and `all?pointwise?` as well. If you'd like to add them, feel free to submit a pull request to the library and they can be added to the upcoming release. Thanks, Matthew On Sat, Jan 6, 2018 at 6:26 AM, Dr. ERDI Gergo wrote: > On Sat, 6 Jan 2018, Dr. ERDI Gergo wrote: > > all?? : ? {a b} {A : Set a} {B : Set b} {P : A ? Set} >> {n} {xs : Vec A n} {ys : Vec B n} ? >> All? (? x y ? P x) xs ys ? All P xs >> all?? [] = [] >> all?? (p ? ps) = p ? all?? ps >> > > Of course there's a symmetric all?? with (? x y ? P y)as well. > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergo at erdi.hu Sun Jan 7 05:34:38 2018 From: gergo at erdi.hu (Dr. ERDI Gergo) Date: Sun, 7 Jan 2018 12:34:38 +0800 (+08) Subject: [Agda] Fwd: Converting All2 to All In-Reply-To: References: Message-ID: On Sat, 6 Jan 2018, Matthew Daggitt wrote: > Hi Gergo,?So the first thing to say is that due to an oversight, the functionality of > `All?` in?`Data.Vec.All` is actually a duplicate of the existing datatype > `Relation.Binary.Vec.Pointwise`. In the upcoming release of the library at the end of > January, we're deprecating `All?` and moving `Relation.Binary.Vec.Pointwise` to > `Data.Vec.Relation.InductivePointwise` and `Data.Vec.Relation.ExtensionalPointwise`. > Feel free to have a look at the CHANGELOG in?standard library?repository for a more > detailed explanation. Thanks, that is a very useful heads-up. I've now migrated my code to D.V.R.InductivePointwise in anticipation of this change. > That's not to say your proofs wouldn't be a welcome contribution to the library! The > natural place for it in v0.15 will be in the new module > `Data.Vec.Relation.InductivePointwise`. I would probably name them something > like?`pointwise??all` and `pointwise??all`, and possibly add their counterparts > `all?pointwise?` and `all?pointwise?` as well. If you'd like to add them, feel free > to submit a pull request to the library and they can be added to the upcoming release. One snag, though, is that the current upgrade path of the stdlib requires D.V.All to import D.V.R.InductivePointwise, so I can't add these proofs to D.V.R.InductivePointwise without causing a circular import... the only place to add them currently is D.V.All. Would it still make sense for me to add them to D.V.All? From andersmortberg at gmail.com Wed Jan 10 17:14:21 2018 From: andersmortberg at gmail.com (Anders Mortberg) Date: Wed, 10 Jan 2018 11:14:21 -0500 Subject: [Agda] Call for Contributions: Workshop on Homotopy Type Theory and Univalent Foundations (HoTT/UF'18) Message-ID: ========================================================== CALL FOR CONTRIBUTIONS Workshop on Homotopy Type Theory and Univalent Foundations (HoTT/UF, at FLoC 2018) ========================================================== ------------------------------------------------------------------------ Workshop on Homotopy Type Theory and Univalent Foundations July 7-8, 2018, Oxford, United Kingdom https://hott-uf.github.io/2018 Co-located with FSCD 2018 and part of FLoC 2018 http://www.cs.le.ac.uk/events/fscd2018/ http://www.floc2018.org/ Abstract submission deadline: March 31 ------------------------------------------------------------------------ Homotopy Type Theory is a young area of logic, combining ideas from several established fields: the use of dependent type theory as a foundation for mathematics, inspired by ideas and tools from abstract homotopy theory. Univalent Foundations are foundations of mathematics based on the homotopical interpretation of type theory. The goal of this workshop is to bring together researchers interested in all aspects of Homotopy Type Theory and Univalent Foundations: from the study of syntax and semantics of type theory to practical formalization in proof assistants based on univalent type theory. ================== # Invited talks * Mart?n Escard? (University of Birmingham) * Paige North (Ohio State University) * Andrew Pitts (University of Cambridge) ================ # Submissions * Abstract submission deadline: March 31 * Author notification: mid April Submissions should consist of a title and a 1-2 pages abstract, in pdf format, via https://easychair.org/conferences/?conf=hottuf18 Considering the broad background of the expected audience, we encourage authors to include information of pedagogical value in their abstract, such as motivation and context of their work. ====================== # Program committee * Benedikt Ahrens (University of Birmingham) * Paolo Capriotti (University of Nottingham) * Simon Huber (University of Gothenburg) * Chris Kapulkin (University of Western Ontario) * Nicolai Kraus (University of Nottingham) * Peter LeFanu Lumsdaine (Stockholm University) * Assia Mahboubi (Inria Saclay) * Anders M?rtberg (Carnegie Mellon University and University of Gothenburg) * Nicolas Tabareau (Inria Nantes) ================ # Organizers * Benedikt Ahrens (University of Birmingham) * Simon Huber (University of Gothenburg) * Anders M?rtberg (Carnegie Mellon University and University of Gothenburg) From matthewdaggitt at gmail.com Wed Jan 10 23:00:39 2018 From: matthewdaggitt at gmail.com (Matthew Daggitt) Date: Wed, 10 Jan 2018 22:00:39 +0000 Subject: [Agda] Fwd: Converting All2 to All In-Reply-To: References: Message-ID: Gergo, thanks for your PR to the library with the proofs. I've updated the library so they shouldn't cause the cyclic dependency any more. On Sun, Jan 7, 2018 at 4:34 AM, Dr. ERDI Gergo wrote: > On Sat, 6 Jan 2018, Matthew Daggitt wrote: > > Hi Gergo, So the first thing to say is that due to an oversight, the >> functionality of >> `All?` in `Data.Vec.All` is actually a duplicate of the existing datatype >> `Relation.Binary.Vec.Pointwise`. In the upcoming release of the library >> at the end of >> January, we're deprecating `All?` and moving >> `Relation.Binary.Vec.Pointwise` to >> `Data.Vec.Relation.InductivePointwise` and `Data.Vec.Relation.Extensional >> Pointwise`. >> Feel free to have a look at the CHANGELOG in standard library repository >> for a more >> detailed explanation. >> > > Thanks, that is a very useful heads-up. I've now migrated my code to > D.V.R.InductivePointwise in anticipation of this change. > > That's not to say your proofs wouldn't be a welcome contribution to the >> library! The >> natural place for it in v0.15 will be in the new module >> `Data.Vec.Relation.InductivePointwise`. I would probably name them >> something >> like `pointwise??all` and `pointwise??all`, and possibly add their >> counterparts >> `all?pointwise?` and `all?pointwise?` as well. If you'd like to add them, >> feel free >> to submit a pull request to the library and they can be added to the >> upcoming release. >> > > One snag, though, is that the current upgrade path of the stdlib requires > D.V.All to import D.V.R.InductivePointwise, so I can't add these proofs to > D.V.R.InductivePointwise without causing a circular import... the only > place to add them currently is D.V.All. Would it still make sense for me to > add them to D.V.All? -------------- next part -------------- An HTML attachment was scrubbed... URL: From apostolis.xekoukoulotakis at gmail.com Thu Jan 11 10:03:27 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Thu, 11 Jan 2018 11:03:27 +0200 Subject: [Agda] Instance arguments and types who have a unique construction. Message-ID: Currently, instance resolution tries all possible ways to construct an instance argument. It will look for arguments in the environment and it will use instance functions to create new ones. If there are multiple solutions, instance resolution will fail. example : Assuming we have defined "less than" as instance. if we have in the context, a variable q with type zero ? (suc zero) , instance resolution will fail because there are two solutions, q and z?n. But q is in fact z?n. We can prove that there is only one possible construction of the type, thus any variables with the same type are the same. At the moment, I am trying to prune my context but it would be nice if instance resolution was a bit smarter. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell at gmail.com Thu Jan 11 10:20:14 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Thu, 11 Jan 2018 10:20:14 +0100 Subject: [Agda] Instance arguments and types who have a unique construction. In-Reply-To: References: Message-ID: Instance search does check solutions for *definitional* equality. The problem in your case is that `q` is only propositionally (provably) equal to `z?n`. I think it's a bit too much to ask of instance search that it would look for proofs that two candidate solutions are equal. Did you have a particular suggestion for what kind of smartness improvement would make this work? / Ulf On Thu, Jan 11, 2018 at 10:03 AM, Apostolis Xekoukoulotakis < apostolis.xekoukoulotakis at gmail.com> wrote: > Currently, instance resolution tries all possible ways to construct an > instance argument. > > It will look for arguments in the environment and it will use instance > functions to create new ones. If there are multiple solutions, instance > resolution will fail. > > example : > > Assuming we have defined "less than" as instance. > > if we have in the context, a variable q with type zero ? (suc zero) , > instance resolution will fail because there are two solutions, q and z?n. > > But q is in fact z?n. > > > We can prove that there is only one possible construction of the type, > thus any variables with the same type are the same. > > At the moment, I am trying to prune my context but it would be nice if > instance resolution was a bit smarter. > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apostolis.xekoukoulotakis at gmail.com Thu Jan 11 10:28:34 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Thu, 11 Jan 2018 11:28:34 +0200 Subject: [Agda] Instance arguments and types who have a unique construction. In-Reply-To: References: Message-ID: I do not know. >From a use case point of view, I would like to provide a proof that all construction of a type are equal. "? x y ? (a : x ? y) ? (b : x ? y) ? a ? b" , and then use this proof to merge all solutions into one. Is this possible today ? On Thu, Jan 11, 2018 at 11:20 AM, Ulf Norell wrote: > Instance search does check solutions for *definitional* equality. The > problem in your case is that `q` is only propositionally (provably) equal > to `z?n`. I think it's a bit too much to ask of instance search that it > would look for proofs that two candidate solutions are equal. > > Did you have a particular suggestion for what kind of smartness > improvement would make this work? > > / Ulf > > On Thu, Jan 11, 2018 at 10:03 AM, Apostolis Xekoukoulotakis < > apostolis.xekoukoulotakis at gmail.com> wrote: > >> Currently, instance resolution tries all possible ways to construct an >> instance argument. >> >> It will look for arguments in the environment and it will use instance >> functions to create new ones. If there are multiple solutions, instance >> resolution will fail. >> >> example : >> >> Assuming we have defined "less than" as instance. >> >> if we have in the context, a variable q with type zero ? (suc zero) , >> instance resolution will fail because there are two solutions, q and z?n. >> >> But q is in fact z?n. >> >> >> We can prove that there is only one possible construction of the type, >> thus any variables with the same type are the same. >> >> At the moment, I am trying to prune my context but it would be nice if >> instance resolution was a bit smarter. >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell at gmail.com Thu Jan 11 10:37:28 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Thu, 11 Jan 2018 10:37:28 +0100 Subject: [Agda] Instance arguments and types who have a unique construction. In-Reply-To: References: Message-ID: The more fundamental problem here is that it does actually matter which solution we pick when they aren't definitionally equal, even in the case when they are provable equal. It might well be the case that picking `q` is the right choice and picking `z?s` is wrong and doing so would result in a type error further down in the code. / Ulf On Thu, Jan 11, 2018 at 10:28 AM, Apostolis Xekoukoulotakis < apostolis.xekoukoulotakis at gmail.com> wrote: > I do not know. > > From a use case point of view, I would like to provide a proof that all > construction of a type are equal. > > "? x y ? (a : x ? y) ? (b : x ? y) ? a ? b" , and then use this proof to > merge all solutions into one. > > Is this possible today ? > > > On Thu, Jan 11, 2018 at 11:20 AM, Ulf Norell wrote: > >> Instance search does check solutions for *definitional* equality. The >> problem in your case is that `q` is only propositionally (provably) equal >> to `z?n`. I think it's a bit too much to ask of instance search that it >> would look for proofs that two candidate solutions are equal. >> >> Did you have a particular suggestion for what kind of smartness >> improvement would make this work? >> >> / Ulf >> >> On Thu, Jan 11, 2018 at 10:03 AM, Apostolis Xekoukoulotakis < >> apostolis.xekoukoulotakis at gmail.com> wrote: >> >>> Currently, instance resolution tries all possible ways to construct an >>> instance argument. >>> >>> It will look for arguments in the environment and it will use instance >>> functions to create new ones. If there are multiple solutions, instance >>> resolution will fail. >>> >>> example : >>> >>> Assuming we have defined "less than" as instance. >>> >>> if we have in the context, a variable q with type zero ? (suc zero) , >>> instance resolution will fail because there are two solutions, q and z?n. >>> >>> But q is in fact z?n. >>> >>> >>> We can prove that there is only one possible construction of the type, >>> thus any variables with the same type are the same. >>> >>> At the moment, I am trying to prune my context but it would be nice if >>> instance resolution was a bit smarter. >>> >>> _______________________________________________ >>> Agda mailing list >>> Agda at lists.chalmers.se >>> https://lists.chalmers.se/mailman/listinfo/agda >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apostolis.xekoukoulotakis at gmail.com Thu Jan 11 11:00:14 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Thu, 11 Jan 2018 12:00:14 +0200 Subject: [Agda] Instance arguments and types who have a unique construction. In-Reply-To: References: Message-ID: I think I understand what you mean. Let me see if I can prune my context then. On Thu, Jan 11, 2018 at 11:37 AM, Ulf Norell wrote: > The more fundamental problem here is that it does actually matter which > solution we > pick when they aren't definitionally equal, even in the case when they are > provable equal. > It might well be the case that picking `q` is the right choice and picking > `z?s` is wrong and > doing so would result in a type error further down in the code. > > / Ulf > > On Thu, Jan 11, 2018 at 10:28 AM, Apostolis Xekoukoulotakis < > apostolis.xekoukoulotakis at gmail.com> wrote: > >> I do not know. >> >> From a use case point of view, I would like to provide a proof that all >> construction of a type are equal. >> >> "? x y ? (a : x ? y) ? (b : x ? y) ? a ? b" , and then use this proof to >> merge all solutions into one. >> >> Is this possible today ? >> >> >> On Thu, Jan 11, 2018 at 11:20 AM, Ulf Norell >> wrote: >> >>> Instance search does check solutions for *definitional* equality. The >>> problem in your case is that `q` is only propositionally (provably) equal >>> to `z?n`. I think it's a bit too much to ask of instance search that it >>> would look for proofs that two candidate solutions are equal. >>> >>> Did you have a particular suggestion for what kind of smartness >>> improvement would make this work? >>> >>> / Ulf >>> >>> On Thu, Jan 11, 2018 at 10:03 AM, Apostolis Xekoukoulotakis < >>> apostolis.xekoukoulotakis at gmail.com> wrote: >>> >>>> Currently, instance resolution tries all possible ways to construct an >>>> instance argument. >>>> >>>> It will look for arguments in the environment and it will use instance >>>> functions to create new ones. If there are multiple solutions, instance >>>> resolution will fail. >>>> >>>> example : >>>> >>>> Assuming we have defined "less than" as instance. >>>> >>>> if we have in the context, a variable q with type zero ? (suc zero) , >>>> instance resolution will fail because there are two solutions, q and z?n. >>>> >>>> But q is in fact z?n. >>>> >>>> >>>> We can prove that there is only one possible construction of the type, >>>> thus any variables with the same type are the same. >>>> >>>> At the moment, I am trying to prune my context but it would be nice if >>>> instance resolution was a bit smarter. >>>> >>>> _______________________________________________ >>>> Agda mailing list >>>> Agda at lists.chalmers.se >>>> https://lists.chalmers.se/mailman/listinfo/agda >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From guillaume.brunerie at gmail.com Thu Jan 11 13:55:51 2018 From: guillaume.brunerie at gmail.com (Guillaume Brunerie) Date: Thu, 11 Jan 2018 13:55:51 +0100 Subject: [Agda] Instance arguments and types who have a unique construction. In-Reply-To: References: Message-ID: Have you tried to use irrelevance? As far as I understand, it does basically what you want, by somehow making all elements of the type x ? y definitionally equal to each other. I haven?t tried, so I don?t know if it interacts well with instance arguments. Guillaume On Thu, Jan 11, 2018 at 11:00 AM, Apostolis Xekoukoulotakis < apostolis.xekoukoulotakis at gmail.com> wrote: > I think I understand what you mean. > > Let me see if I can prune my context then. > > On Thu, Jan 11, 2018 at 11:37 AM, Ulf Norell wrote: > >> The more fundamental problem here is that it does actually matter which >> solution we >> pick when they aren't definitionally equal, even in the case when they >> are provable equal. >> It might well be the case that picking `q` is the right choice and >> picking `z?s` is wrong and >> doing so would result in a type error further down in the code. >> >> / Ulf >> >> On Thu, Jan 11, 2018 at 10:28 AM, Apostolis Xekoukoulotakis < >> apostolis.xekoukoulotakis at gmail.com> wrote: >> >>> I do not know. >>> >>> From a use case point of view, I would like to provide a proof that all >>> construction of a type are equal. >>> >>> "? x y ? (a : x ? y) ? (b : x ? y) ? a ? b" , and then use this proof to >>> merge all solutions into one. >>> >>> Is this possible today ? >>> >>> >>> On Thu, Jan 11, 2018 at 11:20 AM, Ulf Norell >>> wrote: >>> >>>> Instance search does check solutions for *definitional* equality. The >>>> problem in your case is that `q` is only propositionally (provably) equal >>>> to `z?n`. I think it's a bit too much to ask of instance search that it >>>> would look for proofs that two candidate solutions are equal. >>>> >>>> Did you have a particular suggestion for what kind of smartness >>>> improvement would make this work? >>>> >>>> / Ulf >>>> >>>> On Thu, Jan 11, 2018 at 10:03 AM, Apostolis Xekoukoulotakis < >>>> apostolis.xekoukoulotakis at gmail.com> wrote: >>>> >>>>> Currently, instance resolution tries all possible ways to construct an >>>>> instance argument. >>>>> >>>>> It will look for arguments in the environment and it will use instance >>>>> functions to create new ones. If there are multiple solutions, instance >>>>> resolution will fail. >>>>> >>>>> example : >>>>> >>>>> Assuming we have defined "less than" as instance. >>>>> >>>>> if we have in the context, a variable q with type zero ? (suc zero) , >>>>> instance resolution will fail because there are two solutions, q and z?n. >>>>> >>>>> But q is in fact z?n. >>>>> >>>>> >>>>> We can prove that there is only one possible construction of the type, >>>>> thus any variables with the same type are the same. >>>>> >>>>> At the moment, I am trying to prune my context but it would be nice if >>>>> instance resolution was a bit smarter. >>>>> >>>>> _______________________________________________ >>>>> Agda mailing list >>>>> Agda at lists.chalmers.se >>>>> https://lists.chalmers.se/mailman/listinfo/agda >>>>> >>>>> >>>> >>> >> > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apostolis.xekoukoulotakis at gmail.com Sat Jan 13 06:57:53 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Sat, 13 Jan 2018 07:57:53 +0200 Subject: [Agda] Instance arguments and types who have a unique construction. In-Reply-To: References: Message-ID: I tried it before. If I am desperate, I might use it again :). On Thu, Jan 11, 2018 at 2:55 PM, Guillaume Brunerie < guillaume.brunerie at gmail.com> wrote: > Have you tried to use irrelevance? > As far as I understand, it does basically what you want, by somehow making > all elements of the type x ? y definitionally equal to each other. > I haven?t tried, so I don?t know if it interacts well with instance > arguments. > > Guillaume > > On Thu, Jan 11, 2018 at 11:00 AM, Apostolis Xekoukoulotakis < > apostolis.xekoukoulotakis at gmail.com> wrote: > >> I think I understand what you mean. >> >> Let me see if I can prune my context then. >> >> On Thu, Jan 11, 2018 at 11:37 AM, Ulf Norell >> wrote: >> >>> The more fundamental problem here is that it does actually matter which >>> solution we >>> pick when they aren't definitionally equal, even in the case when they >>> are provable equal. >>> It might well be the case that picking `q` is the right choice and >>> picking `z?s` is wrong and >>> doing so would result in a type error further down in the code. >>> >>> / Ulf >>> >>> On Thu, Jan 11, 2018 at 10:28 AM, Apostolis Xekoukoulotakis < >>> apostolis.xekoukoulotakis at gmail.com> wrote: >>> >>>> I do not know. >>>> >>>> From a use case point of view, I would like to provide a proof that all >>>> construction of a type are equal. >>>> >>>> "? x y ? (a : x ? y) ? (b : x ? y) ? a ? b" , and then use this proof >>>> to merge all solutions into one. >>>> >>>> Is this possible today ? >>>> >>>> >>>> On Thu, Jan 11, 2018 at 11:20 AM, Ulf Norell >>>> wrote: >>>> >>>>> Instance search does check solutions for *definitional* equality. The >>>>> problem in your case is that `q` is only propositionally (provably) equal >>>>> to `z?n`. I think it's a bit too much to ask of instance search that it >>>>> would look for proofs that two candidate solutions are equal. >>>>> >>>>> Did you have a particular suggestion for what kind of smartness >>>>> improvement would make this work? >>>>> >>>>> / Ulf >>>>> >>>>> On Thu, Jan 11, 2018 at 10:03 AM, Apostolis Xekoukoulotakis < >>>>> apostolis.xekoukoulotakis at gmail.com> wrote: >>>>> >>>>>> Currently, instance resolution tries all possible ways to construct >>>>>> an instance argument. >>>>>> >>>>>> It will look for arguments in the environment and it will use >>>>>> instance functions to create new ones. If there are multiple solutions, >>>>>> instance resolution will fail. >>>>>> >>>>>> example : >>>>>> >>>>>> Assuming we have defined "less than" as instance. >>>>>> >>>>>> if we have in the context, a variable q with type zero ? (suc zero) , >>>>>> instance resolution will fail because there are two solutions, q and z?n. >>>>>> >>>>>> But q is in fact z?n. >>>>>> >>>>>> >>>>>> We can prove that there is only one possible construction of the >>>>>> type, thus any variables with the same type are the same. >>>>>> >>>>>> At the moment, I am trying to prune my context but it would be nice >>>>>> if instance resolution was a bit smarter. >>>>>> >>>>>> _______________________________________________ >>>>>> Agda mailing list >>>>>> Agda at lists.chalmers.se >>>>>> https://lists.chalmers.se/mailman/listinfo/agda >>>>>> >>>>>> >>>>> >>>> >>> >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mechvel at botik.ru Sat Jan 13 16:25:57 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Sat, 13 Jan 2018 18:25:57 +0300 Subject: [Agda] announce of Binary-3.0 Message-ID: <1515857157.3982.4.camel@one.mechvel.pereslavl.ru> Announcement ------------ Binary-3.0 -- a Pure Binary Natural Number Arithmetic library for Agda is available on ftp://ftp.botik.ru/pub/local/Mechveliani/binNat/ (see license.txt and the manual README.agda in the archive). Binary-3.0 is a pure, regular-performance, complete, and certified binary arithmetic for natural numbers written in Agda. It has been tested under Agda 2.5.3, MAlonzo, lib-0.14. It is also suggested as a replacement for the Bin part in Standard library lib-0.14 (the modules Data.Bin.agda, Data.Bin.Properties.agda). `Pure' means that Binary-3.0 never uses a built-in arithmetic (on Nat) to essentially change performance. The performance order is supposed to remain with replacing the Nat arithmetic with the naive unary arithmetic. `Regular performance' means that the arithmetic on Bin of Binary-3.0 has a regular performance cost order -- the one expected for the corresponding known naive operations with bit lists. Examples: * The comparison <-cmp x y on Bin costs O(|x| + |y|), where |z| = bitLength z. * Division with remainder divMod x y y?0 on Bin is implemented as a loop of {s = shift n dr for certain n; dd := dd -. s} repeated O(|x|) times. So that it costs O( |x|^2 ). `Complete' means that all the items are implemented that are usually required for standard arithmetic. There are provided the following items. * DecTotalOrder instance for Bin, for x <= y defined on Bin as x < y or x == y. * StrictTotalOrder instance for Bin, _<_. * The bijection property for the map pair toNat, fromNat. * Subtraction _-._ on Bin, with the needed properties proved. * The proofs for isomorphism for _+_, _*_, _-._ for toNat, fromNat. * The monotonicity proofs for toNat, fromNat for _<=_ and Nat._<=_. A similar monotonicity for _<_ and Nat._<=_ are proved. * Various kinds of monotonicity for _+_, _*_, _-._ for _<=_ and _<_ are proved. * The CommutativeSemiring instance for Bin. * Division with remainder and GCD for Bin. * The demonstration/test programs for divMod and gcd. `Certified' means that everything is proved in Agda which is regularly required of the above operations. Usage of Standard library lib-0.14 ----------------------------------- Bin0.agda _copies_ the following items from Data.Bin of Standard lib-0.14: Bin?, data Bin, 2^_, toBits, ?log?_?, _*2, _*2+1, ?_/2?, Carry, addBits, addCarry, _+_, _*_, fromBits, addBitList, The last three have a slight change in implementation. Nothing else about Bin is taken from Standard lib-0.14. The definition for inequalities on Bin is totally changed in Bin0, Bin1. More detailed explanations are given in README.agda. Binary-3.0 has been tested under Agda 2.5.3, and it relies on Standard library lib-0.14. It also includes the module LtReasoning.agda -- a support for inequality reasoning by Ulf Norell. Installation: agda -c $agdaLibOpt GCDTest.agda Comments and improvements are welcome. --------------------- Sergei D. Meshveliani mechvel at botik.ru From andreas.abel at ifi.lmu.de Mon Jan 15 14:57:21 2018 From: andreas.abel at ifi.lmu.de (Andreas Abel) Date: Mon, 15 Jan 2018 14:57:21 +0100 Subject: [Agda] ITP abstracts due 25 Jan [Re: Interactive Theorem Proving (ITP) 2018: Second CFP] In-Reply-To: References: Message-ID: <2c07a9a2-0ae8-7974-5b59-8ee345a39530@ifi.lmu.de> Agda papers are well-suited for ITP. Observe the abstract deadline in 10 days: Thursday 25th January Time to start writing! --Andreas On 05.12.2017 23:02, Jeremy Avigad wrote: > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?SECOND CALL FOR PAPERS > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ITP 2018 > ? ? ? ? ? 9th International Conference on Interactive Theorem Proving > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Oxford, UK > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?July 9-12, 2018 > https://itp2018.inria.fr/ > > > Submission Deadlines: Thursday, ?January 25, 2018 (abstracts) > ? ? ? ? ? ? ? ? ? ? ? Wednesday, January 31, 2018 (full papers) > > GENERAL INFORMATION > The ITP conference series is concerned with all topics related to > interactive > theorem proving, ranging from theoretical foundations to implementation > aspects > and applications in program verification, security, and formalization of > mathematics. ITP is the evolution of the TPHOLs conference series to the > broad > field of interactive theorem proving. TPHOLs meetings took place every > year from > 1988 until 2009. The ninth ITP conference, ITP 2018, will be held in Oxford, > July 9-12, 2018. > > SCOPE OF CONFERENCE > ITP welcomes submissions describing original research on all aspects of > interactive theorem proving and its applications. Suggested topics > include but > are not limited to the following: > > * ?formal aspects of hardware and software > * ?formalizations of mathematics > * ?improvements in theorem prover technology > * ?user interfaces for interactive theorem provers > * ?formalizations of computational models > * ?verification of security algorithms > * ?use of theorem provers in education > * ?industrial applications of interactive theorem provers > * ?concise and elegant worked examples of formalizations (proof pearls) > > PUBLICATION DETAILS > The proceedings of the symposium will be published in the Springer's LNCS > series. The organizers intend to publish expanded versions of a select > subset of > papers from the conference in a special issue of the Journal of > Automated Reasoning. > > PAPER SUBMISSIONS > All submissions must be original, unpublished, and not submitted > concurrently > for publication elsewhere. Furthermore, when appropriate, submissions are > expected to be accompanied by verifiable evidence of a suitable > implementation, > such as the source files of a formalization for the proof assistant > used. These > materials can be uploaded with the submission, or made available on the > web. In > either case, the submission should provide clear instructions to > referees as to > how to obtain the relevant materials and compile them or check them, as > the case > may be. > > Submissions will be subjected to single-blind peer review. They should be no > more than 16 pages in length excluding bibliographic references and are > to be > submitted in PDF via EasyChair at the following address: > > https://easychair.org/conferences/?conf=itp2018 > > Submissions must conform to the LNCS style in LaTeX. An author of each > accepted > paper is expected to present it at the conference and will be required > to sign a > copyright release form. > > In addition to regular papers, described above, there will be a section for > shorter papers, which can be used to describe interesting work that is still > ongoing and not fully mature. Such a preliminary report is limited to 6 > pages > and may consist of an extended abstract. Each of these papers should > bear the > phrase "(short paper)" beneath the title, and will be refereed and be > expected > to present innovative and promising ideas, possibly in early form. Accepted > submissions in this category will be published in the main proceedings > and will > be presented as short talks. > > IMPORTANT DATES > Abstract submission deadline: January 25, 2018 > Full paper submission deadline: January 31, 2018 > Author notification: March 31, 2018 > Camera-ready papers: May 25, 2018 > Conference: July 9-12, 2018 > > PROGRAM COMMITTEE > Jeremy Avigad, Carnegie Mellon University (chair) > Assia Mahboubi, Inria (chair) > Andreas Abel, Gothenburg University > Benedikt Ahrens, University of Birmingham > June Andronick, CSIRO|Data61 and UNSW > Adam Chlipala, Massachusetts Institute of Technology > Jasmin Christian Blanchette, Vrije Universiteit Amsterdam > Thierry Coquand, Chalmers University of Technology > Karl Crary, Carnegie Mellon University > Delphine Demange, IRISA / University of Rennes 1 > Timothy Griffin, University of Cambridge > Thomas Hales, University of Pittsburgh > John Harrison, Intel > Johannes H?lzl, Vrije Universiteit Amsterdam > Chung-Kil Hur, Seoul National University > Jacques-Henri Jourdan, LRI, CNRS, Universit? Paris-Sud > Cezary Kaliszyk, University of Innsbruck > Ambrus Kaposi, E?tv?s Lor?nd University, Budapest > Chantal Keller, LRI, CNRS, Universit? Paris-Sud > Panagiotis Manolios, Northeastern University > Mariano Moscato, National Institute of Aerospace > Leonardo de Moura, Microsoft Research > Magnus O. Myreen, Chalmers University of Technology > Tobias Nipkow, Technische Universit?t M?nchen > Lawrence Paulson, University of Cambridge > Andr? Platzer, Carnegie Mellon University > Andrei Popescu, Middlesex University London > Matthieu Sozeau, Inria > Pierre-Yves Strub, ?cole Polytechnique > Enrico Tassi, Inria > Zachary Tatlock, University of Washington > Laurent Th?ry, Inria > Cesare Tinelli, The University of Iowa > Alwen Tiu, Australian National University > Makarius Wenzel, sketis.net > Freek Wiedijk, Radboud University Nijmegen > > CONTACT INFORMATION > Jeremy Avigad > Assia Mahboubi > itp2018 at easychair.org > https://itp2018.inria.fr/ > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel at gu.se http://www.cse.chalmers.se/~abela/ From edprocess at dline.info Wed Jan 17 15:51:37 2018 From: edprocess at dline.info (edprocess at dline.info) Date: Wed, 17 Jan 2018 07:51:37 -0700 Subject: [Agda] ICADIWT 2018 Message-ID: CALL FOR PAPERS The Ninth International Conference on the Applications of Digital Information and Web Technologies (ICADIWT 2018) June 25-27, 2018 Porto, Portugal http://www.socio.org.uk/icadiwt The Ninth International Conference on the Applications of Digital Information and Web Technologies (ICADIWT 2018) is a forum for researchers to present the intensive and innovative research, ideas, developments and applications in the areas of Computer Communications, Communication networks, Communication Software Communication Technologies and Applications, and other related themes. This conference (ICADIWT Edition IX) will include presentations of contributed papers and state-of-the-art lectures by invited keynote speakers. Digital Technologies is embeded in the research activites of a large number of people and it ensures the Ubiquitous reaching of more number of people in the recent years. Research in digital technologies has been carried out in many directions using various resources and tools and on the other side, the application issues are addressed by more volume of researchers not necessarily limited to information and computing technology. Thus the proposed conference series realize its value and potential and manifest the requirements in the form of the international conference. This edition will address the following outlined themes (but not limited to) Internet Communication Internet Technologies Web Applications Internet Software Data Access and Transmission Digital Communication Software Digital Networks Web Communication Interfaces Adaptive Systems Internet of Things Internet of breath Augmented Reality Databases and applications Web Systems Engineering Design Intelligent Agent systems/ Semantic Web Studies Adaptive Web applications and personalization Actuators and sensors Robotics and Machine Vision Smart cities and structures Control Automation Human-machine interfaces Real-time simulation Digital Technologies for Mechanical and other designs Publication and Indexing The accepted full papers will be published in the IOS series (Frontiers in Artificial Intelligence and Applications (FAIA))and submitted for inclusion in many indexes. Accepted full papers will be submitted for indexing to multiple abstract and indexing partners. The papers will be indexed in many databases as given at http://www.frontiersinai.com/?q=indexing The accepted papers will be published as a post-conference publication. During the conference, the pre-conference volume will be distributed. Important Dates Submission of papers- April 01, 2018 Notification-May 10, 2018 Camera ready-June 10, 2018 Registration-June 15, 2018 Conference Dates-June 25-27, 2018 PROGRAM COMMITTEES Honorary Chair Jolanta Mizera-Pietraszko, (Opole University, Poland) General Chairs Ramiro Smano Robles, Instituto Superior de Engenharia do Porto Rua, Portugal Pit Pichappan, Digital Information Research Labs, India Program Chairs Yao-Liang Chung, National Taiwan Ocean University, Taiwan Ricardo Rodriguez Jorge, Autonomous University of Ciudad Juarez, Mexico Submissions at http://www.socio.org.uk/icadiwt/paper-submission/ Contact diwt at dirf.org or icadiwt at socio.org.uk --------------------------------------------------------------- From rodrigo at decsi.ufop.br Thu Jan 18 15:47:17 2018 From: rodrigo at decsi.ufop.br (Rodrigo Ribeiro) Date: Thu, 18 Jan 2018 12:47:17 -0200 Subject: [Agda] CFP - XXII Brazilian Symposium on Programming Languages Message-ID: SBLP 2018: XXII Brazilian Symposium on Programming Languages ________________________________________________________________________________ Universidade de S?o Paulo - ICMC/USP S?o Carlos, Brazil, September 20-21, 2018 Conference website http://www.sbc.org.br/cbsoft2018 Submission link https://easychair.org/conferences/?conf=sblp2018 SBLP 2018 is the 22nd edition of the Brazilian Symposium on Programming Languages. It is promoted by the Brazilian Computer Society (SBC) and constitutes a forum for researchers, students and professionals to present and discuss ideas and innovations in the design, definition, analysis, implementation and practical use of programming languages. SBLP's first edition was in 1996. Since 2010, it is part of CBSoft, the Brazilian Conference on Software: Theory and Practice (http://cbsoft.org/cbsoft2018/). Submission Guidelines ________________________________________________________________________________ Papers must be original and not simultaneously submitted to another journal or conference. Papers must be submitted electronically (in PDF format) via the Easychair System: http://www.easychair.org/conferences/?conf=sblp2018. The following paper categories are welcome (page limits include figures, references, and appendices): Full papers: up to 8 pages long in ACM 2-column format, available at http://www.acm.org/publications/article-templates/proceedings-template.html Short papers: up to 3 pages in the same format, can discuss new ideas which are at an early stage of development or can report partial results of on-going dissertations or theses. List of Topics (related but not limited to the following) ________________________________________________________________________________ ? Programming paradigms and styles, scripting and domain-specific languages and support for real-time, service-oriented, multi-threaded, parallel, and distributed programming ? Program generation and transformation ? Formal semantics and theoretical foundations: denotational, operational, algebraic and categorical ? Program analysis and verification, type systems, static analysis and abstract interpretation ? Programming language design and implementation, programming language environments, compilation and interpretation techniques Program Committee ________________________________________________________________________________ Mariza Bigonha Universidade Federal de Minas Gerais Roberto Bigonha Universidade Federal de Minas Gerais Andre R. Du Bois Universidade Federal de Pelotas Christiano Braga Universidade Federal Fluminense Carlos Camar?o Universidade Federal de Minas Gerais (chair) Fernando Castor Universidade Federal de Pernambuco Renato Cerqueira IBM Research, Brazil Joao Ferreira Teesside University Luc?lia Figueiredo Universidade Federal de Ouro Preto Ismael Figueroa Pontif?cia Universidad Cat?lica de Valparaiso Alex Garcia Instituto Militar de Engenharia Roberto Ierusalimschy Pontif?cia Universidade Cat?lica do Rio de Janeiro Yu David Liu State University of New York at Binghamton Hans-Wolfgang Loidl Heriot-Watt University Marcelo Maia Universidade Federal de Uberl?ndia Andr? M. Maidl Pontif?cia Universidade Cat?lica do Paran? Manuel A. Martins Universidade de Aveiro S?rgio Medeiros Universidade Federal do Rio Grande do Norte Victor Miraldo University of Utrecht ?lvaro Moreira Universidade Federal do Rio Grande do Sul Anamaria M. Moreira Universidade Federal do Rio de Janeiro Peter Mosses Swansea University Martin Musicante Universidade Federal do Rio Grande do Norte Alberto Pardo Universidad de la Rep?blica Fernando Pereira Universidade Federal de Minas Gerais Gustavo Pinto Universidade Federal do Par? Louis-Noel Pouchet Ohio State University Zongyan Qiu Peking University Leonardo Reis Universidade Federal de Ouro Preto Rodrigo Ribeiro Universidade Federal de Ouro Preto Noemi Rodriguez Pontif?cia Universidade Cat?lica do Rio de Janeiro Francisco Sant'Anna Universidade Estadual do Rio de Janeiro Jo?o Saraiva Universidade do Minho Martin Sulzmann Hochschule Karlsruhe - Technik und Wirtschaft (chair) Leopoldo Teixeira Universidade Federal de Pernambuco Varmo Vene University of Tartu Invited Speaker ________________________________________________________________________________ Martin Sulzmann, Hochschule Karlsruhe - Technik und Wirtschaft, Germany Publication ________________________________________________________________________________ As in previous editions, after the conference authors of selected regular papers will be invited to submit an extended version of their work to be considered for publication in a journal's special issue. Since 2009, selected papers of each SBLP edition are being published in a special issue of Science of Computer Programming, by Elsevier. Important dates ________________________________________________________________________________ Abstract submission: April 29th 2018 Paper submission: May 6th 2018 Author notification: June 22nd 2018 Camera ready deadline: July 8th 2018 Contact ________________________________________________________________________________ All questions about submissions should be emailed to Carlos Camar?o (camarao at dcc.ufmg.br) -------------- next part -------------- An HTML attachment was scrubbed... URL: From fhi.1990 at gmail.com Mon Jan 22 12:04:47 2018 From: fhi.1990 at gmail.com (=?UTF-8?Q?Frederik_Hangh=C3=B8j_Iversen?=) Date: Mon, 22 Jan 2018 12:04:47 +0100 Subject: [Agda] Infix-notation and TDNR Message-ID: I just discovered a new feature in Agda. I don't know what's it's called (haven't been able to find any documentation on it) so let me just name it Type-Directed Name-space Resolution (TDNR). The feature I'm talking about it the one that e.g lets you project a field `Object` of a term `?` of type `Category` that has this field like so: ? .Object What I would like to do is use the infix version of this. So for instance for a field `_?_` I would like to express the distributive properties of functors like so: func? (g (? .?) f) ? func? g (? .?) func? f Or perhaps even with backticks (as in Haskell) like so: func? (g `? .?` f) ? func? g `? .?` func? f In stead I am left with writing it like so: func? (? ._?_ g f) ? ? ._?_ (func? g) (func? f) Which is not so readable. I've attached an MWE. -- Regards *Frederik Hangh?j Iversen* -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: T.agda Type: application/octet-stream Size: 689 bytes Desc: not available URL: From a.j.rouvoet at gmail.com Mon Jan 22 13:07:34 2018 From: a.j.rouvoet at gmail.com (a.j.rouvoet) Date: Mon, 22 Jan 2018 13:07:34 +0100 Subject: [Agda] Infix-notation and TDNR In-Reply-To: References: Message-ID: <16e8bdf4-a29c-d7b1-7beb-3902aa0459a0@gmail.com> You can locally declare two modules with the same name as the record instances to accomplish what you want; e.g.: ? record Functor (? : Category) (? : Category) : Set where ??? module ? = Category ? ??? module ? = Category ? ??? field ????? distrib : {A B C : ?.Object} {g : ?.Arrow B C} {f : ?.Arrow A B} ? func? (g ?.? f) ? (func? g) ?.? (func? f) Regards, Arjen On 01/22/2018 12:04 PM, Frederik Hangh?j Iversen wrote: > I just discovered a new feature in Agda. I don't know what's it's > called (haven't been able to find any documentation on it) so let me > just name it Type-Directed Name-space Resolution (TDNR). > > The feature I'm talking about it the one that e.g lets you project a > field `Object` of a term `?` of type `Category` that has this field > like so: > > ? ? ?? .Object > > What I would like to do is use the infix version of this. So for > instance for a field `_?_` I would like to express the distributive > properties of functors like so: > > ? ? func? (g (? .?)?f) ? func? g (? .?)?func? f > > Or perhaps even with backticks (as in Haskell) like so: > > ? ? func? (g `? .?` f) ? func? g `? .?` func? f > > In stead I am left with writing it like so: > > ? ? func? (? ._?_ g f) ? ? ._?_ (func? g) (func? f) > > Which is not so readable. > > I've attached an MWE. > > -- > Regards > /Frederik Hangh?j Iversen/ > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda -------------- next part -------------- An HTML attachment was scrubbed... URL: From sandro.stucki at gmail.com Mon Jan 22 13:45:15 2018 From: sandro.stucki at gmail.com (Sandro Stucki) Date: Mon, 22 Jan 2018 13:45:15 +0100 Subject: [Agda] Infix-notation and TDNR In-Reply-To: <16e8bdf4-a29c-d7b1-7beb-3902aa0459a0@gmail.com> References: <16e8bdf4-a29c-d7b1-7beb-3902aa0459a0@gmail.com> Message-ID: The feature is called "postfix projections", BTW. https://github.com/agda/agda/issues/1963 Cheers /Sandro On Jan 22, 2018 1:07 PM, "a.j.rouvoet" wrote: You can locally declare two modules with the same name as the record instances to accomplish what you want; e.g.: record Functor (? : Category) (? : Category) : Set where module ? = Category ? module ? = Category ? field distrib : {A B C : ?.Object} {g : ?.Arrow B C} {f : ?.Arrow A B} ? func? (g ?.? f) ? (func? g) ?.? (func? f) Regards, Arjen On 01/22/2018 12:04 PM, Frederik Hangh?j Iversen wrote: I just discovered a new feature in Agda. I don't know what's it's called (haven't been able to find any documentation on it) so let me just name it Type-Directed Name-space Resolution (TDNR). The feature I'm talking about it the one that e.g lets you project a field `Object` of a term `?` of type `Category` that has this field like so: ? .Object What I would like to do is use the infix version of this. So for instance for a field `_?_` I would like to express the distributive properties of functors like so: func? (g (? .?) f) ? func? g (? .?) func? f Or perhaps even with backticks (as in Haskell) like so: func? (g `? .?` f) ? func? g `? .?` func? f In stead I am left with writing it like so: func? (? ._?_ g f) ? ? ._?_ (func? g) (func? f) Which is not so readable. I've attached an MWE. -- Regards *Frederik Hangh?j Iversen* _______________________________________________ Agda mailing listAgda at lists.chalmers.sehttps://lists.chalmers.se/mailman/listinfo/agda _______________________________________________ Agda mailing list Agda at lists.chalmers.se https://lists.chalmers.se/mailman/listinfo/agda -------------- next part -------------- An HTML attachment was scrubbed... URL: From mechvel at botik.ru Tue Jan 23 14:14:03 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Tue, 23 Jan 2018 16:14:03 +0300 Subject: [Agda] proofs for (NON)TERMINATING Message-ID: <1516713243.13614.14.camel@scico.botik.ru> Can somebody, please, explain how to express/prove the following lemma? ------------------------------------------------------------------- open import Relation.Nullary using (yes; no) open import Relation.Binary using (Decidable) open import Relation.Binary.PropositionalEquality using (_?_; refl) open import Data.Empty using (?-elim) open import Data.Product using (_,_; proj?; ?) open import Data.Nat using (?; suc) postulate P : ? ? ? ? Set p? : Decidable P {-# NON_TERMINATING #-} find : (m : ?) ? ? ? ? (\k ? P m k) find m n with p? m n ... | yes pmn = (n , pmn) -- found ... | no _ = find m (suc n) -- try next lemma : ? m ? P m 0 ? proj? (find m 0) ? 0 lemma m pm0 with p? m 0 ... | yes _ = refl ... | no ?pm0 = ?-elim (?pm0 pm0) -------------------------------------------------------------------- For some P above the algorithm `find' is not terminating. So that this program would not type-check without pragma. The TERMINATING pragma is wrong to set. So, NON_TERMINATING is needed (?). Then, it occurs that `lemma' is not type-checked. This contradicts to the fact that (find m 0) terminates when (P m 0) is satisfied. Is it possible to express and prove in Agda the above lemma? Thanks, ------ Sergei From nad at cse.gu.se Tue Jan 23 15:01:45 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Tue, 23 Jan 2018 15:01:45 +0100 Subject: [Agda] proofs for (NON)TERMINATING In-Reply-To: <1516713243.13614.14.camel@scico.botik.ru> References: <1516713243.13614.14.camel@scico.botik.ru> Message-ID: <4ae7473a-aef4-de1c-9fc1-4ce7bfd2be72@cse.gu.se> On 2018-01-23 14:14, Sergei Meshveliani wrote: > Is it possible to express and prove in Agda the above lemma? If you want to prove properties of possibly non-terminating code in Agda, then I suggest that you avoid using TERMINATING/NON_TERMINATING and instead use one of several methods to represent non-terminating computations as total values. One possibility is to use the delay monad. -- /NAD From Jesper at sikanda.be Tue Jan 23 15:21:16 2018 From: Jesper at sikanda.be (Jesper Cockx) Date: Tue, 23 Jan 2018 15:21:16 +0100 Subject: [Agda] proofs for (NON)TERMINATING In-Reply-To: <1516713243.13614.14.camel@scico.botik.ru> References: <1516713243.13614.14.camel@scico.botik.ru> Message-ID: If you define a function with a {-# NON_TERMINATING #-} pragma then it's generally not possible to prove things about it because Agda will refuse to evaluate it. This is also the problem in your example: even though in this case evaluation is terminating, Agda will play it safe and block *all* evaluation of the NON_TERMINATING function. So I don't think what you're trying to do is currently possible in Agda. A workaround is to postulate the clauses of the non-terminating function as propositional equalities (i.e. elements of the ? type). This allows you to prove properties of the non-terminating function without breaking the Agda typechecker (as you risk doing when using TERMINATING). In your example: -------------------------------------------------------------------- open import Relation.Nullary using (yes; no; ?_) open import Relation.Binary using (Decidable) open import Relation.Binary.PropositionalEquality using (_?_; refl; cong; inspect; [_]) open import Data.Empty using (?-elim) open import Data.Product using (_,_; proj?; proj?; ?) open import Data.Nat using (?; suc) postulate P : ? ? ? ? Set p? : Decidable P {-# NON_TERMINATING #-} find : (m : ?) ? ? ? ? (\k ? P m k) find m n with p? m n ... | yes pmn = (n , pmn) -- found ... | no _ = find m (suc n) -- try next postulate find-yes : (m n : ?) ( pmn : P m n) ? p? m n ? yes pmn ? find m n ? (n , pmn) find-no : (m n : ?) (?pmn : ? P m n) ? p? m n ? no ?pmn ? find m n ? find m (suc n) lemma : ? m ? P m 0 ? proj? (find m 0) ? 0 lemma m pm0 with p? m 0 | inspect (? m ? p? m 0) m ... | yes pm0' | [ proof ] = cong proj? (find-yes m 0 pm0' proof) ... | no ?pm0 | _ = ?-elim (?pm0 pm0) -------------------------------------------------------------------- Something we could consider adding to Agda is some facility to get hold of the clauses of a non-terminating function automatically, so you wouldn't have to postulate them. -- Jesper On Tue, Jan 23, 2018 at 2:14 PM, Sergei Meshveliani wrote: > Can somebody, please, explain how to express/prove the following lemma? > > ------------------------------------------------------------------- > open import Relation.Nullary using (yes; no) > open import Relation.Binary using (Decidable) > open import Relation.Binary.PropositionalEquality using (_?_; refl) > open import Data.Empty using (?-elim) > open import Data.Product using (_,_; proj?; ?) > open import Data.Nat using (?; suc) > > postulate P : ? ? ? ? Set > p? : Decidable P > > {-# NON_TERMINATING #-} > find : (m : ?) ? ? ? ? (\k ? P m k) > find m n > with p? m n > ... | yes pmn = (n , pmn) -- found > ... | no _ = find m (suc n) -- try next > > lemma : ? m ? P m 0 ? proj? (find m 0) ? 0 > lemma m pm0 > with p? m 0 > ... | yes _ = refl > ... | no ?pm0 = ?-elim (?pm0 pm0) > -------------------------------------------------------------------- > > For some P above the algorithm `find' is not terminating. > So that this program would not type-check without pragma. > The TERMINATING pragma is wrong to set. > So, NON_TERMINATING is needed (?). > > Then, it occurs that `lemma' is not type-checked. > This contradicts to the fact that (find m 0) terminates when (P m 0) > is satisfied. > > Is it possible to express and prove in Agda the above lemma? > > Thanks, > > ------ > Sergei > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apostolis.xekoukoulotakis at gmail.com Tue Jan 23 18:37:44 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Tue, 23 Jan 2018 19:37:44 +0200 Subject: [Agda] Is this a recursive record? Message-ID: I get an error that the specified record is recursive. I don't understand why it is. The code at the moment is full of holes and a bit difficult to read because it is inside a big mutual block. https://github.com/xekoukou/AgdaScript/blob/5fa8728c3c03d33c4b249a1c011958db6e0d36ae/AgdaScript2.agda#L50 Removing this line, stops the error from showing up. https://github.com/xekoukou/AgdaScript/blob/5fa8728c3c03d33c4b249a1c011958db6e0d36ae/AgdaScript2.agda#L80 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mechvel at botik.ru Tue Jan 23 19:54:16 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Tue, 23 Jan 2018 21:54:16 +0300 Subject: [Agda] proofs for (NON)TERMINATING In-Reply-To: <4ae7473a-aef4-de1c-9fc1-4ce7bfd2be72@cse.gu.se> References: <1516713243.13614.14.camel@scico.botik.ru> <4ae7473a-aef4-de1c-9fc1-4ce7bfd2be72@cse.gu.se> Message-ID: <1516733656.2649.4.camel@one.mechvel.pereslavl.ru> On Tue, 2018-01-23 at 15:01 +0100, Nils Anders Danielsson wrote: > On 2018-01-23 14:14, Sergei Meshveliani wrote: > > Is it possible to express and prove in Agda the above lemma? > > If you want to prove properties of possibly non-terminating code in > Agda, then I suggest that you avoid using TERMINATING/NON_TERMINATING > and instead use one of several methods to represent non-terminating > computations as total values. One possibility is to use the delay monad. > Please, where it is described the delay monad ? (I see a certain Monad.agda in Standard library, but do not find the `delay' word). ------ Sergei From nad at cse.gu.se Wed Jan 24 09:21:52 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Wed, 24 Jan 2018 09:21:52 +0100 Subject: [Agda] Is this a recursive record? In-Reply-To: References: Message-ID: <04d147f6-b6a9-76cd-6dc1-d6ad3a158e3d@cse.gu.se> On 2018-01-23 18:37, Apostolis Xekoukoulotakis wrote: > I get an error that the specified record is recursive. > I don't understand why it is. There seems to be a cycle AsFunF ? AsFun ? LFun ? _?f_ ? AsFunFT ? AsFunF. -- /NAD From nad at cse.gu.se Wed Jan 24 09:43:37 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Wed, 24 Jan 2018 09:43:37 +0100 Subject: [Agda] proofs for (NON)TERMINATING In-Reply-To: <1516733656.2649.4.camel@one.mechvel.pereslavl.ru> References: <1516713243.13614.14.camel@scico.botik.ru> <4ae7473a-aef4-de1c-9fc1-4ce7bfd2be72@cse.gu.se> <1516733656.2649.4.camel@one.mechvel.pereslavl.ru> Message-ID: <527881c2-bffd-e9dc-5ed3-d406a58c9401@cse.gu.se> On 2018-01-23 19:54, Sergei Meshveliani wrote: > Please, where it is described the delay monad ? Venanzio Capretta General Recursion via Coinductive Types https://doi.org/10.2168/LMCS-1(2:1)2005 The standard library contains an implementation in Category.Monad.Partiality. I would not recommend that you use this implementation. I have another implementation that uses sized types, and which is therefore in my opinion easier to use (the delay-monad library, available from http://www.cse.chalmers.se/~nad/software.html). However, this implementation depends on a different library, which is set up in a somewhat roundabout way in order to cater to a certain experiment. I believe others have also implemented the delay monad using sized types. Here's an example of how one can implement an interpreter for the untyped ?-calculus using the delay monad: http://www.cse.chalmers.se/~nad/listings/partiality-monad/Lambda.Simplified.Delay-monad.Interpreter.html -- /NAD From fhi.1990 at gmail.com Wed Jan 24 16:36:08 2018 From: fhi.1990 at gmail.com (=?UTF-8?Q?Frederik_Hangh=C3=B8j_Iversen?=) Date: Wed, 24 Jan 2018 16:36:08 +0100 Subject: [Agda] Explicit export Message-ID: Does Agda have an explicit export feature like in Haskell? As in e.g.: module That ( would ; be ; nice ; ! ) where -- Regards *Frederik Hangh?j Iversen* -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jesper at sikanda.be Wed Jan 24 16:45:00 2018 From: Jesper at sikanda.be (Jesper Cockx) Date: Wed, 24 Jan 2018 16:45:00 +0100 Subject: [Agda] Explicit export In-Reply-To: References: Message-ID: Agda works a bit different from Haskell wrt the module system, but you can use the 'private' keyword to prevent certain functions in a module from being exported. If you want to re-export a definition from a different module, you can use 'open M using (...) public'. -- Jesper On Wed, Jan 24, 2018 at 4:36 PM, Frederik Hangh?j Iversen < fhi.1990 at gmail.com> wrote: > Does Agda have an explicit export feature like in Haskell? As in e.g.: > > module That ( would ; be ; nice ; ! ) where > > -- > Regards > *Frederik Hangh?j Iversen* > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fhi.1990 at gmail.com Wed Jan 24 16:55:26 2018 From: fhi.1990 at gmail.com (=?UTF-8?Q?Frederik_Hangh=C3=B8j_Iversen?=) Date: Wed, 24 Jan 2018 16:55:26 +0100 Subject: [Agda] Explicit export In-Reply-To: References: Message-ID: Right... However, in most cases I find it preferable to be explicit about what you *put* in scope rather than what you *hide* from it. On Wed, Jan 24, 2018 at 4:45 PM, Jesper Cockx wrote: > Agda works a bit different from Haskell wrt the module system, but you can > use the 'private' keyword to prevent certain functions in a module from > being exported. If you want to re-export a definition from a different > module, you can use 'open M using (...) public'. > > -- Jesper > > On Wed, Jan 24, 2018 at 4:36 PM, Frederik Hangh?j Iversen < > fhi.1990 at gmail.com> wrote: > >> Does Agda have an explicit export feature like in Haskell? As in e.g.: >> >> module That ( would ; be ; nice ; ! ) where >> >> -- >> Regards >> *Frederik Hangh?j Iversen* >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > -- Regards *Frederik Hangh?j Iversen* -------------- next part -------------- An HTML attachment was scrubbed... URL: From kahl at cas.mcmaster.ca Wed Jan 24 17:19:28 2018 From: kahl at cas.mcmaster.ca (Wolfram Kahl) Date: Wed, 24 Jan 2018 11:19:28 -0500 Subject: [Agda] Explicit export In-Reply-To: References: Message-ID: <20180124161928.GR10144@ritchie.cas.mcmaster.ca> On Wed, Jan 24, 2018 at 04:55:26PM +0100, Frederik Hangh?j Iversen wrote: > > On Wed, Jan 24, 2018 at 4:36 PM, Frederik Hangh?j Iversen < > > fhi.1990 at gmail.com> wrote: > > > >> Does Agda have an explicit export feature like in Haskell? As in e.g.: > >> > >> module That ( would ; be ; nice ; ! ) where > > On Wed, Jan 24, 2018 at 4:45 PM, Jesper Cockx wrote: > > > Agda works a bit different from Haskell wrt the module system, but you can > > use the 'private' keyword to prevent certain functions in a module from > > being exported. If you want to re-export a definition from a different > > module, you can use 'open M using (...) public'. > > Right... However, in most cases I find it preferable to be explicit about > what you *put* in scope rather than what you *hide* from it. You could write a wrapper module: module M where private module M0 where ... everything, including all the internal stuff open M0 public using (what ; you ; want ; to ; export ) Wolfram From 33dbqnxpy7if at gmail.com Fri Jan 26 09:53:13 2018 From: 33dbqnxpy7if at gmail.com (Serge Leblanc) Date: Fri, 26 Jan 2018 09:53:13 +0100 Subject: [Agda] IO programs examples ? Message-ID: <7e297e0e-8970-3bba-1031-662fd1a89cc7@gmail.com> Hi, does someone have examples of IO programs for reads and writing files ? Sincere, -- Serge Leblanc ------------------------------------------------------------------------ gpg --search-keys 0x67B17A3F Fingerprint = 2B2D AC93 8620 43D3 D2C2 C2D3 B67C F631 67B1 7A3F -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 228 bytes Desc: OpenPGP digital signature URL: From guillaume.allais at ens-lyon.org Fri Jan 26 11:02:56 2018 From: guillaume.allais at ens-lyon.org (Guillaume Allais) Date: Fri, 26 Jan 2018 11:02:56 +0100 Subject: [Agda] IO programs examples ? In-Reply-To: <7e297e0e-8970-3bba-1031-662fd1a89cc7@gmail.com> References: <7e297e0e-8970-3bba-1031-662fd1a89cc7@gmail.com> Message-ID: <30467c53-732c-b516-15a3-f0f440359fe0@ens-lyon.org> Hi Serge, Here is a barebones implementation of cat (i.e. a use-case of readFile): https://github.com/gallais/potpourri/blob/master/agda/poc/?.agda Cheers, -- gallais On 26/01/18 09:53, Serge Leblanc wrote: > > Hi, does someone have examples of IO programs for reads and writing > files ? > > Sincere, > > -- > Serge Leblanc > ------------------------------------------------------------------------ > gpg --search-keys 0x67B17A3F > Fingerprint = 2B2D AC93 8620 43D3 D2C2 C2D3 B67C F631 67B1 7A3F > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From mechvel at botik.ru Fri Jan 26 20:13:45 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Fri, 26 Jan 2018 22:13:45 +0300 Subject: [Agda] IO programs examples ? In-Reply-To: <7e297e0e-8970-3bba-1031-662fd1a89cc7@gmail.com> References: <7e297e0e-8970-3bba-1031-662fd1a89cc7@gmail.com> Message-ID: <1516994025.2588.2.camel@one.mechvel.pereslavl.ru> On Fri, 2018-01-26 at 09:53 +0100, Serge Leblanc wrote: > Hi, does someone have examples of IO programs for reads and writing > files ? Below `main' reads a string from data.txt and writes the obtained string to standard output: -------------------------------------------------- module TT where open import Function using (_?_) open import Foreign.Haskell open import IO.Primitive open import Data.String using (String; toCostring) main = (readFiniteFile "data.txt") >>= putStrLn ? toCostring ? g where g : String -> String g str = str -------------------------------------------------- From carter.schonwald at gmail.com Thu Feb 1 23:13:58 2018 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Thu, 1 Feb 2018 17:13:58 -0500 Subject: [Agda] am I doing something fundamentally impredicative in this code? or is there a better approach Message-ID: Hello everyone! i'm messing around with trying to mock / model out first class "signed values", and with a toy development i'm getting some type universe issues which makes me suspect i'm modelling it wrong, feedback would be appreciated, https://gist.github.com/cartazio/373eaa1ab726b2f6e651777a44b3f2b1 is the current version of the code many thanks! -Carter also including it inline below module auth where open import Data.String open import Data.Nat open import Level open import Data.Product open import Relation.Binary.PropositionalEquality open import Relation.Binary.HeterogeneousEquality as Het -- SignedBy will be a magic built in type that requires type checker support -- seems likely in practice that i'll need to have some singleton structures record SignedBy {? } (t : Set ? ) ( identity : String ) : Set ? where field val : t uniqueCounter : ? --- unique natural number th hashOfVal : ? --- nat number thats a Cryptographically Strong Hash of the canonical serialization of val signature : String --- signature of concatenation of ---(hashfOfVal , uniqueCounter), using the public key denotated by identity data AsDelegate : Set where IsDelegate : AsDelegate IsLeaf : AsDelegate open AsDelegate record TypeSing {? : Level} ( tau : Set ? ) (v : tau) : Set ? where field singVal : tau singIsSing : singVal ? v record Pair {tx ty : Level} ( x : Set tx ) (y : Set ty ) : Set ( Level.suc (tx Level.? ty )) where constructor mkPair field one : x two : y data OnBehalfOf : String -> String -> AsDelegate -> Set where Self : { x : String } -> OnBehalfOf x x IsDelegate DelegatedTo : {root mid : String} -> (end : String)-> SignedBy ( mkPair (OnBehalfOf mid root IsDelegate) ( TypeSing String end)) mid -> ---- not sure how to hack around this type universe issue... am I getting impredicative or wishing i was? OnBehalfOf end root IsDelegate LeafAuth : {root mid : String} -> (end : String) -> OnBehalfOf mid root IsDelegate -> OnBehalfOf end root IsLeaf {- equivalent datalog would be (roughly) onBehalfOf(me,me,Delegate). onBehalfOf(agent,originalPerson,Delegate) :- onBehalfOf(mid,originalPerson,Delegate),AddsDelegateFor(mid,originalperson,agent) onBhealfOf(leafAgent,originalPerson,LEAF) :- onBehalfOf(mid,originalPerson,Delegate),AddsLeafFor(mid,originalperson,leafAgent) -} -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Fri Feb 2 00:05:56 2018 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Thu, 1 Feb 2018 18:05:56 -0500 Subject: [Agda] am I doing something fundamentally impredicative in this code? or is there a better approach In-Reply-To: References: Message-ID: the fine folks on IRC helped me get to the bottom of this, needed to remove a needless level suc and replace a use of mkPair with Pair On Thu, Feb 1, 2018 at 5:13 PM, Carter Schonwald wrote: > Hello everyone! i'm messing around with trying to mock / model out first > class "signed values", and with a toy development i'm getting some type > universe issues which makes me suspect i'm modelling it wrong, > > feedback would be appreciated, > https://gist.github.com/cartazio/373eaa1ab726b2f6e651777a44b3f2b1 > is the current version of the code > > many thanks! > -Carter > also including it inline below > > module auth where > > open import Data.String > open import Data.Nat > open import Level > open import Data.Product > open import Relation.Binary.PropositionalEquality > open import Relation.Binary.HeterogeneousEquality as Het > > > -- SignedBy will be a magic built in type that requires type checker > support > -- seems likely in practice that i'll need to have some singleton > structures > record SignedBy {? } (t : Set ? ) ( identity : String ) : Set ? where > field > val : t > uniqueCounter : ? --- unique natural number th > hashOfVal : ? --- nat number thats a Cryptographically Strong Hash > of the canonical serialization of val > signature : String --- signature of concatenation of > ---(hashfOfVal , uniqueCounter), using the public > key denotated by identity > > > > > > data AsDelegate : Set where > IsDelegate : AsDelegate > IsLeaf : AsDelegate > open AsDelegate > > > record TypeSing {? : Level} ( tau : Set ? ) (v : tau) : Set ? where > field > singVal : tau > singIsSing : singVal ? v > > > record Pair {tx ty : Level} ( x : Set tx ) (y : Set ty ) : Set ( Level.suc > (tx Level.? ty )) where > constructor mkPair > field > one : x > two : y > > data OnBehalfOf : String -> String -> AsDelegate -> Set where > Self : { x : String } -> OnBehalfOf x x IsDelegate > DelegatedTo : {root mid : String} -> (end : String)-> > SignedBy ( mkPair (OnBehalfOf mid root IsDelegate) ( > TypeSing String end)) mid -> > ---- not sure how to hack around this type universe > issue... am I getting impredicative or wishing i was? > OnBehalfOf end root IsDelegate > LeafAuth : {root mid : String} -> (end : String) -> OnBehalfOf mid root > IsDelegate -> OnBehalfOf end root IsLeaf > > {- > equivalent datalog would be (roughly) > onBehalfOf(me,me,Delegate). > onBehalfOf(agent,originalPerson,Delegate) :- > onBehalfOf(mid,originalPerson,Delegate),AddsDelegateFor(mid, > originalperson,agent) > onBhealfOf(leafAgent,originalPerson,LEAF) :- > onBehalfOf(mid,originalPerson,Delegate),AddsLeafFor(mid, > originalperson,leafAgent) > -} > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mechvel at botik.ru Fri Feb 2 21:43:54 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Fri, 02 Feb 2018 23:43:54 +0300 Subject: [Agda] Binary library reference Message-ID: <1517604234.2967.14.camel@one.mechvel.pereslavl.ru> Dear Agda page owner, can you, please, set the reference to my Binary library to http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.Libraries ? Probably it fits the section "Libraries, i.e. code which is intended to be reused", or may be, "Other developments". I suggest this reference: ----------------------------------------------------------------------- Binary, a certified library for operations with binary natural numbers, suggested as optimization-extension-replacement for the Bin part in Standard library, by Sergei Meshveliani. http://www.botik.ru/pub/local/Mechveliani/binNat/ ----------------------------------------------------------------------- (the current version there is Binary 3.0). Regards, ------ Sergei From prieto.jona at gmail.com Fri Feb 2 22:25:38 2018 From: prieto.jona at gmail.com (Jonathan Prieto-Cubides) Date: Fri, 2 Feb 2018 22:25:38 +0100 Subject: [Agda] Binary library reference In-Reply-To: <1517604234.2967.14.camel@one.mechvel.pereslavl.ru> References: <1517604234.2967.14.camel@one.mechvel.pereslavl.ru> Message-ID: Hi Sergei, You can edit this page yourself. Just click on the top menu the option "Edit" using the password *agda *and that's it. BR, Jonathan. On Fri, Feb 2, 2018 at 9:43 PM, Sergei Meshveliani wrote: > Dear Agda page owner, > > can you, please, set the reference to my Binary library to > > http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.Libraries > ? > > Probably it fits the section > "Libraries, i.e. code which is intended to be reused", > or may be, > "Other developments". > > I suggest this reference: > > ----------------------------------------------------------------------- > Binary, a certified library for operations with binary natural numbers, > suggested as optimization-extension-replacement for the Bin > part in Standard library, > by Sergei Meshveliani. > > http://www.botik.ru/pub/local/Mechveliani/binNat/ > ----------------------------------------------------------------------- > > (the current version there is Binary 3.0). > > Regards, > > ------ > Sergei > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -- Cordialmente, Jonathan S. Prieto C. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mechvel at botik.ru Sat Feb 3 11:28:43 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Sat, 03 Feb 2018 13:28:43 +0300 Subject: [Agda] Binary library reference In-Reply-To: References: <1517604234.2967.14.camel@one.mechvel.pereslavl.ru> Message-ID: <1517653723.2642.2.camel@one.mechvel.pereslavl.ru> On Fri, 2018-02-02 at 22:25 +0100, Jonathan Prieto-Cubides wrote: > Hi Sergei, > > > You can edit this page yourself. Just click on the top menu the > option "Edit" using the password agda and that's it. > Thank you. It is done. ------ Sergei From icfp.publicity at googlemail.com Mon Feb 5 08:33:02 2018 From: icfp.publicity at googlemail.com (Lindsey Kuper) Date: Sun, 04 Feb 2018 23:33:02 -0800 Subject: [Agda] Second Call for Papers: PACMPL issue ICFP 2018 Message-ID: <5a7808aeded9_2e33fe5a9c53be458347@landin.local.mail> PACMPL Volume 2, Issue ICFP 2018 Call for Papers accepted papers to be invited for presentation at The 23rd ACM SIGPLAN International Conference on Functional Programming St. Louis, Missouri, USA http://icfp18.sigplan.org/ ### Important dates Submissions due: 16 March 2018 (Friday) Anywhere on Earth https://icfp18.hotcrp.com Author response: 2 May (Wednesday) - 4 May (Friday) 14:00 UTC Notification: 18 May (Friday) Final copy due: 22 June (Friday) Conference: 24 September (Monday) - 26 September (Wednesday) ### About PACMPL Proceedings of the ACM on Programming Languages (PACMPL ) is a Gold Open Access journal publishing research on all aspects of programming languages, from design to implementation and from mathematical formalisms to empirical studies. Each issue of the journal is devoted to a particular subject area within programming languages and will be announced through publicized Calls for Papers, like this one. ### Scope [PACMPL](https://pacmpl.acm.org/) issue ICFP 2018 seeks original papers on the art and science of functional programming. Submissions are invited on all topics from principles to practice, from foundations to features, and from abstraction to application. The scope includes all languages that encourage functional programming, including both purely applicative and imperative languages, as well as languages with objects, concurrency, or parallelism. Topics of interest include (but are not limited to): * *Language Design*: concurrency, parallelism, and distribution; modules; components and composition; metaprogramming; type systems; interoperability; domain-specific languages; and relations to imperative, object-oriented, or logic programming. * *Implementation*: abstract machines; virtual machines; interpretation; compilation; compile-time and run-time optimization; garbage collection and memory management; multi-threading; exploiting parallel hardware; interfaces to foreign functions, services, components, or low-level machine resources. * *Software-Development Techniques*: algorithms and data structures; design patterns; specification; verification; validation; proof assistants; debugging; testing; tracing; profiling. * *Foundations*: formal semantics; lambda calculus; rewriting; type theory; monads; continuations; control; state; effects; program verification; dependent types. * *Analysis and Transformation*: control-flow; data-flow; abstract interpretation; partial evaluation; program calculation. * *Applications*: symbolic computing; formal-methods tools; artificial intelligence; systems programming; distributed-systems and web programming; hardware design; databases; XML processing; scientific and numerical computing; graphical user interfaces; multimedia and 3D graphics programming; scripting; system administration; security. * *Education*: teaching introductory programming; parallel programming; mathematical proof; algebra. Submissions will be evaluated according to their relevance, correctness, significance, originality, and clarity. Each submission should explain its contributions in both general and technical terms, clearly identifying what has been accomplished, explaining why it is significant, and comparing it with previous work. The technical content should be accessible to a broad audience. PACMPL issue ICFP 2018 also welcomes submissions in two separate categories — Functional Pearls and Experience Reports — that must be marked as such at the time of submission and that need not report original research results. Detailed guidelines on both categories are given at the end of this call. Please contact the principal editor if you have questions or are concerned about the appropriateness of a topic. ### Preparation of submissions **Deadline**: The deadline for submissions is Friday, March 16, 2018, Anywhere on Earth (). This deadline will be strictly enforced. **Formatting**: Submissions must be in PDF format, printable in black and white on US Letter sized paper, and interpretable by common PDF tools. All submissions must adhere to the "ACM Small" template that is available (in both LaTeX and Word formats) from . For authors using LaTeX, a lighter-weight package, including only the essential files, is available from . There is a limit of 27 pages for a full paper or 14 pages for an Experience Report; in either case, the bibliography will not be counted against these limits. These page limits have been chosen to allow essentially the same amount of content with the new single-column format as was possible with the two-column format used in past ICFP conferences. Submissions that exceed the page limits or, for other reasons, do not meet the requirements for formatting, will be summarily rejected. See also PACMPL's Information and Guidelines for Authors at . **Submission**: Submissions will be accepted at Improved versions of a paper may be submitted at any point before the submission deadline using the same web interface. **Author Response Period**: Authors will have a 72-hour period, starting at 14:00 UTC on Wednesday, May 2, 2018, to read reviews and respond to them. **Supplementary Materials**: Authors have the option to attach supplementary material to a submission, on the understanding that reviewers may choose not to look at it. The material should be uploaded at submission time, as a single pdf or a tarball, not via a URL. This supplementary material may or may not be anonymized; if not anonymized, it will only be revealed to reviewers after they have submitted their review of the paper and learned the identity of the author(s). **Authorship Policies**: All submissions are expected to comply with the ACM Policies for Authorship that are detailed at . **Republication Policies**: Each submission must adhere to SIGPLAN's republication policy, as explained on the web at . **Resubmitted Papers**: Authors who submit a revised version of a paper that has previously been rejected by another conference have the option to attach an annotated copy of the reviews of their previous submission(s), explaining how they have addressed these previous reviews in the present submission. If a reviewer identifies him/herself as a reviewer of this previous submission and wishes to see how his/her comments have been addressed, the principal editor will communicate to this reviewer the annotated copy of his/her previous review. Otherwise, no reviewer will read the annotated copies of the previous reviews. ### Review Process This section outlines the two-stage process with lightweight double-blind reviewing that will be used to select papers for PACMPL issue ICFP 2018. We anticipate that there will be a need to clarify and expand on this process, and we will maintain a list of frequently asked questions and answers on the conference website to address common concerns. **PACMPL issue ICFP 2018 will employ a two-stage review process.** The first stage in the review process will assess submitted papers using the criteria stated above and will allow for feedback and input on initial reviews through the author response period mentioned previously. At the review meeting, a set of papers will be conditionally accepted and all other papers will be rejected. Authors will be notified of these decisions on May 18, 2018. Authors of conditionally accepted papers will be provided with committee reviews (just as in previous conferences) along with a set of mandatory revisions. After five weeks (June 22, 2018), the authors will provide a second submission. The second and final reviewing phase assesses whether the mandatory revisions have been adequately addressed by the authors and thereby determines the final accept/reject status of the paper. The intent and expectation is that the mandatory revisions can be addressed within five weeks and hence that conditionally accepted papers will in general be accepted in the second phase. The second submission should clearly identify how the mandatory revisions were addressed. To that end, the second submission must be accompanied by a cover letter mapping each mandatory revision request to specific parts of the paper. The cover letter will facilitate a quick second review, allowing for confirmation of final acceptance within two weeks. Conversely, the absence of a cover letter will be grounds for the paper?s rejection. **PACMPL issue ICFP 2018 will employ a lightweight double-blind reviewing process.** To facilitate this, submitted papers must adhere to two rules: 1. **author names and institutions must be omitted**, and 2. **references to authors' own related work should be in the third person** (e.g., not "We build on our previous work ..." but rather "We build on the work of ..."). The purpose of this process is to help the reviewers come to an initial judgement about the paper without bias, not to make it impossible for them to discover the authors if they were to try. Nothing should be done in the name of anonymity that weakens the submission or makes the job of reviewing the paper more difficult (e.g., important background references should not be omitted or anonymized). In addition, authors should feel free to disseminate their ideas or draft versions of their paper as they normally would. For instance, authors may post drafts of their papers on the web or give talks on their research ideas. ### Information for Authors of Accepted Papers * As a condition of acceptance, final versions of all papers must adhere to the new ACM Small format. The page limits for final versions of papers will be increased to ensure that authors have space to respond to reviewer comments and mandatory revisions. * Authors of accepted submissions will be required to agree to one of the three ACM licensing options: open access on payment of a fee (**recommended**, and SIGPLAN can cover the cost as described next); copyright transfer to ACM; or retaining copyright but granting ACM exclusive publication rights. Further information about ACM author rights is available from . * PACMPL is a Gold Open Access journal. It will be archived in ACM?s Digital Library, but no membership or fee is required for access. Gold Open Access has been made possible by generous funding through ACM SIGPLAN, which will cover all open access costs in the event authors cannot. Authors who can cover the costs may do so by paying an Article Processing Charge (APC). PACMPL, SIGPLAN, and ACM Headquarters are committed to exploring routes to making Gold Open Access publication both affordable and sustainable. * ACM offers authors a range of copyright options, one of which is Creative Commons CC-BY publication; this is the option recommended by the PACMPL editorial board. A reasoned argument in favour of this option can be found in the article [Why CC-BY?](https://oaspa.org/why-cc-by/) published by OASPA, the Open Access Scholarly Publishers Association. * We intend that the papers will be freely available for download from the ACM Digital Library in perpetuity via the OpenTOC mechanism. * ACM Author-Izer is a unique service that enables ACM authors to generate and post links on either their home page or institutional repository for visitors to download the definitive version of their articles from the ACM Digital Library at no charge. Downloads through Author-Izer links are captured in official ACM statistics, improving the accuracy of usage and impact measurements. Consistently linking to the definitive version of an ACM article should reduce user confusion over article versioning. After an article has been published and assigned to the appropriate ACM Author Profile pages, authors should visit to learn how to create links for free downloads from the ACM DL. * At least one author of each accepted submissions will be expected to attend and present their paper at the conference. The schedule for presentations will be determined and shared with authors after the full program has been selected. Presentations will be videotaped and released online if the presenter consents. * The official publication date is the date the papers are made available in the ACM Digital Library. This date may be up to *two weeks prior* to the first day of the conference. The official publication date affects the deadline for any patent filings related to published work. ### Artifact Evaluation Authors of papers that are conditionally accepted in the first phase of the review process will be encouraged (but not required) to submit supporting materials for Artifact Evaluation. These items will then be reviewed by an Artifact Evaluation Committee, separate from the paper Review Committee, whose task is to assess how the artifacts support the work described in the associated paper. Papers that go through the Artifact Evaluation process successfully will receive a seal of approval printed on the papers themselves. Authors of accepted papers will be encouraged to make the supporting materials publicly available upon publication of the papers, for example, by including them as "source materials" in the ACM Digital Library. An additional seal will mark papers whose artifacts are made available, as outlined in the ACM guidelines for artifact badging. Participation in Artifact Evaluation is voluntary and will not influence the final decision regarding paper acceptance. Further information about the motivations and expectations for Artifact Evaluation can be found at . ### Special categories of papers In addition to research papers, PACMPL issue ICFP solicits two kinds of papers that do not require original research contributions: Functional Pearls, which are full papers, and Experience Reports, which are limited to half the length of a full paper. Authors submitting such papers should consider the following guidelines. #### Functional Pearls A Functional Pearl is an elegant essay about something related to functional programming. Examples include, but are not limited to: * a new and thought-provoking way of looking at an old idea * an instructive example of program calculation or proof * a nifty presentation of an old or new data structure * an interesting application of functional programming techniques * a novel use or exposition of functional programming in the classroom While pearls often demonstrate an idea through the development of a short program, there is no requirement or expectation that they do so. Thus, they encompass the notions of theoretical and educational pearls. Functional Pearls are valued as highly and judged as rigorously as ordinary papers, but using somewhat different criteria. In particular, a pearl is not required to report original research, but, it should be concise, instructive, and entertaining. A pearl is likely to be rejected if its readers get bored, if the material gets too complicated, if too much specialized knowledge is needed, or if the writing is inelegant. The key to writing a good pearl is polishing. A submission that is intended to be treated as a pearl must be marked as such on the submission web page, and should contain the words "Functional Pearl" somewhere in its title or subtitle. These steps will alert reviewers to use the appropriate evaluation criteria. Pearls will be combined with ordinary papers, however, for the purpose of computing the conference's acceptance rate. #### Experience Reports The purpose of an Experience Report is to help create a body of published, refereed, citable evidence that functional programming really works — or to describe what obstacles prevent it from working. Possible topics for an Experience Report include, but are not limited to: * insights gained from real-world projects using functional programming * comparison of functional programming with conventional programming in the context of an industrial project or a university curriculum * project-management, business, or legal issues encountered when using functional programming in a real-world project * curricular issues encountered when using functional programming in education * real-world constraints that created special challenges for an implementation of a functional language or for functional programming in general An Experience Report is distinguished from a normal PACMPL issue ICFP paper by its title, by its length, and by the criteria used to evaluate it. * Both in the papers and in any citations, the title of each accepted Experience Report must begin with the words "Experience Report" followed by a colon. The acceptance rate for Experience Reports will be computed and reported separately from the rate for ordinary papers. * Experience Report submissions can be at most 12 pages long, excluding bibliography. * Each accepted Experience Report will be presented at the conference, but depending on the number of Experience Reports and regular papers accepted, authors of Experience reports may be asked to give shorter talks. * Because the purpose of Experience Reports is to enable our community to accumulate a body of evidence about the efficacy of functional programming, an acceptable Experience Report need not add to the body of knowledge of the functional-programming community by presenting novel results or conclusions. It is sufficient if the Report states a clear thesis and provides supporting evidence. The thesis must be relevant to ICFP, but it need not be novel. The review committee will accept or reject Experience Reports based on whether they judge the evidence to be convincing. Anecdotal evidence will be acceptable provided it is well argued and the author explains what efforts were made to gather as much evidence as possible. Typically, more convincing evidence is obtained from papers which show how functional programming was used than from papers which only say that functional programming was used. The most convincing evidence often includes comparisons of situations before and after the introduction or discontinuation of functional programming. Evidence drawn from a single person's experience may be sufficient, but more weight will be given to evidence drawn from the experience of groups of people. An Experience Report should be short and to the point: it should make a claim about how well functional programming worked on a particular project and why, and produce evidence to substantiate this claim. If functional programming worked in this case in the same ways it has worked for others, the paper need only summarize the results — the main part of the paper should discuss how well it worked and in what context. Most readers will not want to know all the details of the project and its implementation, but the paper should characterize the project and its context well enough so that readers can judge to what degree this experience is relevant to their own projects. The paper should take care to highlight any unusual aspects of the project. Specifics about the project are more valuable than generalities about functional programming; for example, it is more valuable to say that the team delivered its software a month ahead of schedule than it is to say that functional programming made the team more productive. If the paper not only describes experience but also presents new technical results, or if the experience refutes cherished beliefs of the functional-programming community, it may be better off submitted it as a full paper, which will be judged by the usual criteria of novelty, originality, and relevance. The principal editor will be happy to advise on any concerns about which category to submit to. ### ICFP Organizers General Chair: Robby Findler (Northwestern University, USA) Artifact Evaluation Co-Chairs: Simon Marlow (Facebook, UK) Ryan R. Newton (Indiana University, USA) Industrial Relations Chair: Alan Jeffrey (Mozilla Research, USA) Programming Contest Organiser: Matthew Fluet (Rochester Institute of Technology, USA) Publicity and Web Chair: Lindsey Kuper (Intel Labs, USA) Student Research Competition Chair: Ilya Sergey (University College London, UK) Video Co-Chairs: Jose Calderon (Galois, Inc., USA) Nicolas Wu (University of Bristol, UK) Workshops Co-Chair: David Christiansen (Indiana University, USA) Christophe Scholliers (Universiteit Gent, Belgium) ### PACMPL Volume 2, Issue ICFP 2018 Principal Editor: Matthew Flatt (Univesity of Utah, USA) Review Committee: Sandrine Blazy (IRISA, University of Rennes 1, France) David Christiansen (Indiana University, USA) Martin Elsman (University of Copenhagen, Denmark) Marco Gaboardi (University at Buffalo, CUNY, USA) Sam Lindley (University of Edinburgh, UK) Heather Miller (Northweastern University, USA / EPFL, Switzerland) J. Garrett Morris (University of Kansas, USA) Henrik Nilsson (University of Nottingham, UK) Fran?ois Pottier (Inria, France) Alejandro Russo (Chalmers University of Technology, Sweden) Ilya Sergey (University College London, UK) Michael Sperber (Active Group GmbH, Germany) Wouter Swierstra (Utrecht University, UK) ?ric Tanter (University of Chile, Chile) Katsuhiro Ueno (Tohoku University, Japan) Niki Vazou (University of Maryland, USA) Jeremy Yallop (University of Cambridge, UK) External Review Committee: Michael D. Adams (University of Utah, USA) Amal Ahmed (Northeastern University, USA) Nada Amin (University of Cambridge, USA) Zena Ariola (University of Oregon) Lars Bergstrom (Mozilla Research) Lars Birkedal (Aarhus University, Denmark) Edwin Brady ( University of St. Andrews, UK) William Byrd (University of Alabama at Birmingham, USA) Giuseppe Castagna (CRNS / University of Paris Diderot, France) Sheng Chen (University of Louisiana at Lafayette, USA) Koen Claessen (Chalmers University ot Technology, Sweden) Ugo Dal Lago (University of Bologna, Italy / Inria, France) David Darais (University of Vermont, USA) Joshua Dunfield (Queen?s University, Canada) Richard Eisenberg (Bryn Mawr College, USA) Matthew Fluet (Rochester Institute of Technology, USA) Nate Foster (Cornell University, USA) Jurriaan Hage (Utrecht University, Netherlands) David Van Horn (University of Maryland, USA) Zhenjiang Hu (National Institute of Informatics, Japan) Suresh Jagannathan (Purdue University, USA) Simon Peyton Jones (Microsoft Research, UK) Naoki Kobayashi (University of Tokyo, Japan) Neelakantan Krishnaswami (University of Cambridge, UK) Kazutaka Matsuda (Tohoku University, Japan) Trevor McDonell (University of New South Wales, Australia) Hernan Melgratti (University of Buenos Aires, Argentina) Akimasa Morihata (University of Tokyo, Japan) Aleksandar Nanevski (IMDEA Software Institute, Spain) Kim Nguy?n (University of Paris-Sud, France) Cosmin Oancea (DIKU, University of Copenhagen, Denmark) Bruno C. d. S. Oliveira (University of Hong Kong, China) Tomas Petricek (University of Cambridge, UK) Benjamin Pierce (University of Pennsylvania, USA) Christine Rizkallah (University of Pennsylvania, USA) Tom Schrijvers (KU Leuven, Belgium) Manuel Serrano (Inria, France) Jeremy Siek (Indiana University, USA) Josef Svenningsson (Chalmers University of Technology, Sweden) Nicolas Tabareau (Inria, France) Dimitrios Vytiniotis (Microsoft Research, UK) Philip Wadler (University of Edinburgh, UK) Meng Wang (University of Kent, UK) From mechvel at botik.ru Mon Feb 5 10:48:37 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Mon, 05 Feb 2018 12:48:37 +0300 Subject: [Agda] proofs for (NON)TERMINATING In-Reply-To: References: <1516713243.13614.14.camel@scico.botik.ru> Message-ID: <1517824117.2505.18.camel@one.mechvel.pereslavl.ru> On Tue, 2018-01-23 at 15:21 +0100, Jesper Cockx wrote: JC: ------------------------------------------------------------------- If you define a function with a {-# NON_TERMINATING #-} pragma then it's generally not possible to prove things about it because Agda will refuse to evaluate it. This is also the problem in your example: even though in this case evaluation is terminating, Agda will play it safe and block *all* evaluation of the NON_TERMINATING function. So I don't think what you're trying to do is currently possible in Agda. A workaround is to postulate the clauses of the non-terminating function as propositional equalities (i.e. elements of the ? type). This allows you to prove properties of the non-terminating function without breaking the Agda typechecker (as you risk doing when using TERMINATING). In your example: [..] postulate find-yes : (m n : ?) ( pmn : P m n) ? p? m n ? yes pmn ? find m n ? (n , pmn) find-no : (m n : ?) (?pmn : ? P m n) ? p? m n ? no ?pmn ? find m n ? find m (suc n) [..] Something we could consider adding to Agda is some facility to get hold of the clauses of a non-terminating function automatically, so you wouldn't have to postulate them. ------------------------------------------------------------------------- Thank you. This is interesting. My goal is to find a simple way to express in Agda proofs about an algorithm which termination domain is not known. Is there a simpler approach than applying coinductive types and `delay' monad? I try your approach of "postulate-clauses" on the following simple example. f (m : ?) searches for n ? m such that P n, and when finds, returns n + n. It is needed to represent and prove the statement "if (f 0) terminates, then Even (f 0)" (I). -------------------------------------------------------------------- open import Function using (_?_) open import Relation.Nullary using (Dec; yes; no; ?_) open import Relation.Unary using (Decidable) open import Relation.Binary.PropositionalEquality as PE using (_?_; refl; sym; trans; cong; subst) open import Data.Product using (_?_; _,_; ?) open import Data.Nat using (?; suc; _+_; _<_; _>_; _?_) open import Data.Nat.Properties using (?-refl; ?-reflexive; ?-trans; m+n?m?n; +-comm; +-assoc; m?m+n; ; module ?-Reasoning) postulate P : ? ? Set p? : Decidable P {-# NON_TERMINATING #-} f : ? ? ? -- find n satisfying (P n) and return n + n f n with p? n ... | yes _ = n + n -- found ... | no _ = f (suc n) -- try next postulate f-yes : ? n ? P n ? f n ? n + n f-no : ? n ? ? P n ? f n ? f (suc n) data Even : ? ? Set where even0 : Even 0 even+2 : {n : ?} ? Even n ? Even (suc (suc n)) postulate even-n+n : ? n ? Even (n + n) -- the proof skipped for brevity postulate minimizeSolution : ? m ? P m ? ? (\n ? P n ? f 0 ? f n) -- -- Can be proved by moving from m to minimal i such that (P i), -- and by applying f-yes, f-no. theorem : ? m ? P m ? Even (f 0) theorem m pm = let (n , pn , f0?fn) = minimizeSolution m pm fn?n+n = f-yes n pn even-fn = subst Even (sym fn?n+n) (even-n+n n) in subst Even (sym f0?fn) even-fn ------------------------------------------------------------------ First, I think that (Even (f 0)) cannot be proved. Right? Further, the condition "if (f 0) terminates" is replaced with "? m ? P m". I have an impression that `theorem' represents (I), in a certain sense, and proves it. Am I missing something? In general: this approach works when the programmer is able to formulate the statement "(g x1 ... xn) terminates" as some Agda predicate in x1 ... xn. For example, this is possible for any semidecision procedure g (?) I wonder: how generic is this approach. What people think? Thanks, ------ Sergei From Jesper at sikanda.be Mon Feb 5 11:33:24 2018 From: Jesper at sikanda.be (Jesper Cockx) Date: Mon, 5 Feb 2018 11:33:24 +0100 Subject: [Agda] proofs for (NON)TERMINATING In-Reply-To: <1517824117.2505.18.camel@one.mechvel.pereslavl.ru> References: <1516713243.13614.14.camel@scico.botik.ru> <1517824117.2505.18.camel@one.mechvel.pereslavl.ru> Message-ID: It is needed to represent and prove the statement "if (f 0) terminates, then Even (f 0)" (I). I don't think it's possible to formulate inside Agda what it means for a function with a {-# NON_TERMINATING #-} pragma to terminate. So I also don't think it's possible to represent the statement you want. If you want to reason in Agda about termination of functions, I'd recommend to use the Delay monad as Nils suggested. -- Jesper On Mon, Feb 5, 2018 at 10:48 AM, Sergei Meshveliani wrote: > On Tue, 2018-01-23 at 15:21 +0100, Jesper Cockx wrote: > > JC: ------------------------------------------------------------------- > If you define a function with a {-# NON_TERMINATING #-} pragma then > it's generally not possible to prove things about it because Agda will > refuse to evaluate it. This is also the problem in your example: even > though in this case evaluation is terminating, Agda will play it safe > and block *all* evaluation of the NON_TERMINATING function. So I don't > think what you're trying to do is currently possible in Agda. > > A workaround is to postulate the clauses of the non-terminating function > as propositional equalities (i.e. elements of the ? type). This allows > you to prove properties of the non-terminating function without breaking > the Agda typechecker (as you risk doing when using TERMINATING). In your > example: > [..] > > postulate > find-yes : (m n : ?) ( pmn : P m n) ? p? m n ? yes pmn ? > find m n ? (n , pmn) > find-no : (m n : ?) (?pmn : ? P m n) ? p? m n ? no ?pmn ? > find m n ? find m (suc n) > [..] > > Something we could consider adding to Agda is some facility to get hold > of the clauses of a non-terminating function automatically, so you > wouldn't have to postulate them. > ------------------------------------------------------------------------- > > > > Thank you. This is interesting. > > My goal is to find a simple way to express in Agda proofs about an > algorithm which termination domain is not known. > Is there a simpler approach than applying coinductive types and `delay' > monad? > > I try your approach of "postulate-clauses" on the following simple > example. > > f (m : ?) searches for n ? m such that P n, and when finds, > returns n + n. > It is needed to represent and prove the statement > "if (f 0) terminates, then Even (f 0)" (I). > > -------------------------------------------------------------------- > open import Function using (_?_) > open import Relation.Nullary using (Dec; yes; no; ?_) > open import Relation.Unary using (Decidable) > open import Relation.Binary.PropositionalEquality as PE using > (_?_; refl; sym; trans; cong; subst) > open import Data.Product using (_?_; _,_; ?) > open import Data.Nat using (?; suc; _+_; _<_; _>_; _?_) > open import Data.Nat.Properties using > (?-refl; ?-reflexive; ?-trans; m+n?m?n; +-comm; +-assoc; > m?m+n; ; module ?-Reasoning) > > postulate P : ? ? Set > p? : Decidable P > > {-# NON_TERMINATING #-} > f : ? ? ? -- find n satisfying (P n) and return n + n > f n > with p? n > ... | yes _ = n + n -- found > ... | no _ = f (suc n) -- try next > > > postulate f-yes : ? n ? P n ? f n ? n + n > f-no : ? n ? ? P n ? f n ? f (suc n) > > data Even : ? ? Set > where > even0 : Even 0 > even+2 : {n : ?} ? Even n ? Even (suc (suc n)) > > postulate > even-n+n : ? n ? Even (n + n) -- the proof skipped for brevity > > postulate > minimizeSolution : ? m ? P m ? ? (\n ? P n ? f 0 ? f n) > -- > -- Can be proved by moving from m to minimal i such that (P i), > -- and by applying f-yes, f-no. > > theorem : ? m ? P m ? Even (f 0) > theorem m pm = > let > (n , pn , f0?fn) = minimizeSolution m pm > fn?n+n = f-yes n pn > even-fn = subst Even (sym fn?n+n) (even-n+n n) > in > subst Even (sym f0?fn) even-fn > ------------------------------------------------------------------ > > > First, I think that (Even (f 0)) cannot be proved. Right? > > Further, the condition "if (f 0) terminates" is replaced with > "? m ? P m". > > I have an impression that `theorem' represents (I), in a certain sense, > and proves it. > Am I missing something? > > In general: > this approach works when the programmer is able to formulate the > statement > "(g x1 ... xn) terminates" > > as some Agda predicate in x1 ... xn. > For example, this is possible for any semidecision procedure g > (?) > I wonder: how generic is this approach. > > What people think? > > Thanks, > > ------ > Sergei > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.escardo at cs.bham.ac.uk Mon Feb 5 11:55:45 2018 From: m.escardo at cs.bham.ac.uk (Martin Escardo) Date: Mon, 5 Feb 2018 10:55:45 +0000 Subject: [Agda] proofs for (NON)TERMINATING In-Reply-To: References: <1516713243.13614.14.camel@scico.botik.ru> <1517824117.2505.18.camel@one.mechvel.pereslavl.ru> Message-ID: <4af98bbc-4aa5-25ac-c886-41bc9bd70140@cs.bham.ac.uk> On 05/02/18 10:33, Jesper at sikanda.be wrote: > > It is needed to represent and prove the statement > ? ? ? ? ? ? ? ? "if (f 0) terminates, then? Even (f 0)"? ? ?(I). > > I don't think it's possible to formulate inside Agda what it means for a > function with a {-# NON_TERMINATING #-} pragma to terminate. So I also > don't think it's possible to represent the statement you want. If you > want to reason in Agda about termination of functions, I'd recommend to > use the Delay monad as Nils suggested. Or you can define a relation R, and show that if R 0 y then y is even. M. > > -- Jesper > > On Mon, Feb 5, 2018 at 10:48 AM, Sergei Meshveliani > wrote: > > On Tue, 2018-01-23 at 15:21 +0100, Jesper Cockx wrote: > > JC: ------------------------------------------------------------------- > If you define a function with a {-# NON_TERMINATING #-} pragma then > it's generally not possible to prove things about it because Agda will > refuse to evaluate it. This is also the problem in your example: even > though in this case evaluation is terminating, Agda will play it safe > and block *all* evaluation of the NON_TERMINATING function. So I don't > think what you're trying to do is currently possible in Agda. > > A workaround is to postulate the clauses of the non-terminating function > as propositional equalities (i.e. elements of the ? type). This allows > you to prove properties of the non-terminating function without breaking > the Agda typechecker (as you risk doing when using TERMINATING). In your > example: > [..] > > postulate > ? find-yes : (m n : ?) ( pmn :? ?P m n) ? p? m n ? yes pmn ? > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? find m n ? (n , pmn) > ? find-no? : (m n : ?) (?pmn : ? P m n) ? p? m n ? no ?pmn ? > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? find m n ? find m (suc n) > [..] > > Something we could consider adding to Agda is some facility to get hold > of the clauses of a non-terminating function automatically, so you > wouldn't have to postulate them. > ------------------------------------------------------------------------- > > > > Thank you. This is interesting. > > My goal is to find a simple way to express in Agda proofs about an > algorithm which termination domain is not known. > Is there a simpler approach than applying coinductive types and `delay' > monad? > > I try your approach of "postulate-clauses" on the following simple > example. > > f (m : ?)? searches for? n ? m? such that? P n,? and when finds, > returns? n + n. > It is needed to represent and prove the statement > ? ? ? ? ? ? ? ? "if (f 0) terminates, then? Even (f 0)"? ? ?(I). > > -------------------------------------------------------------------- > open import Function? ? ? ? ?using (_?_) > open import Relation.Nullary using (Dec; yes; no; ?_) > open import Relation.Unary? ?using (Decidable) > open import Relation.Binary.PropositionalEquality as PE using > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? (_?_; refl; sym; trans; cong; subst) > open import Data.Product using (_?_; _,_; ?) > open import Data.Nat using (?; suc; _+_; _<_; _>_; _?_) > open import Data.Nat.Properties using > ? ? ? ? ? ? (?-refl; ?-reflexive; ?-trans; m+n?m?n; +-comm; +-assoc; > ? ? ? ? ? ? ?m?m+n; ; module ?-Reasoning) > > postulate? P? : ? ? Set > ? ? ? ? ? ?p? : Decidable P > > {-# NON_TERMINATING #-} > f : ? ? ?? ? ? ? ? ? ? ? -- find n satisfying (P n) and return? n + n > f n > ? ? with p? n > ... | yes _ = n + n? ? ? -- found > ... | no? _ = f (suc n)? -- try next > > > postulate? f-yes :? ? n ? P n? ?? f n ? n + n > ? ? ? ? ? ?f-no? :? ? n ? ? P n ? f n ? f (suc n) > > data Even : ? ? Set > ? ? ?where > ? ? ?even0? : Even 0 > ? ? ?even+2 : {n : ?} ? Even n ? Even (suc (suc n)) > > postulate > ? even-n+n : ? n ? Even (n + n)? ? -- the proof skipped for brevity > > postulate > ? minimizeSolution :? ? m ? P m ? ? (\n ? P n ? f 0 ? f n) > ? -- > ? -- Can be proved by moving from m to minimal i such that (P i), > ? -- and by applying? f-yes, f-no. > > theorem :? ? m ? P m ? Even (f 0) > theorem m pm = > ? let > ? ? (n , pn , f0?fn) = minimizeSolution m pm > ? ? fn?n+n? = f-yes n pn > ? ? even-fn = subst Even (sym fn?n+n) (even-n+n n) > ? in > ? subst Even (sym f0?fn) even-fn > ------------------------------------------------------------------ > > > First, I think that? (Even (f 0))? cannot be proved. Right? > > Further, the condition? "if (f 0) terminates"? is replaced with > "? m ? P m". > > I have an impression that `theorem' represents (I), in a certain sense, > and proves it. > Am I missing something? > > In general: > this approach works when the programmer is able to formulate the > statement > ? ? ? ? ? ? ? ? ? ? "(g x1 ... xn)? terminates" > > as some Agda predicate in? x1 ... xn. > For example, this is possible for any semidecision procedure? g > (?) > I wonder: how generic is this approach. > > What people think? > > Thanks, > > ------ > Sergei > > > > > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -- Martin Escardo http://www.cs.bham.ac.uk/~mhe From mechvel at botik.ru Mon Feb 5 12:36:53 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Mon, 05 Feb 2018 14:36:53 +0300 Subject: [Agda] proofs for (NON)TERMINATING In-Reply-To: References: <1516713243.13614.14.camel@scico.botik.ru> <1517824117.2505.18.camel@one.mechvel.pereslavl.ru> Message-ID: <1517830613.2866.34.camel@one.mechvel.pereslavl.ru> On Mon, 2018-02-05 at 11:33 +0100, Jesper Cockx wrote: > > It is needed to represent and prove the statement > "if (f 0) terminates, then Even (f 0)" > (I). > I don't think it's possible to formulate inside Agda what it means for > a function with a {-# NON_TERMINATING #-} pragma to terminate. So I > also don't think it's possible to represent the statement you want. If > you want to reason in Agda about termination of functions, I'd > recommend to use the Delay monad as Nils suggested. Can anybody, please, demonstrate the usage of the Delay monad on the below example of f : ? ? ? and expressing the statement "if (f 0) terminates, then Even (f 0)" (I) ------------------------------------------------------------------- open import Relation.Nullary using (yes; no) open import Relation.Unary using (Decidable) open import Data.Nat using (?; suc; _+_) postulate P : ? ? Set p? : Decidable P {-# NON_TERMINATING #-} f : ? ? ? -- find n satisfying (P n) and return n + n f n with p? n ... | yes _ = n + n -- found ... | no _ = f (suc n) -- try next data Even : ? ? Set where even0 : Even 0 even+2 : {n : ?} ? Even n ? Even (suc (suc n)) postulate even-n+n : ? n ? Even (n + n) -- the proof skipped for brevity ---------------------------------------------------------------------- Thanks, ------ Sergei From nad at cse.gu.se Mon Feb 5 14:06:51 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Mon, 5 Feb 2018 14:06:51 +0100 Subject: [Agda] proofs for (NON)TERMINATING In-Reply-To: <1517830613.2866.34.camel@one.mechvel.pereslavl.ru> References: <1516713243.13614.14.camel@scico.botik.ru> <1517824117.2505.18.camel@one.mechvel.pereslavl.ru> <1517830613.2866.34.camel@one.mechvel.pereslavl.ru> Message-ID: <441b6826-e57e-2678-92af-61e9336ee986@cse.gu.se> On 2018-02-05 12:36, Sergei Meshveliani wrote: > Can anybody, please, demonstrate the usage of the Delay monad on the > below example of f : ? ? ? and expressing the statement > > "if (f 0) terminates, then Even (f 0)" (I) .agda-lib file: depend: equality delay-monad .agda file: module _ where open import Delay-monad open import Delay-monad.Always open import Delay-monad.Monad open import Equality.Propositional open import Prelude open import Monad equality-with-J Even : ? ? Set Even n = ? ? k ? n ? k + k module _ (P : ? ? Set) (p? : ? n ? Dec (P n)) where f : ? {i} ? ? ? Delay ? i f n with p? n ... | yes _ = return (n + n) ... | no _ = later ? { .force ? f (suc n) } f-even : ? {i} n ? ? i Even (f n) f-even n with p? n ... | yes _ = now (n , refl) ... | no _ = later ? { .force ? f-even (suc n) } -- /NAD From mechvel at botik.ru Tue Feb 6 17:15:20 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Tue, 06 Feb 2018 19:15:20 +0300 Subject: [Agda] proofs for (NON)TERMINATING In-Reply-To: <441b6826-e57e-2678-92af-61e9336ee986@cse.gu.se> References: <1516713243.13614.14.camel@scico.botik.ru> <1517824117.2505.18.camel@one.mechvel.pereslavl.ru> <1517830613.2866.34.camel@one.mechvel.pereslavl.ru> <441b6826-e57e-2678-92af-61e9336ee986@cse.gu.se> Message-ID: <1517933720.2518.5.camel@one.mechvel.pereslavl.ru> On Mon, 2018-02-05 at 14:06 +0100, Nils Anders Danielsson wrote: > On 2018-02-05 12:36, Sergei Meshveliani wrote: > > Can anybody, please, demonstrate the usage of the Delay monad on the > > below example of f : ? ? ? and expressing the statement > > > > "if (f 0) terminates, then Even (f 0)" (I) > > .agda-lib file: > > depend: equality delay-monad > > .agda file: > > module _ where > > open import Delay-monad > open import Delay-monad.Always > open import Delay-monad.Monad > open import Equality.Propositional > open import Prelude > > open import Monad equality-with-J > > Even : ? ? Set > Even n = ? ? k ? n ? k + k > > module _ > (P : ? ? Set) > (p? : ? n ? Dec (P n)) > where > > f : ? {i} ? ? ? Delay ? i > f n with p? n > ... | yes _ = return (n + n) > ... | no _ = later ? { .force ? f (suc n) } > > f-even : ? {i} n ? ? i Even (f n) > f-even n with p? n > ... | yes _ = now (n , refl) > ... | no _ = later ? { .force ? f-even (suc n) } > Thank you. I shall keep this in mind. One day the DoCon-A library may need to prove something about a function with unsolved termination domain. ------ Sergei From wadler at inf.ed.ac.uk Thu Feb 8 22:36:13 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Thu, 8 Feb 2018 17:36:13 -0400 Subject: [Agda] Superscript l and r in unicode Message-ID: The documentation says that one should type \^l to get a superscript l in unicode, and similarly for superscript r. However, the documentation also says that one should type the exact same sequence \^l to get a leftward pointing superscript arrow, and similarly with r for a rightward pointing arrow. In my emacs, the latter wins out. How do I get a superscript l or r letter? Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From gergo at erdi.hu Fri Feb 9 06:47:14 2018 From: gergo at erdi.hu (=?UTF-8?B?RHIuIMOJUkRJIEdlcmfFkQ==?=) Date: Fri, 9 Feb 2018 13:47:14 +0800 Subject: [Agda] Superscript l and r in unicode In-Reply-To: References: Message-ID: You should get a menu of possible Unicode characters in the minibuf when you type \^l, and you can choose from them with cursor keys. The selection is "sticky" in that the next insert with default to the last selection. On Feb 9, 2018 13:44, "Philip Wadler" wrote: The documentation says that one should type \^l to get a superscript l in unicode, and similarly for superscript r. However, the documentation also says that one should type the exact same sequence \^l to get a leftward pointing superscript arrow, and similarly with r for a rightward pointing arrow. In my emacs, the latter wins out. How do I get a superscript l or r letter? Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. _______________________________________________ Agda mailing list Agda at lists.chalmers.se https://lists.chalmers.se/mailman/listinfo/agda -------------- next part -------------- An HTML attachment was scrubbed... URL: From nyraghu27132 at gmail.com Sat Feb 10 07:59:53 2018 From: nyraghu27132 at gmail.com (N. Raghavendra) Date: Sat, 10 Feb 2018 12:29:53 +0530 Subject: [Agda] Superscript l and r in unicode In-Reply-To: (Philip Wadler's message of "Thu, 8 Feb 2018 17:36:13 -0400") References: Message-ID: <87d11d2uty.fsf@gmail.com> At 2018-02-08T17:36:13-04:00, Philip Wadler wrote: > The documentation says that one should type > > ? \^l > > to get a superscript l in unicode, and similarly for superscript r. > > However, the documentation also says that one should type the exact > same sequence > > ? \^l > > to get a leftward pointing superscript arrow, and similarly with r > for a rightward pointing arrow. > > In my emacs, the latter wins out. How do I get a superscript l or r > letter? In my installation of `agda-input', when I type "\^l", the minibuffer window shows the choices "1.? 2.? 3.? 4.?"; to choose "?", I now type "4", and to choose "?", I now type "1". Moreover, the package makes the last choice the current default. Thus, after I type "?" with "\^l3", then "\^l[SPC]" inserts "?" into the buffer. Raghu. -- N. Raghavendra , http://www.retrotexts.net/ Harish-Chandra Research Institute, http://www.hri.res.in/ From wadler at inf.ed.ac.uk Sat Feb 10 13:35:32 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Sat, 10 Feb 2018 08:35:32 -0400 Subject: [Agda] Superscript l and r in unicode In-Reply-To: <87d11d2uty.fsf@gmail.com> References: <87d11d2uty.fsf@gmail.com> Message-ID: Thank you to Gerg? ?rdi and N. Raghavendra for helping with my newbie question. I had seen only the options for leftward arrows after typing \^l, and failed to spot that superscript l was the final option. Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 10 February 2018 at 02:59, N. Raghavendra wrote: > At 2018-02-08T17:36:13-04:00, Philip Wadler wrote: > > > The documentation says that one should type > > > > \^l > > > > to get a superscript l in unicode, and similarly for superscript r. > > > > However, the documentation also says that one should type the exact > > same sequence > > > > \^l > > > > to get a leftward pointing superscript arrow, and similarly with r > > for a rightward pointing arrow. > > > > In my emacs, the latter wins out. How do I get a superscript l or r > > letter? > > In my installation of `agda-input', when I type "\^l", the minibuffer > window shows the choices "1.? 2.? 3.? 4.?"; to choose "?", I now type "4", > and to choose "?", I now type "1". Moreover, the package makes the last > choice the current default. Thus, after I type "?" with "\^l3", then > "\^l[SPC]" inserts "?" into the buffer. > > Raghu. > > -- > N. Raghavendra , http://www.retrotexts.net/ > Harish-Chandra Research Institute, http://www.hri.res.in/ > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From mechvel at botik.ru Sat Feb 10 14:45:07 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Sat, 10 Feb 2018 16:45:07 +0300 Subject: [Agda] type check with large constant Message-ID: <1518270307.2970.20.camel@one.mechvel.pereslavl.ru> Dear all, I need to type-check a program that uses a certain large global constant a. And the function test2 below is type-checked much longer than test1, It takes too long. This is Agda 2.5.3. Can people, please, explain the effect? -------------------------------------------------------------- open import Function using (_?_; _$_) open import Relation.Binary.PropositionalEquality using (_?_; cong) open import Data.Nat using (?; suc; _+_; _?_) open import Data.Nat.Properties using (+-comm) a : ? a = 12345 test1 : ? n ? (a + n) ? a ? (n + a) ? a test1 n = cong (_? a) (+-comm a n) test2 : ? n ? suc ((a + n) ? a) ? suc ((n + a) ? a) test2 n = cong (suc ? (_? a)) (+-comm a n) -- cong suc (test1 n) --------------------------------------------------------------- The interactive type-checker highlights the expression cong (suc ? (_? a)) (+-comm a n) and hangs for a long time. Also test2 type-checks fast if it is implemented as cong suc (test1 n). I can type-check the whole program with, say, a = 7. But for a good run-time performance `a' needs to be large (and it relies on that the run-time arithmetic is built-in). Thanks, ------ Sergei From apostolis.xekoukoulotakis at gmail.com Sat Feb 10 19:56:14 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Sat, 10 Feb 2018 20:56:14 +0200 Subject: [Agda] Coinduction and Instance Arguments - is it possible? Message-ID: I have a datatype (called "Bob") that tracks whether a variable has been used or not. I have an index datatype that points to multiple variables in the datatype Bob without depending on the datatype "Bob" so as to not become invalid when "Bob" changes to reflect the unavailability of a variable. The datatype "Belongs" depends on an Index and Bob. It proves that all the variables pointed by the index are actually available. Every time Bob, changes, a new Belongs datatype is needed. I want this proof to be generated by instance resolution. I am not sure if this is possible when the index points to an infinite number of variables, ie if we have coinductive types. Here is the example. ------------------------- module Test where open import Data.Bool open import Size mutual data Bob (i : Size) : Set where more : Bob i ? Bool ? Bob i none : Bob i twoPaths : Bob i ? Bob i ? Bob i inf : Bob? i ? Bob i record Bob? (i : Size) : Set where coinductive field bob : {j : Size< i} ? Bob j open Bob? data Bel : Set where bel : Bel nbel : Bel mutual data Index (i : Size) : Set where here : Index i more : Index i ? Bel ? Index i left : Index i ? Index i right : Index i ? Index i inf : Index? i ? Index i record Index? (i : Size) : Set where coinductive field index : {j : Size< i} ? Index j open Index? mutual data Belongs {i : Size} : Index i ? Bob i ? Set where instance here : ?{b} ? Belongs here (more b true) moreBel : ?{ind b} ? {{is : Belongs ind b}} ? Belongs (more ind bel) (more b true) morenBel : ?{ind b bool} ? {{is : Belongs ind b}} ? Belongs (more ind nbel) (more b bool) left : ?{ind bl br} ? {{is : Belongs ind bl}} ? Belongs (left ind) (twoPaths bl br) right : ?{ind bl br} ? {{is : Belongs ind br}} ? Belongs (right ind) (twoPaths bl br) inf : ?{ind? bob?} ? {{is? : Belongs? ind? bob?}} ? Belongs (inf ind?) (inf bob?) record Belongs? {i : Size} (ind? : Index? i) (bob? : Bob? i) : Set where coinductive field belongs : {j : Size< i} ? Belongs (index ind?) (bob bob?) open Belongs? mutual b : ?{i} ? Bob i b = more (inf b?) true b? : ?{i} ? Bob? i bob b? = b mutual ind : ?{i} ? Index i ind = more (inf ind?) bel ind? : ?{i} ? Index? i index ind? = ind data R : Set where r : R test : {{bl : Belongs ind b}} ? R test = r -- I want instance resolution to create this datatype. mutual bl : {i : Size} ? Belongs {i} ind b bl = moreBel {{inf {{bl?}}}} bl? : {i : Size} ? Belongs? {i} ind? b? belongs bl? = bl f : R f = test -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jesper at sikanda.be Sun Feb 11 15:17:56 2018 From: Jesper at sikanda.be (Jesper Cockx) Date: Sun, 11 Feb 2018 15:17:56 +0100 Subject: [Agda] Coinduction and Instance Arguments - is it possible? In-Reply-To: References: Message-ID: Hi Apostolis, Instance search is not meant to construct new recursive (or corecursive) solutions, so it is not able to automatically find your term bl unless you've already defined it somewhere before. However, are you sure the types 'Index' and 'Belongs' define what you want them to mean? Usually you have one infinite datastructure (such as a stream) and a type of *finite* indices (such as natural numbers). So I don't think you need the 'inf' constructor for Index and Belongs. Without these constructors, it should be possible to have instance search construct proofs of Belongs, since then all proofs are finite. I hope this helps. -- Jesper ps: A remark about terminology: you seem to be using the word 'datatype' when you mean 'element of the datatype'. On Sat, Feb 10, 2018 at 7:56 PM, Apostolis Xekoukoulotakis < apostolis.xekoukoulotakis at gmail.com> wrote: > I have a datatype (called "Bob") that tracks whether a variable has been > used or not. > I have an index datatype that points to multiple variables in the datatype > Bob without depending on the datatype "Bob" so as to not become invalid > when "Bob" changes to reflect the unavailability of a variable. > > The datatype "Belongs" depends on an Index and Bob. It proves that all the > variables pointed by the index are actually available. > > Every time Bob, changes, a new Belongs datatype is needed. I want this > proof to be generated by instance resolution. > > I am not sure if this is possible when the index points to an infinite > number of variables, ie if we have coinductive types. > > Here is the example. > > ------------------------- > > module Test where > > open import Data.Bool > open import Size > > mutual > > data Bob (i : Size) : Set where > more : Bob i ? Bool ? Bob i > none : Bob i > twoPaths : Bob i ? Bob i ? Bob i > inf : Bob? i ? Bob i > > record Bob? (i : Size) : Set where > coinductive > field > bob : {j : Size< i} ? Bob j > > open Bob? > > data Bel : Set where > bel : Bel > nbel : Bel > > mutual > > data Index (i : Size) : Set where > here : Index i > more : Index i ? Bel ? Index i > left : Index i ? Index i > right : Index i ? Index i > inf : Index? i ? Index i > > record Index? (i : Size) : Set where > coinductive > field > index : {j : Size< i} ? Index j > > open Index? > > mutual > > data Belongs {i : Size} : Index i ? Bob i ? Set where > instance > here : ?{b} ? Belongs here (more b true) > moreBel : ?{ind b} ? {{is : Belongs ind b}} ? Belongs (more ind bel) > (more b true) > morenBel : ?{ind b bool} ? {{is : Belongs ind b}} ? Belongs (more > ind nbel) (more b bool) > left : ?{ind bl br} ? {{is : Belongs ind bl}} ? Belongs (left ind) > (twoPaths bl br) > right : ?{ind bl br} ? {{is : Belongs ind br}} ? Belongs (right ind) > (twoPaths bl br) > inf : ?{ind? bob?} ? {{is? : Belongs? ind? bob?}} ? Belongs (inf > ind?) (inf bob?) > > record Belongs? {i : Size} (ind? : Index? i) (bob? : Bob? i) : Set where > coinductive > field > belongs : {j : Size< i} ? Belongs (index ind?) (bob bob?) > > open Belongs? > > mutual > > b : ?{i} ? Bob i > b = more (inf b?) true > > b? : ?{i} ? Bob? i > bob b? = b > > > mutual > > ind : ?{i} ? Index i > ind = more (inf ind?) bel > > ind? : ?{i} ? Index? i > index ind? = ind > > > data R : Set where > r : R > > test : {{bl : Belongs ind b}} ? R > test = r > > > -- I want instance resolution to create this datatype. > > mutual > > bl : {i : Size} ? Belongs {i} ind b > bl = moreBel {{inf {{bl?}}}} > > bl? : {i : Size} ? Belongs? {i} ind? b? > belongs bl? = bl > > > f : R > f = test > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apostolis.xekoukoulotakis at gmail.com Sun Feb 11 19:55:04 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Sun, 11 Feb 2018 20:55:04 +0200 Subject: [Agda] Coinduction and Instance Arguments - is it possible? In-Reply-To: References: Message-ID: Yes, I need to remove Inf and insert a finite version of it. There are some repercussions though which I need to deal with. Let us say that we have a stream that gives two natural numbers at a time. Now, with agda, you can give the same stream to two different functions. The first will use the first natural number and the second the second. In our case, the computation can be destructive. Thus after the first function, we will have a stream in which the first number has been used. Because an infinite index on the stream does not allow us to produce a "belongs" proof with instance resolution, I think that I should call all the stream as used. That would force people to split the stream into two infinite parts and then give each part to the corresponding function. (Splitting the stream might be tricky because we do not permit "aliasing", we need to prove that the two new streams do not use a common resource/memory/variable.) I hope it works. ps : an "element of a datatype" is too big of a phrase to use. :) On Sun, Feb 11, 2018 at 4:17 PM, Jesper Cockx wrote: > Hi Apostolis, > > Instance search is not meant to construct new recursive (or corecursive) > solutions, so it is not able to automatically find your term bl unless > you've already defined it somewhere before. > > However, are you sure the types 'Index' and 'Belongs' define what you want > them to mean? Usually you have one infinite datastructure (such as a > stream) and a type of *finite* indices (such as natural numbers). So I > don't think you need the 'inf' constructor for Index and Belongs. Without > these constructors, it should be possible to have instance search construct > proofs of Belongs, since then all proofs are finite. > > I hope this helps. > > -- Jesper > > > ps: A remark about terminology: you seem to be using the word 'datatype' > when you mean 'element of the datatype'. > > On Sat, Feb 10, 2018 at 7:56 PM, Apostolis Xekoukoulotakis < > apostolis.xekoukoulotakis at gmail.com> wrote: > >> I have a datatype (called "Bob") that tracks whether a variable has been >> used or not. >> I have an index datatype that points to multiple variables in the >> datatype Bob without depending on the datatype "Bob" so as to not become >> invalid when "Bob" changes to reflect the unavailability of a variable. >> >> The datatype "Belongs" depends on an Index and Bob. It proves that all >> the variables pointed by the index are actually available. >> >> Every time Bob, changes, a new Belongs datatype is needed. I want this >> proof to be generated by instance resolution. >> >> I am not sure if this is possible when the index points to an infinite >> number of variables, ie if we have coinductive types. >> >> Here is the example. >> >> ------------------------- >> >> module Test where >> >> open import Data.Bool >> open import Size >> >> mutual >> >> data Bob (i : Size) : Set where >> more : Bob i ? Bool ? Bob i >> none : Bob i >> twoPaths : Bob i ? Bob i ? Bob i >> inf : Bob? i ? Bob i >> >> record Bob? (i : Size) : Set where >> coinductive >> field >> bob : {j : Size< i} ? Bob j >> >> open Bob? >> >> data Bel : Set where >> bel : Bel >> nbel : Bel >> >> mutual >> >> data Index (i : Size) : Set where >> here : Index i >> more : Index i ? Bel ? Index i >> left : Index i ? Index i >> right : Index i ? Index i >> inf : Index? i ? Index i >> >> record Index? (i : Size) : Set where >> coinductive >> field >> index : {j : Size< i} ? Index j >> >> open Index? >> >> mutual >> >> data Belongs {i : Size} : Index i ? Bob i ? Set where >> instance >> here : ?{b} ? Belongs here (more b true) >> moreBel : ?{ind b} ? {{is : Belongs ind b}} ? Belongs (more ind >> bel) (more b true) >> morenBel : ?{ind b bool} ? {{is : Belongs ind b}} ? Belongs (more >> ind nbel) (more b bool) >> left : ?{ind bl br} ? {{is : Belongs ind bl}} ? Belongs (left ind) >> (twoPaths bl br) >> right : ?{ind bl br} ? {{is : Belongs ind br}} ? Belongs (right >> ind) (twoPaths bl br) >> inf : ?{ind? bob?} ? {{is? : Belongs? ind? bob?}} ? Belongs (inf >> ind?) (inf bob?) >> >> record Belongs? {i : Size} (ind? : Index? i) (bob? : Bob? i) : Set where >> coinductive >> field >> belongs : {j : Size< i} ? Belongs (index ind?) (bob bob?) >> >> open Belongs? >> >> mutual >> >> b : ?{i} ? Bob i >> b = more (inf b?) true >> >> b? : ?{i} ? Bob? i >> bob b? = b >> >> >> mutual >> >> ind : ?{i} ? Index i >> ind = more (inf ind?) bel >> >> ind? : ?{i} ? Index? i >> index ind? = ind >> >> >> data R : Set where >> r : R >> >> test : {{bl : Belongs ind b}} ? R >> test = r >> >> >> -- I want instance resolution to create this datatype. >> >> mutual >> >> bl : {i : Size} ? Belongs {i} ind b >> bl = moreBel {{inf {{bl?}}}} >> >> bl? : {i : Size} ? Belongs? {i} ind? b? >> belongs bl? = bl >> >> >> f : R >> f = test >> >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell at gmail.com Mon Feb 12 08:18:36 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Mon, 12 Feb 2018 08:18:36 +0100 Subject: [Agda] type check with large constant In-Reply-To: <1518270307.2970.20.camel@one.mechvel.pereslavl.ru> References: <1518270307.2970.20.camel@one.mechvel.pereslavl.ru> Message-ID: I haven't looked at what the type checker is doing in detail that makes test2 so extremely slow, but note that built-in arithmetic does not kick in for open terms. In your example `(a + n) ? a` contains a free variable `n`, if the type checker has to evaluate it (which I suspect it does for test2, but not test1) it will use the non-built-in recursive definitions for `_+_` and `_?_`. I would advise abstracting over `a` whenever you can. / Ulf On Sat, Feb 10, 2018 at 2:45 PM, Sergei Meshveliani wrote: > Dear all, > > I need to type-check a program that uses a certain large global constant > a. > And the function test2 below is type-checked much longer than test1, > It takes too long. > This is Agda 2.5.3. > > Can people, please, explain the effect? > > -------------------------------------------------------------- > open import Function using (_?_; _$_) > open import Relation.Binary.PropositionalEquality using (_?_; cong) > open import Data.Nat using (?; suc; _+_; _?_) > open import Data.Nat.Properties using (+-comm) > > a : ? > a = 12345 > > test1 : ? n ? (a + n) ? a ? (n + a) ? a > test1 n = cong (_? a) (+-comm a n) > > test2 : ? n ? suc ((a + n) ? a) ? suc ((n + a) ? a) > test2 n = cong (suc ? (_? a)) (+-comm a n) > > -- cong suc (test1 n) > --------------------------------------------------------------- > > The interactive type-checker highlights the expression > cong (suc ? (_? a)) (+-comm a n) > > and hangs for a long time. > > Also test2 type-checks fast if it is implemented as > cong suc (test1 n). > > I can type-check the whole program with, say, a = 7. > But for a good run-time performance `a' needs to be large > (and it relies on that the run-time arithmetic is built-in). > > Thanks, > > ------ > Sergei > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mechvel at botik.ru Mon Feb 12 16:57:18 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Mon, 12 Feb 2018 18:57:18 +0300 Subject: [Agda] type check with large constant In-Reply-To: References: <1518270307.2970.20.camel@one.mechvel.pereslavl.ru> Message-ID: <1518451038.2411.28.camel@one.mechvel.pereslavl.ru> On Mon, 2018-02-12 at 08:18 +0100, Ulf Norell wrote: > I haven't looked at what the type checker is doing in detail that > makes test2 so extremely slow, but note that built-in arithmetic does > not kick in for open terms. In your example `(a + n) ? a` contains a > free variable `n`, if the type checker has to evaluate it (which I > suspect it does for test2, but not test1) it will use the non-built-in > recursive definitions for `_+_` and `_?_`. Did you mean `a' being free there rather than `n' ? As to `a', it is a constant, it is substituted with 12345, at some stage. I do not know of whether this occurrence is qualified as free. > I would advise abstracting over `a` whenever you can. Thank you for your note. I shall think about this. ------ Sergei > On Sat, Feb 10, 2018 at 2:45 PM, Sergei Meshveliani > wrote: > Dear all, > > I need to type-check a program that uses a certain large > global constant a. > And the function test2 below is type-checked much longer > than test1, It takes too long. > This is Agda 2.5.3. > > Can people, please, explain the effect? > > -------------------------------------------------------------- > open import Function using (_?_; _$_) > open import Relation.Binary.PropositionalEquality using (_?_; > cong) > open import Data.Nat using (?; suc; _+_; _?_) > open import Data.Nat.Properties using (+-comm) > > a : ? > a = 12345 > > test1 : ? n ? (a + n) ? a ? (n + a) ? a > test1 n = cong (_? a) (+-comm a n) > > test2 : ? n ? suc ((a + n) ? a) ? suc ((n + a) ? a) > test2 n = cong (suc ? (_? a)) (+-comm a n) > > -- cong suc (test1 n) > --------------------------------------------------------------- > > The interactive type-checker highlights the expression > cong (suc ? (_? a)) (+-comm a n) > > and hangs for a long time. > > Also test2 type-checks fast if it is implemented as > cong suc (test1 n). > > I can type-check the whole program with, say, a = 7. > But for a good run-time performance `a' needs to be large > (and it relies on that the run-time arithmetic is built-in). > > Thanks, > > ------ > Sergei > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > From ulf.norell at gmail.com Mon Feb 12 17:10:02 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Mon, 12 Feb 2018 17:10:02 +0100 Subject: [Agda] type check with large constant In-Reply-To: <1518451038.2411.28.camel@one.mechvel.pereslavl.ru> References: <1518270307.2970.20.camel@one.mechvel.pereslavl.ru> <1518451038.2411.28.camel@one.mechvel.pereslavl.ru> Message-ID: I did mean `n`, which is a free variable of the term `(a + n) ? a`. Built-in arithmetic can only do its thing if all arguments to the built-in function are constants, but in this case `n` is an argument to the function and its value is not fixed at type checking time. / Ulf On Mon, Feb 12, 2018 at 4:57 PM, Sergei Meshveliani wrote: > On Mon, 2018-02-12 at 08:18 +0100, Ulf Norell wrote: > > I haven't looked at what the type checker is doing in detail that > > makes test2 so extremely slow, but note that built-in arithmetic does > > not kick in for open terms. In your example `(a + n) ? a` contains a > > free variable `n`, if the type checker has to evaluate it (which I > > suspect it does for test2, but not test1) it will use the non-built-in > > recursive definitions for `_+_` and `_?_`. > > > Did you mean `a' being free there rather than `n' ? > > As to `a', it is a constant, it is substituted with 12345, at some > stage. I do not know of whether this occurrence is qualified as free. > > > I would advise abstracting over `a` whenever you can. > > Thank you for your note. I shall think about this. > > ------ > Sergei > > > > > On Sat, Feb 10, 2018 at 2:45 PM, Sergei Meshveliani > > wrote: > > Dear all, > > > > I need to type-check a program that uses a certain large > > global constant a. > > And the function test2 below is type-checked much longer > > than test1, It takes too long. > > This is Agda 2.5.3. > > > > Can people, please, explain the effect? > > > > -------------------------------------------------------------- > > open import Function using (_?_; _$_) > > open import Relation.Binary.PropositionalEquality using (_?_; > > cong) > > open import Data.Nat using (?; suc; _+_; _?_) > > open import Data.Nat.Properties using (+-comm) > > > > a : ? > > a = 12345 > > > > test1 : ? n ? (a + n) ? a ? (n + a) ? a > > test1 n = cong (_? a) (+-comm a n) > > > > test2 : ? n ? suc ((a + n) ? a) ? suc ((n + a) ? a) > > test2 n = cong (suc ? (_? a)) (+-comm a n) > > > > -- cong suc (test1 n) > > --------------------------------------------------------------- > > > > The interactive type-checker highlights the expression > > cong (suc ? (_? a)) (+-comm a n) > > > > and hangs for a long time. > > > > Also test2 type-checks fast if it is implemented as > > cong suc (test1 n). > > > > I can type-check the whole program with, say, a = 7. > > But for a good run-time performance `a' needs to be large > > (and it relies on that the run-time arithmetic is built-in). > > > > Thanks, > > > > ------ > > Sergei > > > > _______________________________________________ > > Agda mailing list > > Agda at lists.chalmers.se > > https://lists.chalmers.se/mailman/listinfo/agda > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Graham.Hutton at nottingham.ac.uk Mon Feb 12 17:42:30 2018 From: Graham.Hutton at nottingham.ac.uk (Graham Hutton) Date: Mon, 12 Feb 2018 16:42:30 +0000 Subject: [Agda] Midlands Graduate School 2018 Message-ID: Dear all, Midlands Graduate School (MGS) registration is now open! Eight courses on dependently typed programming, category theory, lambda calculus, denotational semantics, and more. 9-13 April 2018, Nottingham, UK. Spaces are limited, so early registration is recommended. Please share! http://tinyurl.com/MGS18NOTT Best wishes, Graham Hutton and Henrik Nilsson ========================================================== *** CALL FOR PARTICIPATION *** Midlands Graduate School 2018 9-13 April 2018, Nottingham, UK http://tinyurl.com/MGS18NOTT BACKGROUND: The Midlands Graduate School (MGS) in the Foundations of Computing Science provides an intensive course of lectures on the mathematical foundations of computing. The MGS has been running since 1999, and is aimed at PhD students in their first or second year of study, but the school is open to everyone, and has increasingly seen participation from industry. We welcome participants from all over the world! COURSES: Eight courses will be given. Participants usually take all the introductory courses and choose additional options from the advanced courses depending on their interests. Invited course - Type-Driven Development with Idris, Edwin Brady Introductory courses - Lambda Calculus, Venanzio Capretta - Category Theory, Roy Crole - Domain Theory and Denotational Semantics, Achim Jung Advanced courses - Univalent Foundations, Benedikt Ahrens - Coalgebra, Alexander Kurz - Separation Logic, Georg Struth - Machine Learning, Michel Valstar REGISTRATION: Registration is ?550 for student, academic and independent participants, and ?850 for industry participants. The fee includes 5 nights single en-suite accommodation (Sun-Thu), lunch and coffee breaks, and the conference dinner. The registration deadline is Friday 16th March. Spaces are limited, so please register early to secure your place. SPONSORSHIP: We offer a range of sponsorship opportunities for industry (bronze, silver and gold), each with specific benefits. Please see the website for further details. ========================================================== This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please contact the sender and delete the email and attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. Email communications with the University of Nottingham may be monitored where permitted by law. From fhi.1990 at gmail.com Mon Feb 12 19:52:17 2018 From: fhi.1990 at gmail.com (=?UTF-8?Q?Frederik_Hangh=C3=B8j_Iversen?=) Date: Mon, 12 Feb 2018 19:52:17 +0100 Subject: [Agda] C preprocessor with agda Message-ID: Can I somehow use the C preprocessor with Agda? -- Regards *Frederik Hangh?j Iversen* -------------- next part -------------- An HTML attachment was scrubbed... URL: From wadler at inf.ed.ac.uk Thu Feb 15 16:52:09 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Thu, 15 Feb 2018 13:52:09 -0200 Subject: [Agda] Hoogle for Agda? Message-ID: Is there anything like Hoogle for Agda? It would save newbies like me a *lot* of time. Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From guillaume.allais at ens-lyon.org Thu Feb 15 17:01:51 2018 From: guillaume.allais at ens-lyon.org (Guillaume Allais) Date: Thu, 15 Feb 2018 17:01:51 +0100 Subject: [Agda] Hoogle for Agda? In-Reply-To: References: Message-ID: Hi Phil, There's a *very basic* search functionality which you can invoke from emacs using C-c C-z. You can then input a space-separated list of identifiers and strings and Agda will return all the identifiers which: - are in scope in the current module - contain in their type *all* of the identifiers mentioned - contain as substring *all* of the mentioned strings For instance, using a fairly recent version of the stdlib, from the module containing: =========================================== open import Data.Nat open import Data.Nat.Properties =========================================== C-c C-z RET _+_ _*_ RET will return =========================================== Definitions about _+_, _*_ ? *-+-isCommutativeSemiring ????????? : .Algebra.Structures.IsCommutativeSemiring ??????????? .Agda.Builtin.Equality._?_ _+_ _*_ 0 1 ? *-cancel?-? ????????? : {i j : ?} (k : ?) ? ??????????? i + k * i .Agda.Builtin.Equality.? j + k * j ? ??????????? i .Agda.Builtin.Equality.? j ? *-distrib-+ ????????? : (.Agda.Builtin.Equality._?_ ???????????? .Algebra.FunctionProperties.DistributesOver _*_) ??????????? _+_ ? *-distrib?-+ ????????? : (.Agda.Builtin.Equality._?_ ???????????? .Algebra.FunctionProperties.DistributesOver? _*_) ??????????? _+_ ? *-distrib?-+ ????????? : (.Agda.Builtin.Equality._?_ ???????????? .Algebra.FunctionProperties.DistributesOver? _*_) ??????????? _+_ ? +-*-suc : (m n : ?) ? m * suc n .Agda.Builtin.Equality.? m + m * n ? ^-distrib?-+-* ????????? : (m n p : ?) ? ??????????? (m ^ (n + p)) .Agda.Builtin.Equality.? (m ^ n) * (m ^ p) ? distrib?-*-+ ????????? : (.Agda.Builtin.Equality._?_ ???????????? .Algebra.FunctionProperties.DistributesOver? _*_) ??????????? _+_ ? im?jm+n?[i?j]m?n ????????? : (i j m n : ?) ? ??????????? i * m .Agda.Builtin.Equality.? j * m + n ? ??????????? (i ? j) * m .Agda.Builtin.Equality.? n ? isCommutativeSemiring ????????? : .Algebra.Structures.IsCommutativeSemiring ??????????? .Agda.Builtin.Equality._?_ _+_ _*_ 0 1 =========================================== and C-c C-z RET _+_ _*_ "distr" RET will filter definitions which are not about distributivity: =========================================== Definitions about _+_, _*_, "distr" ? *-distrib-+ ?? : (.Agda.Builtin.Equality._?_ ????? .Algebra.FunctionProperties.DistributesOver _*_) ???? _+_ ? *-distrib?-+ ?? : (.Agda.Builtin.Equality._?_ ????? .Algebra.FunctionProperties.DistributesOver? _*_) ???? _+_ ? *-distrib?-+ ?? : (.Agda.Builtin.Equality._?_ ????? .Algebra.FunctionProperties.DistributesOver? _*_) ???? _+_ ? ^-distrib?-+-* ?? : (m n p : ?) ? ???? (m ^ (n + p)) .Agda.Builtin.Equality.? (m ^ n) * (m ^ p) ? distrib?-*-+ ?? : (.Agda.Builtin.Equality._?_ ????? .Algebra.FunctionProperties.DistributesOver? _*_) ???? _+_ =========================================== This search function respect the normalisation modifiers (that is the (C-u)* you can type before most commands) and will search types according to the normalisation level you've requested (and print results accordingly). Cheers, -- gallais On 15/02/18 16:52, Philip Wadler wrote: > Is there anything like Hoogle for Agda? It would save newbies like me > a *lot* of time. Cheers, -- P > > . ? \ Philip Wadler, Professor of Theoretical Computer Science, > . ? /\ School of Informatics, University of Edinburgh > .? /? \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From wadler at inf.ed.ac.uk Thu Feb 15 17:18:08 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Thu, 15 Feb 2018 14:18:08 -0200 Subject: [Agda] Hoogle for Agda? In-Reply-To: References: Message-ID: Thanks! What would help enormously is if I could do the same thing, *searching the entire standard library*. This basically requires someone to put together a huge import list and put it in a file (preferably available with the standard library). Has anyone done so, or could this be whipped together quickly? Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 15 February 2018 at 14:01, Guillaume Allais < guillaume.allais at ens-lyon.org> wrote: > Hi Phil, > > There's a *very basic* search functionality which you can invoke > from emacs using C-c C-z. You can then input a space-separated > list of identifiers and strings and Agda will return all the > identifiers which: > - are in scope in the current module > - contain in their type *all* of the identifiers mentioned > - contain as substring *all* of the mentioned strings > > For instance, using a fairly recent version of the stdlib, from > the module containing: > > =========================================== > open import Data.Nat > open import Data.Nat.Properties > =========================================== > > C-c C-z RET _+_ _*_ RET > > will return > > =========================================== > Definitions about _+_, _*_ > *-+-isCommutativeSemiring > : .Algebra.Structures.IsCommutativeSemiring > .Agda.Builtin.Equality._?_ _+_ _*_ 0 1 > *-cancel?-? > : {i j : ?} (k : ?) ? > i + k * i .Agda.Builtin.Equality.? j + k * j ? > i .Agda.Builtin.Equality.? j > *-distrib-+ > : (.Agda.Builtin.Equality._?_ > .Algebra.FunctionProperties.DistributesOver _*_) > _+_ > *-distrib?-+ > : (.Agda.Builtin.Equality._?_ > .Algebra.FunctionProperties.DistributesOver? _*_) > _+_ > *-distrib?-+ > : (.Agda.Builtin.Equality._?_ > .Algebra.FunctionProperties.DistributesOver? _*_) > _+_ > +-*-suc : (m n : ?) ? m * suc n .Agda.Builtin.Equality.? m + m * n > ^-distrib?-+-* > : (m n p : ?) ? > (m ^ (n + p)) .Agda.Builtin.Equality.? (m ^ n) * (m ^ p) > distrib?-*-+ > : (.Agda.Builtin.Equality._?_ > .Algebra.FunctionProperties.DistributesOver? _*_) > _+_ > im?jm+n?[i?j]m?n > : (i j m n : ?) ? > i * m .Agda.Builtin.Equality.? j * m + n ? > (i ? j) * m .Agda.Builtin.Equality.? n > isCommutativeSemiring > : .Algebra.Structures.IsCommutativeSemiring > .Agda.Builtin.Equality._?_ _+_ _*_ 0 1 > =========================================== > > and C-c C-z RET _+_ _*_ "distr" RET > will filter definitions which are not about distributivity: > > =========================================== > Definitions about _+_, _*_, "distr" > *-distrib-+ > : (.Agda.Builtin.Equality._?_ > .Algebra.FunctionProperties.DistributesOver _*_) > _+_ > *-distrib?-+ > : (.Agda.Builtin.Equality._?_ > .Algebra.FunctionProperties.DistributesOver? _*_) > _+_ > *-distrib?-+ > : (.Agda.Builtin.Equality._?_ > .Algebra.FunctionProperties.DistributesOver? _*_) > _+_ > ^-distrib?-+-* > : (m n p : ?) ? > (m ^ (n + p)) .Agda.Builtin.Equality.? (m ^ n) * (m ^ p) > distrib?-*-+ > : (.Agda.Builtin.Equality._?_ > .Algebra.FunctionProperties.DistributesOver? _*_) > _+_ > =========================================== > > This search function respect the normalisation modifiers (that > is the (C-u)* you can type before most commands) and will search > types according to the normalisation level you've requested (and > print results accordingly). > > Cheers, > -- > gallais > > > On 15/02/18 16:52, Philip Wadler wrote: > > Is there anything like Hoogle for Agda? It would save newbies like me a > *lot* of time. Cheers, -- P > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > > > _______________________________________________ > Agda mailing listAgda at lists.chalmers.sehttps://lists.chalmers.se/mailman/listinfo/agda > > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From liamoc at cse.unsw.edu.au Thu Feb 15 17:23:59 2018 From: liamoc at cse.unsw.edu.au (Liam O'Connor) Date: Fri, 16 Feb 2018 03:23:59 +1100 Subject: [Agda] Hoogle for Agda? In-Reply-To: References: Message-ID: The agda standard library has a makefile entry for an ?Everything.agda? that includes.. well? everything in the standard library. You can build that file, and it should suit your purposes. (It has a listing here?http://www.cse.chalmers.se/~nad/listings/lib/Everything.html) Regards, Liam On 16 February 2018 at 3:19:04 am, Philip Wadler (wadler at inf.ed.ac.uk) wrote: Thanks! What would help enormously is if I could do the same thing, *searching the entire standard library*. This basically requires someone to put together a huge import list and put it in a file (preferably available with the standard library). Has anyone done so, or could this be whipped together quickly? Cheers, -- P . ? \ Philip Wadler, Professor of Theoretical Computer Science, . ? /\ School of Informatics, University of Edinburgh .? /? \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 15 February 2018 at 14:01, Guillaume Allais wrote: Hi Phil, There's a *very basic* search functionality which you can invoke from emacs using C-c C-z. You can then input a space-separated list of identifiers and strings and Agda will return all the identifiers which: - are in scope in the current module - contain in their type *all* of the identifiers mentioned - contain as substring *all* of the mentioned strings For instance, using a fairly recent version of the stdlib, from the module containing: =========================================== open import Data.Nat open import Data.Nat.Properties =========================================== C-c C-z RET _+_ _*_ RET will return =========================================== Definitions about _+_, _*_ ? *-+-isCommutativeSemiring ????????? : .Algebra.Structures.IsCommutativeSemiring ??????????? .Agda.Builtin.Equality._?_ _+_ _*_ 0 1 ? *-cancel?-? ????????? : {i j : ?} (k : ?) ? ??????????? i + k * i .Agda.Builtin.Equality.? j + k * j ? ??????????? i .Agda.Builtin.Equality.? j ? *-distrib-+ ????????? : (.Agda.Builtin.Equality._?_ ???????????? .Algebra.FunctionProperties.DistributesOver _*_) ??????????? _+_ ? *-distrib?-+ ????????? : (.Agda.Builtin.Equality._?_ ???????????? .Algebra.FunctionProperties.DistributesOver? _*_) ??????????? _+_ ? *-distrib?-+ ????????? : (.Agda.Builtin.Equality._?_ ???????????? .Algebra.FunctionProperties.DistributesOver? _*_) ??????????? _+_ ? +-*-suc : (m n : ?) ? m * suc n .Agda.Builtin.Equality.? m + m * n ? ^-distrib?-+-* ????????? : (m n p : ?) ? ??????????? (m ^ (n + p)) .Agda.Builtin.Equality.? (m ^ n) * (m ^ p) ? distrib?-*-+ ????????? : (.Agda.Builtin.Equality._?_ ???????????? .Algebra.FunctionProperties.DistributesOver? _*_) ??????????? _+_ ? im?jm+n?[i?j]m?n ????????? : (i j m n : ?) ? ??????????? i * m .Agda.Builtin.Equality.? j * m + n ? ??????????? (i ? j) * m .Agda.Builtin.Equality.? n ? isCommutativeSemiring ????????? : .Algebra.Structures.IsCommutativeSemiring ??????????? .Agda.Builtin.Equality._?_ _+_ _*_ 0 1 =========================================== and C-c C-z RET _+_ _*_ "distr" RET will filter definitions which are not about distributivity: =========================================== Definitions about _+_, _*_, "distr" ? *-distrib-+ ?? : (.Agda.Builtin.Equality._?_ ????? .Algebra.FunctionProperties.DistributesOver _*_) ???? _+_ ? *-distrib?-+ ?? : (.Agda.Builtin.Equality._?_ ????? .Algebra.FunctionProperties.DistributesOver? _*_) ???? _+_ ? *-distrib?-+ ?? : (.Agda.Builtin.Equality._?_ ????? .Algebra.FunctionProperties.DistributesOver? _*_) ???? _+_ ? ^-distrib?-+-* ?? : (m n p : ?) ? ???? (m ^ (n + p)) .Agda.Builtin.Equality.? (m ^ n) * (m ^ p) ? distrib?-*-+ ?? : (.Agda.Builtin.Equality._?_ ????? .Algebra.FunctionProperties.DistributesOver? _*_) ???? _+_ =========================================== This search function respect the normalisation modifiers (that is the (C-u)* you can type before most commands) and will search types according to the normalisation level you've requested (and print results accordingly). Cheers, -- gallais On 15/02/18 16:52, Philip Wadler wrote: Is there anything like Hoogle for Agda? It would save newbies like me a *lot* of time. Cheers, -- P . ? \ Philip Wadler, Professor of Theoretical Computer Science, . ? /\ School of Informatics, University of Edinburgh .? /? \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. _______________________________________________ Agda mailing list Agda at lists.chalmers.se https://lists.chalmers.se/mailman/listinfo/agda _______________________________________________ Agda mailing list Agda at lists.chalmers.se https://lists.chalmers.se/mailman/listinfo/agda The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. _______________________________________________ Agda mailing list Agda at lists.chalmers.se https://lists.chalmers.se/mailman/listinfo/agda -------------- next part -------------- An HTML attachment was scrubbed... URL: From leo at halfaya.org Thu Feb 15 17:27:03 2018 From: leo at halfaya.org (John Leo) Date: Thu, 15 Feb 2018 16:27:03 +0000 Subject: [Agda] Hoogle for Agda? In-Reply-To: References: Message-ID: I recall a bachelors or masters student at Chalmers was working on such a project, but I?m not sure what became of it. John On Thu, Feb 15, 2018 at 7:52 AM Philip Wadler wrote: > Is there anything like Hoogle for Agda? It would save newbies like me a > *lot* of time. Cheers, -- P > -- John -------------- next part -------------- An HTML attachment was scrubbed... URL: From wadler at inf.ed.ac.uk Thu Feb 15 20:07:22 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Thu, 15 Feb 2018 17:07:22 -0200 Subject: [Agda] Hoogle for Agda? In-Reply-To: References: Message-ID: Thank you! Everything sounds like everything I need! I got the standard library from here: git clone https://github.com/agda/agda-stdlib.git ~/agda-stdlib This version does not have a file called Everything. It has no Makefile that I can spot. It does contain a file called GenerateEverything.hs, but it doesn't work for me: bruichladdich$ ghci GenerateEverything.hs > GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help > [1 of 1] Compiling Main ( GenerateEverything.hs, interpreted ) > GenerateEverything.hs:9:1: error: > Could not find module ?System.FilePath.Find? > Perhaps you meant > System.FilePath.Windows (from filepath-1.4.1.2) > System.FilePath (from filepath-1.4.1.2) > System.FilePath.Posix (from filepath-1.4.1.2) > Use -v to see a list of the files searched for. > | > 9 | import System.FilePath.Find > | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Failed, no modules loaded. > Prelude> What are my other options? Could someone simply add Everything.agda to https://github.com/agda/agda-stdlib.git, and then I could pull it? Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 15 February 2018 at 14:23, Liam O'Connor wrote: > > The agda standard library has a makefile entry for an ?Everything.agda? > that includes.. well? everything in the standard library. > > You can build that file, and it should suit your purposes. (It has a > listing here http://www.cse.chalmers.se/~nad/listings/lib/Everything.html) > > Regards, > Liam > > On 16 February 2018 at 3:19:04 am, Philip Wadler (wadler at inf.ed.ac.uk) > wrote: > > Thanks! > > What would help enormously is if I could do the same thing, *searching the > entire standard library*. This basically requires someone to put together a > huge import list and put it in a file (preferably available with the > standard library). Has anyone done so, or could this be whipped together > quickly? > > Cheers, -- P > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > On 15 February 2018 at 14:01, Guillaume Allais < > guillaume.allais at ens-lyon.org> wrote: > >> Hi Phil, >> >> There's a *very basic* search functionality which you can invoke >> from emacs using C-c C-z. You can then input a space-separated >> list of identifiers and strings and Agda will return all the >> identifiers which: >> - are in scope in the current module >> - contain in their type *all* of the identifiers mentioned >> - contain as substring *all* of the mentioned strings >> >> For instance, using a fairly recent version of the stdlib, from >> the module containing: >> >> =========================================== >> open import Data.Nat >> open import Data.Nat.Properties >> =========================================== >> >> C-c C-z RET _+_ _*_ RET >> >> will return >> >> =========================================== >> Definitions about _+_, _*_ >> *-+-isCommutativeSemiring >> : .Algebra.Structures.IsCommutativeSemiring >> .Agda.Builtin.Equality._?_ _+_ _*_ 0 1 >> *-cancel?-? >> : {i j : ?} (k : ?) ? >> i + k * i .Agda.Builtin.Equality.? j + k * j ? >> i .Agda.Builtin.Equality.? j >> *-distrib-+ >> : (.Agda.Builtin.Equality._?_ >> .Algebra.FunctionProperties.DistributesOver _*_) >> _+_ >> *-distrib?-+ >> : (.Agda.Builtin.Equality._?_ >> .Algebra.FunctionProperties.DistributesOver? _*_) >> _+_ >> *-distrib?-+ >> : (.Agda.Builtin.Equality._?_ >> .Algebra.FunctionProperties.DistributesOver? _*_) >> _+_ >> +-*-suc : (m n : ?) ? m * suc n .Agda.Builtin.Equality.? m + m * n >> ^-distrib?-+-* >> : (m n p : ?) ? >> (m ^ (n + p)) .Agda.Builtin.Equality.? (m ^ n) * (m ^ p) >> distrib?-*-+ >> : (.Agda.Builtin.Equality._?_ >> .Algebra.FunctionProperties.DistributesOver? _*_) >> _+_ >> im?jm+n?[i?j]m?n >> : (i j m n : ?) ? >> i * m .Agda.Builtin.Equality.? j * m + n ? >> (i ? j) * m .Agda.Builtin.Equality.? n >> isCommutativeSemiring >> : .Algebra.Structures.IsCommutativeSemiring >> .Agda.Builtin.Equality._?_ _+_ _*_ 0 1 >> =========================================== >> >> and C-c C-z RET _+_ _*_ "distr" RET >> will filter definitions which are not about distributivity: >> >> =========================================== >> Definitions about _+_, _*_, "distr" >> *-distrib-+ >> : (.Agda.Builtin.Equality._?_ >> .Algebra.FunctionProperties.DistributesOver _*_) >> _+_ >> *-distrib?-+ >> : (.Agda.Builtin.Equality._?_ >> .Algebra.FunctionProperties.DistributesOver? _*_) >> _+_ >> *-distrib?-+ >> : (.Agda.Builtin.Equality._?_ >> .Algebra.FunctionProperties.DistributesOver? _*_) >> _+_ >> ^-distrib?-+-* >> : (m n p : ?) ? >> (m ^ (n + p)) .Agda.Builtin.Equality.? (m ^ n) * (m ^ p) >> distrib?-*-+ >> : (.Agda.Builtin.Equality._?_ >> .Algebra.FunctionProperties.DistributesOver? _*_) >> _+_ >> =========================================== >> >> This search function respect the normalisation modifiers (that >> is the (C-u)* you can type before most commands) and will search >> types according to the normalisation level you've requested (and >> print results accordingly). >> >> Cheers, >> -- >> gallais >> >> >> On 15/02/18 16:52, Philip Wadler wrote: >> >> Is there anything like Hoogle for Agda? It would save newbies like me a >> *lot* of time. Cheers, -- P >> >> . \ Philip Wadler, Professor of Theoretical Computer Science, >> . /\ School of Informatics, University of Edinburgh >> . / \ and Senior Research Fellow, IOHK >> . http://homepages.inf.ed.ac.uk/wadler/ >> >> >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> >> >> _______________________________________________ >> Agda mailing listAgda at lists.chalmers.sehttps://lists.chalmers.se/mailman/listinfo/agda >> >> >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From wadler at inf.ed.ac.uk Thu Feb 15 20:25:07 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Thu, 15 Feb 2018 17:25:07 -0200 Subject: [Agda] Hoogle for Agda? In-Reply-To: References: Message-ID: OK, I've made it work. I used copy and paste from http://www.cse.chalmers.se/~nad/listings/lib/Everything.html and then changed all occurrences of "import" to "open import", and then using ^C ^Z does indeed work. It produces a large and difficult to read listing (because it finds many entries with huge types), but is much better than what I had previously (which was to guess where to look). Thank you to all for your help. If someone did produce Hoogle for Agda, it would be a huge boon. Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 15 February 2018 at 17:07, Philip Wadler wrote: > Thank you! Everything sounds like everything I need! > > I got the standard library from here: > > git clone https://github.com/agda/agda-stdlib.git ~/agda-stdlib > > This version does not have a file called Everything. It has no Makefile > that I can spot. It does contain a file called GenerateEverything.hs, but > it doesn't work for me: > > bruichladdich$ ghci GenerateEverything.hs >> GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help >> [1 of 1] Compiling Main ( GenerateEverything.hs, interpreted ) >> GenerateEverything.hs:9:1: error: >> Could not find module ?System.FilePath.Find? >> Perhaps you meant >> System.FilePath.Windows (from filepath-1.4.1.2) >> System.FilePath (from filepath-1.4.1.2) >> System.FilePath.Posix (from filepath-1.4.1.2) >> Use -v to see a list of the files searched for. >> | >> 9 | import System.FilePath.Find >> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> Failed, no modules loaded. >> Prelude> > > > What are my other options? Could someone simply add Everything.agda to > https://github.com/agda/agda-stdlib.git, and then I could pull it? > > Cheers, -- P > > > > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > On 15 February 2018 at 14:23, Liam O'Connor > wrote: > >> >> The agda standard library has a makefile entry for an ?Everything.agda? >> that includes.. well? everything in the standard library. >> >> You can build that file, and it should suit your purposes. (It has a >> listing here http://www.cse.chalmers.se/~nad/listings/lib/Everything.html >> ) >> >> Regards, >> Liam >> >> On 16 February 2018 at 3:19:04 am, Philip Wadler (wadler at inf.ed.ac.uk) >> wrote: >> >> Thanks! >> >> What would help enormously is if I could do the same thing, *searching >> the entire standard library*. This basically requires someone to put >> together a huge import list and put it in a file (preferably available with >> the standard library). Has anyone done so, or could this be whipped >> together quickly? >> >> Cheers, -- P >> >> . \ Philip Wadler, Professor of Theoretical Computer Science, >> . /\ School of Informatics, University of Edinburgh >> . / \ and Senior Research Fellow, IOHK >> . http://homepages.inf.ed.ac.uk/wadler/ >> >> On 15 February 2018 at 14:01, Guillaume Allais < >> guillaume.allais at ens-lyon.org> wrote: >> >>> Hi Phil, >>> >>> There's a *very basic* search functionality which you can invoke >>> from emacs using C-c C-z. You can then input a space-separated >>> list of identifiers and strings and Agda will return all the >>> identifiers which: >>> - are in scope in the current module >>> - contain in their type *all* of the identifiers mentioned >>> - contain as substring *all* of the mentioned strings >>> >>> For instance, using a fairly recent version of the stdlib, from >>> the module containing: >>> >>> =========================================== >>> open import Data.Nat >>> open import Data.Nat.Properties >>> =========================================== >>> >>> C-c C-z RET _+_ _*_ RET >>> >>> will return >>> >>> =========================================== >>> Definitions about _+_, _*_ >>> *-+-isCommutativeSemiring >>> : .Algebra.Structures.IsCommutativeSemiring >>> .Agda.Builtin.Equality._?_ _+_ _*_ 0 1 >>> *-cancel?-? >>> : {i j : ?} (k : ?) ? >>> i + k * i .Agda.Builtin.Equality.? j + k * j ? >>> i .Agda.Builtin.Equality.? j >>> *-distrib-+ >>> : (.Agda.Builtin.Equality._?_ >>> .Algebra.FunctionProperties.DistributesOver _*_) >>> _+_ >>> *-distrib?-+ >>> : (.Agda.Builtin.Equality._?_ >>> .Algebra.FunctionProperties.DistributesOver? _*_) >>> _+_ >>> *-distrib?-+ >>> : (.Agda.Builtin.Equality._?_ >>> .Algebra.FunctionProperties.DistributesOver? _*_) >>> _+_ >>> +-*-suc : (m n : ?) ? m * suc n .Agda.Builtin.Equality.? m + m * n >>> ^-distrib?-+-* >>> : (m n p : ?) ? >>> (m ^ (n + p)) .Agda.Builtin.Equality.? (m ^ n) * (m ^ p) >>> distrib?-*-+ >>> : (.Agda.Builtin.Equality._?_ >>> .Algebra.FunctionProperties.DistributesOver? _*_) >>> _+_ >>> im?jm+n?[i?j]m?n >>> : (i j m n : ?) ? >>> i * m .Agda.Builtin.Equality.? j * m + n ? >>> (i ? j) * m .Agda.Builtin.Equality.? n >>> isCommutativeSemiring >>> : .Algebra.Structures.IsCommutativeSemiring >>> .Agda.Builtin.Equality._?_ _+_ _*_ 0 1 >>> =========================================== >>> >>> and C-c C-z RET _+_ _*_ "distr" RET >>> will filter definitions which are not about distributivity: >>> >>> =========================================== >>> Definitions about _+_, _*_, "distr" >>> *-distrib-+ >>> : (.Agda.Builtin.Equality._?_ >>> .Algebra.FunctionProperties.DistributesOver _*_) >>> _+_ >>> *-distrib?-+ >>> : (.Agda.Builtin.Equality._?_ >>> .Algebra.FunctionProperties.DistributesOver? _*_) >>> _+_ >>> *-distrib?-+ >>> : (.Agda.Builtin.Equality._?_ >>> .Algebra.FunctionProperties.DistributesOver? _*_) >>> _+_ >>> ^-distrib?-+-* >>> : (m n p : ?) ? >>> (m ^ (n + p)) .Agda.Builtin.Equality.? (m ^ n) * (m ^ p) >>> distrib?-*-+ >>> : (.Agda.Builtin.Equality._?_ >>> .Algebra.FunctionProperties.DistributesOver? _*_) >>> _+_ >>> =========================================== >>> >>> This search function respect the normalisation modifiers (that >>> is the (C-u)* you can type before most commands) and will search >>> types according to the normalisation level you've requested (and >>> print results accordingly). >>> >>> Cheers, >>> -- >>> gallais >>> >>> >>> On 15/02/18 16:52, Philip Wadler wrote: >>> >>> Is there anything like Hoogle for Agda? It would save newbies like me a >>> *lot* of time. Cheers, -- P >>> >>> . \ Philip Wadler, Professor of Theoretical Computer Science, >>> . /\ School of Informatics, University of Edinburgh >>> . / \ and Senior Research Fellow, IOHK >>> . http://homepages.inf.ed.ac.uk/wadler/ >>> >>> >>> The University of Edinburgh is a charitable body, registered in >>> Scotland, with registration number SC005336. >>> >>> >>> >>> _______________________________________________ >>> Agda mailing listAgda at lists.chalmers.sehttps://lists.chalmers.se/mailman/listinfo/agda >>> >>> >>> >>> _______________________________________________ >>> Agda mailing list >>> Agda at lists.chalmers.se >>> https://lists.chalmers.se/mailman/listinfo/agda >>> >>> >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From wadler at inf.ed.ac.uk Thu Feb 15 21:26:55 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Thu, 15 Feb 2018 18:26:55 -0200 Subject: [Agda] Boolean and Decidable comparison Message-ID: I presume there are operations in the standard prelude to compute whether one natural is less than or equal to another with types Nat -> Nat -> Bool (n : Nat) -> (m : Nat) -> Dec (m \leq n) But I can't find them. Where are they and what are they called? Cheers, -- P PS. Using ^C ^Z to search Everything.agda (see previous thread) for Nat Bool or Nat Dec yields nothing. Indeed, using it to search for Nat gives: Definitions about Nat followed by nothing! I'm not sure why. . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From mietek at bak.io Thu Feb 15 21:35:28 2018 From: mietek at bak.io (=?utf-8?Q?Mi=C3=ABtek_Bak?=) Date: Thu, 15 Feb 2018 20:35:28 +0000 Subject: [Agda] Boolean and Decidable comparison In-Reply-To: References: Message-ID: <31CD4071-C590-4F8C-99E1-2EEC18F22B51@bak.io> The standard library defines synonyms that obscure the underlying types. I haven?t found C-c C-z to be of much use; I grep the source trees instead. $ git grep Dec | grep Nat src/Data/Nat/Base.agda:156:_??_ : Decidable _?_ Here?s the second operation: https://agda.github.io/agda-stdlib/Data.Nat.Base.html#3179 We can obtain the first operation via projection: https://agda.github.io/agda-stdlib/Relation.Nullary.Decidable.html#822 -- M. > On 15 Feb 2018, at 20:26, Philip Wadler wrote: > > I presume there are operations in the standard prelude to compute whether one natural is less than or equal to another with types > > Nat -> Nat -> Bool > (n : Nat) -> (m : Nat) -> Dec (m \leq n) > > But I can't find them. Where are they and what are they called? Cheers, -- P > > PS. Using ^C ^Z to search Everything.agda (see previous thread) for Nat Bool or Nat Dec yields nothing. Indeed, using it to search for Nat gives: > > Definitions about Nat > > followed by nothing! I'm not sure why. > > > > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda -------------- next part -------------- An HTML attachment was scrubbed... URL: From wadler at inf.ed.ac.uk Thu Feb 15 22:21:29 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Thu, 15 Feb 2018 19:21:29 -0200 Subject: [Agda] Boolean and Decidable comparison In-Reply-To: <31CD4071-C590-4F8C-99E1-2EEC18F22B51@bak.io> References: <31CD4071-C590-4F8C-99E1-2EEC18F22B51@bak.io> Message-ID: Thanks to Amr and Mi?tek for their responses. Here is a follow up question. First, is there a name in the standard library for the operation called _??_ below? Second, and less trivially, is there a way to fill in the holes in the proof of _???_ below, or to complete a proof along similar lines? Many thanks, -- P open import Data.Nat using (?; zero; suc; _?_; z?n; s?s) open import Relation.Nullary using (?_) open import Relation.Nullary.Negation using (contraposition) open import Data.Unit using (?; tt) open import Data.Empty using (?) data Bool : Set where true : Bool false : Bool T : Bool ? Set T true = ? T false = ? _??_ : ? ? ? ? Bool zero ?? n = true suc m ?? zero = false suc m ?? suc n = m ?? n ???? : ? {m n : ?} ? m ? n ? T (m ?? n) ???? z?n = tt ???? (s?s m?n) = ???? m?n ???? : ? (m n : ?) ? T (m ?? n) ? m ? n ???? zero n tt = z?n ???? (suc m) zero () ???? (suc m) (suc n) m??n = s?s (???? m n m??n) data Dec (A : Set) : Set where yes : A ? Dec A no : ? A ? Dec A _??_ : ? (m n : ?) ? Dec (m ? n) zero ?? n = yes z?n suc m ?? zero = no ?() suc m ?? suc n with m ?? n ... | yes m?n = yes (s?s m?n) ... | no ?m?n = no ?{ (s?s m?n) ? ?m?n m?n } _???_ : ? (m n : ?) ? Dec (m ? n) m ??? n with m ?? n ... | true = yes (???? m n {!!}) ... | false = no (contraposition ???? {!!}) . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 15 February 2018 at 18:35, Mi?tek Bak wrote: > The standard library defines synonyms that obscure the underlying types. > I haven?t found C-c C-z to be of much use; I grep the source trees instead. > > $ git grep Dec | grep Nat > src/Data/Nat/Base.agda:156:_??_ : Decidable _?_ > > Here?s the second operation: > https://agda.github.io/agda-stdlib/Data.Nat.Base.html#3179 > > We can obtain the first operation via projection: > https://agda.github.io/agda-stdlib/Relation.Nullary.Decidable.html#822 > > > -- > M. > > > > On 15 Feb 2018, at 20:26, Philip Wadler wrote: > > I presume there are operations in the standard prelude to compute whether > one natural is less than or equal to another with types > > Nat -> Nat -> Bool > (n : Nat) -> (m : Nat) -> Dec (m \leq n) > > But I can't find them. Where are they and what are they called? Cheers, -- > P > > PS. Using ^C ^Z to search Everything.agda (see previous thread) for Nat > Bool or Nat Dec yields nothing. Indeed, using it to search for Nat gives: > > Definitions about Nat > > followed by nothing! I'm not sure why. > > > > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From mietek at bak.io Thu Feb 15 22:49:24 2018 From: mietek at bak.io (=?utf-8?Q?Mi=C3=ABtek_Bak?=) Date: Thu, 15 Feb 2018 21:49:24 +0000 Subject: [Agda] Boolean and Decidable comparison In-Reply-To: References: <31CD4071-C590-4F8C-99E1-2EEC18F22B51@bak.io> Message-ID: <5397224A-E4B7-4034-AD63-20747CA919A1@bak.io> > First, is there a name in the standard library for the operation called _??_ below? I don?t think the _??_ operation appears in the standard library. Instead, the library supplies a projection function that lets us define _??_ in one line. open import Data.Bool using (Bool; T) open import Data.Nat using (?; _?_; _??_) open import Relation.Nullary using (Dec) open import Relation.Nullary.Decidable using (?_?; True; toWitness; fromWitness) _??_ : ? ? ? ? Bool m ?? n = ? m ?? n ? ???? : ? {m n : ?} ? m ? n ? T (m ?? n) ???? p = fromWitness p ???? : ? {m n : ?} ? T (m ?? n) ? m ? n ???? p = toWitness p _???_ : ? (m n : ?) ? Dec (m ? n) m ??? n = m ?? n Alternative type notation using synonyms supplied by the library: ????? : ? {m n : ?} ? m ? n ? True (m ?? n) ????? p = fromWitness p ????? : ? {m n : ?} ? True (m ?? n) ? m ? n ????? p = toWitness p _???_ : Decidable _?_ m ??? n = m ?? n -- M. > > Second, and less trivially, is there a way to fill in the holes in the proof of _???_ below, or to complete a proof along similar lines? > > Many thanks, -- P > > > open import Data.Nat using (?; zero; suc; _?_; z?n; s?s) > open import Relation.Nullary using (?_) > open import Relation.Nullary.Negation using (contraposition) > open import Data.Unit using (?; tt) > open import Data.Empty using (?) > > data Bool : Set where > true : Bool > false : Bool > > T : Bool ? Set > T true = ? > T false = ? > > _??_ : ? ? ? ? Bool > zero ?? n = true > suc m ?? zero = false > suc m ?? suc n = m ?? n > > ???? : ? {m n : ?} ? m ? n ? T (m ?? n) > ???? z?n = tt > ???? (s?s m?n) = ???? m?n > > ???? : ? (m n : ?) ? T (m ?? n) ? m ? n > ???? zero n tt = z?n > ???? (suc m) zero () > ???? (suc m) (suc n) m??n = s?s (???? m n m??n) > > data Dec (A : Set) : Set where > yes : A ? Dec A > no : ? A ? Dec A > > _??_ : ? (m n : ?) ? Dec (m ? n) > zero ?? n = yes z?n > suc m ?? zero = no ?() > suc m ?? suc n with m ?? n > ... | yes m?n = yes (s?s m?n) > ... | no ?m?n = no ?{ (s?s m?n) ? ?m?n m?n } > > _???_ : ? (m n : ?) ? Dec (m ? n) > m ??? n with m ?? n > ... | true = yes (???? m n {!!}) > ... | false = no (contraposition ???? {!!}) > > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > On 15 February 2018 at 18:35, Mi?tek Bak > wrote: > The standard library defines synonyms that obscure the underlying types. I haven?t found C-c C-z to be of much use; I grep the source trees instead. > > $ git grep Dec | grep Nat > src/Data/Nat/Base.agda:156:_??_ : Decidable _?_ > > Here?s the second operation: > https://agda.github.io/agda-stdlib/Data.Nat.Base.html#3179 > > We can obtain the first operation via projection: > https://agda.github.io/agda-stdlib/Relation.Nullary.Decidable.html#822 > > > -- > M. > > > >> On 15 Feb 2018, at 20:26, Philip Wadler > wrote: >> >> I presume there are operations in the standard prelude to compute whether one natural is less than or equal to another with types >> >> Nat -> Nat -> Bool >> (n : Nat) -> (m : Nat) -> Dec (m \leq n) >> >> But I can't find them. Where are they and what are they called? Cheers, -- P >> >> PS. Using ^C ^Z to search Everything.agda (see previous thread) for Nat Bool or Nat Dec yields nothing. Indeed, using it to search for Nat gives: >> >> Definitions about Nat >> >> followed by nothing! I'm not sure why. >> >> >> >> >> . \ Philip Wadler, Professor of Theoretical Computer Science, >> . /\ School of Informatics, University of Edinburgh >> . / \ and Senior Research Fellow, IOHK >> . http://homepages.inf.ed.ac.uk/wadler/ The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda > > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mietek at bak.io Thu Feb 15 22:55:10 2018 From: mietek at bak.io (=?utf-8?Q?Mi=C3=ABtek_Bak?=) Date: Thu, 15 Feb 2018 21:55:10 +0000 Subject: [Agda] Boolean and Decidable comparison In-Reply-To: <5397224A-E4B7-4034-AD63-20747CA919A1@bak.io> References: <31CD4071-C590-4F8C-99E1-2EEC18F22B51@bak.io> <5397224A-E4B7-4034-AD63-20747CA919A1@bak.io> Message-ID: Ah, I forgot there is a similar _<_ operation supplied as part of Agda built-ins. Note that the Agda.Builtin.* modules are available even when the standard library is not installed. https://agda.github.io/agda-stdlib/Agda.Builtin.Nat.html#651 -- M. > On 15 Feb 2018, at 21:49, Mi?tek Bak wrote: > >> First, is there a name in the standard library for the operation called _??_ below? > > I don?t think the _??_ operation appears in the standard library. Instead, the library supplies a projection function that lets us define _??_ in one line. > > open import Data.Bool using (Bool; T) > open import Data.Nat using (?; _?_; _??_) > open import Relation.Nullary using (Dec) > open import Relation.Nullary.Decidable using (?_?; True; toWitness; fromWitness) > > _??_ : ? ? ? ? Bool > m ?? n = ? m ?? n ? > > ???? : ? {m n : ?} ? m ? n ? T (m ?? n) > ???? p = fromWitness p > > ???? : ? {m n : ?} ? T (m ?? n) ? m ? n > ???? p = toWitness p > > _???_ : ? (m n : ?) ? Dec (m ? n) > m ??? n = m ?? n > > Alternative type notation using synonyms supplied by the library: > > ????? : ? {m n : ?} ? m ? n ? True (m ?? n) > ????? p = fromWitness p > > ????? : ? {m n : ?} ? True (m ?? n) ? m ? n > ????? p = toWitness p > > _???_ : Decidable _?_ > m ??? n = m ?? n > > > -- > M. > > >> >> Second, and less trivially, is there a way to fill in the holes in the proof of _???_ below, or to complete a proof along similar lines? >> >> Many thanks, -- P >> >> >> open import Data.Nat using (?; zero; suc; _?_; z?n; s?s) >> open import Relation.Nullary using (?_) >> open import Relation.Nullary.Negation using (contraposition) >> open import Data.Unit using (?; tt) >> open import Data.Empty using (?) >> >> data Bool : Set where >> true : Bool >> false : Bool >> >> T : Bool ? Set >> T true = ? >> T false = ? >> >> _??_ : ? ? ? ? Bool >> zero ?? n = true >> suc m ?? zero = false >> suc m ?? suc n = m ?? n >> >> ???? : ? {m n : ?} ? m ? n ? T (m ?? n) >> ???? z?n = tt >> ???? (s?s m?n) = ???? m?n >> >> ???? : ? (m n : ?) ? T (m ?? n) ? m ? n >> ???? zero n tt = z?n >> ???? (suc m) zero () >> ???? (suc m) (suc n) m??n = s?s (???? m n m??n) >> >> data Dec (A : Set) : Set where >> yes : A ? Dec A >> no : ? A ? Dec A >> >> _??_ : ? (m n : ?) ? Dec (m ? n) >> zero ?? n = yes z?n >> suc m ?? zero = no ?() >> suc m ?? suc n with m ?? n >> ... | yes m?n = yes (s?s m?n) >> ... | no ?m?n = no ?{ (s?s m?n) ? ?m?n m?n } >> >> _???_ : ? (m n : ?) ? Dec (m ? n) >> m ??? n with m ?? n >> ... | true = yes (???? m n {!!}) >> ... | false = no (contraposition ???? {!!}) >> >> >> . \ Philip Wadler, Professor of Theoretical Computer Science, >> . /\ School of Informatics, University of Edinburgh >> . / \ and Senior Research Fellow, IOHK >> . http://homepages.inf.ed.ac.uk/wadler/ >> On 15 February 2018 at 18:35, Mi?tek Bak > wrote: >> The standard library defines synonyms that obscure the underlying types. I haven?t found C-c C-z to be of much use; I grep the source trees instead. >> >> $ git grep Dec | grep Nat >> src/Data/Nat/Base.agda:156:_??_ : Decidable _?_ >> >> Here?s the second operation: >> https://agda.github.io/agda-stdlib/Data.Nat.Base.html#3179 >> >> We can obtain the first operation via projection: >> https://agda.github.io/agda-stdlib/Relation.Nullary.Decidable.html#822 >> >> >> -- >> M. >> >> >> >>> On 15 Feb 2018, at 20:26, Philip Wadler > wrote: >>> >>> I presume there are operations in the standard prelude to compute whether one natural is less than or equal to another with types >>> >>> Nat -> Nat -> Bool >>> (n : Nat) -> (m : Nat) -> Dec (m \leq n) >>> >>> But I can't find them. Where are they and what are they called? Cheers, -- P >>> >>> PS. Using ^C ^Z to search Everything.agda (see previous thread) for Nat Bool or Nat Dec yields nothing. Indeed, using it to search for Nat gives: >>> >>> Definitions about Nat >>> >>> followed by nothing! I'm not sure why. >>> >>> >>> >>> >>> . \ Philip Wadler, Professor of Theoretical Computer Science, >>> . /\ School of Informatics, University of Edinburgh >>> . / \ and Senior Research Fellow, IOHK >>> . http://homepages.inf.ed.ac.uk/wadler/ The University of Edinburgh is a charitable body, registered in >>> Scotland, with registration number SC005336. >>> _______________________________________________ >>> Agda mailing list >>> Agda at lists.chalmers.se >>> https://lists.chalmers.se/mailman/listinfo/agda >> >> >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda -------------- next part -------------- An HTML attachment was scrubbed... URL: From grewe at st.informatik.tu-darmstadt.de Thu Feb 15 23:13:09 2018 From: grewe at st.informatik.tu-darmstadt.de (Sylvia Grewe) Date: Thu, 15 Feb 2018 23:13:09 +0100 Subject: [Agda] Call for Posters: 2018 Message-ID: <26f1261b-95cf-59fa-e557-c00c5f932dc0@st.informatik.tu-darmstadt.de> ----------------------------------------------------------------------------------- 2018 : The Art, Science, and Engineering of Programming Mon 9 - Thu 12 April 2018 Nice, France http://2018.programming-conference.org/ ******************************************************** CALL FOR POSTERS ******************************************************** Important dates: - Poster abstract submission: Sunday, March 4th - Notification: Friday, March 9th - Poster Presentation: Tuesday, April 10th Posters are an integral part of . We are soliciting quality contributions for the regular Poster Session of (submissions due March 4th). The Poster Session aims at showcasing very recent or ongoing work, clarifying problem statements, vetting solutions, or identifying evaluation methods in an interactive way. It will offer an excellent opportunity for authors to receive feedback from the community and encourage one-to-one and small group discussions on a technical topic. Students are especially encouraged to submit their ongoing work and to introduce it to peer researchers. Accepted poster abstracts will be?made available on the conference Web site. The Posters track will take place on Tuesday, April 10th and will be organized jointly with the ACM Student Research Competition Poster track, thus fostering interactions between all presenters and attendees. Poster author(s) are required to attend the scheduled poster session, so that they can discuss their work with conference attendees. Poster Submission Guidelines: Posters will be evaluated based on their contribution and relevance to . Poster submissions should be sent toas a 1-2 page extended abstract in PDF format. This document should contain: ?- the poster title; ?- names and affiliations of the authors (one of whom should be named as a contact person); ?- motivation and the addressed problem, proposed solution, and/or novel contributions of the proposal. ---------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From liamoc at cse.unsw.edu.au Fri Feb 16 01:00:25 2018 From: liamoc at cse.unsw.edu.au (Liam O'Connor) Date: Fri, 16 Feb 2018 11:00:25 +1100 Subject: [Agda] Hoogle for Agda? In-Reply-To: References: Message-ID: Hi Phil, Sorry, the Makefile is called GNUmakefile. it?s here, for future reference: https://github.com/agda/agda-stdlib/blob/master/GNUmakefile I think, if you have GNU make, ?make Everything.agda? should work. L On 16 February 2018 at 6:08:18 am, Philip Wadler (wadler at inf.ed.ac.uk) wrote: Thank you! Everything sounds like everything I need! I got the standard library from here: ? git clone?https://github.com/agda/agda-stdlib.git?~/agda-stdlib This version does not have a file called Everything. It has no Makefile that I can spot. It does contain a file called GenerateEverything.hs, but it doesn't work for me: bruichladdich$ ghci GenerateEverything.hs? GHCi, version 8.2.2: http://www.haskell.org/ghc/? :? for help [1 of 1] Compiling Main? ? ? ? ? ? ?( GenerateEverything.hs, interpreted ) GenerateEverything.hs:9:1: error: ? ? Could not find module ?System.FilePath.Find? ? ? Perhaps you meant ? ? ? System.FilePath.Windows (from filepath-1.4.1.2) ? ? ? System.FilePath (from filepath-1.4.1.2) ? ? ? System.FilePath.Posix (from filepath-1.4.1.2) ? ? Use -v to see a list of the files searched for. ? | 9 | import System.FilePath.Find ? | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Failed, no modules loaded. Prelude>? What are my other options? Could someone simply add Everything.agda to?https://github.com/agda/agda-stdlib.git, and then I could pull it? Cheers, -- P ? . ? \ Philip Wadler, Professor of Theoretical Computer Science, . ? /\ School of Informatics, University of Edinburgh .? /? \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 15 February 2018 at 14:23, Liam O'Connor wrote: The agda standard library has a makefile entry for an ?Everything.agda? that includes.. well? everything in the standard library. You can build that file, and it should suit your purposes. (It has a listing here?http://www.cse.chalmers.se/~nad/listings/lib/Everything.html) Regards, Liam On 16 February 2018 at 3:19:04 am, Philip Wadler (wadler at inf.ed.ac.uk) wrote: Thanks! What would help enormously is if I could do the same thing, *searching the entire standard library*. This basically requires someone to put together a huge import list and put it in a file (preferably available with the standard library). Has anyone done so, or could this be whipped together quickly? Cheers, -- P . ? \ Philip Wadler, Professor of Theoretical Computer Science, . ? /\ School of Informatics, University of Edinburgh .? /? \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 15 February 2018 at 14:01, Guillaume Allais wrote: Hi Phil, There's a *very basic* search functionality which you can invoke from emacs using C-c C-z. You can then input a space-separated list of identifiers and strings and Agda will return all the identifiers which: - are in scope in the current module - contain in their type *all* of the identifiers mentioned - contain as substring *all* of the mentioned strings For instance, using a fairly recent version of the stdlib, from the module containing: =========================================== open import Data.Nat open import Data.Nat.Properties =========================================== C-c C-z RET _+_ _*_ RET will return =========================================== Definitions about _+_, _*_ ? *-+-isCommutativeSemiring ????????? : .Algebra.Structures.IsCommutativeSemiring ??????????? .Agda.Builtin.Equality._?_ _+_ _*_ 0 1 ? *-cancel?-? ????????? : {i j : ?} (k : ?) ? ??????????? i + k * i .Agda.Builtin.Equality.? j + k * j ? ??????????? i .Agda.Builtin.Equality.? j ? *-distrib-+ ????????? : (.Agda.Builtin.Equality._?_ ???????????? .Algebra.FunctionProperties.DistributesOver _*_) ??????????? _+_ ? *-distrib?-+ ????????? : (.Agda.Builtin.Equality._?_ ???????????? .Algebra.FunctionProperties.DistributesOver? _*_) ??????????? _+_ ? *-distrib?-+ ????????? : (.Agda.Builtin.Equality._?_ ???????????? .Algebra.FunctionProperties.DistributesOver? _*_) ??????????? _+_ ? +-*-suc : (m n : ?) ? m * suc n .Agda.Builtin.Equality.? m + m * n ? ^-distrib?-+-* ????????? : (m n p : ?) ? ??????????? (m ^ (n + p)) .Agda.Builtin.Equality.? (m ^ n) * (m ^ p) ? distrib?-*-+ ????????? : (.Agda.Builtin.Equality._?_ ???????????? .Algebra.FunctionProperties.DistributesOver? _*_) ??????????? _+_ ? im?jm+n?[i?j]m?n ????????? : (i j m n : ?) ? ??????????? i * m .Agda.Builtin.Equality.? j * m + n ? ??????????? (i ? j) * m .Agda.Builtin.Equality.? n ? isCommutativeSemiring ????????? : .Algebra.Structures.IsCommutativeSemiring ??????????? .Agda.Builtin.Equality._?_ _+_ _*_ 0 1 =========================================== and C-c C-z RET _+_ _*_ "distr" RET will filter definitions which are not about distributivity: =========================================== Definitions about _+_, _*_, "distr" ? *-distrib-+ ?? : (.Agda.Builtin.Equality._?_ ????? .Algebra.FunctionProperties.DistributesOver _*_) ???? _+_ ? *-distrib?-+ ?? : (.Agda.Builtin.Equality._?_ ????? .Algebra.FunctionProperties.DistributesOver? _*_) ???? _+_ ? *-distrib?-+ ?? : (.Agda.Builtin.Equality._?_ ????? .Algebra.FunctionProperties.DistributesOver? _*_) ???? _+_ ? ^-distrib?-+-* ?? : (m n p : ?) ? ???? (m ^ (n + p)) .Agda.Builtin.Equality.? (m ^ n) * (m ^ p) ? distrib?-*-+ ?? : (.Agda.Builtin.Equality._?_ ????? .Algebra.FunctionProperties.DistributesOver? _*_) ???? _+_ =========================================== This search function respect the normalisation modifiers (that is the (C-u)* you can type before most commands) and will search types according to the normalisation level you've requested (and print results accordingly). Cheers, -- gallais On 15/02/18 16:52, Philip Wadler wrote: Is there anything like Hoogle for Agda? It would save newbies like me a *lot* of time. Cheers, -- P . ? \ Philip Wadler, Professor of Theoretical Computer Science, . ? /\ School of Informatics, University of Edinburgh .? /? \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. _______________________________________________ Agda mailing list Agda at lists.chalmers.se https://lists.chalmers.se/mailman/listinfo/agda _______________________________________________ Agda mailing list Agda at lists.chalmers.se https://lists.chalmers.se/mailman/listinfo/agda The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. _______________________________________________ Agda mailing list Agda at lists.chalmers.se https://lists.chalmers.se/mailman/listinfo/agda The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fhi.1990 at gmail.com Fri Feb 16 09:59:59 2018 From: fhi.1990 at gmail.com (=?UTF-8?Q?Frederik_Hangh=C3=B8j_Iversen?=) Date: Fri, 16 Feb 2018 09:59:59 +0100 Subject: [Agda] Finer-grained library control in Agda Message-ID: Can I depend on a package only locally? I know I can put a package in `~/.agda/libraries` and thus make it available globally on my system. What I really need is a way for a library to ship with it's own dependencies. So that I can e.g. use git-submodules to explicitly list dependencies. The problem I have is that I'm working on a library that explicitly does not want to depend on the standard library (for reasons I guess) - but I also need to use this library in another library that depends on this library *and* the standard library - but it would make my life a *lot easier* if we agreed on the definition of e..g Sigma. So I want to depend on a modified version of the library. But if I have two versions lying around in my system I can work on the dependency as all module names are suddenly ambiguous. And if I don't register the dependency globally I cannot use it in the dependent package. -- Regards *Frederik Hangh?j Iversen* -------------- next part -------------- An HTML attachment was scrubbed... URL: From fhi.1990 at gmail.com Fri Feb 16 10:11:09 2018 From: fhi.1990 at gmail.com (=?UTF-8?Q?Frederik_Hangh=C3=B8j_Iversen?=) Date: Fri, 16 Feb 2018 10:11:09 +0100 Subject: [Agda] Finer-grained library control in Agda In-Reply-To: References: Message-ID: Yeah I had been thinking of that. Actually I think I did go down that road previously but ran into some other annoying snag. This is really quite hampering for library writers. I have a few ideas that I would love to implement, but I'm a bit hesitant to start working on it since I think it might be require quite a big refactor of Agda. On Fri, Feb 16, 2018 at 10:08 AM, a.j.rouvoet wrote: > The indirection via a global libraries file is a limitation of the Agda > library system I also run into now and then. > My best approximation of what you are asking for is to have project-local > copies of the (right versions of) libraries I depend on. > E.g. via git submodules. And instead of adding them in the `depends:` > section, you add them to the `include:` section of your agda-lib file. > > An example project that uses this setup can be found here: > https://github.com/metaborg/mj.agda > Check the makefile and the .agda-lib file > > Arjen > > On 02/16/2018 09:59 AM, Frederik Hangh?j Iversen wrote: > > Can I depend on a package only locally? > > I know I can put a package in `~/.agda/libraries` and thus make it > available globally on my system. > > What I really need is a way for a library to ship with it's own > dependencies. So that I can e.g. use git-submodules to explicitly list > dependencies. > > The problem I have is that I'm working on a library that explicitly does > not want to depend on the standard library (for reasons I guess) - but I > also need to use this library in another library that depends on this > library *and* the standard library - but it would make my life a *lot > easier* if we agreed on the definition of e..g Sigma. So I want to depend > on a modified version of the library. But if I have two versions lying > around in my system I can work on the dependency as all module names are > suddenly ambiguous. And if I don't register the dependency globally I > cannot use it in the dependent package. > > -- > Regards > *Frederik Hangh?j Iversen* > > > _______________________________________________ > Agda mailing listAgda at lists.chalmers.sehttps://lists.chalmers.se/mailman/listinfo/agda > > > -- Regards *Frederik Hangh?j Iversen* -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell at gmail.com Fri Feb 16 10:16:25 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Fri, 16 Feb 2018 10:16:25 +0100 Subject: [Agda] Finer-grained library control in Agda In-Reply-To: References: Message-ID: I'm not sure I understand your problem exactly, but note that registering a package in `~/.agda/libraries` only makes it available as a possible dependency. As long as the library name doesn't clash with other libraries and you don't add it to `~/.agda/defaults` it will not interfere with other libraries. In your case it should be enough to rename the modified version of the standard library (or add a special version number [1]). / Ulf [1] http://agda.readthedocs.io/en/latest/tools/package-system.html#version-numbers On Fri, Feb 16, 2018 at 9:59 AM, Frederik Hangh?j Iversen < fhi.1990 at gmail.com> wrote: > Can I depend on a package only locally? > > I know I can put a package in `~/.agda/libraries` and thus make it > available globally on my system. > > What I really need is a way for a library to ship with it's own > dependencies. So that I can e.g. use git-submodules to explicitly list > dependencies. > > The problem I have is that I'm working on a library that explicitly does > not want to depend on the standard library (for reasons I guess) - but I > also need to use this library in another library that depends on this > library *and* the standard library - but it would make my life a *lot > easier* if we agreed on the definition of e..g Sigma. So I want to depend > on a modified version of the library. But if I have two versions lying > around in my system I can work on the dependency as all module names are > suddenly ambiguous. And if I don't register the dependency globally I > cannot use it in the dependent package. > > -- > Regards > *Frederik Hangh?j Iversen* > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chisvasileandrei at gmail.com Fri Feb 16 10:29:11 2018 From: chisvasileandrei at gmail.com (Andrei Chis) Date: Fri, 16 Feb 2018 10:29:11 +0100 Subject: [Agda] First Call for Papers: 11th ACM SIGPLAN International Conference on Software Language Engineering (SLE 2018) Message-ID: ------------------------------------------------------------------------ Call for Papers: 11th ACM SIGPLAN International Conference on Software Language Engineering (SLE 2018) co-located with SPLASH 2018 November 5-6, 2018 Boston, Massachusetts, United States https://conf.researchr.org/track/sle-2018/papers ------------------------------------------------------------------------ We are pleased to invite you to submit papers to the 11th ACM SIGPLAN International Conference on Software Language Engineering (SLE 2018), held in conjunction with SPLASH 2018 at Boston, Massachusetts on November 5-6, 2018. --------------------------- Scope --------------------------- With the ubiquity of computers, software has become the dominating intellectual asset of our time. In turn, this software depends on software languages, namely the languages it is written in, the languages used to describe its environment, and the languages driving its development process. Given that everything depends on software and that software depends on software languages, it seems fair to say that for many years to come, everything will depend on software languages. Software language engineering (SLE) is the discipline of engineering languages and their tools required for the creation of software. It abstracts from the differences between programming languages, modelling languages, and other software languages, and emphasizes the engineering facet of the creation of such languages, that is, the establishment of the scientific methods and practices that enable the best results. While SLE is certainly driven by its metacircular character (software languages are engineered using software languages), SLE is not self-satisfying: its scope extends to the engineering of languages for all and everything. Like its predecessors, the 11th edition of the SLE conference, SLE 2018, will bring together researchers from different areas united by their common interest in the creation, capture, and tooling of software languages. It overlaps with traditional conferences on the design and implementation of programming languages, model-driven engineering, and compiler construction, and emphasizes the fusion of their communities. To foster the latter, SLE traditionally fills a two-day program with a single track, with the only temporal overlap occurring between co-located events. --------------------------- Topics of Interest --------------------------- SLE 2018 solicits high-quality contributions in areas ranging from theoretical and conceptual contributions, to tools, techniques, and frameworks in the domain of software language engineering. Topics relevant to SLE cover generic aspects of software languages development rather than aspects of engineering a specific language. In particular, SLE is interested in contributions from the following areas: * Software Language Design and Implementation - Approaches to and methods for language design - Static semantics (e.g., design rules, well-formedness constraints) - Techniques for specifying behavioral / executable semantics - Generative approaches (incl. code synthesis, compilation) - Meta-languages, meta-tools, language workbenches * Software Language Validation - Verification and formal methods for languages - Testing techniques for languages - Simulation techniques for languages * Software Language Integration and Composition - Coordination of heterogeneous languages and tools - Mappings between languages (incl. transformation languages) - Traceability between languages - Deployment of languages to different platforms * Software Language Maintenance - Software language reuse - Language evolution - Language families and variability * Domain-specific approaches for any aspects of SLE (design, implementation, validation, maintenance) * Empirical evaluation and experience reports of language engineering tools - User studies evaluating usability - Performance benchmarks - Industrial applications --------------------------- Important Dates --------------------------- All dates are Anywhere on Earth. * Fri 29 June 2018 - Abstract Submission * Fri 6 July 2018 - Paper Submission * Fri 24 August 2018 - Author Notification * Fri 31 August 2018 - Artifact Submission * Fri 5 October 2018 - Camera Ready Deadline * Wed 10 October 2018 - Artifact Notification * Fri 12 October 2018 - Deadline for Artifact-Related Paper Updates * Sun 4 Nov 2018 - SLE Workshops * Mon 5 Nov - Tue 6 Nov 2018 - SLE Conference --------------------------- Types of Submissions --------------------------- * Research papers These should report a substantial research contribution to SLE or successful application of SLE techniques or both. Full paper submissions must not exceed 12 pages excluding bibliography. * Tool papers Because of SLE?s interest in tools, we seek papers that present software tools related to the field of SLE. Selection criteria include originality of the tool, its innovative aspects, and relevance to SLE. Any of the SLE topics of interest are appropriate areas for tool demonstrations. Submissions must provide a tool description of 4 pages excluding bibliography, and a demonstration outline including screenshots of up to 6 pages. Tool demonstrations must have the keywords ?Tool Demo? or ?Tool Demonstration? in the title. The 4-page tool description will, if the demonstration is accepted, be published in the proceedings. The 6-page demonstration outline will be used by the program committee only for evaluating the submission. * New ideas / vision papers New ideas papers should describe new, non-conventional SLE research approaches that depart from standard practice. They are intended to describe well-defined research ideas that are at an early stage of investigation. Vision papers are intended to present new unifying theories about existing SLE research that can lead to the development of new technologies or approaches. New ideas / vision papers must not exceed 4 pages excluding bibliography. Workshops: Workshops will be organized by SPLASH. Please inform us and contact the SPLASH organizers if you would like to organize a workshop of interest to the SLE audience. Information on how to submit workshops can be found at the SPLASH 2018 Website: https://conf.researchr.org/track/splash-2018/splash-2018-Workshops. --------------------------- Artifact Evaluation --------------------------- For the third year SLE will use an evaluation process for assessing the quality of the artifacts on which papers are based to foster the culture of experimental reproducibility. Authors of accepted papers are invited to submit artifacts. More information will be announced on the Website. --------------------------- Submission --------------------------- Submissions have to use the ACM SIGPLAN Conference Format "acmart" ( http://sigplan.org/Resources/Author/#acmart-format); please make sure that you always use the latest ACM SIGPLAN acmart LaTeX template ( https://www.acm.org/binaries/content/assets/publications/consolidated-tex-template/acmart-master.zip), and that the document class definition is \documentclass[sigplan,screen]{acmart}. Do not make any changes to this format! Using the Word template is strongly discouraged. Ensure that your submission is legible when printed on a black and white printer. In particular, please check that colors remain distinct and font sizes in figures and tables are legible. SLE follows a single-blind review process. Thus, you do not have to blind your submission. All submissions must be in PDF format. Concurrent Submissions: Papers must describe unpublished work that is not currently submitted for publication elsewhere as described by SIGPLAN?s Republication Policy ( http://www.sigplan.org/Resources/Policies/Republication). Submitters should also be aware of ACM?s Policy and Procedures on Plagiarism ( http://www.acm.org/publications/policies/plagiarism_policy). Submissions that violate these policies will be desk-rejected. Submission Site: Submissions will be accepted at https://sle18.hotcrp.com/. --------------------------- Reviewing Process --------------------------- All submitted papers will be reviewed by at least three members of the program committee. Research papers and tool papers will be evaluated concerning novelty, correctness, significance, readability, and alignment with the conference call. New ideas / vision papers will be evaluated primarily concerning novelty, significance, readability, and alignment with the conference call. For fairness reasons, all submitted papers must conform to the above instructions. Submissions that violate these instructions may be rejected without review, at the discretion of the PC chairs. --------------------------- Awards --------------------------- * Distinguished paper: Award for most notable paper, as determined by the PC chairs based on the recommendations of the programme committee. * Distinguished reviewer: Award for distinguished reviewer, as determined by the PC chairs. * Distinguished artifact: Award for the artifact most significantly exceeding expectations, as determined by the AEC chairs based on the recommendations of the artifact evaluation committee. --------------------------- Publication --------------------------- All accepted papers will be published in the ACM Digital Library. AUTHORS TAKE NOTE: The official publication date is the date the proceedings are made available in the ACM Digital Library. This date may be up to two weeks prior to the first day of the conference. The official publication date affects the deadline for any patent filings related to published work. --------------------------- Program Committee --------------------------- Andrew Black, Portland State University, USA Erwan Bousse, TU Wien, Austria Marco Brambilla, Politecnico di Milano, Italy Ruth Breu, University of Innsbruck, Austria Walter Cazzola, University of Milan, Italy Marsha Chechik, University of Toronto, Canada Tony Clark, Sheffield Hallam University, UK Juan de Lara, Universidad Autonoma de Madrid, Spain Thomas Degueule, CWI Amsterdam, Netherlands Juergen Dingel, Queen's University, Canada Tom Dinkelaker, Ericsson, Germany Sebastian Erdweg, Delft University of Technology, Netherlands Bernd Fischer, Stellenbosch University, South Africa Esther Guerra, Autonomous University of Madrid, Spain Daco Harkes, Delft University of Technology, Netherlands Robert Hirschfeld, University of Potsdam, Germany Michael Homer, Victoria University of Wellington, New Zealand Dimitris Kolovos, University of York, UK Ralf L?mmel, University of Koblenz-Landau, Germany Marjan Mernik, University of Maribor, Slovenia Gunter Mussbacher, McGill University, Canada James Noble, Victoria University of Wellington, New Zealand Bruno Oliveira, University of Hong Kong, China Christoph Reichenbach, Lund University, Sweden Jan Oliver Ringert, University of Leicester, UK Bernhard Rumpe, RWTH Aachen University, Germany Anthony Sloane, Macquarie University, Australia Emma S?derberg, Google, Denmark Mark van den Brand, TU Eindhoven, Netherlands Tijs van der Storm, CWI Amsterdam, Netherlands Eelco Visser, Delft University of Technology, Netherlands Eric Walkingshaw, Oregon State University, USA Andreas Wortmann, RWTH Aachen University, Germany Vadim Zaytsev, Rain Code, Belgium --------------------------- Contact --------------------------- For additional information, clarification, or answers to questions, please contact the organizers by email: sle2018 at googlegroups.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.escardo at cs.bham.ac.uk Fri Feb 16 11:32:59 2018 From: m.escardo at cs.bham.ac.uk (Martin Escardo) Date: Fri, 16 Feb 2018 10:32:59 +0000 Subject: [Agda] Absolute links in html rendering of Agda files Message-ID: <46322701-6bb3-4281-100a-d7bdd269ba92@cs.bham.ac.uk> Say I have a function `blah` in some Agda file. The html link of `blah` changes every time I change my agda file and regenerate the html file. Is there a way to get an absolute link that won't change, so that I can use it from another html document? Thanks, Martin -- Martin Escardo http://www.cs.bham.ac.uk/~mhe From guillaume.allais at ens-lyon.org Fri Feb 16 13:40:24 2018 From: guillaume.allais at ens-lyon.org (Guillaume Allais) Date: Fri, 16 Feb 2018 13:40:24 +0100 Subject: [Agda] Absolute links in html rendering of Agda files In-Reply-To: <46322701-6bb3-4281-100a-d7bdd269ba92@cs.bham.ac.uk> References: <46322701-6bb3-4281-100a-d7bdd269ba92@cs.bham.ac.uk> Message-ID: <9cf9bc5d-ab4a-8425-9f93-a8d495843ff3@ens-lyon.org> Hi Martin, This discussion seems relevant: https://github.com/agda/agda/issues/2604 This feature was shipped as part of 2.5.3 Cheers, -- gallais On 16/02/18 11:32, Martin Escardo wrote: > Say I have a function `blah` in some Agda file. The html link of > `blah` changes every time I change my agda file and regenerate the > html file. Is there a way to get an absolute link that won't change, > so that I can use it from another html document? > Thanks, > Martin -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From wadler at inf.ed.ac.uk Fri Feb 16 14:06:27 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Fri, 16 Feb 2018 11:06:27 -0200 Subject: [Agda] Hoogle for Agda? In-Reply-To: References: Message-ID: Thanks! There is a long run, ending with: cabal exec -- GenerateEverything cabal: The program 'GenerateEverything' is required but it could not be found. make: *** [Everything.agda] Error 1 bruichladdich$ ls AllNonAsciiChars.hs Setup.hs CHANGELOG.md dist GNUmakefile index.agda GenerateEverything.hs index.sh HACKING.md lib.cabal Header notes LICENCE publish-listings.sh README src README.agda standard-library.agda-lib README.md bruichladdich$ Which is mysterious, since as you can see, GenerateEverything.hs is present. Complete run below, in case you want details. Fortunately, I have a version copied from the html page cited earlier, which works well enough for now. An easy way to fix the problem for the future is to check Everything.agda into the repository, rather than leaving each user to generate it for theirself. Cheers, -- P bruichladdich$ cd ~/agda-stdlib/ bruichladdich$ ls AllNonAsciiChars.hs README.md CHANGELOG.md Setup.hs GNUmakefile index.agda GenerateEverything.hs index.sh HACKING.md lib.cabal Header notes LICENCE publish-listings.sh README src README.agda standard-library.agda-lib bruichladdich$ git pull remote: Counting objects: 17, done. remote: Compressing objects: 100% (3/3), done. remote: Total 17 (delta 13), reused 17 (delta 13), pack-reused 0 Unpacking objects: 100% (17/17), done. From https://github.com/agda/agda-stdlib a68ee7e0..157497a5 master -> origin/master 81b74c8a..d8ae867e gh-pages -> origin/gh-pages Updating a68ee7e0..157497a5 Fast-forward CHANGELOG.md | 25 ++++++++++++------------- src/Data/Table.agda | 6 +++--- src/Data/Table/Base.agda | 10 +++++----- src/Data/Table/Properties.agda | 31 ++++++++++++++++--------------- src/Data/Table/Relation/Equality.agda | 4 ++-- 5 files changed, 38 insertions(+), 38 deletions(-) bruichladdich$ ls AllNonAsciiChars.hs README.md CHANGELOG.md Setup.hs GNUmakefile index.agda GenerateEverything.hs index.sh HACKING.md lib.cabal Header notes LICENCE publish-listings.sh README src README.agda standard-library.agda-lib bruichladdich$ make Everything.agda cabal clean && cabal install cleaning... Warning: --root-cmd is no longer supported, see https://github.com/haskell/cabal/issues/3353 (if you didn't type --root-cmd, comment out root-cmd in your ~/.cabal/config file) Warning: The package list for 'hackage.haskell.org' is 63 days old. Run 'cabal update' to get the latest list of available packages. Resolving dependencies... Downloading unix-compat-0.5.0.1... Configuring unix-compat-0.5.0.1... Preprocessing library for unix-compat-0.5.0.1.. Building library for unix-compat-0.5.0.1.. [1 of 8] Compiling System.PosixCompat.Files ( dist/build/System/PosixCompat/Files.hs, dist/build/System/PosixCompat/Files.o ) [2 of 8] Compiling System.PosixCompat.Temp ( src/System/PosixCompat/Temp.hs, dist/build/System/PosixCompat/Temp.o ) [3 of 8] Compiling System.PosixCompat.Time ( src/System/PosixCompat/Time.hs, dist/build/System/PosixCompat/Time.o ) [4 of 8] Compiling System.PosixCompat.Types ( src/System/PosixCompat/Types.hs, dist/build/System/PosixCompat/Types.o ) [5 of 8] Compiling System.PosixCompat.Extensions ( dist/build/System/PosixCompat/Extensions.hs, dist/build/System/PosixCompat/Extensions.o ) [6 of 8] Compiling System.PosixCompat.Unistd ( src/System/PosixCompat/Unistd.hs, dist/build/System/PosixCompat/Unistd.o ) [7 of 8] Compiling System.PosixCompat.User ( dist/build/System/PosixCompat/User.hs, dist/build/System/PosixCompat/User.o ) [8 of 8] Compiling System.PosixCompat ( src/System/PosixCompat.hs, dist/build/System/PosixCompat.o ) [1 of 8] Compiling System.PosixCompat.Files ( dist/build/System/PosixCompat/Files.hs, dist/build/System/PosixCompat/Files.p_o ) [2 of 8] Compiling System.PosixCompat.Temp ( src/System/PosixCompat/Temp.hs, dist/build/System/PosixCompat/Temp.p_o ) [3 of 8] Compiling System.PosixCompat.Time ( src/System/PosixCompat/Time.hs, dist/build/System/PosixCompat/Time.p_o ) [4 of 8] Compiling System.PosixCompat.Types ( src/System/PosixCompat/Types.hs, dist/build/System/PosixCompat/Types.p_o ) [5 of 8] Compiling System.PosixCompat.Extensions ( dist/build/System/PosixCompat/Extensions.hs, dist/build/System/PosixCompat/Extensions.p_o ) [6 of 8] Compiling System.PosixCompat.Unistd ( src/System/PosixCompat/Unistd.hs, dist/build/System/PosixCompat/Unistd.p_o ) [7 of 8] Compiling System.PosixCompat.User ( dist/build/System/PosixCompat/User.hs, dist/build/System/PosixCompat/User.p_o ) [8 of 8] Compiling System.PosixCompat ( src/System/PosixCompat.hs, dist/build/System/PosixCompat.p_o ) Preprocessing library for unix-compat-0.5.0.1.. Running Haddock on library for unix-compat-0.5.0.1.. Haddock coverage: 99% ( 77 / 78) in 'System.PosixCompat.Files' Missing documentation for: PathVar 100% ( 2 / 2) in 'System.PosixCompat.Temp' 100% ( 2 / 2) in 'System.PosixCompat.Time' 100% ( 2 / 2) in 'System.PosixCompat.Types' 71% ( 5 / 7) in 'System.PosixCompat.Extensions' Missing documentation for: CMajor (src/System/PosixCompat/Extensions.hsc:23) CMinor (src/System/PosixCompat/Extensions.hsc:24) 75% ( 6 / 8) in 'System.PosixCompat.Unistd' Missing documentation for: SystemID getSystemID 91% ( 21 / 23) in 'System.PosixCompat.User' Missing documentation for: GroupEntry UserEntry 100% ( 8 / 8) in 'System.PosixCompat' Documentation created: dist/doc/html/unix-compat/index.html Installing library in /Users/wadler/Library/Haskell/ghc-8.2.2/lib/unix-compat-0.5.0.1/lib Installed unix-compat-0.5.0.1 Downloading filemanip-0.3.6.3... Configuring filemanip-0.3.6.3... Preprocessing library for filemanip-0.3.6.3.. Building library for filemanip-0.3.6.3.. [1 of 4] Compiling System.FilePath.GlobPattern ( System/FilePath/GlobPattern.hs, dist/build/System/FilePath/GlobPattern.o ) System/FilePath/GlobPattern.hs:149:22: warning: [-Wname-shadowing] This binding for ?g? shadows the existing binding bound at System/FilePath/GlobPattern.hs:148:24 | 149 | where matchGroup g = matchTerms (MatchLiteral g : ts) cs | ^ [2 of 4] Compiling System.FilePath.Glob ( System/FilePath/Glob.hs, dist/build/System/FilePath/Glob.o ) [3 of 4] Compiling System.FilePath.Find ( System/FilePath/Find.hs, dist/build/System/FilePath/Find.o ) System/FilePath/Find.hs:227:20: warning: [-Wname-shadowing] This binding for ?depth? shadows the existing binding defined at System/FilePath/Find.hs:195:1 | 227 | where visit path depth st = | ^^^^^ System/FilePath/Find.hs:231:9: warning: [-Wname-shadowing] This binding for ?traverse? shadows the existing binding imported from ?Prelude? at System/FilePath/Find.hs:39:8-27 (and originally defined in ?Data.Traversable?) | 231 | traverse dir depth dirSt = do | ^^^^^^^^ System/FilePath/Find.hs:231:22: warning: [-Wname-shadowing] This binding for ?depth? shadows the existing binding defined at System/FilePath/Find.hs:195:1 | 231 | traverse dir depth dirSt = do | ^^^^^ System/FilePath/Find.hs:238:25: warning: [-Wname-shadowing] This binding for ?depth? shadows the existing binding defined at System/FilePath/Find.hs:195:1 | 238 | filterPath path depth st result = | ^^^^^ System/FilePath/Find.hs:274:15: warning: [-Wname-shadowing] This binding for ?state? shadows the existing binding bound at System/FilePath/Find.hs:271:38 | 274 | where visit state path depth st = | ^^^^^ System/FilePath/Find.hs:274:21: warning: [-Wname-shadowing] This binding for ?path? shadows the existing binding bound at System/FilePath/Find.hs:271:44 | 274 | where visit state path depth st = | ^^^^ System/FilePath/Find.hs:274:26: warning: [-Wname-shadowing] This binding for ?depth? shadows the existing binding defined at System/FilePath/Find.hs:195:1 | 274 | where visit state path depth st = | ^^^^^ System/FilePath/Find.hs:279:9: warning: [-Wname-shadowing] This binding for ?traverse? shadows the existing binding imported from ?Prelude? at System/FilePath/Find.hs:39:8-27 (and originally defined in ?Data.Traversable?) | 279 | traverse state dir depth dirSt = handle (errHandler dir state) $ | ^^^^^^^^ System/FilePath/Find.hs:279:18: warning: [-Wname-shadowing] This binding for ?state? shadows the existing binding bound at System/FilePath/Find.hs:271:38 | 279 | traverse state dir depth dirSt = handle (errHandler dir state) $ | ^^^^^ System/FilePath/Find.hs:279:28: warning: [-Wname-shadowing] This binding for ?depth? shadows the existing binding defined at System/FilePath/Find.hs:195:1 | 279 | traverse state dir depth dirSt = handle (errHandler dir state) $ | ^^^^^ System/FilePath/Find.hs:282:53: warning: [-Wname-shadowing] This binding for ?state? shadows the existing binding bound at System/FilePath/Find.hs:279:18 | 282 | in state' `seq` flip foldM state' (\state name -> | ^^^^^ System/FilePath/Find.hs:284:25: warning: [-Wname-shadowing] This binding for ?path? shadows the existing binding bound at System/FilePath/Find.hs:271:44 | 284 | let path = dir name | ^^^^ [4 of 4] Compiling System.FilePath.Manip ( System/FilePath/Manip.hs, dist/build/System/FilePath/Manip.o ) [1 of 4] Compiling System.FilePath.GlobPattern ( System/FilePath/GlobPattern.hs, dist/build/System/FilePath/GlobPattern.p_o ) System/FilePath/GlobPattern.hs:149:22: warning: [-Wname-shadowing] This binding for ?g? shadows the existing binding bound at System/FilePath/GlobPattern.hs:148:24 | 149 | where matchGroup g = matchTerms (MatchLiteral g : ts) cs | ^ [2 of 4] Compiling System.FilePath.Glob ( System/FilePath/Glob.hs, dist/build/System/FilePath/Glob.p_o ) [3 of 4] Compiling System.FilePath.Find ( System/FilePath/Find.hs, dist/build/System/FilePath/Find.p_o ) System/FilePath/Find.hs:227:20: warning: [-Wname-shadowing] This binding for ?depth? shadows the existing binding defined at System/FilePath/Find.hs:195:1 | 227 | where visit path depth st = | ^^^^^ System/FilePath/Find.hs:231:9: warning: [-Wname-shadowing] This binding for ?traverse? shadows the existing binding imported from ?Prelude? at System/FilePath/Find.hs:39:8-27 (and originally defined in ?Data.Traversable?) | 231 | traverse dir depth dirSt = do | ^^^^^^^^ System/FilePath/Find.hs:231:22: warning: [-Wname-shadowing] This binding for ?depth? shadows the existing binding defined at System/FilePath/Find.hs:195:1 | 231 | traverse dir depth dirSt = do | ^^^^^ System/FilePath/Find.hs:238:25: warning: [-Wname-shadowing] This binding for ?depth? shadows the existing binding defined at System/FilePath/Find.hs:195:1 | 238 | filterPath path depth st result = | ^^^^^ System/FilePath/Find.hs:274:15: warning: [-Wname-shadowing] This binding for ?state? shadows the existing binding bound at System/FilePath/Find.hs:271:38 | 274 | where visit state path depth st = | ^^^^^ System/FilePath/Find.hs:274:21: warning: [-Wname-shadowing] This binding for ?path? shadows the existing binding bound at System/FilePath/Find.hs:271:44 | 274 | where visit state path depth st = | ^^^^ System/FilePath/Find.hs:274:26: warning: [-Wname-shadowing] This binding for ?depth? shadows the existing binding defined at System/FilePath/Find.hs:195:1 | 274 | where visit state path depth st = | ^^^^^ System/FilePath/Find.hs:279:9: warning: [-Wname-shadowing] This binding for ?traverse? shadows the existing binding imported from ?Prelude? at System/FilePath/Find.hs:39:8-27 (and originally defined in ?Data.Traversable?) | 279 | traverse state dir depth dirSt = handle (errHandler dir state) $ | ^^^^^^^^ System/FilePath/Find.hs:279:18: warning: [-Wname-shadowing] This binding for ?state? shadows the existing binding bound at System/FilePath/Find.hs:271:38 | 279 | traverse state dir depth dirSt = handle (errHandler dir state) $ | ^^^^^ System/FilePath/Find.hs:279:28: warning: [-Wname-shadowing] This binding for ?depth? shadows the existing binding defined at System/FilePath/Find.hs:195:1 | 279 | traverse state dir depth dirSt = handle (errHandler dir state) $ | ^^^^^ System/FilePath/Find.hs:282:53: warning: [-Wname-shadowing] This binding for ?state? shadows the existing binding bound at System/FilePath/Find.hs:279:18 | 282 | in state' `seq` flip foldM state' (\state name -> | ^^^^^ System/FilePath/Find.hs:284:25: warning: [-Wname-shadowing] This binding for ?path? shadows the existing binding bound at System/FilePath/Find.hs:271:44 | 284 | let path = dir name | ^^^^ [4 of 4] Compiling System.FilePath.Manip ( System/FilePath/Manip.hs, dist/build/System/FilePath/Manip.p_o ) Preprocessing library for filemanip-0.3.6.3.. Running Haddock on library for filemanip-0.3.6.3.. Haddock coverage: System/FilePath/GlobPattern.hs:149:22: warning: [-Wname-shadowing] This binding for ?g? shadows the existing binding bound at System/FilePath/GlobPattern.hs:148:24 | 149 | where matchGroup g = matchTerms (MatchLiteral g : ts) cs | ^ 100% ( 7 / 7) in 'System.FilePath.GlobPattern' 100% ( 2 / 2) in 'System.FilePath.Glob' System/FilePath/Find.hs:227:20: warning: [-Wname-shadowing] This binding for ?depth? shadows the existing binding defined at System/FilePath/Find.hs:195:1 | 227 | where visit path depth st = | ^^^^^ System/FilePath/Find.hs:231:9: warning: [-Wname-shadowing] This binding for ?traverse? shadows the existing binding imported from ?Prelude? at System/FilePath/Find.hs:39:8-27 (and originally defined in ?Data.Traversable?) | 231 | traverse dir depth dirSt = do | ^^^^^^^^ System/FilePath/Find.hs:231:22: warning: [-Wname-shadowing] This binding for ?depth? shadows the existing binding defined at System/FilePath/Find.hs:195:1 | 231 | traverse dir depth dirSt = do | ^^^^^ System/FilePath/Find.hs:238:25: warning: [-Wname-shadowing] This binding for ?depth? shadows the existing binding defined at System/FilePath/Find.hs:195:1 | 238 | filterPath path depth st result = | ^^^^^ System/FilePath/Find.hs:274:15: warning: [-Wname-shadowing] This binding for ?state? shadows the existing binding bound at System/FilePath/Find.hs:271:38 | 274 | where visit state path depth st = | ^^^^^ System/FilePath/Find.hs:274:21: warning: [-Wname-shadowing] This binding for ?path? shadows the existing binding bound at System/FilePath/Find.hs:271:44 | 274 | where visit state path depth st = | ^^^^ System/FilePath/Find.hs:274:26: warning: [-Wname-shadowing] This binding for ?depth? shadows the existing binding defined at System/FilePath/Find.hs:195:1 | 274 | where visit state path depth st = | ^^^^^ System/FilePath/Find.hs:279:9: warning: [-Wname-shadowing] This binding for ?traverse? shadows the existing binding imported from ?Prelude? at System/FilePath/Find.hs:39:8-27 (and originally defined in ?Data.Traversable?) | 279 | traverse state dir depth dirSt = handle (errHandler dir state) $ | ^^^^^^^^ System/FilePath/Find.hs:279:18: warning: [-Wname-shadowing] This binding for ?state? shadows the existing binding bound at System/FilePath/Find.hs:271:38 | 279 | traverse state dir depth dirSt = handle (errHandler dir state) $ | ^^^^^ System/FilePath/Find.hs:279:28: warning: [-Wname-shadowing] This binding for ?depth? shadows the existing binding defined at System/FilePath/Find.hs:195:1 | 279 | traverse state dir depth dirSt = handle (errHandler dir state) $ | ^^^^^ System/FilePath/Find.hs:282:53: warning: [-Wname-shadowing] This binding for ?state? shadows the existing binding bound at System/FilePath/Find.hs:279:18 | 282 | in state' `seq` flip foldM state' (\state name -> | ^^^^^ System/FilePath/Find.hs:284:25: warning: [-Wname-shadowing] This binding for ?path? shadows the existing binding bound at System/FilePath/Find.hs:271:44 | 284 | let path = dir name | ^^^^ 65% ( 41 / 63) in 'System.FilePath.Find' Missing documentation for: FileType (System/FilePath/Find.hs:394) FilterPredicate (System/FilePath/Find.hs:202) RecursionPredicate (System/FilePath/Find.hs:203) deviceID (System/FilePath/Find.hs:439) fileID (System/FilePath/Find.hs:442) fileOwner (System/FilePath/Find.hs:445) fileGroup (System/FilePath/Find.hs:448) fileSize (System/FilePath/Find.hs:451) linkCount (System/FilePath/Find.hs:454) specialDeviceID (System/FilePath/Find.hs:457) fileMode (System/FilePath/Find.hs:460) accessTime (System/FilePath/Find.hs:478) modificationTime (System/FilePath/Find.hs:481) statusChangeTime (System/FilePath/Find.hs:484) ==? (System/FilePath/Find.hs:527) /=? (System/FilePath/Find.hs:531) >? (System/FilePath/Find.hs:535) =? (System/FilePath/Find.hs:543) <=? (System/FilePath/Find.hs:547) &&? (System/FilePath/Find.hs:557) ||? (System/FilePath/Find.hs:561) 100% ( 6 / 6) in 'System.FilePath.Manip' Documentation created: dist/doc/html/filemanip/index.html Installing library in /Users/wadler/Library/Haskell/ghc-8.2.2/lib/filemanip-0.3.6.3/lib Installed filemanip-0.3.6.3 Configuring lib-0.14... Preprocessing executable 'GenerateEverything' for lib-0.14.. Building executable 'GenerateEverything' for lib-0.14.. [1 of 1] Compiling Main ( GenerateEverything.hs, dist/build/GenerateEverything/GenerateEverything-tmp/Main.o ) Linking dist/build/GenerateEverything/GenerateEverything ... Preprocessing executable 'AllNonAsciiChars' for lib-0.14.. Building executable 'AllNonAsciiChars' for lib-0.14.. [1 of 1] Compiling Main ( AllNonAsciiChars.hs, dist/build/AllNonAsciiChars/AllNonAsciiChars-tmp/Main.o ) Linking dist/build/AllNonAsciiChars/AllNonAsciiChars ... Warning: No documentation was generated as this package does not contain a library. Perhaps you want to use the --executables, --tests, --benchmarks or --foreign-libraries flags. Installing executable GenerateEverything in /Users/wadler/Library/Haskell/ghc-8.2.2/lib/lib-0.14/bin Warning: The directory /Users/wadler/Library/Haskell/ghc-8.2.2/lib/lib-0.14/bin is not in the system search path. Installing executable AllNonAsciiChars in /Users/wadler/Library/Haskell/ghc-8.2.2/lib/lib-0.14/bin Warning: The directory /Users/wadler/Library/Haskell/ghc-8.2.2/lib/lib-0.14/bin is not in the system search path. Installed lib-0.14 Updating documentation index /Users/wadler/Library/Haskell/doc/index.html cabal exec -- GenerateEverything cabal: The program 'GenerateEverything' is required but it could not be found. make: *** [Everything.agda] Error 1 bruichladdich$ ls AllNonAsciiChars.hs Setup.hs CHANGELOG.md dist GNUmakefile index.agda GenerateEverything.hs index.sh HACKING.md lib.cabal Header notes LICENCE publish-listings.sh README src README.agda standard-library.agda-lib README.md bruichladdich$ . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 15 February 2018 at 22:00, Liam O'Connor wrote: > Hi Phil, > > Sorry, the Makefile is called GNUmakefile. it?s here, for future reference: > > https://github.com/agda/agda-stdlib/blob/master/GNUmakefile > > I think, if you have GNU make, ?make Everything.agda? should work. > > L > > On 16 February 2018 at 6:08:18 am, Philip Wadler (wadler at inf.ed.ac.uk) > wrote: > > Thank you! Everything sounds like everything I need! > > I got the standard library from here: > > git clone https://github.com/agda/agda-stdlib.git ~/agda-stdlib > > This version does not have a file called Everything. It has no Makefile > that I can spot. It does contain a file called GenerateEverything.hs, but > it doesn't work for me: > > bruichladdich$ ghci GenerateEverything.hs >> GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help >> [1 of 1] Compiling Main ( GenerateEverything.hs, interpreted ) >> GenerateEverything.hs:9:1: error: >> Could not find module ?System.FilePath.Find? >> Perhaps you meant >> System.FilePath.Windows (from filepath-1.4.1.2) >> System.FilePath (from filepath-1.4.1.2) >> System.FilePath.Posix (from filepath-1.4.1.2) >> Use -v to see a list of the files searched for. >> | >> 9 | import System.FilePath.Find >> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> Failed, no modules loaded. >> Prelude> > > > What are my other options? Could someone simply add Everything.agda to > https://github.com/agda/agda-stdlib.git, and then I could pull it? > > Cheers, -- P > > > > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > On 15 February 2018 at 14:23, Liam O'Connor > wrote: > >> >> The agda standard library has a makefile entry for an ?Everything.agda? >> that includes.. well? everything in the standard library. >> >> You can build that file, and it should suit your purposes. (It has a >> listing here http://www.cse.chalmers.se/~nad/listings/lib/Everything.html >> ) >> >> Regards, >> Liam >> >> On 16 February 2018 at 3:19:04 am, Philip Wadler (wadler at inf.ed.ac.uk) >> wrote: >> >> Thanks! >> >> What would help enormously is if I could do the same thing, *searching >> the entire standard library*. This basically requires someone to put >> together a huge import list and put it in a file (preferably available with >> the standard library). Has anyone done so, or could this be whipped >> together quickly? >> >> Cheers, -- P >> >> . \ Philip Wadler, Professor of Theoretical Computer Science, >> . /\ School of Informatics, University of Edinburgh >> . / \ and Senior Research Fellow, IOHK >> . http://homepages.inf.ed.ac.uk/wadler/ >> >> On 15 February 2018 at 14:01, Guillaume Allais < >> guillaume.allais at ens-lyon.org> wrote: >> >>> Hi Phil, >>> >>> There's a *very basic* search functionality which you can invoke >>> from emacs using C-c C-z. You can then input a space-separated >>> list of identifiers and strings and Agda will return all the >>> identifiers which: >>> - are in scope in the current module >>> - contain in their type *all* of the identifiers mentioned >>> - contain as substring *all* of the mentioned strings >>> >>> For instance, using a fairly recent version of the stdlib, from >>> the module containing: >>> >>> =========================================== >>> open import Data.Nat >>> open import Data.Nat.Properties >>> =========================================== >>> >>> C-c C-z RET _+_ _*_ RET >>> >>> will return >>> >>> =========================================== >>> Definitions about _+_, _*_ >>> *-+-isCommutativeSemiring >>> : .Algebra.Structures.IsCommutativeSemiring >>> .Agda.Builtin.Equality._?_ _+_ _*_ 0 1 >>> *-cancel?-? >>> : {i j : ?} (k : ?) ? >>> i + k * i .Agda.Builtin.Equality.? j + k * j ? >>> i .Agda.Builtin.Equality.? j >>> *-distrib-+ >>> : (.Agda.Builtin.Equality._?_ >>> .Algebra.FunctionProperties.DistributesOver _*_) >>> _+_ >>> *-distrib?-+ >>> : (.Agda.Builtin.Equality._?_ >>> .Algebra.FunctionProperties.DistributesOver? _*_) >>> _+_ >>> *-distrib?-+ >>> : (.Agda.Builtin.Equality._?_ >>> .Algebra.FunctionProperties.DistributesOver? _*_) >>> _+_ >>> +-*-suc : (m n : ?) ? m * suc n .Agda.Builtin.Equality.? m + m * n >>> ^-distrib?-+-* >>> : (m n p : ?) ? >>> (m ^ (n + p)) .Agda.Builtin.Equality.? (m ^ n) * (m ^ p) >>> distrib?-*-+ >>> : (.Agda.Builtin.Equality._?_ >>> .Algebra.FunctionProperties.DistributesOver? _*_) >>> _+_ >>> im?jm+n?[i?j]m?n >>> : (i j m n : ?) ? >>> i * m .Agda.Builtin.Equality.? j * m + n ? >>> (i ? j) * m .Agda.Builtin.Equality.? n >>> isCommutativeSemiring >>> : .Algebra.Structures.IsCommutativeSemiring >>> .Agda.Builtin.Equality._?_ _+_ _*_ 0 1 >>> =========================================== >>> >>> and C-c C-z RET _+_ _*_ "distr" RET >>> will filter definitions which are not about distributivity: >>> >>> =========================================== >>> Definitions about _+_, _*_, "distr" >>> *-distrib-+ >>> : (.Agda.Builtin.Equality._?_ >>> .Algebra.FunctionProperties.DistributesOver _*_) >>> _+_ >>> *-distrib?-+ >>> : (.Agda.Builtin.Equality._?_ >>> .Algebra.FunctionProperties.DistributesOver? _*_) >>> _+_ >>> *-distrib?-+ >>> : (.Agda.Builtin.Equality._?_ >>> .Algebra.FunctionProperties.DistributesOver? _*_) >>> _+_ >>> ^-distrib?-+-* >>> : (m n p : ?) ? >>> (m ^ (n + p)) .Agda.Builtin.Equality.? (m ^ n) * (m ^ p) >>> distrib?-*-+ >>> : (.Agda.Builtin.Equality._?_ >>> .Algebra.FunctionProperties.DistributesOver? _*_) >>> _+_ >>> =========================================== >>> >>> This search function respect the normalisation modifiers (that >>> is the (C-u)* you can type before most commands) and will search >>> types according to the normalisation level you've requested (and >>> print results accordingly). >>> >>> Cheers, >>> -- >>> gallais >>> >>> >>> On 15/02/18 16:52, Philip Wadler wrote: >>> >>> Is there anything like Hoogle for Agda? It would save newbies like me a >>> *lot* of time. Cheers, -- P >>> >>> . \ Philip Wadler, Professor of Theoretical Computer Science, >>> . /\ School of Informatics, University of Edinburgh >>> . / \ and Senior Research Fellow, IOHK >>> . http://homepages.inf.ed.ac.uk/wadler/ >>> >>> >>> The University of Edinburgh is a charitable body, registered in >>> Scotland, with registration number SC005336. >>> >>> >>> >>> _______________________________________________ >>> Agda mailing listAgda at lists.chalmers.sehttps://lists.chalmers.se/mailman/listinfo/agda >>> >>> >>> >>> _______________________________________________ >>> Agda mailing list >>> Agda at lists.chalmers.se >>> https://lists.chalmers.se/mailman/listinfo/agda >>> >>> >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From wadler at inf.ed.ac.uk Fri Feb 16 14:15:24 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Fri, 16 Feb 2018 11:15:24 -0200 Subject: [Agda] Boolean and Decidable comparison In-Reply-To: <5397224A-E4B7-4034-AD63-20747CA919A1@bak.io> References: <31CD4071-C590-4F8C-99E1-2EEC18F22B51@bak.io> <5397224A-E4B7-4034-AD63-20747CA919A1@bak.io> Message-ID: Thanks, Mi?tek. That's clearly the cleanest way to define those functions. But, I was starting with _??_ as in my notes for pedagogical purposes, not because I need those particular functions. I'm still curious as to whether _???_ can be defined along the lines I sketch. Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 15 February 2018 at 19:49, Mi?tek Bak wrote: > First, is there a name in the standard library for the operation called _??_ > below? > > > I don?t think the _??_ operation appears in the standard library. > Instead, the library supplies a projection function that lets us define _??_ > in one line. > > open import Data.Bool using (Bool; T) > open import Data.Nat using (?; _?_; _??_) > open import Relation.Nullary using (Dec) > open import Relation.Nullary.Decidable using (?_?; True; toWitness; > fromWitness) > > _??_ : ? ? ? ? Bool > m ?? n = ? m ?? n ? > > ???? : ? {m n : ?} ? m ? n ? T (m ?? n) > ???? p = fromWitness p > > ???? : ? {m n : ?} ? T (m ?? n) ? m ? n > ???? p = toWitness p > > _???_ : ? (m n : ?) ? Dec (m ? n) > m ??? n = m ?? n > > Alternative type notation using synonyms supplied by the library: > > ????? : ? {m n : ?} ? m ? n ? True (m ?? n) > ????? p = fromWitness p > > ????? : ? {m n : ?} ? True (m ?? n) ? m ? n > ????? p = toWitness p > > _???_ : Decidable _?_ > m ??? n = m ?? n > > > -- > M. > > > > Second, and less trivially, is there a way to fill in the holes in the > proof of _???_ below, or to complete a proof along similar lines? > > Many thanks, -- P > > > open import Data.Nat using (?; zero; suc; _?_; z?n; s?s) > open import Relation.Nullary using (?_) > open import Relation.Nullary.Negation using (contraposition) > open import Data.Unit using (?; tt) > open import Data.Empty using (?) > > data Bool : Set where > true : Bool > false : Bool > > T : Bool ? Set > T true = ? > T false = ? > > _??_ : ? ? ? ? Bool > zero ?? n = true > suc m ?? zero = false > suc m ?? suc n = m ?? n > > ???? : ? {m n : ?} ? m ? n ? T (m ?? n) > ???? z?n = tt > ???? (s?s m?n) = ???? m?n > > ???? : ? (m n : ?) ? T (m ?? n) ? m ? n > ???? zero n tt = z?n > ???? (suc m) zero () > ???? (suc m) (suc n) m??n = s?s (???? m n m??n) > > data Dec (A : Set) : Set where > yes : A ? Dec A > no : ? A ? Dec A > > _??_ : ? (m n : ?) ? Dec (m ? n) > zero ?? n = yes z?n > suc m ?? zero = no ?() > suc m ?? suc n with m ?? n > ... | yes m?n = yes (s?s m?n) > ... | no ?m?n = no ?{ (s?s m?n) ? ?m?n m?n } > > _???_ : ? (m n : ?) ? Dec (m ? n) > m ??? n with m ?? n > ... | true = yes (???? m n {!!}) > ... | false = no (contraposition ???? {!!}) > > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > On 15 February 2018 at 18:35, Mi?tek Bak wrote: > >> The standard library defines synonyms that obscure the underlying types. >> I haven?t found C-c C-z to be of much use; I grep the source trees instead. >> >> $ git grep Dec | grep Nat >> src/Data/Nat/Base.agda:156:_??_ : Decidable _?_ >> >> Here?s the second operation: >> https://agda.github.io/agda-stdlib/Data.Nat.Base.html#3179 >> >> We can obtain the first operation via projection: >> https://agda.github.io/agda-stdlib/Relation.Nullary.Decidable.html#822 >> >> >> -- >> M. >> >> >> >> On 15 Feb 2018, at 20:26, Philip Wadler wrote: >> >> I presume there are operations in the standard prelude to compute whether >> one natural is less than or equal to another with types >> >> Nat -> Nat -> Bool >> (n : Nat) -> (m : Nat) -> Dec (m \leq n) >> >> But I can't find them. Where are they and what are they called? Cheers, >> -- P >> >> PS. Using ^C ^Z to search Everything.agda (see previous thread) for Nat >> Bool or Nat Dec yields nothing. Indeed, using it to search for Nat gives: >> >> Definitions about Nat >> >> followed by nothing! I'm not sure why. >> >> >> >> >> . \ Philip Wadler, Professor of Theoretical Computer Science, >> . /\ School of Informatics, University of Edinburgh >> . / \ and Senior Research Fellow, IOHK >> . http://homepages.inf.ed.ac.uk/wadler/ >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> >> > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From asr at eafit.edu.co Fri Feb 16 14:36:13 2018 From: asr at eafit.edu.co (=?UTF-8?B?QW5kcsOpcyBTaWNhcmQtUmFtw61yZXo=?=) Date: Fri, 16 Feb 2018 08:36:13 -0500 Subject: [Agda] Hoogle for Agda? In-Reply-To: References: Message-ID: On 16 February 2018 at 08:06, Philip Wadler wrote: > There is a long run, ending with: > > cabal exec -- GenerateEverything > cabal: The program 'GenerateEverything' is required but it could not be > Download the version of the standard library supported by your version of Agda from http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Libraries.StandardLibrary Then (I downloaded version 0.14 supported by Agda 2.5.3) the following commands $ tar xvf agda-stdlib-0.14.tar.gz $ cd agda-stdlib-0.14 $ make Everything.agda generate the `Everything.agda` file. -- Andr?s La informaci?n contenida en este correo electr?nico est? dirigida ?nicamente a su destinatario y puede contener informaci?n confidencial, material privilegiado o informaci?n protegida por derecho de autor. Est? prohibida cualquier copia, utilizaci?n, indebida retenci?n, modificaci?n, difusi?n, distribuci?n o reproducci?n total o parcial. Si usted recibe este mensaje por error, por favor contacte al remitente y elim?nelo. La informaci?n aqu? contenida es responsabilidad exclusiva de su remitente por lo tanto la Universidad EAFIT no se hace responsable de lo que el mensaje contenga. The information contained in this email is addressed to its recipient only and may contain confidential information, privileged material or information protected by copyright. Its prohibited any copy, use, improper retention, modification, dissemination, distribution or total or partial reproduction. If you receive this message by error, please contact the sender and delete it. The information contained herein is the sole responsibility of the sender therefore Universidad EAFIT is not responsible for what the message contains. From guillaume.allais at ens-lyon.org Fri Feb 16 14:41:33 2018 From: guillaume.allais at ens-lyon.org (Guillaume Allais) Date: Fri, 16 Feb 2018 14:41:33 +0100 Subject: [Agda] Boolean and Decidable comparison In-Reply-To: References: <31CD4071-C590-4F8C-99E1-2EEC18F22B51@bak.io> <5397224A-E4B7-4034-AD63-20747CA919A1@bak.io> Message-ID: Hi Phil, There are a few different possibilities here: * Using a multi-with `with x | y` so that the result of evaluating `x` gets abstracted in the `y` expression like so: =========================================================== module convo where ?_???_ : ? (m n : ?) ? Dec (m ? n) ?m ??? n with m ?? n | ???? m n | ???? {m} {n} ?... | true? | p | _?? = yes (p tt) ?... | false | _ | ?p? = no ?p =========================================================== * Using the `inspect` idiom defined in PropositionalEquality to remember that the boolean you get was created by calling `m ?? n` =========================================================== module inspect where ?open import Relation.Binary.PropositionalEquality ?_???_ : ? (m n : ?) ? Dec (m ? n) ?m ??? n with m ?? n | inspect (m ??_) n ?... | true? | [ eq ] = yes (???? m n (subst T (sym eq) tt)) ?... | false | [ eq ] = no? (contraposition ???? (subst (? b ? ? T b) (sym eq) (? x ? x))) =========================================================== * Finally doing away with your proofs that `????` and `????` and instead using a ssreflect-style `Reflects` idiom and proving directly that ?????: =========================================================== module reflects where ? data Reflects (P : Set) : Bool ? Set where ??? yes : (p : P)??? ? Reflects P true ??? no? : (?p : ? P) ? Reflects P false ? map : ? {P Q} ? (P ? Q) ? (Q ? P) ? ? {b} ? Reflects P b ? Reflects Q b ? map p?q q?p (yes p) = yes (p?q p) ? map p?q q?p (no ?p) = no (? q ? ?p (q?p q)) ? s?s-inj : ? {m n} ? suc m ? suc n ? m ? n ? s?s-inj (s?s p) = p ? ????? : ? m n ? Reflects (m ? n) (m ?? n) ? ????? zero??? n?????? = yes z?n ? ????? (suc m) zero??? = no (? ()) ? ????? (suc m) (suc n) = map s?s s?s-inj (????? m n) ? dec-Reflects : ? {b P} ? Reflects P b ? Dec P ? dec-Reflects (yes p) = yes p ? dec-Reflects (no ?p) = no ?p =========================================================== Cheers, -- gallais On 16/02/18 14:15, Philip Wadler wrote: > Thanks, Mi?tek. That's clearly the cleanest way to define those > functions. But, I was starting with _??_ as in my notes for > pedagogical purposes, not because I need those particular functions. > I'm still curious as to whether?_???_ can be defined along the lines I > sketch. Cheers, -- P > > . ? \ Philip Wadler, Professor of Theoretical Computer Science, > . ? /\ School of Informatics, University of Edinburgh > .? /? \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > On 15 February 2018 at 19:49, Mi?tek Bak > wrote: > >> First, is there a name in the standard library for the operation >> called?_??_ below? > > I don?t think the?_??_?operation appears in the standard library.? > Instead, the library supplies a projection function that lets us > define?_??_ in one line. > > open import Data.Bool using (Bool; T) > open import Data.Nat using (?; _?_; _??_) > open import Relation.Nullary using (Dec) > open import Relation.Nullary.Decidable using (?_?; True; > toWitness; fromWitness) > > _??_ : ? ? ? ? Bool > m ?? n = ? m ?? n ? > > ???? : ? {m n : ?} ? m ? n ? T (m ?? n) > ???? p = fromWitness p > > ???? : ? {m n : ?} ? T (m ?? n) ? m ? n > ???? p = toWitness p > > _???_ : ? (m n : ?) ? Dec (m ? n) > m ??? n = m ?? n > > Alternative type notation using synonyms supplied by the library: > > ????? : ? {m n : ?} ? m ? n ? True (m ?? n) > ????? p = fromWitness p > > ????? : ? {m n : ?} ? True (m ?? n) ? m ? n > ????? p = toWitness p > > _???_ : Decidable _?_ > m ??? n = m ?? n > > > --? > M. > > >> >> Second, and less trivially, is there a way to fill in the holes >> in the proof of?_???_ below, or to complete a proof along similar >> lines? >> >> Many thanks, -- P >> >> >> open import Data.Nat using (?; zero; suc; _?_; z?n; s?s) >> open import Relation.Nullary using (?_) >> open import Relation.Nullary.Negation using (contraposition) >> open import Data.Unit using (?; tt) >> open import Data.Empty using (?) >> >> data Bool : Set where >> ? true : Bool >> ? false : Bool >> >> T : Bool ? Set >> T true = ? >> T false = ? >> >> _??_ : ? ? ? ? Bool >> zero ?? n = true >> suc m ?? zero = false >> suc m ?? suc n = m ?? n >> >> ???? : ? {m n : ?} ? m ? n ? T (m ?? n) >> ???? z?n = tt >> ???? (s?s m?n) = ???? m?n >> >> ???? : ? (m n : ?) ? T (m ?? n) ? m ? n >> ???? zero n tt = z?n >> ???? (suc m) zero () >> ???? (suc m) (suc n) m??n =? s?s (???? m n m??n) >> >> data Dec (A : Set) : Set where >> ? yes : A ? Dec A >> ? no : ? A ? Dec A >> >> _??_ : ? (m n : ?) ? Dec (m ? n) >> zero ?? n = yes z?n >> suc m ?? zero = no ?() >> suc m ?? suc n with m ?? n >> ... | yes m?n = yes (s?s m?n) >> ... | no ?m?n = no ?{ (s?s m?n) ? ?m?n m?n } >> >> _???_ : ? (m n : ?) ? Dec (m ? n) >> m ??? n with m ?? n >> ... | true = yes (???? m n {!!}) >> ... | false = no (contraposition ???? {!!}) >> >> >> . ? \ Philip Wadler, Professor of Theoretical Computer Science, >> . ? /\ School of Informatics, University of Edinburgh >> .? /? \ and Senior Research Fellow, IOHK >> . http://homepages.inf.ed.ac.uk/wadler/ >> >> >> On 15 February 2018 at 18:35, Mi?tek Bak > > wrote: >> >> The standard library defines synonyms that obscure the >> underlying types.? I haven?t found C-c C-z to be of much use; >> I grep the source trees instead. >> >> $ git grep Dec | grep Nat >> src/Data/Nat/Base.agda:156:_??_ : Decidable _?_ >> >> Here?s the second operation: >> https://agda.github.io/agda-stdlib/Data.Nat.Base.html#3179 >> >> >> We can obtain the first operation via projection: >> https://agda.github.io/agda-stdlib/Relation.Nullary.Decidable.html#822 >> >> >> >> --? >> M. >> >> >> >>> On 15 Feb 2018, at 20:26, Philip Wadler >> > wrote: >>> >>> I presume there are operations in the standard prelude to >>> compute whether one natural is less than or equal to another >>> with types >>> >>> ? Nat -> Nat -> Bool >>> ? (n : Nat) -> (m : Nat) -> Dec (m \leq n) >>> >>> But I can't find them. Where are they and what are they >>> called? Cheers, -- P >>> >>> PS. Using ^C ^Z to search Everything.agda (see previous >>> thread) for Nat Bool or Nat Dec yields nothing. Indeed, >>> using it to search for Nat gives: >>> >>> ??Definitions about Nat >>> >>> followed by nothing! I'm not sure why. >>> >>> ? >>> >>> >>> . ? \ Philip Wadler, Professor of Theoretical Computer Science, >>> . ? /\ School of Informatics, University of Edinburgh >>> .? /? \ and Senior Research Fellow, IOHK >>> . http://homepages.inf.ed.ac.uk/wadler/ >>> >>> The University of Edinburgh is a charitable body, registered in >>> Scotland, with registration number SC005336. >>> _______________________________________________ >>> Agda mailing list >>> Agda at lists.chalmers.se >>> https://lists.chalmers.se/mailman/listinfo/agda >>> >> >> >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. > > > > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From m.escardo at cs.bham.ac.uk Fri Feb 16 15:42:03 2018 From: m.escardo at cs.bham.ac.uk (Martin Escardo) Date: Fri, 16 Feb 2018 14:42:03 +0000 Subject: [Agda] Absolute links in html rendering of Agda files In-Reply-To: <9cf9bc5d-ab4a-8425-9f93-a8d495843ff3@ens-lyon.org> References: <46322701-6bb3-4281-100a-d7bdd269ba92@cs.bham.ac.uk> <9cf9bc5d-ab4a-8425-9f93-a8d495843ff3@ens-lyon.org> Message-ID: <406163f4-25ee-4800-397c-09cda19697d3@cs.bham.ac.uk> Thanks, this seems to be exactly what I want, although I haven't managed to make it work (with Agda version 2.6.0-5135fd5). I will ask questions in that issue page, rather than here. Martin On 16/02/18 12:40, guillaume.allais at ens-lyon.org wrote: > Hi Martin, > > This discussion seems relevant: https://github.com/agda/agda/issues/2604 > This feature was shipped as part of 2.5.3 > > Cheers, > -- > gallais > > On 16/02/18 11:32, Martin Escardo wrote: >> Say I have a function `blah` in some Agda file. The html link of >> `blah` changes every time I change my agda file and regenerate the >> html file. Is there a way to get an absolute link that won't change, >> so that I can use it from another html document? >> Thanks, >> Martin > > > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -- Martin Escardo http://www.cs.bham.ac.uk/~mhe From abela at chalmers.se Fri Feb 16 16:03:08 2018 From: abela at chalmers.se (Andreas Abel) Date: Fri, 16 Feb 2018 15:03:08 +0000 Subject: [Agda] Absolute links in html rendering of Agda files In-Reply-To: <406163f4-25ee-4800-397c-09cda19697d3@cs.bham.ac.uk> References: <46322701-6bb3-4281-100a-d7bdd269ba92@cs.bham.ac.uk> <9cf9bc5d-ab4a-8425-9f93-a8d495843ff3@ens-lyon.org> <406163f4-25ee-4800-397c-09cda19697d3@cs.bham.ac.uk> Message-ID: That feature was useful but wasn't working flawlessly, so it is not in the current development versions. (See gallais pointer.) On 16.02.2018 14:42, Martin Escardo wrote: > Thanks, this seems to be exactly what I want, although I haven't managed > to make it work (with Agda version 2.6.0-5135fd5). I will ask questions > in that issue page, rather than here. Martin > > On 16/02/18 12:40, guillaume.allais at ens-lyon.org wrote: >> Hi Martin, >> >> This discussion seems relevant: https://github.com/agda/agda/issues/2604 >> This feature was shipped as part of 2.5.3 >> >> Cheers, >> -- >> gallais >> >> On 16/02/18 11:32, Martin Escardo wrote: >>> Say I have a function `blah` in some Agda file. The html link of >>> `blah` changes every time I change my agda file and regenerate the >>> html file. Is there a way to get an absolute link that won't change, >>> so that I can use it from another html document? >>> Thanks, >>> Martin >> >> >> >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> > -- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel at gu.se http://www.cse.chalmers.se/~abela/ From wadler at inf.ed.ac.uk Fri Feb 16 18:53:48 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Fri, 16 Feb 2018 15:53:48 -0200 Subject: [Agda] Boolean and Decidable comparison In-Reply-To: References: <31CD4071-C590-4F8C-99E1-2EEC18F22B51@bak.io> <5397224A-E4B7-4034-AD63-20747CA919A1@bak.io> Message-ID: Thank you very much, Guillaume. Exactly what I needed to learn! Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 16 February 2018 at 11:41, Guillaume Allais < guillaume.allais at ens-lyon.org> wrote: > Hi Phil, > > There are a few different possibilities here: > > * Using a multi-with `with x | y` so that the result of evaluating > `x` gets abstracted in the `y` expression like so: > > =========================================================== > module convo where > > _???_ : ? (m n : ?) ? Dec (m ? n) > m ??? n with m ?? n | ???? m n | ???? {m} {n} > ... | true | p | _ = yes (p tt) > ... | false | _ | ?p = no ?p > =========================================================== > > * Using the `inspect` idiom defined in PropositionalEquality to > remember that the boolean you get was created by calling `m ?? n` > > =========================================================== > module inspect where > > open import Relation.Binary.PropositionalEquality > > _???_ : ? (m n : ?) ? Dec (m ? n) > m ??? n with m ?? n | inspect (m ??_) n > ... | true | [ eq ] = yes (???? m n (subst T (sym eq) tt)) > ... | false | [ eq ] = no (contraposition ???? (subst (? b ? ? T b) (sym > eq) (? x ? x))) > =========================================================== > > * Finally doing away with your proofs that `????` and `????` > and instead using a ssreflect-style `Reflects` idiom and proving > directly that ?????: > > =========================================================== > module reflects where > > data Reflects (P : Set) : Bool ? Set where > yes : (p : P) ? Reflects P true > no : (?p : ? P) ? Reflects P false > > map : ? {P Q} ? (P ? Q) ? (Q ? P) ? ? {b} ? Reflects P b ? Reflects Q b > map p?q q?p (yes p) = yes (p?q p) > map p?q q?p (no ?p) = no (? q ? ?p (q?p q)) > > s?s-inj : ? {m n} ? suc m ? suc n ? m ? n > s?s-inj (s?s p) = p > > ????? : ? m n ? Reflects (m ? n) (m ?? n) > ????? zero n = yes z?n > ????? (suc m) zero = no (? ()) > ????? (suc m) (suc n) = map s?s s?s-inj (????? m n) > > dec-Reflects : ? {b P} ? Reflects P b ? Dec P > dec-Reflects (yes p) = yes p > dec-Reflects (no ?p) = no ?p > =========================================================== > > Cheers, > -- > gallais > > On 16/02/18 14:15, Philip Wadler wrote: > > Thanks, Mi?tek. That's clearly the cleanest way to define those functions. > But, I was starting with _??_ as in my notes for pedagogical purposes, > not because I need those particular functions. I'm still curious as to > whether _???_ can be defined along the lines I sketch. Cheers, -- P > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > On 15 February 2018 at 19:49, Mi?tek Bak wrote: > >> First, is there a name in the standard library for the operation called _??_ >> below? >> >> >> I don?t think the _??_ operation appears in the standard library. >> Instead, the library supplies a projection function that lets us define _??_ >> in one line. >> >> open import Data.Bool using (Bool; T) >> open import Data.Nat using (?; _?_; _??_) >> open import Relation.Nullary using (Dec) >> open import Relation.Nullary.Decidable using (?_?; True; toWitness; >> fromWitness) >> >> _??_ : ? ? ? ? Bool >> m ?? n = ? m ?? n ? >> >> ???? : ? {m n : ?} ? m ? n ? T (m ?? n) >> ???? p = fromWitness p >> >> ???? : ? {m n : ?} ? T (m ?? n) ? m ? n >> ???? p = toWitness p >> >> _???_ : ? (m n : ?) ? Dec (m ? n) >> m ??? n = m ?? n >> >> Alternative type notation using synonyms supplied by the library: >> >> ????? : ? {m n : ?} ? m ? n ? True (m ?? n) >> ????? p = fromWitness p >> >> ????? : ? {m n : ?} ? True (m ?? n) ? m ? n >> ????? p = toWitness p >> >> _???_ : Decidable _?_ >> m ??? n = m ?? n >> >> >> -- >> M. >> >> >> >> Second, and less trivially, is there a way to fill in the holes in the >> proof of _???_ below, or to complete a proof along similar lines? >> >> Many thanks, -- P >> >> >> open import Data.Nat using (?; zero; suc; _?_; z?n; s?s) >> open import Relation.Nullary using (?_) >> open import Relation.Nullary.Negation using (contraposition) >> open import Data.Unit using (?; tt) >> open import Data.Empty using (?) >> >> data Bool : Set where >> true : Bool >> false : Bool >> >> T : Bool ? Set >> T true = ? >> T false = ? >> >> _??_ : ? ? ? ? Bool >> zero ?? n = true >> suc m ?? zero = false >> suc m ?? suc n = m ?? n >> >> ???? : ? {m n : ?} ? m ? n ? T (m ?? n) >> ???? z?n = tt >> ???? (s?s m?n) = ???? m?n >> >> ???? : ? (m n : ?) ? T (m ?? n) ? m ? n >> ???? zero n tt = z?n >> ???? (suc m) zero () >> ???? (suc m) (suc n) m??n = s?s (???? m n m??n) >> >> data Dec (A : Set) : Set where >> yes : A ? Dec A >> no : ? A ? Dec A >> >> _??_ : ? (m n : ?) ? Dec (m ? n) >> zero ?? n = yes z?n >> suc m ?? zero = no ?() >> suc m ?? suc n with m ?? n >> ... | yes m?n = yes (s?s m?n) >> ... | no ?m?n = no ?{ (s?s m?n) ? ?m?n m?n } >> >> _???_ : ? (m n : ?) ? Dec (m ? n) >> m ??? n with m ?? n >> ... | true = yes (???? m n {!!}) >> ... | false = no (contraposition ???? {!!}) >> >> >> . \ Philip Wadler, Professor of Theoretical Computer Science, >> . /\ School of Informatics, University of Edinburgh >> . / \ and Senior Research Fellow, IOHK >> . http://homepages.inf.ed.ac.uk/wadler/ >> >> On 15 February 2018 at 18:35, Mi?tek Bak wrote: >> >>> The standard library defines synonyms that obscure the underlying >>> types. I haven?t found C-c C-z to be of much use; I grep the source trees >>> instead. >>> >>> $ git grep Dec | grep Nat >>> src/Data/Nat/Base.agda:156:_??_ : Decidable _?_ >>> >>> Here?s the second operation: >>> https://agda.github.io/agda-stdlib/Data.Nat.Base.html#3179 >>> >>> We can obtain the first operation via projection: >>> https://agda.github.io/agda-stdlib/Relation.Nullary.Decidable.html#822 >>> >>> >>> -- >>> M. >>> >>> >>> >>> On 15 Feb 2018, at 20:26, Philip Wadler wrote: >>> >>> I presume there are operations in the standard prelude to compute >>> whether one natural is less than or equal to another with types >>> >>> Nat -> Nat -> Bool >>> (n : Nat) -> (m : Nat) -> Dec (m \leq n) >>> >>> But I can't find them. Where are they and what are they called? Cheers, >>> -- P >>> >>> PS. Using ^C ^Z to search Everything.agda (see previous thread) for Nat >>> Bool or Nat Dec yields nothing. Indeed, using it to search for Nat gives: >>> >>> Definitions about Nat >>> >>> followed by nothing! I'm not sure why. >>> >>> >>> >>> >>> . \ Philip Wadler, Professor of Theoretical Computer Science, >>> . /\ School of Informatics, University of Edinburgh >>> . / \ and Senior Research Fellow, IOHK >>> . http://homepages.inf.ed.ac.uk/wadler/ >>> The University of Edinburgh is a charitable body, registered in >>> Scotland, with registration number SC005336. >>> _______________________________________________ >>> Agda mailing list >>> Agda at lists.chalmers.se >>> https://lists.chalmers.se/mailman/listinfo/agda >>> >>> >>> >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> >> > > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > > > _______________________________________________ > Agda mailing listAgda at lists.chalmers.sehttps://lists.chalmers.se/mailman/listinfo/agda > > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From m.escardo at cs.bham.ac.uk Fri Feb 16 20:57:33 2018 From: m.escardo at cs.bham.ac.uk (=?UTF-8?B?TWFydMOtbiBIw7Z0emVsIEVzY2FyZMOz?=) Date: Fri, 16 Feb 2018 19:57:33 +0000 Subject: [Agda] Absolute links in html rendering of Agda files In-Reply-To: References: <46322701-6bb3-4281-100a-d7bdd269ba92@cs.bham.ac.uk> <9cf9bc5d-ab4a-8425-9f93-a8d495843ff3@ens-lyon.org> <406163f4-25ee-4800-397c-09cda19697d3@cs.bham.ac.uk> Message-ID: On 16/02/18 15:03, abela at chalmers.se wrote: > That feature was useful but wasn't working flawlessly, so it is not in > the current development versions.? (See gallais pointer.) I think that if Agda wants to succeed in the long term, this is an important feature. People want to write papers, blog posts, grant applications, promotion applications, and more generally do and disseminate research. It is very difficult to disseminate research if you can't point reliable and somewhat permanently to it on the web. Best, Martin > > On 16.02.2018 14:42, Martin Escardo wrote: >> Thanks, this seems to be exactly what I want, although I haven't >> managed to make it work (with Agda version 2.6.0-5135fd5). I will ask >> questions in that issue page, rather than here. Martin >> >> On 16/02/18 12:40, guillaume.allais at ens-lyon.org wrote: >>> Hi Martin, >>> >>> This discussion seems relevant: https://github.com/agda/agda/issues/2604 >>> This feature was shipped as part of 2.5.3 >>> >>> Cheers, >>> -- >>> gallais >>> >>> On 16/02/18 11:32, Martin Escardo wrote: >>>> Say I have a function `blah` in some Agda file. The html link of >>>> `blah` changes every time I change my agda file and regenerate the >>>> html file. Is there a way to get an absolute link that won't change, >>>> so that I can use it from another html document? >>>> Thanks, >>>> Martin >>> >>> >>> >>> >>> _______________________________________________ >>> Agda mailing list >>> Agda at lists.chalmers.se >>> https://lists.chalmers.se/mailman/listinfo/agda >>> >> > > -- http://www.cs.bham.ac.uk/~mhe From igorzsci at gmail.com Sat Feb 17 10:37:35 2018 From: igorzsci at gmail.com (=?UTF-8?B?djDOuWQ=?=) Date: Sat, 17 Feb 2018 19:37:35 +1000 Subject: [Agda] Some problems with termination checker Message-ID: Dear list, I try to define a zip-with function without pattern matching through universal constructor eliminator for Lists. id : {a : _} ? {A : Set a} ? A ? A id x = x data List {a} (A : Set a) : Set a where nil : List A cons : A ? List A ? List A fold : {a b c : _} ? {A : Set a} ? {B : Set b} ? {C : Set c} ? List A ? (A ? List A ? ((B ? C) ? B ? C) ? (B ? C) ? B ? C) ? (B ? C) ? B ? C fold nil _ fs s = fs s fold (cons x xs) f = f x xs (fold xs f) zip-with : {a b c : _} ? {A : Set a} ? {B : Set b} ? {C : Set c} ? (A ? B ? C) ? List A ? List B ? List C zip-with f x y = fold x (? ? ?s _ _ _ ? fold y (? ? ?s _ _ _ ? cons (f ? ?) (zip-with f ?s ?s)) id nil) id nil But it fails termination checking. Termination checking failed for the following functions: zip-with Problematic calls: zip-with f ?s ?s I would not want to suppress termination checking at all with {-# TERMINATING #-}. What can I do here? Maybe it makes sense somehow to improve termination checker for so obvious cases? -------------- next part -------------- An HTML attachment was scrubbed... URL: From arseniy.alekseyev at gmail.com Sat Feb 17 13:18:34 2018 From: arseniy.alekseyev at gmail.com (Arseniy Alekseyev) Date: Sat, 17 Feb 2018 12:18:34 +0000 Subject: [Agda] Some problems with termination checker In-Reply-To: References: Message-ID: The point of termination checker is roughly to "desugar" recursive definitions with pattern matching into non-recursive definitions that use universal eliminator. (I think it's not quite what it does in Agda, but that's how its behavior is justified). Here you have no pattern matching so there's nothing to desugar, so nothing for termination checker to do. When you write something using universal eliminators, that's normally an exercise in avoiding recursion altogether. > so obvious cases It's not so obvious: you need to know that [fold] will only ever give you "smaller" ?s, which is maybe possible using sized types (I have no idea), but it's not visible syntactically in the definition of [zip-with]. On 17 February 2018 at 09:37, v0?d wrote: > Dear list, > I try to define a zip-with function without pattern matching through > universal constructor eliminator for Lists. > > id : {a : _} ? {A : Set a} ? A ? A > id x = x > > data List {a} (A : Set a) : Set a where > nil : List A > cons : A ? List A ? List A > > fold : {a b c : _} ? {A : Set a} ? {B : Set b} ? {C : Set c} ? List A ? (A > ? List A ? ((B ? C) ? B ? C) ? (B ? C) ? B ? C) ? (B ? C) ? B ? C > fold nil _ fs s = fs s > fold (cons x xs) f = f x xs (fold xs f) > > zip-with : {a b c : _} ? {A : Set a} ? {B : Set b} ? {C : Set c} ? (A ? B > ? C) ? List A ? List B ? List C > zip-with f x y = fold x (? ? ?s _ _ _ ? fold y (? ? ?s _ _ _ ? cons (f ? > ?) (zip-with f ?s ?s)) id nil) id nil > > But it fails termination checking. > > Termination checking failed for the following functions: > zip-with > Problematic calls: > zip-with f ?s ?s > > I would not want to suppress termination checking at all with {-# > TERMINATING #-}. > What can I do here? Maybe it makes sense somehow to improve termination > checker for so obvious cases? > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From guillaume.allais at ens-lyon.org Sun Feb 18 12:20:50 2018 From: guillaume.allais at ens-lyon.org (Guillaume Allais) Date: Sun, 18 Feb 2018 12:20:50 +0100 Subject: [Agda] Some problems with termination checker In-Reply-To: References: Message-ID: <6d2eb72f-161d-4da5-fa94-80cfec300618@ens-lyon.org> Do you need the recursive call? I started implementing the same function using Vec instead of List to make the size invariant clearer and after a bit of cleaning up I got an implementation which is just using two folds (which makes sense: the first one performs the induction, the second one is merely used to do a case analysis) ================================================================ open import Agda.Builtin.Nat id : {a : _} ? {A : Set a} ? A ? A id x = x data Vec {a} (A : Set a) : Nat ? Set a where ?nil : Vec A 0 ?cons : ? {n} ? A ? Vec A n ? Vec A (suc n) module _ {a b} {A : Set a} (B : Nat ? Set b) where ?fold : ? {n} ? Vec A n ? (? {n} ? A ? Vec A n ? B n ? B (suc n)) ? B 0 ? B n ?fold nil???????? c n = n ?fold (cons x xs) c n = c x xs (fold xs c n) module _ {a b c} {A : Set a} {B : Set b} {C : Set c}? where ?zip-with : ? {n} ? (A ? B ? C) ? Vec A n ? Vec B n ? Vec C n ?zip-with f xs ys = fold P xs step base ys where ? P : Nat ? Set _ ? P n = Vec B n ? Vec C n ? step : ? {n} ? A ? Vec A n ? P n ? P (suc n) ? step x xs rec yys = fold (Vec C) yys (? y ys ? cons (f x y)) nil ? base : P 0 ? base _ = nil ================================================================ Cheers, On 17/02/18 10:37, v0?d wrote: > Dear list, > I try to define a zip-with function without pattern matching through > universal constructor eliminator for Lists. > > id?: {a : _} ? {A : Set a} ? A ? A > id?x = x > > data List {a} (A : Set a) : Set a where > ?nil : List A > ?cons : A ? List A ? List A > > fold : {a b c : _} ? {A : Set a} ? {B : Set b} ? {C : Set c} ? List A > ? (A ? List A ? ((B ? C) ? B ? C) ? (B ? C) ? B ? C) ? (B ? C) ? B ? C > fold nil _ fs s = fs s > fold (cons x xs) f = f x xs (fold xs f) > > zip-with : {a b c : _} ? {A : Set a} ? {B : Set b} ? {C : Set c} ? (A > ? B ? C) ? List A ? List B ? List C > zip-with f x y = fold x (? ? ?s _ _ _ ? fold y (? ? ?s _ _ _ ? cons (f > ? ?) (zip-with f ?s ?s)) id nil) id nil > > But it fails termination checking. > > Termination checking failed for the following functions: > ? zip-with > Problematic calls: > ? zip-with f ?s ?s > > I would not want to suppress?termination checking at all with?{-# > TERMINATING #-}. > What can I do here? Maybe it makes sense somehow to > improve?termination checker for so obvious cases? > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda -------------- next part -------------- An HTML attachment was scrubbed... URL: From andersmortberg at gmail.com Sun Feb 18 16:07:13 2018 From: andersmortberg at gmail.com (Anders Mortberg) Date: Sun, 18 Feb 2018 10:07:13 -0500 Subject: [Agda] Call for Contributions: Workshop on Homotopy Type Theory and Univalent Foundations (HoTT/UF'18) Message-ID: ========================================================== 2nd CALL FOR CONTRIBUTIONS Workshop on Homotopy Type Theory and Univalent Foundations (HoTT/UF, at FLoC 2018) ========================================================== NEWS: submission deadline changed to April 15 (was March 31) to align with general submission deadline of FLoC workshops. ------------------------------------------------------------------------ Workshop on Homotopy Type Theory and Univalent Foundations July 7-8, 2018, Oxford, United Kingdom https://hott-uf.github.io/2018 Co-located with FSCD 2018 and part of FLoC 2018 http://www.cs.le.ac.uk/events/fscd2018/ http://www.floc2018.org/ Abstract submission deadline: April 15 ------------------------------------------------------------------------ Homotopy Type Theory is a young area of logic, combining ideas from several established fields: the use of dependent type theory as a foundation for mathematics, inspired by ideas and tools from abstract homotopy theory. Univalent Foundations are foundations of mathematics based on the homotopical interpretation of type theory. The goal of this workshop is to bring together researchers interested in all aspects of Homotopy Type Theory and Univalent Foundations: from the study of syntax and semantics of type theory to practical formalization in proof assistants based on univalent type theory. ================== # Invited talks * Mart?n Escard? (University of Birmingham) * Paige North (Ohio State University) * Andrew Pitts (University of Cambridge) ================ # Submissions * Abstract submission deadline: April 15 * Author notification: end of April Submissions should consist of a title and a 1-2 pages abstract, in pdf format, via https://easychair.org/conferences/?conf=hottuf18 Considering the broad background of the expected audience, we encourage authors to include information of pedagogical value in their abstract, such as motivation and context of their work. ====================== # Program committee * Benedikt Ahrens (University of Birmingham) * Paolo Capriotti (University of Nottingham) * Simon Huber (University of Gothenburg) * Chris Kapulkin (University of Western Ontario) * Nicolai Kraus (University of Nottingham) * Peter LeFanu Lumsdaine (Stockholm University) * Assia Mahboubi (Inria Saclay) * Anders M?rtberg (Carnegie Mellon University and University of Gothenburg) * Nicolas Tabareau (Inria Nantes) ================ # Organizers * Benedikt Ahrens (University of Birmingham) * Simon Huber (University of Gothenburg) * Anders M?rtberg (Carnegie Mellon University and University of Gothenburg) From frederic.loulergue at univ-orleans.fr Sun Feb 18 18:31:10 2018 From: frederic.loulergue at univ-orleans.fr (Frederic Loulergue) Date: Sun, 18 Feb 2018 10:31:10 -0700 Subject: [Agda] CfP: 4PAD 2018 - 5th International Symposium on Formal Approaches to Parallel and Distributed Systems Message-ID: Please, accept our apologies in case of multiple copies of this CFP. ============================================================ = CALL FOR PAPERS = = 5th International Symposium on = = Formal Approaches to Parallel and Distributed Systems = = (4PAD 2018) = = affiliated to the = = 16th International Conference on = = High Performance Computing & Simulation (HPCS 2018) = = http://hpcs2018.cisedu.info/ = = Orleans, France, July 17-19, 2018 = ============================================================ http://hpcs2018.cisedu.info/2-conference/symposia---hpcs2018/symp05-4pad SCOPE AND OBJECTIVES The aim of 4PAD is to foster interaction between the formal methods communities and systems researchers working on topics in modern parallel, distributed, and network-based processing systems (e.g., autonomous computing systems, cloud computing systems, service-oriented systems and parallel computing architectures). 4PAD topics include (but are not limited to) the following: * Rigorous software engineering approaches and their tool support; * Model-based approaches, including model-driven development; * Service- and component-based approaches; * Semantics, types and logics; * Formal specification and verification; * Performance analysis based on formal approaches; * Formal aspects of programming paradigms and languages; * Formal approaches to parallel architectures and weak memory models; * Formal approaches to deployment, run-time analysis, adaptation/evolution, reconfiguration, and monitoring; * Case studies developed/analyzed with formal approaches; * Formal stochastic models and analysis; * Formal methods for large-scale distributed systems; * Statistical analysis techniques based on formal approaches. PAPER SUBMISSION AND PUBLICATION You are invited to submit original and unpublished research works on above and other topics related to Formal Approaches to Parallel and Distributed Systems. Submitted papers must not have been published or simultaneously submitted elsewhere until it appears in HPCS proceedings, in the case of acceptance, or notified otherwise. For Regular papers, please submit a PDF copy of your full manuscript, not to exceed 8 double-column IEEE formatted pages per template, and include up to 6 keywords and an abstract of no more than 400 words. Short papers (up to 4 pages), poster papers and posters (please refer to http://hpcs2018.cisedu.info/1-call-for-papers-and-participation/call-for-posters for posters submission details) will also be considered. Please specify the type of submission you have. Please include page numbers on all preliminary submissions to make it easier for reviewers to provide helpful comments. Submit a PDF copy of your full manuscript to the symposium paper submission site at https://easychair.org/conferences/?conf=4pad. IMPORTANT DATES Paper Submissions: March 12, 2018 Acceptance Notification: April 11, 2018 Camera Ready Papers and Registration Due by: May 03, 2018 Conference Dates (HPCS and affiliated events): July 16-20, 2018 PROGRAM COMMITTEE Gul Agha University of Illinois at Urbana-Champaign, USA Marco Aldinucci University of Torino, IT Allan Blanchard Inria, FR Simon Bliudze Inria, FR Laura Bocchi University of Kent, UK Jean-Michel Couvreur University of Orleans, FR, chair Kento Emoto Kyushu Institute of Technology, JP Gidon Ernst National Institute of Informatics, JP Joaquin Ezpeleta Universidad de Zaragoza, ES Ylies Falcone Univ. Grenoble APles, Inria, FR Serge Haddad LSV, ENS Cachan, CNRS, Inria, FR Ludovic Henrio CNRS, FR Claude Jard University of Nantes, FR Igor Konnov Vienna University of Technology, AT Sandeep Kulkarni Michigan State University, USA Alberto Lluch Lafuente Technical University of Denmark, DK Frederic Loulergue Northern Arizona University, USA, chair Neeraj Mittal The University of Texas at Dallas, USA Gwen Salaun University of Grenoble Alpes, FR Sven Schewe University of Liverpool, UK Elena Sherman Boise State University, USA Francesco Tiezzi Universita di Camerino, IT Emilio Tuosto University of Leicester, UK -- Dr. Frederic Loulergue Professor School of Informatics, Computing, and Cyber Systems Northern Arizona University Home: http://nau.edu/SICCS/Faculty/Frederic-Loulergue Phone: +1 928-523-5044 From abela at chalmers.se Mon Feb 19 21:48:52 2018 From: abela at chalmers.se (Andreas Abel) Date: Mon, 19 Feb 2018 21:48:52 +0100 Subject: [Agda] Absolute links in html rendering of Agda files In-Reply-To: References: <46322701-6bb3-4281-100a-d7bdd269ba92@cs.bham.ac.uk> <9cf9bc5d-ab4a-8425-9f93-a8d495843ff3@ens-lyon.org> <406163f4-25ee-4800-397c-09cda19697d3@cs.bham.ac.uk> Message-ID: <652d027e-26ba-dadd-96a3-08a007226e4a@chalmers.se> Hi Martin, I just reenabled the feature, fixing a problem we had with it. This means it should be present in Agda 2.5.4 and 2.6.0 as well. The documentation is here: https://github.com/agda/agda/blob/master/CHANGELOG.md#html-backend A living example is our POPL 2018 paper, see: http://www.cse.chalmers.se/~abela/publications.html#popl18 The blue formulas in the PDF are clickable and take you to the HTML-rendered Agda code. Enjoy! Andreas On 16.02.2018 20:57, Mart?n H?tzel Escard? wrote: > > > On 16/02/18 15:03, abela at chalmers.se wrote: >> That feature was useful but wasn't working flawlessly, so it is not in >> the current development versions.? (See gallais pointer.) > > I think that if Agda wants to succeed in the long term, this is an > important feature. People want to write papers, blog posts, grant > applications, promotion applications, and more generally do and > disseminate research. It is very difficult to disseminate research if > you can't point reliable and somewhat permanently to it on the web. > > Best, > Martin > >> >> On 16.02.2018 14:42, Martin Escardo wrote: >>> Thanks, this seems to be exactly what I want, although I haven't >>> managed to make it work (with Agda version 2.6.0-5135fd5). I will ask >>> questions in that issue page, rather than here. Martin >>> >>> On 16/02/18 12:40, guillaume.allais at ens-lyon.org wrote: >>>> Hi Martin, >>>> >>>> This discussion seems relevant: >>>> https://github.com/agda/agda/issues/2604 >>>> This feature was shipped as part of 2.5.3 >>>> >>>> Cheers, >>>> -- >>>> gallais >>>> >>>> On 16/02/18 11:32, Martin Escardo wrote: >>>>> Say I have a function `blah` in some Agda file. The html link of >>>>> `blah` changes every time I change my agda file and regenerate the >>>>> html file. Is there a way to get an absolute link that won't change, >>>>> so that I can use it from another html document? >>>>> Thanks, >>>>> Martin >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> Agda mailing list >>>> Agda at lists.chalmers.se >>>> https://lists.chalmers.se/mailman/listinfo/agda >>>> >>> >> >> > -- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel at gu.se http://www.cse.chalmers.se/~abela/ From m.escardo at cs.bham.ac.uk Tue Feb 20 15:36:53 2018 From: m.escardo at cs.bham.ac.uk (Martin Escardo) Date: Tue, 20 Feb 2018 14:36:53 +0000 Subject: [Agda] Absolute links in html rendering of Agda files In-Reply-To: <652d027e-26ba-dadd-96a3-08a007226e4a@chalmers.se> References: <46322701-6bb3-4281-100a-d7bdd269ba92@cs.bham.ac.uk> <9cf9bc5d-ab4a-8425-9f93-a8d495843ff3@ens-lyon.org> <406163f4-25ee-4800-397c-09cda19697d3@cs.bham.ac.uk> <652d027e-26ba-dadd-96a3-08a007226e4a@chalmers.se> Message-ID: <6b908847-787f-38e9-9e68-1fdb101027fc@cs.bham.ac.uk> Thank you very much! Martin On 19/02/18 20:48, abela at chalmers.se wrote: > Hi Martin, > > I just reenabled the feature, fixing a problem we had with it. > This means it should be present in Agda 2.5.4 and 2.6.0 as well. > > The documentation is here: > ? https://github.com/agda/agda/blob/master/CHANGELOG.md#html-backend > > A living example is our POPL 2018 paper, see: > > ? http://www.cse.chalmers.se/~abela/publications.html#popl18 > > The blue formulas in the PDF are clickable and take you to the > HTML-rendered Agda code. > > Enjoy! > Andreas > > On 16.02.2018 20:57, Mart?n H?tzel Escard? wrote: >> >> >> On 16/02/18 15:03, abela at chalmers.se wrote: >>> That feature was useful but wasn't working flawlessly, so it is not >>> in the current development versions.? (See gallais pointer.) >> >> I think that if Agda wants to succeed in the long term, this is an >> important feature. People want to write papers, blog posts, grant >> applications, promotion applications, and more generally do and >> disseminate research. It is very difficult to disseminate research if >> you can't point reliable and somewhat permanently to it on the web. >> >> Best, >> Martin >> >>> >>> On 16.02.2018 14:42, Martin Escardo wrote: >>>> Thanks, this seems to be exactly what I want, although I haven't >>>> managed to make it work (with Agda version 2.6.0-5135fd5). I will >>>> ask questions in that issue page, rather than here. Martin >>>> >>>> On 16/02/18 12:40, guillaume.allais at ens-lyon.org wrote: >>>>> Hi Martin, >>>>> >>>>> This discussion seems relevant: >>>>> https://github.com/agda/agda/issues/2604 >>>>> This feature was shipped as part of 2.5.3 >>>>> >>>>> Cheers, >>>>> -- >>>>> gallais >>>>> >>>>> On 16/02/18 11:32, Martin Escardo wrote: >>>>>> Say I have a function `blah` in some Agda file. The html link of >>>>>> `blah` changes every time I change my agda file and regenerate the >>>>>> html file. Is there a way to get an absolute link that won't change, >>>>>> so that I can use it from another html document? >>>>>> Thanks, >>>>>> Martin >>>>> >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Agda mailing list >>>>> Agda at lists.chalmers.se >>>>> https://lists.chalmers.se/mailman/listinfo/agda >>>>> >>>> >>> >>> >> > > -- Martin Escardo http://www.cs.bham.ac.uk/~mhe From nad at cse.gu.se Wed Feb 21 12:23:14 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Wed, 21 Feb 2018 12:23:14 +0100 Subject: [Agda] C preprocessor with agda In-Reply-To: References: Message-ID: <15f88791-f538-b513-827f-8e378f4d0c4a@cse.gu.se> On 2018-02-12 19:52, Frederik Hangh?j Iversen wrote: > Can I somehow use the C preprocessor with Agda? There is no special support for the C preprocessor, but you can of course preprocess your files manually. -- /NAD From fhi.1990 at gmail.com Wed Feb 21 15:25:07 2018 From: fhi.1990 at gmail.com (=?UTF-8?Q?Frederik_Hangh=C3=B8j_Iversen?=) Date: Wed, 21 Feb 2018 15:25:07 +0100 Subject: [Agda] C preprocessor with agda In-Reply-To: <15f88791-f538-b513-827f-8e378f4d0c4a@cse.gu.se> References: <15f88791-f538-b513-827f-8e378f4d0c4a@cse.gu.se> Message-ID: Yes of course - but I'm guessing this won't work with agda-mode... On Wed, Feb 21, 2018 at 12:23 PM, Nils Anders Danielsson wrote: > On 2018-02-12 19:52, Frederik Hangh?j Iversen wrote: > >> Can I somehow use the C preprocessor with Agda? >> > > There is no special support for the C preprocessor, but you can of > course preprocess your files manually. > > -- > /NAD > -- Regards *Frederik Hangh?j Iversen* -------------- next part -------------- An HTML attachment was scrubbed... URL: From fhi.1990 at gmail.com Wed Feb 21 15:40:16 2018 From: fhi.1990 at gmail.com (=?UTF-8?Q?Frederik_Hangh=C3=B8j_Iversen?=) Date: Wed, 21 Feb 2018 15:40:16 +0100 Subject: [Agda] INLINE-pragma Message-ID: I know there's an INLINE-pragma for Agda (though it's not documented here [1]). This pragma affects compilation. I wonder if there was something akin to this for type-checking. When I want to close a goal with a complex type I usually spend a considerable time defining helper functions and in particular figuring out what type these should have. Agda of course can help me here, but often it doesn't display the type that I want. The best type is rarely the non-normalized *nor* fully normalized type. Ideally I would like to be able to step up and down these types interactively. But something perhaps easier to implement and also super helpful would be if I could e.g. mark a "type synonym" as being completely transparent, so that it's definition would be inlined when I ask for goal and context. As a super small example of what I'm looking for is: Assume I have a type-synonym `P T = A ? T' and I want to close a hole of type `P T` then `C-c C-,` should give me `Goal: A ? T`. Incidentally if I issue `C-u C-u C-c C-,` the hole will be displayed as `? A (? x ? T)` which is less helpful. Granted in this case the type is easily understood - but this is rarely the case. [1]: http://agda.readthedocs.io/en/latest/language/pragmas.html -- Regards *Frederik Hangh?j Iversen* -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrei.paskevich at lri.fr Wed Feb 21 17:10:40 2018 From: andrei.paskevich at lri.fr (Andrei Paskevich) Date: Wed, 21 Feb 2018 17:10:40 +0100 Subject: [Agda] VerifyThis 2018: Call for Problems and First Announcement Message-ID: <20180221161040.GA23627@tikki.lri.fr> ******************************************************************************* VerifyThis Verification Competition 2018 FIRST ANNOUNCEMENT AND CALL FOR PROBLEMS Competition to be held at ETAPS 2018 http://verifythis.ethz.ch ******************************************************************************** Get involved, even if you cannot participate in the competition: provide a challenge. IMPORTANT DATES Submission deadline: March 9, 2018 Competition: April 14 and 15, 2018 CALL FOR PROBLEMS To extend the problem pool, we are now soliciting algorithms and data structures which could contribute interesting verification challenges for the VerifyThis program verification competition (itself introduced below). We encourage suggestions at any level of detail, in particular submissions without a fully worked out verification task. - a problem may contain an informal statement of the algorithm to be implemented (optionally with complete or partial pseudocode) and the requirement(s) to be verified - a problem should be suitable for a 60-90 minute time slot - submission of reference solutions is welcome but not mandatory - problems with an inherent language- or tool-specific bias should be clearly identified as such - problems that contain several subproblems or other means of difficulty scaling are especially welcome - the organizers reserve the right (but no obligation) to use the problems in the competition, either as submitted or with modifications - submissions from (potential) competition participants are allowed Problems from previous competitions can be seen at http://verifythis.ethz.ch Submissions are to be sent by email to verifythis at cs.nuim.ie by the date indicated above. PRIZES The most suitable submission for competition will receive a prize. ABOUT VerifyThis 2018 will take place as part of the European Joint Conferences on Theory and Practice of Software (ETAPS 2018) on April 14 and 15, 2018. It is the 7th event in the VerifyThis competition series. Information on previous events and participants can be found at http://verifythis.ethz.ch The aims of the competition are: - to bring together those interested in formal verification, and to provide an engaging, hands-on, and fun opportunity for discussion - to evaluate the usability of logic-based program verification tools in a controlled experiment that could be easily repeated by others. The competition will offer a number of challenges presented in natural language. Participants have to formalize the requirements, implement a solution, and formally verify the implementation for adherence to the specification. There are no restrictions on the programming language and verification technology used. The correctness properties posed in problems will have the input-output behaviour of programs in focus. Solutions will be judged for correctness, completeness and elegance. ORGANIZERS * Marieke Huisman, University of Twente, the Netherlands * Rosemary Monahan, Maynooth University, Ireland * Peter M?ller, ETH Z?rich, Switzerland * Andrei Paskevich, Paris-Sud University, France * Gidon Ernst, National Institute of Informatics Tokyo, Japan CONTACT Email: verifythis at cs.nuim.ie Web: http://verifythis.ethz.ch From thiemann at informatik.uni-freiburg.de Wed Feb 21 17:36:49 2018 From: thiemann at informatik.uni-freiburg.de (Peter Thiemann) Date: Wed, 21 Feb 2018 17:36:49 +0100 Subject: [Agda] Proof involving Fin Message-ID: <59E4C594-0E08-4677-8DD1-00BE5788B665@informatik.uni-freiburg.de> Dear list, I?m stuck with a proof involving the Fin module from the standard library. I need to use Data.Fin.inject+ and the last definition is the lemma that I need. However, when I try to solve the first hole by pattern matching on the argument of coerce list this: inject+0n {suc n} zero with finn=n+0 n ... | p = {!!} But then I cannot destruct p because its type is p : Fin n ? Fin (n + 0) That ought to be fixable with a rewrite, but all alternatives I tried were rejected by Agda. -Peter %%%%%%%%%%%% module Lemmas where open import Data.Fin hiding (_+_ ; _?_) open import Data.Nat open import Relation.Binary.PropositionalEquality -- about Fin and Nat n=n+0 : (n : ?) ? n ? n + 0 n=n+0 zero = refl n=n+0 (suc n) = cong suc (n=n+0 n) n+0=n : (n : ?) ? n + 0 ? n n+0=n zero = refl n+0=n (suc n) = cong suc (n+0=n n) m=n=>finm=finn : ? {m n : ?} ? m ? n ? Fin m ? Fin n m=n=>finm=finn refl = refl finn=n+0 : (n : ?) ? Fin n ? Fin (n + 0) finn=n+0 n = m=n=>finm=finn (n=n+0 n) coerce : ? {A B : Set} ? A ? B ? A ? B coerce refl x = x inject+0n : ? {n : ?} (fn : Fin n) ? inject+ 0 fn ? coerce (finn=n+0 n) fn inject+0n {zero} () inject+0n {suc n} zero = {!!} inject+0n {suc n} (suc fn) = {!!} %%%%%%%%%%%% From bch29 at cam.ac.uk Wed Feb 21 18:05:56 2018 From: bch29 at cam.ac.uk (Bradley Hardy) Date: Wed, 21 Feb 2018 17:05:56 +0000 Subject: [Agda] Proof involving Fin In-Reply-To: <59E4C594-0E08-4677-8DD1-00BE5788B665@informatik.uni-freiburg.de> References: <59E4C594-0E08-4677-8DD1-00BE5788B665@informatik.uni-freiburg.de> Message-ID: <9958F5A4-FEB1-41D6-976D-7D1A5E9757B6@cam.ac.uk> Dear Peter, Agda often doesn?t like pattern matching or rewriting on type equalities where the same variable appears in both sides. To get around this issue, it helps to use heterogeneous equality. The standard library defines a general version, but here?s a type specific to `Fin` that should be easier to understand. data _?_ {m} : ? {n} ? Fin m ? Fin n ? Set where reflexive : {i j : Fin m} ? i ? j ? i ? j cong-suc : ? {m n} {i : Fin m} {j : Fin n} ? i ? j ? suc i ? suc j cong-suc (reflexive p) = reflexive (cong suc p) You can see how it?s possible to write `i ? j` even when `i` and `j` are from finite sets of different sizes. Now an analogous theorem to yours is easy to prove. inject+0n : ? {n : ?} (fn : Fin n) ? inject+ 0 fn ? fn inject+0n {zero} () inject+0n {suc n} zero rewrite n+0=n n = reflexive refl inject+0n {suc n} (suc fn) = cong-suc (inject+0n fn) Notice the rewrite on `n+0=n n` to convince Agda that it is valid to introduce the `reflexive` constructor. We can retrieve propositional equality like this: ?-n?m : ? {m n} {i : Fin m} {j : Fin n} ? i ? j ? m ? n ?-n?m (reflexive _) = refl ?-to-? : ? {m n} {i : Fin m} {j : Fin n} (p : i ? j) ? subst Fin (?-n?m p) i ? j ?-to-? (reflexive p) = p inject+0n? : ? {n : ?} (fn : Fin n) ? subst Fin (?-n?m (inject+0n fn)) (inject+ 0 fn) ? fn inject+0n? fn = ?-to-? (inject+0n fn) I hope this helps! -Bradley > On 21 Feb 2018, at 16:36, Peter Thiemann wrote: > > Dear list, > > I?m stuck with a proof involving the Fin module from the standard library. > I need to use Data.Fin.inject+ and the last definition is the lemma that I need. > However, when I try to solve the first hole by pattern matching on the argument of coerce list this: > > inject+0n {suc n} zero with finn=n+0 n > ... | p = {!!} > > But then I cannot destruct p because its type is > p : Fin n ? Fin (n + 0) > > That ought to be fixable with a rewrite, but all alternatives I tried were rejected by Agda. > > -Peter > > > %%%%%%%%%%%% > module Lemmas where > > open import Data.Fin hiding (_+_ ; _?_) > open import Data.Nat > open import Relation.Binary.PropositionalEquality > > > -- about Fin and Nat > n=n+0 : (n : ?) ? n ? n + 0 > n=n+0 zero = refl > n=n+0 (suc n) = cong suc (n=n+0 n) > > n+0=n : (n : ?) ? n + 0 ? n > n+0=n zero = refl > n+0=n (suc n) = cong suc (n+0=n n) > > m=n=>finm=finn : ? {m n : ?} ? m ? n ? Fin m ? Fin n > m=n=>finm=finn refl = refl > > finn=n+0 : (n : ?) ? Fin n ? Fin (n + 0) > finn=n+0 n = m=n=>finm=finn (n=n+0 n) > > coerce : ? {A B : Set} ? A ? B ? A ? B > coerce refl x = x > > inject+0n : ? {n : ?} (fn : Fin n) ? inject+ 0 fn ? coerce (finn=n+0 n) fn > inject+0n {zero} () > inject+0n {suc n} zero = {!!} > inject+0n {suc n} (suc fn) = {!!} > %%%%%%%%%%%% > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda -------------- next part -------------- An HTML attachment was scrubbed... URL: From thiemann at informatik.uni-freiburg.de Wed Feb 21 18:15:38 2018 From: thiemann at informatik.uni-freiburg.de (Peter Thiemann) Date: Wed, 21 Feb 2018 18:15:38 +0100 Subject: [Agda] Proof involving Fin In-Reply-To: <9958F5A4-FEB1-41D6-976D-7D1A5E9757B6@cam.ac.uk> References: <59E4C594-0E08-4677-8DD1-00BE5788B665@informatik.uni-freiburg.de> <9958F5A4-FEB1-41D6-976D-7D1A5E9757B6@cam.ac.uk> Message-ID: Dear Bradley, Excellent, that will get me further. Thanks -Peter > On 21. Feb 2018, at 18:05, Bradley Hardy wrote: > > Dear Peter, > > Agda often doesn?t like pattern matching or rewriting on type equalities where the same variable appears in both sides. > > To get around this issue, it helps to use heterogeneous equality. The standard library defines a general version, but here?s a type specific to `Fin` that should be easier to understand. > > data _?_ {m} : ? {n} ? Fin m ? Fin n ? Set where > reflexive : {i j : Fin m} ? i ? j ? i ? j > > cong-suc : ? {m n} {i : Fin m} {j : Fin n} ? i ? j ? suc i ? suc j > cong-suc (reflexive p) = reflexive (cong suc p) > > You can see how it?s possible to write `i ? j` even when `i` and `j` are from finite sets of different sizes. Now an analogous theorem to yours is easy to prove. > > inject+0n : ? {n : ?} (fn : Fin n) ? inject+ 0 fn ? fn > inject+0n {zero} () > inject+0n {suc n} zero rewrite n+0=n n = reflexive refl > inject+0n {suc n} (suc fn) = cong-suc (inject+0n fn) > > Notice the rewrite on `n+0=n n` to convince Agda that it is valid to introduce the `reflexive` constructor. > > We can retrieve propositional equality like this: > > ?-n?m : ? {m n} {i : Fin m} {j : Fin n} ? i ? j ? m ? n > ?-n?m (reflexive _) = refl > > ?-to-? : ? {m n} {i : Fin m} {j : Fin n} (p : i ? j) ? subst Fin (?-n?m p) i ? j > ?-to-? (reflexive p) = p > > inject+0n? : ? {n : ?} (fn : Fin n) ? subst Fin (?-n?m (inject+0n fn)) (inject+ 0 fn) ? fn > inject+0n? fn = ?-to-? (inject+0n fn) > > I hope this helps! > > -Bradley > >> On 21 Feb 2018, at 16:36, Peter Thiemann wrote: >> >> Dear list, >> >> I?m stuck with a proof involving the Fin module from the standard library. >> I need to use Data.Fin.inject+ and the last definition is the lemma that I need. >> However, when I try to solve the first hole by pattern matching on the argument of coerce list this: >> >> inject+0n {suc n} zero with finn=n+0 n >> ... | p = {!!} >> >> But then I cannot destruct p because its type is >> p : Fin n ? Fin (n + 0) >> >> That ought to be fixable with a rewrite, but all alternatives I tried were rejected by Agda. >> >> -Peter >> >> >> %%%%%%%%%%%% >> module Lemmas where >> >> open import Data.Fin hiding (_+_ ; _?_) >> open import Data.Nat >> open import Relation.Binary.PropositionalEquality >> >> >> -- about Fin and Nat >> n=n+0 : (n : ?) ? n ? n + 0 >> n=n+0 zero = refl >> n=n+0 (suc n) = cong suc (n=n+0 n) >> >> n+0=n : (n : ?) ? n + 0 ? n >> n+0=n zero = refl >> n+0=n (suc n) = cong suc (n+0=n n) >> >> m=n=>finm=finn : ? {m n : ?} ? m ? n ? Fin m ? Fin n >> m=n=>finm=finn refl = refl >> >> finn=n+0 : (n : ?) ? Fin n ? Fin (n + 0) >> finn=n+0 n = m=n=>finm=finn (n=n+0 n) >> >> coerce : ? {A B : Set} ? A ? B ? A ? B >> coerce refl x = x >> >> inject+0n : ? {n : ?} (fn : Fin n) ? inject+ 0 fn ? coerce (finn=n+0 n) fn >> inject+0n {zero} () >> inject+0n {suc n} zero = {!!} >> inject+0n {suc n} (suc fn) = {!!} >> %%%%%%%%%%%% >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda > From apostolis.xekoukoulotakis at gmail.com Sun Feb 25 10:55:56 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Sun, 25 Feb 2018 11:55:56 +0200 Subject: [Agda] Serialization to ByteString Message-ID: There is a Bytes Type in agda-prelude, https://github.com/UlfNorell/agda-prelude/blob/2e3addb9a434ed121805fa571f1dd0a077076a29/src/Prelude/Bytes.agda but there is no defined way to encode/decode a builtin type to/from Bytes. Is there a way to perform the serialization with the builtin types or do I have to define my own pragmas? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell at gmail.com Sun Feb 25 11:12:26 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Sun, 25 Feb 2018 11:12:26 +0100 Subject: [Agda] Serialization to ByteString In-Reply-To: References: Message-ID: Philipp added the Bytes type in https://github.com/UlfNorell/agda-prelude/commit/6214370064f14b to do binary IO, but it doesn't look like he added any functions to create them other than reading from file. / Ulf On Sun, Feb 25, 2018 at 10:55 AM, Apostolis Xekoukoulotakis < apostolis.xekoukoulotakis at gmail.com> wrote: > There is a Bytes Type in agda-prelude, > https://github.com/UlfNorell/agda-prelude/blob/ > 2e3addb9a434ed121805fa571f1dd0a077076a29/src/Prelude/Bytes.agda > > but there is no defined way to encode/decode a builtin type to/from Bytes. > Is there a way to perform the serialization with the builtin types or do I > have to define my own pragmas? > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apostolis.xekoukoulotakis at gmail.com Sun Feb 25 11:38:18 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Sun, 25 Feb 2018 12:38:18 +0200 Subject: [Agda] Serialization to ByteString In-Reply-To: References: Message-ID: I could use haskell' Binary library, but that would require me to know the haskell type of the builtin types. The other option is that Agda has primitive functions that make the transformation, this way I do not need to know how builtin types are represented in Haskell. The other option is to define my my own pragmas for the builtin types. I do not want to do that because the builtin representation was done for a reason. I would prefer the second option. To add primitive functions that make the transformation. On Sun, Feb 25, 2018 at 12:12 PM, Ulf Norell wrote: > Philipp added the Bytes type in https://github.com/UlfNorell/ > agda-prelude/commit/6214370064f14b to do binary IO, but it doesn't look > like he added any functions to create them other than reading from file. > > / Ulf > > On Sun, Feb 25, 2018 at 10:55 AM, Apostolis Xekoukoulotakis < > apostolis.xekoukoulotakis at gmail.com> wrote: > >> There is a Bytes Type in agda-prelude, >> https://github.com/UlfNorell/agda-prelude/blob/2e3addb9a434e >> d121805fa571f1dd0a077076a29/src/Prelude/Bytes.agda >> >> but there is no defined way to encode/decode a builtin type to/from Bytes. >> Is there a way to perform the serialization with the builtin types or do >> I have to define my own pragmas? >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell at gmail.com Sun Feb 25 12:28:29 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Sun, 25 Feb 2018 12:28:29 +0100 Subject: [Agda] Serialization to ByteString In-Reply-To: References: Message-ID: I think the simplest approach would be to add a binding to a Haskell function taking a list of Integers (which is how natural numbers are represented) and storing them (mod 256) in a byte string. Then you can do all the encoding on the Agda side and there's no need for any new primitives or worry over how builtin types are represented. / Ulf On Sun, Feb 25, 2018 at 11:38 AM, Apostolis Xekoukoulotakis < apostolis.xekoukoulotakis at gmail.com> wrote: > I could use haskell' Binary library, but that would require me to know the > haskell type of the builtin types. > > The other option is that Agda has primitive functions that make the > transformation, this way I do not need to know how builtin types are > represented in Haskell. > > The other option is to define my my own pragmas for the builtin types. I > do not want to do that because the builtin representation was done for a > reason. > > I would prefer the second option. To add primitive functions that make the > transformation. > > On Sun, Feb 25, 2018 at 12:12 PM, Ulf Norell wrote: > >> Philipp added the Bytes type in https://github.com/UlfNorell/a >> gda-prelude/commit/6214370064f14b to do binary IO, but it doesn't look >> like he added any functions to create them other than reading from file. >> >> / Ulf >> >> On Sun, Feb 25, 2018 at 10:55 AM, Apostolis Xekoukoulotakis < >> apostolis.xekoukoulotakis at gmail.com> wrote: >> >>> There is a Bytes Type in agda-prelude, >>> https://github.com/UlfNorell/agda-prelude/blob/2e3addb9a434e >>> d121805fa571f1dd0a077076a29/src/Prelude/Bytes.agda >>> >>> but there is no defined way to encode/decode a builtin type to/from >>> Bytes. >>> Is there a way to perform the serialization with the builtin types or do >>> I have to define my own pragmas? >>> >>> _______________________________________________ >>> Agda mailing list >>> Agda at lists.chalmers.se >>> https://lists.chalmers.se/mailman/listinfo/agda >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fhi.1990 at gmail.com Sun Feb 25 14:47:00 2018 From: fhi.1990 at gmail.com (=?UTF-8?Q?Frederik_Hangh=C3=B8j_Iversen?=) Date: Sun, 25 Feb 2018 14:47:00 +0100 Subject: [Agda] List of exports Message-ID: Can I get Agda to generate a tree of symbols exported in my project/a module? -- Regards *Frederik Hangh?j Iversen* -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell at gmail.com Sun Feb 25 15:58:18 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Sun, 25 Feb 2018 15:58:18 +0100 Subject: [Agda] List of exports In-Reply-To: References: Message-ID: C-c C-o shows you the contents of a module in the emacs mode. / Ulf On Sun, Feb 25, 2018 at 2:47 PM, Frederik Hangh?j Iversen < fhi.1990 at gmail.com> wrote: > Can I get Agda to generate a tree of symbols exported in my project/a > module? > > -- > Regards > *Frederik Hangh?j Iversen* > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apostolis.xekoukoulotakis at gmail.com Sun Feb 25 16:57:21 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Sun, 25 Feb 2018 17:57:21 +0200 Subject: [Agda] Serialization to ByteString In-Reply-To: References: Message-ID: Wouldn't that be inefficient? A Nat would need to be divided by 256 , then we need to take the remainder Nat and transform it into an Integer. Wouldn't that last step require us to recursively add +1 to the integer? On Sun, Feb 25, 2018 at 1:28 PM, Ulf Norell wrote: > I think the simplest approach would be to add a binding to a Haskell > function taking a list of Integers (which is how natural numbers are > represented) and storing them (mod 256) in a byte string. Then you can do > all the encoding on the Agda side and there's no need for any new > primitives or worry over how builtin types are represented. > > / Ulf > > On Sun, Feb 25, 2018 at 11:38 AM, Apostolis Xekoukoulotakis < > apostolis.xekoukoulotakis at gmail.com> wrote: > >> I could use haskell' Binary library, but that would require me to know >> the haskell type of the builtin types. >> >> The other option is that Agda has primitive functions that make the >> transformation, this way I do not need to know how builtin types are >> represented in Haskell. >> >> The other option is to define my my own pragmas for the builtin types. I >> do not want to do that because the builtin representation was done for a >> reason. >> >> I would prefer the second option. To add primitive functions that make >> the transformation. >> >> On Sun, Feb 25, 2018 at 12:12 PM, Ulf Norell >> wrote: >> >>> Philipp added the Bytes type in https://github.com/UlfNorell/a >>> gda-prelude/commit/6214370064f14b to do binary IO, but it doesn't look >>> like he added any functions to create them other than reading from file. >>> >>> / Ulf >>> >>> On Sun, Feb 25, 2018 at 10:55 AM, Apostolis Xekoukoulotakis < >>> apostolis.xekoukoulotakis at gmail.com> wrote: >>> >>>> There is a Bytes Type in agda-prelude, >>>> https://github.com/UlfNorell/agda-prelude/blob/2e3addb9a434e >>>> d121805fa571f1dd0a077076a29/src/Prelude/Bytes.agda >>>> >>>> but there is no defined way to encode/decode a builtin type to/from >>>> Bytes. >>>> Is there a way to perform the serialization with the builtin types or >>>> do I have to define my own pragmas? >>>> >>>> _______________________________________________ >>>> Agda mailing list >>>> Agda at lists.chalmers.se >>>> https://lists.chalmers.se/mailman/listinfo/agda >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell at gmail.com Sun Feb 25 17:20:37 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Sun, 25 Feb 2018 17:20:37 +0100 Subject: [Agda] Serialization to ByteString In-Reply-To: References: Message-ID: I'm not quite following, but sure, if you want high performance you should bind against the Haskell binary library (your first option). FFI bindings are type checked so you don't have to worry about mistaking the representation of a builtin type. / Ulf On Sun, Feb 25, 2018 at 4:57 PM, Apostolis Xekoukoulotakis < apostolis.xekoukoulotakis at gmail.com> wrote: > Wouldn't that be inefficient? A Nat would need to be divided by 256 , then > we need to take the remainder Nat and transform it into an Integer. > Wouldn't that last step require us to recursively add +1 to the integer? > > > On Sun, Feb 25, 2018 at 1:28 PM, Ulf Norell wrote: > >> I think the simplest approach would be to add a binding to a Haskell >> function taking a list of Integers (which is how natural numbers are >> represented) and storing them (mod 256) in a byte string. Then you can do >> all the encoding on the Agda side and there's no need for any new >> primitives or worry over how builtin types are represented. >> >> / Ulf >> >> On Sun, Feb 25, 2018 at 11:38 AM, Apostolis Xekoukoulotakis < >> apostolis.xekoukoulotakis at gmail.com> wrote: >> >>> I could use haskell' Binary library, but that would require me to know >>> the haskell type of the builtin types. >>> >>> The other option is that Agda has primitive functions that make the >>> transformation, this way I do not need to know how builtin types are >>> represented in Haskell. >>> >>> The other option is to define my my own pragmas for the builtin types. I >>> do not want to do that because the builtin representation was done for a >>> reason. >>> >>> I would prefer the second option. To add primitive functions that make >>> the transformation. >>> >>> On Sun, Feb 25, 2018 at 12:12 PM, Ulf Norell >>> wrote: >>> >>>> Philipp added the Bytes type in https://github.com/UlfNorell/a >>>> gda-prelude/commit/6214370064f14b to do binary IO, but it doesn't look >>>> like he added any functions to create them other than reading from file. >>>> >>>> / Ulf >>>> >>>> On Sun, Feb 25, 2018 at 10:55 AM, Apostolis Xekoukoulotakis < >>>> apostolis.xekoukoulotakis at gmail.com> wrote: >>>> >>>>> There is a Bytes Type in agda-prelude, >>>>> https://github.com/UlfNorell/agda-prelude/blob/2e3addb9a434e >>>>> d121805fa571f1dd0a077076a29/src/Prelude/Bytes.agda >>>>> >>>>> but there is no defined way to encode/decode a builtin type to/from >>>>> Bytes. >>>>> Is there a way to perform the serialization with the builtin types or >>>>> do I have to define my own pragmas? >>>>> >>>>> _______________________________________________ >>>>> Agda mailing list >>>>> Agda at lists.chalmers.se >>>>> https://lists.chalmers.se/mailman/listinfo/agda >>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apostolis.xekoukoulotakis at gmail.com Sun Feb 25 18:04:45 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Sun, 25 Feb 2018 19:04:45 +0200 Subject: [Agda] Serialization to ByteString In-Reply-To: References: Message-ID: Thanks, I will do that. On Sun, Feb 25, 2018 at 6:20 PM, Ulf Norell wrote: > I'm not quite following, but sure, if you want high performance you should > bind against the Haskell binary library (your first option). FFI bindings > are type checked so you don't have to worry about mistaking the > representation of a builtin type. > > / Ulf > > On Sun, Feb 25, 2018 at 4:57 PM, Apostolis Xekoukoulotakis < > apostolis.xekoukoulotakis at gmail.com> wrote: > >> Wouldn't that be inefficient? A Nat would need to be divided by 256 , >> then we need to take the remainder Nat and transform it into an Integer. >> Wouldn't that last step require us to recursively add +1 to the integer? >> >> >> On Sun, Feb 25, 2018 at 1:28 PM, Ulf Norell wrote: >> >>> I think the simplest approach would be to add a binding to a Haskell >>> function taking a list of Integers (which is how natural numbers are >>> represented) and storing them (mod 256) in a byte string. Then you can do >>> all the encoding on the Agda side and there's no need for any new >>> primitives or worry over how builtin types are represented. >>> >>> / Ulf >>> >>> On Sun, Feb 25, 2018 at 11:38 AM, Apostolis Xekoukoulotakis < >>> apostolis.xekoukoulotakis at gmail.com> wrote: >>> >>>> I could use haskell' Binary library, but that would require me to know >>>> the haskell type of the builtin types. >>>> >>>> The other option is that Agda has primitive functions that make the >>>> transformation, this way I do not need to know how builtin types are >>>> represented in Haskell. >>>> >>>> The other option is to define my my own pragmas for the builtin types. >>>> I do not want to do that because the builtin representation was done for a >>>> reason. >>>> >>>> I would prefer the second option. To add primitive functions that make >>>> the transformation. >>>> >>>> On Sun, Feb 25, 2018 at 12:12 PM, Ulf Norell >>>> wrote: >>>> >>>>> Philipp added the Bytes type in https://github.com/UlfNorell/a >>>>> gda-prelude/commit/6214370064f14b to do binary IO, but it doesn't >>>>> look like he added any functions to create them other than reading from >>>>> file. >>>>> >>>>> / Ulf >>>>> >>>>> On Sun, Feb 25, 2018 at 10:55 AM, Apostolis Xekoukoulotakis < >>>>> apostolis.xekoukoulotakis at gmail.com> wrote: >>>>> >>>>>> There is a Bytes Type in agda-prelude, >>>>>> https://github.com/UlfNorell/agda-prelude/blob/2e3addb9a434e >>>>>> d121805fa571f1dd0a077076a29/src/Prelude/Bytes.agda >>>>>> >>>>>> but there is no defined way to encode/decode a builtin type to/from >>>>>> Bytes. >>>>>> Is there a way to perform the serialization with the builtin types or >>>>>> do I have to define my own pragmas? >>>>>> >>>>>> _______________________________________________ >>>>>> Agda mailing list >>>>>> Agda at lists.chalmers.se >>>>>> https://lists.chalmers.se/mailman/listinfo/agda >>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mechvel at botik.ru Mon Feb 26 12:06:49 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Mon, 26 Feb 2018 14:06:49 +0300 Subject: [Agda] =?iso-8859-1?q?=AC_0=23_=3F_1=23?= Message-ID: <1519643209.2817.15.camel@one.mechvel.pereslavl.ru> People, this is a question about Standard library. I write module _ {? ?=} (R : CommutativeRing ? ?=) (open CommutativeRing R using (0#; 1#; ...)) (0?1 : ? 0# ? 1#) ... But probably 0?1 needs to be an axiom in RingWithOne (and in CommutativeRing). Is such in Standard library? Thanks, ------ Sergei From mechvel at botik.ru Mon Feb 26 18:08:58 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Mon, 26 Feb 2018 20:08:58 +0300 Subject: [Agda] =?iso-8859-1?q?=AC_0=23_=3F_1=23?= Message-ID: <1519664938.2363.35.camel@one.mechvel.pereslavl.ru> On Mon, Feb 26, 2018 at 11:06 AM, Sergei Meshveliani wrote: [..] > I write > > module _ {? ?=} (R : CommutativeRing ? ?=) > (open CommutativeRing R using (0#; 1#; ...)) > (0?1 : ? 0# ? 1#) > ... > > > But probably 0?1 needs to be an axiom in RingWithOne (and in > CommutativeRing). Is such in Standard library? But I have looked now into (I) "Algebra" by S.Lang 1968, and into (II) "Algebra" by Wan Der Waerden. (I) requires 0 ? 1 only starting from Principle Ideal Ring. (II) requires 0 ? 1 only starting from Division Ring. So that Standard library agrees with these two books, and RingWithOne does not need to include 0?1, and I withdraw my question. Sorry for noise, ------ Sergei From wadler at inf.ed.ac.uk Tue Feb 27 14:26:52 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Tue, 27 Feb 2018 14:26:52 +0100 Subject: [Agda] Typed DeBruijn, typed Phoas, and untyped DeBruijn Message-ID: The typed DeBruijn representation is well known, as are typed PHOAS and untyped DeBruijn. It is easy to convert PHOAS to untyped DeBruijn. Is it known how to convert PHOAS to typed DeBruijn? Yours, -- P ## Imports \begin{code} open import Relation.Binary.PropositionalEquality using (_?_; refl) open import Data.Nat using (?; zero; suc; _+_; _?_) \end{code} ## Typed DeBruijn \begin{code} infixr 4 _?_ data Type : Set where o : Type _?_ : Type ? Type ? Type data Env : Set where ? : Env _,_ : Env ? Type ? Env data Var : Env ? Type ? Set where Z : ? {? : Env} {A : Type} ? Var (? , A) A S : ? {? : Env} {A B : Type} ? Var ? B ? Var (? , A) B data Exp : Env ? Type ? Set where var : ? {? : Env} {A : Type} ? Var ? A ? Exp ? A abs : ? {? : Env} {A B : Type} ? Exp (? , A) B ? Exp ? (A ? B) app : ? {? : Env} {A B : Type} ? Exp ? (A ? B) ? Exp ? A ? Exp ? B \end{code} ## Untyped DeBruijn \begin{code} data DB : Set where var : ? ? DB abs : DB ? DB app : DB ? DB ? DB \end{code} # PHOAS \begin{code} data PH (X : Type ? Set) : Type ? Set where var : ? {A : Type} ? X A ? PH X A abs : ? {A B : Type} ? (X A ? PH X B) ? PH X (A ? B) app : ? {A B : Type} ? PH X (A ? B) ? PH X A ? PH X B \end{code} # Convert PHOAS to DB \begin{code} PH?DB : ? {A} ? (? {X} ? PH X A) ? DB PH?DB M = h M 0 where K : Type ? Set K A = ? h : ? {A} ? PH K A ? ? ? DB h (var k) j = var (j ? k) h (abs N) j = abs (h (N (j + 1)) (j + 1)) h (app L M) j = app (h L j) (h M j) \end{code} # Test examples \begin{code} Church : Type Church = (o ? o) ? o ? o twoExp : Exp ? Church twoExp = (abs (abs (app (var (S Z)) (app (var (S Z)) (var Z))))) twoPH : ? {X} ? PH X Church twoPH = (abs (? f ? (abs (? x ? (app (var f) (app (var f) (var x))))))) twoDB : DB twoDB = (abs (abs (app (var 1) (app (var 1) (var 0))))) ex : PH?DB twoPH ? twoDB ex = refl \end{code} . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From nad at cse.gu.se Tue Feb 27 17:43:46 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Tue, 27 Feb 2018 17:43:46 +0100 Subject: [Agda] Typed DeBruijn, typed Phoas, and untyped DeBruijn In-Reply-To: References: Message-ID: <9441452b-9205-0b30-4d57-866ba7991530@cse.gu.se> On 2018-02-27 14:26, Philip Wadler wrote: > The typed DeBruijn representation is well known, as are typed PHOAS > and untyped DeBruijn. It is easy to convert PHOAS to untyped > DeBruijn. Is it known how to convert PHOAS to typed DeBruijn? I haven't checked the details, but Adam Chlipala seems to discuss this topic: http://adam.chlipala.net/cpdt/html/Intensional.html -- /NAD From effectfully at gmail.com Tue Feb 27 22:07:57 2018 From: effectfully at gmail.com (Roman) Date: Wed, 28 Feb 2018 00:07:57 +0300 Subject: [Agda] Typed DeBruijn, typed Phoas, and untyped DeBruijn In-Reply-To: <9441452b-9205-0b30-4d57-866ba7991530@cse.gu.se> References: <9441452b-9205-0b30-4d57-866ba7991530@cse.gu.se> Message-ID: You can easily get the PHOAS representation of a regular Agda lambda expression [1]. E.g. K : Term (? ? ? ? ?) K = ? const S : Term ((? ? ? ? ?) ? (? ? ?) ? ? ? ?) S = ? _?_ Here `?` takes an Agda combinator, specializes all type variables as it desires and constructs the corresponding PHOAS term. The implementation is just a matter of a few lines. Constructing typed de Bruijn terms from metalanguage lambda terms is much harder. When you do normalisation by evaluation, you use some form of Kripke semantics in order to get an easy way to reify target-language terms back. But PHOAS representation is basically a shallow embedding of metalanguage terms which do not have the notions of weakening, future contexts and such, so things become quite more involved as witnessed by Adam Chlipala's elaborations Nils referred to. There is always a way to cheat, though. You can turn the PHOAS -> untyped de Bruijn machinery into the PHOAS -> typed de Bruijn machinery by checking that future contexts indeed extend past contexts and throwing an error otherwise (which can't happed, because future contexts always extend past contexts, but it's a metatheorem). Not a type-theoretic way to do things, "but works". This is discussed in the Andreas Abel's habilitation thesis [2] under the heading "Liftable terms". I have an implementation of these ideas in Agda: [3]. Reifying regular Agda lambda terms costs one postulate with this approach. But I'm not a type theorist, so take it with a grain of salt. [1] https://github.com/effectfully/random-stuff/blob/master/Normalization/PHOAS.agda [2] http://www.cse.chalmers.se/~abela/habil.pdf [3] https://github.com/effectfully/random-stuff/blob/master/Normalization/Liftable.agda From mechvel at botik.ru Tue Feb 27 22:11:35 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Wed, 28 Feb 2018 00:11:35 +0300 Subject: [Agda] (Semi)RingWithOne Message-ID: <1519765895.2666.32.camel@one.mechvel.pereslavl.ru> Dear all, This is a certain minor point about algebra in Standard library. I am writing a certain application that relies on Standard library algebra, from Semigroup up to CommutativeRing. And I observe the following. (I) A classical book by Lang (1968) defines that a Ring has an unity element by multiplication. (II) A classical book by Van Der Waerden (1971) defines that a Ring does not necessary has unity. If it has, people call it "Ring with unity". I expected that in Standard library it would be called RinWithOne. But I do not find such there. (III) Standard library defines that Semiring has unity (1#), and Ring inherits Semiring, so that Ring always has an unity element by multiplication. And this agrees with (I). (and naturally, the name RingWithOne is skipped). (IV) But Standard library also introduces SemiringWithoutOne. ------- (V) Even integer numbers occur a Ring according to (II), but not according to (I). Summing all this, I think that this will be more natural for Standard library * to define Ring as in (II), * to define Semiring with skipping 1# (instead of SemiringWihoutOne), * to define SemiringWithOne as including 1#, * to define RingWithOne as inheriting SemiringWithOne. -- ? Regards, ------ Sergei From matthewdaggitt at gmail.com Tue Feb 27 23:51:24 2018 From: matthewdaggitt at gmail.com (Matthew Daggitt) Date: Tue, 27 Feb 2018 22:51:24 +0000 Subject: [Agda] (Semi)RingWithOne In-Reply-To: <1519765895.2666.32.camel@one.mechvel.pereslavl.ru> References: <1519765895.2666.32.camel@one.mechvel.pereslavl.ru> Message-ID: Hi Sergei, Without wishing to get into a citation war, I think there is no clear consensus that (semi)rings are traditionally defined without a multiplicative identity. Indeed in every course or textbook I've seen, they've come with a one defined. Of course that may be a cultural thing. However given that it's not necessarily clear which way is most common, I think the standard library will err on the side of sticking with the current definition. To do otherwise would raise a lot of backwards compatibility issues with other people's code. I'm also a bit confused by your statement that the integer numbers does not have a one. Surely the multiplicative identity of the integers is just "1"? If there is anything else we can do in the existing framework of the standard library to help you use the current definitions, do let us know and we'll consider it for addition. Best, Matthew On Tue, Feb 27, 2018 at 9:11 PM, Sergei Meshveliani wrote: > Dear all, > > This is a certain minor point about algebra in Standard library. > I am writing a certain application that relies on Standard library > algebra, from Semigroup up to CommutativeRing. > And I observe the following. > > (I) A classical book by Lang (1968) defines that a Ring has an unity > element by multiplication. > > (II) A classical book by Van Der Waerden (1971) defines that a Ring does > not necessary has unity. If it has, people call it "Ring with unity". > I expected that in Standard library it would be called RinWithOne. > But I do not find such there. > > (III) Standard library defines that Semiring has unity (1#), > and Ring inherits Semiring, so that Ring always has an unity element > by multiplication. And this agrees with (I). > (and naturally, the name RingWithOne is skipped). > > (IV) But Standard library also introduces SemiringWithoutOne. > ------- > > (V) Even integer numbers occur a Ring according to (II), > but not according to (I). > > > Summing all this, I think that this will be more natural for Standard > library > * to define Ring as in (II), > * to define Semiring with skipping 1# (instead of SemiringWihoutOne), > * to define SemiringWithOne as including 1#, > * to define RingWithOne as inheriting SemiringWithOne. > > -- ? > > Regards, > > ------ > Sergei > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mechvel at botik.ru Wed Feb 28 10:51:33 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Wed, 28 Feb 2018 12:51:33 +0300 Subject: [Agda] (Semi)RingWithOne In-Reply-To: References: <1519765895.2666.32.camel@one.mechvel.pereslavl.ru> Message-ID: <1519811493.2366.22.camel@one.mechvel.pereslavl.ru> On Tue, 2018-02-27 at 22:51 +0000, Matthew Daggitt wrote: > Hi Sergei, > Without wishing to get into a citation war, I think there is no clear > consensus that (semi)rings are traditionally defined without a > multiplicative identity. Indeed in every course or textbook I've seen, > they've come with a one defined. Of course that may be a cultural > thing. However given that it's not necessarily clear which way is most > common, I think the standard library will err on the side of sticking > with the current definition. To do otherwise would raise a lot of > backwards compatibility issues with other people's code. > All right. > I'm also a bit confused by your statement that the integer numbers > does not have a one. Surely the multiplicative identity of the > integers is just "1"? I wrote >> (V) Even integer numbers occur a Ring according to (II), >> but not according to (I). I have run into a play on words. The word `even' also has mathematical meanings. By "Even integer numbers" I meant the set Z2 of even integers: Z2 = {2 * n | n <- Integer}. The operations 0, +, -_, * restricted on Z2 satisfy the ring axioms -- except the unity one for multiplication (if I am not missing something). ------ Sergei > If there is anything else we can do in the existing framework of the > standard library to help you use the current definitions, do let us > know and we'll consider it for addition. > Best, > Matthew > > On Tue, Feb 27, 2018 at 9:11 PM, Sergei Meshveliani > wrote: > Dear all, > > This is a certain minor point about algebra in Standard > library. > I am writing a certain application that relies on Standard > library > algebra, from Semigroup up to CommutativeRing. > And I observe the following. > > (I) A classical book by Lang (1968) defines that a Ring has an > unity > element by multiplication. > > (II) A classical book by Van Der Waerden (1971) defines that a > Ring does > not necessary has unity. If it has, people call it "Ring with > unity". > I expected that in Standard library it would be called > RinWithOne. > But I do not find such there. > > (III) Standard library defines that Semiring has unity (1#), > and Ring inherits Semiring, so that Ring always has an unity > element > by multiplication. And this agrees with (I). > (and naturally, the name RingWithOne is skipped). > > (IV) But Standard library also introduces SemiringWithoutOne. > ------- > > (V) Even integer numbers occur a Ring according to (II), > but not according to (I). > > > Summing all this, I think that this will be more natural for > Standard > library > * to define Ring as in (II), > * to define Semiring with skipping 1# (instead of > SemiringWihoutOne), > * to define SemiringWithOne as including 1#, > * to define RingWithOne as inheriting SemiringWithOne. > > -- ? > > Regards, > > ------ > Sergei > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > From wadler at inf.ed.ac.uk Wed Feb 28 12:23:32 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Wed, 28 Feb 2018 12:23:32 +0100 Subject: [Agda] Typed DeBruijn, typed Phoas, and untyped DeBruijn In-Reply-To: References: <9441452b-9205-0b30-4d57-866ba7991530@cse.gu.se> Message-ID: Many thanks to Nils and Roman. Attached find an implementation along the lines sketched by Roman; I found it after I sent my request and before Roman sent his helpful reply. One thing I note, in both Roman's code and mine, is that the code to decide whether two contexts are equal is lengthy (_?T_ and _?_, below). Is there a better way to do it? Does Agda offer an equivalent of Haskell's derivable for equality? Cheers, -- P ## Imports \begin{code} open import Relation.Binary.PropositionalEquality using (_?_; refl) open import Data.Nat using (?; zero; suc; _+_; _?_) open import Data.Product using (_?_; proj?; proj?; ?; ?-syntax) renaming (_,_ to ?_,_?) open import Data.Sum using (_?_; inj?; inj?) open import Relation.Nullary using (?_; Dec; yes; no) open import Relation.Nullary.Decidable using (map) open import Relation.Nullary.Negation using (contraposition) open import Relation.Nullary.Product using (_?-dec_) open import Data.Unit using (?; tt) open import Data.Empty using (?; ?-elim) open import Function using (_?_) open import Function.Equivalence using (_?_; equivalence) \end{code} ## Typed DeBruijn \begin{code} infixr 5 _?_ data Type : Set where o : Type _?_ : Type ? Type ? Type data Env : Set where ? : Env _,_ : Env ? Type ? Env data Var : Env ? Type ? Set where Z : ? {? : Env} {A : Type} ? Var (? , A) A S : ? {? : Env} {A B : Type} ? Var ? B ? Var (? , A) B data Exp : Env ? Type ? Set where var : ? {? : Env} {A : Type} ? Var ? A ? Exp ? A abs : ? {? : Env} {A B : Type} ? Exp (? , A) B ? Exp ? (A ? B) app : ? {? : Env} {A B : Type} ? Exp ? (A ? B) ? Exp ? A ? Exp ? B \end{code} ## Untyped DeBruijn \begin{code} data DB : Set where var : ? ? DB abs : DB ? DB app : DB ? DB ? DB \end{code} # PHOAS \begin{code} data PH (X : Type ? Set) : Type ? Set where var : ? {A : Type} ? X A ? PH X A abs : ? {A B : Type} ? (X A ? PH X B) ? PH X (A ? B) app : ? {A B : Type} ? PH X (A ? B) ? PH X A ? PH X B \end{code} # Convert PHOAS to DB \begin{code} PH?DB : ? {A} ? (? {X} ? PH X A) ? DB PH?DB M = h M 0 where K : Type ? Set K A = ? h : ? {A} ? PH K A ? ? ? DB h (var k) j = var (j ? (k + 1)) h (abs N) j = abs (h (N j) (j + 1)) h (app L M) j = app (h L j) (h M j) \end{code} # Test examples \begin{code} Church : Type Church = (o ? o) ? o ? o twoExp : Exp ? Church twoExp = (abs (abs (app (var (S Z)) (app (var (S Z)) (var Z))))) twoPH : ? {X} ? PH X Church twoPH = (abs (? f ? (abs (? x ? (app (var f) (app (var f) (var x))))))) twoDB : DB twoDB = (abs (abs (app (var 1) (app (var 1) (var 0))))) ex : PH?DB twoPH ? twoDB ex = refl \end{code} ## Decide whether environments and types are equal \begin{code} _?T_ : ? (A B : Type) ? Dec (A ? B) o ?T o = yes refl o ?T (A? ? B?) = no (?()) (A ? B) ?T o = no (?()) (A ? B) ?T (A? ? B?) = map (equivalence obv1 obv2) ((A ?T A?) ?-dec (B ?T B?)) where obv1 : ? {A B A? B? : Type} ? (A ? A?) ? (B ? B?) ? A ? B ? A? ? B? obv1 ? refl , refl ? = refl obv2 : ? {A B A? B? : Type} ? A ? B ? A? ? B? ? (A ? A?) ? (B ? B?) obv2 refl = ? refl , refl ? _?_ : ? (? ? : Env) ? Dec (? ? ?) ? ? ? = yes refl ? ? (? , A) = no (?()) (? , A) ? ? = no (?()) (? , A) ? (? , B) = map (equivalence obv1 obv2) ((? ? ?) ?-dec (A ?T B)) where obv1 : ? {? ? A B} ? (? ? ?) ? (A ? B) ? (? , A) ? (? , B) obv1 ? refl , refl ? = refl obv2 : ? {? ? A B} ? (? , A) ? (? , B) ? (? ? ?) ? (A ? B) obv2 refl = ? refl , refl ? \end{code} ## Convert Phoas to Exp \begin{code} compare : ? (A : Type) (? ? : Env) ? Var ? A compare A ? ? with (? , A) ? ? compare A ? ? | yes refl = Z compare A ? (? , B) | no _ = S (compare A ? ?) compare A ? ? | no _ = impossible where postulate impossible : ? {A : Set} ? A PH?Exp : ? {A : Type} ? (? {X} ? PH X A) ? Exp ? A PH?Exp M = h M ? where K : Type ? Set K A = Env h : ? {A} ? PH K A ? (? : Env) ? Exp ? A h {A} (var ?) ? = var (compare A ? ?) h {A ? B} (abs N) ? = abs (h (N ?) (? , A)) h (app L M) ? = app (h L ?) (h M ?) ex? : PH?Exp twoPH ? twoExp ex? = refl \end{code} ## When one environment extends another We could get rid of the use of `impossible` above if we could prove that `Extends (? , A) ?` in the `(var ?)` case of the definition of `h`. \begin{code} data Extends : (? : Env) ? (? : Env) ? Set where Z : ? {? : Env} ? Extends ? ? S : ? {A : Type} {? ? : Env} ? Extends ? ? ? Extends ? (? , A) extract : ? {A : Type} {? ? : Env} ? Extends (? , A) ? ? Var ? A extract Z = Z extract (S k) = S (extract k) \end{code} . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 27 February 2018 at 22:07, Roman wrote: > You can easily get the PHOAS representation of a regular Agda lambda > expression [1]. E.g. > > K : Term (? ? ? ? ?) > K = ? const > > S : Term ((? ? ? ? ?) ? (? ? ?) ? ? ? ?) > S = ? _?_ > > Here `?` takes an Agda combinator, specializes all type variables as > it desires and constructs the corresponding PHOAS term. The > implementation is just a matter of a few lines. > > Constructing typed de Bruijn terms from metalanguage lambda terms is > much harder. When you do normalisation by evaluation, you use some > form of Kripke semantics in order to get an easy way to reify > target-language terms back. But PHOAS representation is basically a > shallow embedding of metalanguage terms which do not have the notions > of weakening, future contexts and such, so things become quite more > involved as witnessed by Adam Chlipala's elaborations Nils referred > to. > > There is always a way to cheat, though. You can turn the PHOAS -> > untyped de Bruijn machinery into the PHOAS -> typed de Bruijn > machinery by checking that future contexts indeed extend past contexts > and throwing an error otherwise (which can't happed, because future > contexts always extend past contexts, but it's a metatheorem). Not a > type-theoretic way to do things, "but works". This is discussed in the > Andreas Abel's habilitation thesis [2] under the heading "Liftable > terms". I have an implementation of these ideas in Agda: [3]. Reifying > regular Agda lambda terms costs one postulate with this approach. > > But I'm not a type theorist, so take it with a grain of salt. > > [1] https://github.com/effectfully/random-stuff/blob/ > master/Normalization/PHOAS.agda > [2] http://www.cse.chalmers.se/~abela/habil.pdf > [3] https://github.com/effectfully/random-stuff/blob/ > master/Normalization/Liftable.agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From effectfully at gmail.com Wed Feb 28 14:31:07 2018 From: effectfully at gmail.com (Roman) Date: Wed, 28 Feb 2018 16:31:07 +0300 Subject: [Agda] Typed DeBruijn, typed Phoas, and untyped DeBruijn In-Reply-To: References: <9441452b-9205-0b30-4d57-866ba7991530@cse.gu.se> Message-ID: Agda doesn't have a built-in deriving machinery, but Agda has tactics which can be used to implement it. Ulf's `agda-prelude` allows to derive decidable equality [1]. The downside is that `agda-prelude` is not compatible with the standard library. There are several instances you can derive with this library, but there is no strongly typed representation of data types, hence if you want to derive your own instances, you'll need to roll out substitution, unification, de Bruijn indices/levels shifting and other tools from scratch and deal with weakly typed `Term`s which is inconvenient and error-prone. I have a library [2] that is compatible with the standard one and allows to derive decidable equality and has a typed data type representation (based on The Gentle Art of Levitation) and even though it's able to handle a vast amount of data types (universe polymorphism, implicit and instance arguments, indices and parameters, higher-order induction -- all of these are supported), there are practical (you can't reflect mutually recursive data types) and theoretical limitations (you can't reflect non-strictly-positive, inductive-inductive data types and most notably there is no internal notion of polarity like in the Indexed Functors approach [4]). Deriving your own instances is complicated and requires knowledge of internals of the library. Still inconvenient, but not as error-prone as dealing with weakly typed `Term`s. I'd say switch to `agda-prelude` and use it. [1] https://github.com/UlfNorell/agda-prelude/blob/master/src/Tactic/Deriving/Eq.agda [2] https://github.com/effectfully/Generic [3] https://pages.lip6.fr/Pierre-Evariste.Dagand/papers/levitation.pdf [4] https://www.andres-loeh.de/IndexedFunctors/ From ulf.norell at gmail.com Wed Feb 28 16:10:29 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Wed, 28 Feb 2018 16:10:29 +0100 Subject: [Agda] Typed DeBruijn, typed Phoas, and untyped DeBruijn In-Reply-To: References: <9441452b-9205-0b30-4d57-866ba7991530@cse.gu.se> Message-ID: On Wed, Feb 28, 2018 at 2:31 PM, Roman wrote: > The downside is that `agda-prelude` is not compatible with the standard > library. These days agda-prelude is compatible with the standard library. The only wrinkle is that the deriving Eq functionality gives you an implementation of the agda-prelude Eq record, but converting it to the standard library equivalent should be straight-forward. In fact here's the code: \begin{code} -- These two imports are from agda-prelude ( https://github.com/UlfNorell/agda-prelude) open import Tactic.Deriving.Eq using (deriveEq) import Prelude instance unquoteDecl EqType = deriveEq EqType (quote Type) unquoteDecl EqEnv = deriveEq EqEnv (quote Env) ?To? : Prelude.? ? ? ?To? () decToDec : ? {a} {A : Set a} ? Prelude.Dec A ? Dec A decToDec (Prelude.yes x) = yes x decToDec (Prelude.no nx) = no (?To? ? nx) _?T_ : ? (A B : Type) ? Dec (A ? B) A ?T B = decToDec (A Prelude.== B) _?_ : ? (? ? : Env) ? Dec (? ? ?) ? ? ? = decToDec (? Prelude.== ?) \end{code} / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From Thorsten.Altenkirch at nottingham.ac.uk Wed Feb 28 19:07:23 2018 From: Thorsten.Altenkirch at nottingham.ac.uk (Thorsten Altenkirch) Date: Wed, 28 Feb 2018 18:07:23 +0000 Subject: [Agda] rewriting before defining Message-ID: Hi, I am mutually defining an equality and some other things. To be able to type check the other things I need the equality as a rewriting rule but agda doesn't let me. That is I get the error Rewrite rule from function Skm-? cannot be added before the function definition when checking the pragma REWRITE Skm-? when checking the attached file. I know that I am cheating but I want to do it. Can I tell it that I am a doctor and I know what I am doing. Otherwise I shouldn't be allowed to use Rewrite anyway. Yes, I can replace it by a postulate but that misses the point. Cheers, Thorsten This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please contact the sender and delete the email and attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. Email communications with the University of Nottingham may be monitored where permitted by law. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SSx.agda Type: application/octet-stream Size: 1319 bytes Desc: SSx.agda URL: From wadler at inf.ed.ac.uk Wed Feb 28 19:45:40 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Wed, 28 Feb 2018 19:45:40 +0100 Subject: [Agda] Typed DeBruijn, typed Phoas, and untyped DeBruijn In-Reply-To: References: <9441452b-9205-0b30-4d57-866ba7991530@cse.gu.se> Message-ID: That worked perfectly!!! Thank you, Ulf! Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 28 February 2018 at 16:10, Ulf Norell wrote: > > On Wed, Feb 28, 2018 at 2:31 PM, Roman wrote: > >> The downside is that `agda-prelude` is not compatible with the standard >> library. > > > These days agda-prelude is compatible with the standard library. The only > wrinkle > is that the deriving Eq functionality gives you an implementation of the > agda-prelude > Eq record, but converting it to the standard library equivalent should be > straight-forward. > > In fact here's the code: > > \begin{code} > -- These two imports are from agda-prelude (https://github.com/UlfNorell/ > agda-prelude) > open import Tactic.Deriving.Eq using (deriveEq) > import Prelude > > instance > unquoteDecl EqType = deriveEq EqType (quote Type) > unquoteDecl EqEnv = deriveEq EqEnv (quote Env) > > ?To? : Prelude.? ? ? > ?To? () > > decToDec : ? {a} {A : Set a} ? Prelude.Dec A ? Dec A > decToDec (Prelude.yes x) = yes x > decToDec (Prelude.no nx) = no (?To? ? nx) > > _?T_ : ? (A B : Type) ? Dec (A ? B) > A ?T B = decToDec (A Prelude.== B) > > _?_ : ? (? ? : Env) ? Dec (? ? ?) > ? ? ? = decToDec (? Prelude.== ?) > \end{code} > > / Ulf > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From afelty at uottawa.ca Wed Feb 21 15:06:25 2018 From: afelty at uottawa.ca (Amy Felty) Date: Wed, 21 Feb 2018 14:06:25 +0000 Subject: [Agda] WiL 2018: Women in Logic Workshop 2nd Call for Papers Message-ID: <640BE3B8-589D-43C9-9C4A-A70355806D75@uottawa.ca> Second Call for Papers WiL 2018: Second Women in Logic Workshop Oxford, UK 8 July 2018 https://sites.google.com/site/womeninlogic2018/welcome/ NEW * Two invited speakers! (https://sites.google.com/site/womeninlogic2018/invited-speakers) * New dates including extended submission deadline: 15 April 2018 * New format for paper submissions Affiliated with the Thirty-Third Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), 9-12 July 2018 (http://lics.siglog.org/lics18/) and held as part of the Federated Logic Conference 2018 (FLoC), 6-19 July 2018 (http://www.floc2018.org/). We are holding the second Women in Logic Workshop (WiL 2018) as a LICS associated workshop this year. The workshop follows the pattern of meetings such as Women in Machine Learning (WiML, http://wimlworkshop.org/) or Women in Engineering (WIE, http://www.ieee-ras.org/membership/women-in-engineering) that have been taking place for quite a few years. Women are chronically underrepresented in the LICS community; consequently they sometimes feel both conspicuous and isolated, and hence there is a risk that the under-representation is self-perpetuating. The workshop will provide an opportunity for women in the field to increase awareness of one another and one another's work, to combat the feeling of isolation. It will also provide an environment where women can present to an audience comprised of mostly women, replicating the experience that most men have at most LICS meetings, and lowering the stress of the occasion; we hope that this will be particularly attractive to early-career women. Topics of interest of this workshop include but are not limited to the usual Logic in Computer Science (LICS) topics. These are: automata theory, automated deduction, categorical models and logics, concurrency and distributed computation, constraint programming, constructive mathematics, database theory, decision procedures, description logics, domain theory, finite model theory, formal aspects of program analysis, formal methods, foundations of computability, higher-order logic, lambda and combinatory calculi, linear logic, logic in artificial intelligence, logic programming, logical aspects of bioinformatics, logical aspects of computational complexity, logical aspects of quantum computation, logical frameworks, logics of programs, modal and temporal logics, model checking, probabilistic systems, process calculi, programming language semantics, proof theory, real-time systems, reasoning about security and privacy, rewriting, type systems and type theory, and verification. INVITED SPEAKERS * Brigitte Pientka (McGill University, Canada) * Perdita Stevens (University of Edinburgh, UK) IMPORTANT DATES Paper submission deadline: 15 April 2018 Author notification: 15 May 2018 Contribution for Informal Proceedings: 31 May 2018 SUBMISSIONS Contributions should be written in English and can be submitted in the form of full papers (with a maximum of 10 pages), short papers (with a maximum of 5 pages), or talk abstracts (1 page). Formatting instructions: Papers and abstracts should be prepared using the Easychair style (https://easychair.org/publications/for_authors). The submission should be in the form of a PDF file uploaded to the WiL 2018 Easychair page (https://easychair.org/conferences/?conf=wil2018) before the submission deadline of 15 April 2018, anywhere on Earth. PROCEEDINGS We plan to publish an informal post conference volume at ENTCS or other equally visible outlet. SCIENTIFIC AND ORGANIZING COMMITTEE * Valeria de Paiva (Co-Chair, Nuance Communications, USA) * Adriana Compagnoni (Stevens Institute of Technology, USA) * Amy Felty (Co-Chair, University of Ottawa, Canada) * Anna Ingolfsdottir (Reykjavik University, Iceland) * Sara Kalvala (University of Warwick, UK) * Ursula Martin (University of Oxford, UK) * Valeria Vignudelli (Ecole Normale Sup?rieure de Lyon, France) From fhi.1990 at gmail.com Thu Mar 1 09:42:40 2018 From: fhi.1990 at gmail.com (=?UTF-8?Q?Frederik_Hangh=C3=B8j_Iversen?=) Date: Thu, 1 Mar 2018 09:42:40 +0100 Subject: [Agda] List of exports In-Reply-To: References: Message-ID: Thanks On Feb 25, 2018 15:58, "Ulf Norell" wrote: > C-c C-o shows you the contents of a module in the emacs mode. > > / Ulf > > On Sun, Feb 25, 2018 at 2:47 PM, Frederik Hangh?j Iversen < > fhi.1990 at gmail.com> wrote: > >> Can I get Agda to generate a tree of symbols exported in my project/a >> module? >> >> -- >> Regards >> *Frederik Hangh?j Iversen* >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From abela at chalmers.se Thu Mar 1 10:30:42 2018 From: abela at chalmers.se (Andreas Abel) Date: Thu, 1 Mar 2018 10:30:42 +0100 Subject: [Agda] rewriting before defining In-Reply-To: References: Message-ID: Well, the doctor could perform some surgery on Agda, take out the cancerous error message and see what happens. ;-) I wash my hands in innocence. For me, the intended use of REWRITE was to add a proven propositional equality to definitional equality; if you go beyond it, you have to worry about the semantics yourself. Cheers, Andreas On 28.02.2018 19:07, Thorsten Altenkirch wrote: > Hi, > > I am mutually defining an equality and some other things. To be able to > type check the other things I need the equality as a rewriting rule but > agda doesn't let me. > > That is I get the error > Rewrite rule from function ?Skm-? ?cannot be added before the function > definition > when checking the pragma REWRITE Skm-? > when checking the attached file. > > I know that I am cheating but I want to do it. Can I tell it that I am a > doctor and I know what I am doing. Otherwise I shouldn't be allowed to > use Rewrite anyway. > > Yes, I can replace it by a postulate but that misses the point. > > Cheers, > Thorsten > > > This message and any attachment are intended solely for the addressee > and may contain confidential information. If you have received this > message in error, please contact the sender and delete the email and > attachment. > > Any views or opinions expressed by the author of this email do not > necessarily reflect the views of the University of Nottingham. Email > communications with the University of Nottingham may be monitored > where permitted by law. > > > > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel at gu.se http://www.cse.chalmers.se/~abela/ From Thorsten.Altenkirch at nottingham.ac.uk Thu Mar 1 11:02:33 2018 From: Thorsten.Altenkirch at nottingham.ac.uk (Thorsten Altenkirch) Date: Thu, 1 Mar 2018 10:02:33 +0000 Subject: [Agda] rewriting before defining In-Reply-To: References: Message-ID: <5B39B17B-C3C0-48D8-B83F-E92970B2EF6C@exmail.nottingham.ac.uk> On 01/03/2018, 09:30, "Agda on behalf of Andreas Abel" wrote: >Well, the doctor could perform some surgery on Agda, take out the >cancerous error message and see what happens. ;-) I was hoping that a surgeon who is better versed with the Agda source would do this for me. :-) In particular I don?t really want to use a non-standard version of Agda. >I wash my hands in innocence. For me, the intended use of REWRITE was >to add a proven propositional equality to definitional equality; if you >go beyond it, you have to worry about the semantics yourself. You are right. Basically REWRITE is a limited form of equality reflection. I do prove this equality only I am proving it mutually with its use. This you can certainly do when you have full equality reflection. I shouldn?t need to introduce postulates here. This particular instance enables me to define semisimplicial types without using a 2-level theory (the 2-level approach was described in our CSL 2016 paper http://www.cs.nott.ac.uk/~psztxa/publ/csl16.pdf). The rewrite version is both better from a pragmatic view (easier to use - I think) and from a semantic point (there are interpretations or type theory that model semisimplical types but not a (strong) 2-level theory where Nat is fibrant - at least that is what Mike Shulman told me). In this setting we certainly do not want to have full equality reflection because it would destroy proof relevance and hence it is in this form incompatible with univalence. However, I claim that this instance of equality reflection is harmless (this is a conjecture). We know that REWRITE can destroy soundness - so no difference here. Thorsten > >Cheers, >Andreas > >On 28.02.2018 19:07, Thorsten Altenkirch wrote: >> Hi, >> >> I am mutually defining an equality and some other things. To be able to >> type check the other things I need the equality as a rewriting rule but >> agda doesn't let me. >> >> That is I get the error >> Rewrite rule from function Skm-? cannot be added before the function >> definition >> when checking the pragma REWRITE Skm-? >> when checking the attached file. >> >> I know that I am cheating but I want to do it. Can I tell it that I am a >> doctor and I know what I am doing. Otherwise I shouldn't be allowed to >> use Rewrite anyway. >> >> Yes, I can replace it by a postulate but that misses the point. >> >> Cheers, >> Thorsten >> >> >> This message and any attachment are intended solely for the addressee >> and may contain confidential information. If you have received this >> message in error, please contact the sender and delete the email and >> attachment. >> >> Any views or opinions expressed by the author of this email do not >> necessarily reflect the views of the University of Nottingham. Email >> communications with the University of Nottingham may be monitored >> where permitted by law. >> >> >> >> >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> > > >-- >Andreas Abel <>< Du bist der geliebte Mensch. > >Department of Computer Science and Engineering >Chalmers and Gothenburg University, Sweden > >andreas.abel at gu.se >http://www.cse.chalmers.se/~abela/ >_______________________________________________ >Agda mailing list >Agda at lists.chalmers.se >https://lists.chalmers.se/mailman/listinfo/agda This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please contact the sender and delete the email and attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. Email communications with the University of Nottingham may be monitored where permitted by law. From kovacsahun at hotmail.com Thu Mar 1 23:54:05 2018 From: kovacsahun at hotmail.com (=?UTF-8?B?QW5kcsOhcyBLb3bDoWNz?=) Date: Thu, 1 Mar 2018 23:54:05 +0100 Subject: [Agda] Typed DeBruijn, typed Phoas, and untyped DeBruijn In-Reply-To: References: <9441452b-9205-0b30-4d57-866ba7991530@cse.gu.se> Message-ID: Alternatively, we can postulate parametricity for PHOAS terms, and then the translation works without further cheating (that's why it's "parametric", right?). 2018-02-28 19:45 GMT+01:00 Philip Wadler : > That worked perfectly!!! Thank you, Ulf! Cheers, -- P > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > On 28 February 2018 at 16:10, Ulf Norell wrote: > >> >> On Wed, Feb 28, 2018 at 2:31 PM, Roman wrote: >> >>> The downside is that `agda-prelude` is not compatible with the standard >>> library. >> >> >> These days agda-prelude is compatible with the standard library. The only >> wrinkle >> is that the deriving Eq functionality gives you an implementation of the >> agda-prelude >> Eq record, but converting it to the standard library equivalent should be >> straight-forward. >> >> In fact here's the code: >> >> \begin{code} >> -- These two imports are from agda-prelude (https://github.com/UlfNorell/ >> agda-prelude) >> open import Tactic.Deriving.Eq using (deriveEq) >> import Prelude >> >> instance >> unquoteDecl EqType = deriveEq EqType (quote Type) >> unquoteDecl EqEnv = deriveEq EqEnv (quote Env) >> >> ?To? : Prelude.? ? ? >> ?To? () >> >> decToDec : ? {a} {A : Set a} ? Prelude.Dec A ? Dec A >> decToDec (Prelude.yes x) = yes x >> decToDec (Prelude.no nx) = no (?To? ? nx) >> >> _?T_ : ? (A B : Type) ? Dec (A ? B) >> A ?T B = decToDec (A Prelude.== B) >> >> _?_ : ? (? ? : Env) ? Dec (? ? ?) >> ? ? ? = decToDec (? Prelude.== ?) >> \end{code} >> >> / Ulf >> > > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wadler at inf.ed.ac.uk Fri Mar 2 11:35:18 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Fri, 2 Mar 2018 11:35:18 +0100 Subject: [Agda] Typed DeBruijn, typed Phoas, and untyped DeBruijn In-Reply-To: References: <9441452b-9205-0b30-4d57-866ba7991530@cse.gu.se> Message-ID: Andras, Thank you, that's very cool. It will take a while to work my head around it! Yours, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 1 March 2018 at 23:54, Andr?s Kov?cs wrote: > Alternatively, we can postulate parametricity > for PHOAS terms, and then the translation works without further cheating > (that's why it's "parametric", right?). > > 2018-02-28 19:45 GMT+01:00 Philip Wadler : > >> That worked perfectly!!! Thank you, Ulf! Cheers, -- P >> >> . \ Philip Wadler, Professor of Theoretical Computer Science, >> . /\ School of Informatics, University of Edinburgh >> . / \ and Senior Research Fellow, IOHK >> . http://homepages.inf.ed.ac.uk/wadler/ >> >> On 28 February 2018 at 16:10, Ulf Norell wrote: >> >>> >>> On Wed, Feb 28, 2018 at 2:31 PM, Roman wrote: >>> >>>> The downside is that `agda-prelude` is not compatible with the standard >>>> library. >>> >>> >>> These days agda-prelude is compatible with the standard library. The >>> only wrinkle >>> is that the deriving Eq functionality gives you an implementation of the >>> agda-prelude >>> Eq record, but converting it to the standard library equivalent should >>> be straight-forward. >>> >>> In fact here's the code: >>> >>> \begin{code} >>> -- These two imports are from agda-prelude ( >>> https://github.com/UlfNorell/agda-prelude) >>> open import Tactic.Deriving.Eq using (deriveEq) >>> import Prelude >>> >>> instance >>> unquoteDecl EqType = deriveEq EqType (quote Type) >>> unquoteDecl EqEnv = deriveEq EqEnv (quote Env) >>> >>> ?To? : Prelude.? ? ? >>> ?To? () >>> >>> decToDec : ? {a} {A : Set a} ? Prelude.Dec A ? Dec A >>> decToDec (Prelude.yes x) = yes x >>> decToDec (Prelude.no nx) = no (?To? ? nx) >>> >>> _?T_ : ? (A B : Type) ? Dec (A ? B) >>> A ?T B = decToDec (A Prelude.== B) >>> >>> _?_ : ? (? ? : Env) ? Dec (? ? ?) >>> ? ? ? = decToDec (? Prelude.== ?) >>> \end{code} >>> >>> / Ulf >>> >> >> >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From wadler at inf.ed.ac.uk Fri Mar 2 12:40:57 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Fri, 2 Mar 2018 12:40:57 +0100 Subject: [Agda] Lists and products Message-ID: And now a simpler question. In order to make it handy to write examples with lists, it is handy to define: [_] : ? {A : Set} ? A ? List A [ z ] = z ? [] [_,_] : ? {A : Set} ? A ? A ? List A [ y , z ] = y ? z ? [] [_,_,_] : ? {A : Set} ? A ? A ? A ? List A [ x , y , z ] = x ? y ? z ? [] [_,_,_,_] : ? {A : Set} ? A ? A ? A ? A ? List A [ w , x , y , z ] = w ? x ? y ? z ? [] [_,_,_,_,_] : ? {A : Set} ? A ? A ? A ? A ? A ? List A [ v , w , x , y , z ] = v ? w ? x ? y ? z ? [] [_,_,_,_,_,_] : ? {A : Set} ? A ? A ? A ? A ? A ? A ? List A [ u , v , w , x , y , z ] = u ? v ? w ? x ? y ? z ? [] This conflicts (in terms of parsing) with the standard notation for products, so I have altered that slightly: open import Data.Product using (_?_ ) renaming (_,_ to ?_,_? ) The question is, have I chosen the best way to deal with the situation? Or is there an alternative that others recommend? Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From guillaume.allais at ens-lyon.org Fri Mar 2 12:51:16 2018 From: guillaume.allais at ens-lyon.org (Guillaume Allais) Date: Fri, 2 Mar 2018 12:51:16 +0100 Subject: [Agda] Lists and products In-Reply-To: References: Message-ID: <2d4b456f-4459-234f-25e3-20ba935a2d94@ens-lyon.org> Hi Phil, instead of declaring all of these toplevel definitions with different arities, you can use infix identifiers. Even better: using pattern-synonyms you'll be able to use these on the left hand side! ================================================= module poc.list-literals where open import Agda.Builtin.List module _ {?} {A : Set ?} where ? infix 1 [_ ? infixr 2 _,_ ? infix 3 _] ? -- [_ : List A ? List A ? pattern [_ xs = xs ? -- _,_ : A ? List A ? List A ? pattern _,_ a as = a ? as ? --? _] : A ? List A ? pattern _] x = x ? [] open import Agda.Builtin.Nat _ : List Nat _ = [ 1 , 2 , 3 , 4 ] open import Data.Maybe last : List Nat ? Maybe Nat last ([ x ])? = just x last (x ? xs) = last xs last _ = nothing ================================================= On 02/03/18 12:40, Philip Wadler wrote: > And now a simpler question. > > In order to make it handy to write examples with lists, it is handy to > define: > > [_] : ? {A : Set} ? A ? List A > [ z ] = z ? [] > > [_,_] : ? {A : Set} ? A ? A ? List A > [ y , z ] = y ? z ? [] > > [_,_,_] : ? {A : Set} ? A ? A ? A ? List A > [ x , y , z ] = x ? y ? z ? [] > > [_,_,_,_] : ? {A : Set} ? A ? A ? A ? A ? List A > [ w , x , y , z ] = w ? x ? y ? z ? [] > > [_,_,_,_,_] : ? {A : Set} ? A ? A ? A ? A ? A ? List A > [ v , w , x , y , z ] = v ? w ? x ? y ? z ? [] > > [_,_,_,_,_,_] : ? {A : Set} ? A ? A ? A ? A ? A ? A ? List A > [ u , v , w , x , y , z ] = u ? v ? w ? x ? y ? z ? [] > This conflicts (in terms of parsing) with the standard notation for > products, so I have altered that slightly: > > open import Data.Product using (_?_ ) renaming (_,_ to ?_,_? ) > The question is, have I chosen the best way to deal with the > situation? Or is there an alternative that others recommend? Cheers, -- P > > > . ? \ Philip Wadler, Professor of Theoretical Computer Science, > . ? /\ School of Informatics, University of Edinburgh > .? /? \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From wadler at inf.ed.ac.uk Fri Mar 2 13:07:20 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Fri, 2 Mar 2018 13:07:20 +0100 Subject: [Agda] Lists and products In-Reply-To: <2d4b456f-4459-234f-25e3-20ba935a2d94@ens-lyon.org> References: <2d4b456f-4459-234f-25e3-20ba935a2d94@ens-lyon.org> Message-ID: Guillaume, Thank you for the suggestion. I tried something similar, but gave it up because I wanted to write map (1 +_) [ 0 , 1 , 2 ] rather than map (1 +_) ([ 0 , 1 , 2 ]) in examples. Thank you for the point about 'pattern', which should apply to either method. Thank you also for the example of using `_` to name an example, which I had not seen before and is much more convenient than using ex1, ex2, ..., which may need to be renamed if other examples are added in the middle. Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 2 March 2018 at 12:51, Guillaume Allais wrote: > Hi Phil, instead of declaring all of these toplevel definitions > with different arities, you can use infix identifiers. Even better: > using pattern-synonyms you'll be able to use these on the left > hand side! > > ================================================= > module poc.list-literals where > > open import Agda.Builtin.List > > module _ {?} {A : Set ?} where > > infix 1 [_ > infixr 2 _,_ > infix 3 _] > > -- [_ : List A ? List A > pattern [_ xs = xs > > -- _,_ : A ? List A ? List A > pattern _,_ a as = a ? as > > -- _] : A ? List A > pattern _] x = x ? [] > > > open import Agda.Builtin.Nat > > _ : List Nat > _ = [ 1 , 2 , 3 , 4 ] > > open import Data.Maybe > > last : List Nat ? Maybe Nat > last ([ x ]) = just x > last (x ? xs) = last xs > last _ = nothing > ================================================= > > On 02/03/18 12:40, Philip Wadler wrote: > > And now a simpler question. > > In order to make it handy to write examples with lists, it is handy to > define: > > [_] : ? {A : Set} ? A ? List A [ z ] = z ? [] > [_,_] : ? {A : Set} ? A ? A ? List A [ y , z ] = y ? z ? [] > [_,_,_] : ? {A : Set} ? A ? A ? A ? List A [ x , y , z ] = x ? y ? z ? [] > [_,_,_,_] : ? {A : Set} ? A ? A ? A ? A ? List A [ w , x , y , z ] = w ? x ? y ? z ? [] > [_,_,_,_,_] : ? {A : Set} ? A ? A ? A ? A ? A ? List A [ v , w , x , y , z ] = v ? w ? x ? y ? z ? [] > [_,_,_,_,_,_] : ? {A : Set} ? A ? A ? A ? A ? A ? A ? List A [ u , v , w , x , y , z ] = u ? v ? w ? x ? y ? z ? [] > > This conflicts (in terms of parsing) with the standard notation for > products, so I have altered that slightly: > > open import Data.Product using (_?_ ) renaming (_,_ to ?_,_? ) > > The question is, have I chosen the best way to deal with the situation? Or > is there an alternative that others recommend? Cheers, -- P > > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > > > _______________________________________________ > Agda mailing listAgda at lists.chalmers.sehttps://lists.chalmers.se/mailman/listinfo/agda > > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From bob.atkey at gmail.com Fri Mar 2 13:36:13 2018 From: bob.atkey at gmail.com (Robert Atkey) Date: Fri, 2 Mar 2018 12:36:13 +0000 Subject: [Agda] Mathematically Structured Functional Programming 2018: Call for Papers Message-ID: <42d5b7c7-c785-e102-3d2d-969b4d5b54d5@gmail.com> Seventh Workshop on MATHEMATICALLY STRUCTURED FUNCTIONAL PROGRAMMING Sunday 8th July 2018, Oxford, UK A satellite workshop of FSCD 2018 http://msfp2018.bentnib.org/ ** New this time: additional talk proposal category ** ** Deadline: 5th April (abstract), 12th April (paper) ** The seventh workshop on Mathematically Structured Functional Programming is devoted to the derivation of functionality from structure. It is a celebration of the direct impact of Theoretical Computer Science on programs as we write them today. Modern programming languages, and in particular functional languages, support the direct expression of mathematical structures, equipping programmers with tools of remarkable power and abstraction. Where would Haskell be without monads? Functional reactive programming without temporal logic? Call-by-push-value without adjunctions? The list goes on. This workshop is a forum for researchers who seek to reflect mathematical phenomena in data and control. The first MSFP workshop was held in Kuressaare, Estonia, in July 2006, affiliated with MPC 2006 and AMAST 2006. The second MSFP workshop was held in Reykjavik, Iceland as part of ICALP 2008. The third MSFP workshop was held in Baltimore, USA, as part of ICFP 2010. The fourth workshop was held in Tallinn, Estonia, as part of ETAPS 2012. The fifth workshop was held in Grenoble, France, as part of ETAPS 2014. The sixth MSFP Workshop was held in April 2016, in Eindhoven, Netherlands, just after ETAPS 2016. Important Dates: ================ Abstract deadline: 5th April (Thursday) Paper deadline: 12th April (Thursday) Notification: 17th May (Thursday) Final version: 14th June (Thursday) Workshop: 8th July (Sunday) Invited Speakers: ================= - Tamara von Glehn, University of Cambridge, UK - Didier Remy, INRIA, France Program Committee: ================== Andreas Abel - Chalmers, Sweden Danel Ahman - INRIA Paris, France Robert Atkey - University of Strathclyde, UK (co-chair) Jeremy Gibbons - University of Oxford, UK Jennifer Hackett - University of Nottingham, UK Mauro Jaskelioff - Universidad Nacional de Rosario, Argentina Shin-ya Katsumata - National Institute of Informatics, Japan Sam Lindley - University of Edinburgh, UK (co-chair) Clare Martin - Oxford Brookes University, UK Shin-Cheng Mu - Academia Sinica, Taiwan Valeria de Paiva - Nuance Communications, US Alexandra Silva - University College London, UK Submission: =========== Submissions are welcomed on, but by no means restricted to, topics such as: structured effectful computation structured recursion structured corecursion structured tree and graph operations structured syntax with variable binding structured datatype-genericity structured search structured representations of functions structured quantum computation structure directed optimizations structured types structure derived from programs and data Please contact the programme chairs Robert Atkey and Sam Lindley if you have any questions about the scope of the workshop. (New this time) We accept two categories of submission: full papers of no more than 15 pages that will appear in the proceedings, and extended abstracts of no more than 2 pages which we will post on the website, but which do not constitute formal publications and will not appear in the proceedings. References and appendices are not included in page limits. Appendices may not be read by reviewers. Full papers (not two page talk abstracts) must report previously unpublished work and not be submitted concurrently to another conference with refereed proceedings. Accepted papers and talks must be presented at the workshop by at least one of the authors. The proceedings will be published under the auspices of EPTCS with a Creative Commons license. We are using EasyChair to manage submissions. To submit a paper, use this link: https://easychair.org/conferences/?conf=msfp2018. From fhi.1990 at gmail.com Fri Mar 2 16:26:54 2018 From: fhi.1990 at gmail.com (=?UTF-8?Q?Frederik_Hangh=C3=B8j_Iversen?=) Date: Fri, 2 Mar 2018 16:26:54 +0100 Subject: [Agda] INLINE-pragma In-Reply-To: References: Message-ID: In-line with the above idea I wonder if there is an option to do something in the middle between fully normalizing a goal and not normalizing it. Is it possible to normalize something to the first visible constructors? Say I have declared a function that is not visible in my current scope. The function is defined in terms of other functions that are visible in scope. Can I get Agda to show me the visible type? MWE: module _ where open import Data.Product module _ {C O M P L E X : Set} where private T = C ? O ? M ? P ? L ? E ? X ex : T ? X ex (c , o , m , p , l , e , x) = x x : {X : Set} ? X x = ex {!!} In this goal I want to be the type displayed to me to be as if `T` had been inlined in the definition of `ex`. In this case it's a septuple with elements corresponding to the implicit parameters at the usage-site of `ex`. This is just a contrived example but it highlights what I'm after. On Wed, Feb 21, 2018 at 3:40 PM, Frederik Hangh?j Iversen < fhi.1990 at gmail.com> wrote: > I know there's an INLINE-pragma for Agda (though it's not documented here > [1]). This pragma affects compilation. I wonder if there was something akin > to this for type-checking. > > When I want to close a goal with a complex type I usually spend a > considerable time defining helper functions and in particular figuring out > what type these should have. Agda of course can help me here, but often it > doesn't display the type that I want. The best type is rarely the > non-normalized *nor* fully normalized type. Ideally I would like to be able > to step up and down these types interactively. But something perhaps easier > to implement and also super helpful would be if I could e.g. mark a "type > synonym" as being completely transparent, so that it's definition would be > inlined when I ask for goal and context. > > As a super small example of what I'm looking for is: > > Assume I have a type-synonym `P T = A ? T' and I want to close a hole of > type `P T` then `C-c C-,` should give me `Goal: A ? T`. Incidentally if I > issue `C-u C-u C-c C-,` the hole will be displayed as `? A (? x ? T)` which > is less helpful. Granted in this case the type is easily understood - but > this is rarely the case. > > [1]: http://agda.readthedocs.io/en/latest/language/pragmas.html > > -- > Regards > *Frederik Hangh?j Iversen* > -- Regards *Frederik Hangh?j Iversen* -------------- next part -------------- An HTML attachment was scrubbed... URL: From abela at chalmers.se Fri Mar 2 19:34:08 2018 From: abela at chalmers.se (Andreas Abel) Date: Fri, 2 Mar 2018 19:34:08 +0100 Subject: [Agda] [Deadline Monday!] TYPES 2018: final call for contributions Message-ID: <5b99659d-7a56-b333-d23c-0942a4821efe@chalmers.se> (Apologies for cross-posting) FINAL CALL FOR CONTRIBUTIONS 24th International Conference on Types for Proofs and Programs, TYPES 2018 and EUTYPES Cost Action CA15123 meeting Braga, Portugal, 18 - 21 June 2018 http://w3.math.uminho.pt/types2018 BACKGROUND The TYPES meetings are a forum to present new and on-going work in all aspects of type theory and its applications, especially in formalised and computer assisted reasoning and computer programming. The TYPES areas of interest include, but are not limited to: * foundations of type theory and constructive mathematics; * applications of type theory; * dependently typed programming; * industrial uses of type theory technology; * meta-theoretic studies of type systems; * proof assistants and proof technology; * automation in computer-assisted reasoning; * links between type theory and functional programming; * formalizing mathematics using type theory. We encourage talks proposing new ways of applying type theory. In the spirit of workshops, talks may be based on newly published papers, work submitted for publication, but also work in progress. The EUTypes Cost Action CA15123 (eutypes.cs.ru.nl) focuses on the same research topics as TYPES and partially sponsors the TYPES Conference: Part of the programme is organised under the auspices of EUTypes. INVITED SPEAKERS * C?dric Fournet (Microsoft Research, UK) * Matthieu Sozeau? (INRIA, France) * Josef Urban (CIIRC, Czech Republic) CONTRIBUTED TALKS We solicit contributed talks. Selection of those will be based on extended abstracts/short papers of 2 pp formatted with easychair.cls. The submission site is https://easychair.org/conferences/?conf=types2018 Important dates: * submission of 2 pp abstract: 5 March 2018 * notification of acceptance/rejection: 13 April 2018 * camera-ready version of abstract: 7 May 2018 Camera-ready versions of the accepted contributions will be published in an informal book of abstracts for distribution at the workshop. POST-PROCEEDINGS Similarly to TYPES 2011 and TYPES 2013-2017, a post-proceedings volume will published in the Leibniz International Proceedings in Informatics (LIPIcs) series. Submission to that volume will be open to everyone. Tentative submission deadline: September 2018. PROGRAMME COMMITTEE Andreas Abel (Chalmers University Gothenburg) Amal Ahmed (Northeastern University Boston) Andrej Bauer (University of Ljubljana) Marc Bezem (University of Bergen) Maria Paola Bonacina (University of Verona) Gilles Dowek (INRIA ? ENS Paris-Saclay) Peter Dybjer (Chalmers University Gothenburg) Jos? Esp?rito Santo (University of Minho) (co-chair) Herman Geuvers (Radboud University Nijmegen) Ambrus Kaposi (E?tv?s Lor?nd University) Ugo de?Liguoro (University of Torino) Ralph Matthes (IRIT ? CNRS and University of Toulouse) Assia Mahboubi (INRIA ? LS2N Nantes) Keiko Nakata (SAP Potsdam) Pierre-Marie P?drot (Max Planck Institute for Software Systems Saarbruck?n) Lu?s Pinto (University of Minho) (co-chair) Andrew Pitts (University of Cambridge) Aleksy Schubert (University of Warsaw) Carsten Sch?rmann (IT University of Copenhagen) Anton Setzer (University of Swansea) TYPES STEERING COMMITTEE Jos? Esp?rito Santo, Silvia Ghilezan, Hugo Herbelin, Ambrus Kaposi, Ralph Matthes (chair), Aleksy Schubert. ABOUT TYPES The TYPES meetings from 1990 to 2008 were annual workshops of a sequence of five EU funded networking projects. From 2009 to 2015, TYPES has been run as an independent conference series. From 2016, TYPES is partially supported by COST Action EUTypes CA15123. Previous TYPES meetings were held in Antibes (1990), Edinburgh (1991), B?stad (1992), Nijmegen (1993), B?stad (1994), Torino (1995), Aussois (1996), Kloster Irsee (1998), L?keberg (1999), Durham (2000), Berg en Dal near Nijmegen (2002), Torino (2003), Jouy-en-Josas near Paris (2004), Nottingham (2006), Cividale del Friuli (2007), Torino (2008), Aussois (2009), Warsaw (2010), Bergen (2011), Toulouse (2013), Paris (2014), Tallinn (2015), Novi Sad (2016), Budapest (2017). CONTACT Email:types2018 at math.uminho.pt Organisers: Jos? Esp?rito Santo (Centre of Mathematics, University of Minho) Maria Jo?o Frade (HASLab, University of Minho and INESC TEC) Cl?udia Mendes Ara?jo (Centre of Mathematics, University of Minho) Lu?s Pinto (Centre of Mathematics, University of Minho) -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _______________________________________________ Eutypes mailing list Eutypes at cs.ru.nl https://mailman.science.ru.nl/mailman/listinfo/eutypes From scm at iis.sinica.edu.tw Sat Mar 3 01:11:58 2018 From: scm at iis.sinica.edu.tw (Shin-Cheng Mu) Date: Sat, 3 Mar 2018 08:11:58 +0800 Subject: [Agda] Mathematically Structured Functional Programming (MSFP 2018) Call for Papers Message-ID: Seventh Workshop on MATHEMATICALLY STRUCTURED FUNCTIONAL PROGRAMMING Sunday 8th July 2018, Oxford, UK A satellite workshop of FSCD 2018 http://msfp2018.bentnib.org/ ** New this time: additional talk proposal category ** ** Deadline: 5th April (abstract), 12th April (paper) ** The seventh workshop on Mathematically Structured Functional Programming is devoted to the derivation of functionality from structure. It is a celebration of the direct impact of Theoretical Computer Science on programs as we write them today. Modern programming languages, and in particular functional languages, support the direct expression of mathematical structures, equipping programmers with tools of remarkable power and abstraction. Where would Haskell be without monads? Functional reactive programming without temporal logic? Call-by-push-value without adjunctions? The list goes on. This workshop is a forum for researchers who seek to reflect mathematical phenomena in data and control. The first MSFP workshop was held in Kuressaare, Estonia, in July 2006, affiliated with MPC 2006 and AMAST 2006. The second MSFP workshop was held in Reykjavik, Iceland as part of ICALP 2008. The third MSFP workshop was held in Baltimore, USA, as part of ICFP 2010. The fourth workshop was held in Tallinn, Estonia, as part of ETAPS 2012. The fifth workshop was held in Grenoble, France, as part of ETAPS 2014. The sixth MSFP Workshop was held in April 2016, in Eindhoven, Netherlands, just after ETAPS 2016. Important Dates: ================ Abstract deadline: 5th April (Thursday) Paper deadline: 12th April (Thursday) Notification: 17th May (Thursday) Final version: 14th June (Thursday) Workshop: 8th July (Sunday) Invited Speakers: ================= - Tamara von Glehn, University of Cambridge, UK - Didier Remy, INRIA, France Program Committee: ================== Andreas Abel - Chalmers, Sweden Danel Ahman - INRIA Paris, France Robert Atkey - University of Strathclyde, UK (co-chair) Jeremy Gibbons - University of Oxford, UK Jennifer Hackett - University of Nottingham, UK Mauro Jaskelioff - Universidad Nacional de Rosario, Argentina Shin-ya Katsumata - National Institute of Informatics, Japan Sam Lindley - University of Edinburgh, UK (co-chair) Clare Martin - Oxford Brookes University, UK Shin-Cheng Mu - Academia Sinica, Taiwan Valeria de Paiva - Nuance Communications, US Alexandra Silva - University College London, UK Submission: =========== Submissions are welcomed on, but by no means restricted to, topics such as: structured effectful computation structured recursion structured corecursion structured tree and graph operations structured syntax with variable binding structured datatype-genericity structured search structured representations of functions structured quantum computation structure directed optimizations structured types structure derived from programs and data Please contact the programme chairs Robert Atkey and Sam Lindley if you have any questions about the scope of the workshop. (New this time) We accept two categories of submission: full papers of no more than 15 pages that will appear in the proceedings, and extended abstracts of no more than 2 pages which we will post on the website, but which do not constitute formal publications and will not appear in the proceedings. References and appendices are not included in page limits. Appendices may not be read by reviewers. Full papers (not two page talk abstracts) must report previously unpublished work and not be submitted concurrently to another conference with refereed proceedings. Accepted papers and talks must be presented at the workshop by at least one of the authors. The proceedings will be published under the auspices of EPTCS with a Creative Commons license. We are using EasyChair to manage submissions. To submit a paper, use this link: https://easychair.org/conferences/?conf=msfp2018. From abela at chalmers.se Sat Mar 3 12:05:41 2018 From: abela at chalmers.se (Andreas Abel) Date: Sat, 3 Mar 2018 12:05:41 +0100 Subject: [Agda] PARIS workshop @ FLoC 2018 : Programming And Reasoning on Infinite Structures (First CfP) Message-ID: <22aa88a4-6ca2-7ac8-cf85-b93fb5537691@chalmers.se> Programming And Reasoning on Infinite Structures A workshop affiliated with FSCD at FLOC 2018 July 7&8, 2018 Oxford, UK Developing formal methods to program and reason about infinite data, whether inductive or coinductive, is challenging and subject to numerous recent research efforts. The understanding of the logical and computational principles underlying these notions is reaching a mature stage as illustrated by the numerous advances that have appeared in the recent years. Various examples of this can be viewed in recent works on co-patterns, infinite proof systems for logics with induction and coinduction, circular proofs, guarded recursive type theory, research effort on integrated coinduction in proof assistants, concrete semantics of coinductive computation, recent developments in infinitary rewriting, or the unveiling of the Curry-Howard correspondence between temporal logics and functional reactive programming, to name a few. The workshop aims at gathering researchers working on these topics as well as colleagues interested in understanding the recent results and open problems of this line of research: - For outsiders, the workshop will offer tutorial sessions and survey-like invited talks. - For specialists of the topic, the workshop will permit to gather people working with syntactical or semantical methods, people focusing on proof systems or programming languages, and foster exchanges and discussions benefiting from their various perspectives. We are seeking for short submissions (~3-4 pages long) presenting (i) new completed results (ii) work in progress, or (iii) advertising recently published results. The workshop is affiliated with FSCD 2018, as part of the Federated Logic Conference of 2018 and is funded by French ANR, RAPIDO project. ** Important dates and submission details: Submissions: April 15 Notification: May 15 Final abstract: May 25 Workshop: July 7 and 8 Submission page: http://easychair.org/conferences/?conf=paris18 Website: https://www.irif.fr/~saurin/RAPIDO/PARIS-2018/ ** Program Committee: Andreas Abel (Gothenburg University) David Baelde (LSV, ENS Paris-Saclay & Inria Paris; co-chair) Amina Doumane (LIP, ENS Lyon) Martin Lange (University of Kassel) Rasmus M?gelberg (IT University of Copenhagen) Luke Ong (University of Oxford) Andrew Polonsky (Appalachian State University) Colin Riba (LIP, ENS Lyon) Alexis Saurin (IRIF, Universit? Paris Diderot; co-chair) Alex Simpson (University of Ljubljana) ** Invited speakers: A tutorial and two invited talks will be announced shortly. ** Topics: Suggested, but not exclusive, topics of interest for the workshop are: - Proof systems: proof system for logics with least and greatest fixed points, infinitary and cyclic/circular proof systems - Calculi: infinitary rewriting, infinitary ?-calculi, co-patterns - Type systems: infinitary type systems, guarded recursive type theory - Curry-Howard correspondence to linear temporal logic and functional reactive programming - Semantics: denotational and interactive semantics for infinite data and computations - Tools: extensions of programming languages and proof assistants to better treat infinite data, results on extending programming languages with primitives for manipulating infinite data such as streams in a more structured and convenient way, coinductive proof methods in proof assistants - Proof theory and verification: the workshop will welcome works demonstrating how proof-theoretical investigations can be applied to model-checking problems, e.g. as in recent studies of higher-order recursive schemes or infinitary proofs. -- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel at gu.se http://www.cse.chalmers.se/~abela/ From howseeu at gmail.com Sun Mar 4 07:37:24 2018 From: howseeu at gmail.com (How Si Yu) Date: Sun, 4 Mar 2018 06:37:24 +0000 Subject: [Agda] Well-foundedness of list of well-founded elements Message-ID: Hi, all. given a well-founded relation _<_ on A, define _?_ on List A where where xs ? ys = ? (? x ? x ? ys) ? (? x ? x ? xs ? x ? ys). Is it true that _?_ is well-founded? This is definitely true in classical logic since we can argue in the following way: Assume not. Then there exists an infinite sequence ... ? xs3 ? xs2 ? xs1 ? xs0. ? i, xs(n+1) ? xsn so ? x ? xsn. If n ? 0, ? y ? xs(n-1) st x < y. Continuiting moving rightwards we find a strictly increasing sequence starting at x and ends in xs0. Hence there must exist infinitely such sequences ending at xs0. Since xs0 is finite, ? x0 ? xs0 where infinitely many such sequences ending at x0. All such sequences besides one pass through xs1. Since xs1 is finite, ? x1 ? xs1 where infinitely many such sequences pass through x1. Continuing such construction we get an infinite descending chain in A. But _<_ is well-founded. Contradiction. Is this true constructively as well? Thanks a lot! I need it in doing induction in my proof in Agda. Below are codes to make precise my question. open import Data.List.Base using (List; []; _?_) open import Relation.Binary.Core using (Rel) open import Agda.Primitive using (lzero) open import Induction.WellFounded using (Well-founded) open import Data.Product using (?; _?_; _,_) postulate A : Set postulate _<_ : Rel A lzero data _?_ (x : A) : List A ? Set where here : ? {xs} ? x ? (x ? xs) there : ? {y xs} ? x ? xs ? x ? (y ? xs) _?_ : Rel (List A) lzero xs ? ys = ? (? x ? x ? ys) ? (? x ? x ? xs ? x ? ys) _?_-wf : Well-founded _<_ ? Well-founded _?_ _?_-wf = {!!} Regards, Si Yu From ulf.norell at gmail.com Sun Mar 4 09:45:59 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Sun, 4 Mar 2018 09:45:59 +0100 Subject: [Agda] Well-foundedness of list of well-founded elements In-Reply-To: References: Message-ID: I think there's something wrong with your definition of _?_. It doesn't mention _<_, and it's clearly reflexive on non-empty lists: refl-? : ? xs ? ? (? x ? x ? xs) ? xs ? xs refl-? xs non-empty = non-empty , ? _ i ? i Did you mean _?_ : Rel (List A) lzero xs ? ys = ? (? x ? x ? ys) ? (? x ? x ? xs ? ? (? y ? y ? ys ? x < y)) ? / Ulf On Sun, Mar 4, 2018 at 7:37 AM, How Si Yu wrote: > Hi, all. given a well-founded relation _<_ on A, define _?_ on List A > where where xs ? ys = ? (? x ? x ? ys) ? (? x ? x ? xs ? x ? ys). Is > it true that _?_ is well-founded? > > This is definitely true in classical logic since we can argue in the > following way: Assume not. Then there exists an infinite sequence ... > ? xs3 ? xs2 ? xs1 ? xs0. ? i, xs(n+1) ? xsn so ? x ? xsn. If n ? 0, ? > y ? xs(n-1) st x < y. Continuiting moving rightwards we find a > strictly increasing sequence starting at x and ends in xs0. Hence > there must exist infinitely such sequences ending at xs0. Since xs0 is > finite, ? x0 ? xs0 where infinitely many such sequences ending at x0. > All such sequences besides one pass through xs1. Since xs1 is finite, > ? x1 ? xs1 where infinitely many such sequences pass through x1. > Continuing such construction we get an infinite descending chain in A. > But _<_ is well-founded. Contradiction. > > Is this true constructively as well? Thanks a lot! I need it in doing > induction in my proof in > Agda. Below are codes to make precise my question. > > open import Data.List.Base using (List; []; _?_) > open import Relation.Binary.Core using (Rel) > open import Agda.Primitive using (lzero) > open import Induction.WellFounded using (Well-founded) > open import Data.Product using (?; _?_; _,_) > > postulate A : Set > postulate _<_ : Rel A lzero > > data _?_ (x : A) : List A ? Set where > here : ? {xs} ? x ? (x ? xs) > there : ? {y xs} ? x ? xs ? x ? (y ? xs) > > _?_ : Rel (List A) lzero > xs ? ys = ? (? x ? x ? ys) ? (? x ? x ? xs ? x ? ys) > > _?_-wf : Well-founded _<_ ? Well-founded _?_ > _?_-wf = {!!} > > Regards, > Si Yu > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wadler at inf.ed.ac.uk Sun Mar 4 13:51:48 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Sun, 4 Mar 2018 13:51:48 +0100 Subject: [Agda] Typed DeBruijn, typed Phoas, and untyped DeBruijn In-Reply-To: References: <9441452b-9205-0b30-4d57-866ba7991530@cse.gu.se> Message-ID: Andras, Thank you very much for your note [1]. Your proof appears related to the wf relation of Chlipala [2,3]. One difference is that yours is unary whereas his is binary, so I would expect his is more powerful, or do you think they have equal power? Yours, -- P [1] http://lpaste.net/363029 [2] http://adam.chlipala.net/cpdt/html/Cpdt.ProgLang.html#HigherOrder.Wf [3] http://adam.chlipala.net/cpdt/html/Intensional.html . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 1 March 2018 at 23:54, Andr?s Kov?cs wrote: > Alternatively, we can postulate parametricity > for PHOAS terms, and then the translation works without further cheating > (that's why it's "parametric", right?). > > 2018-02-28 19:45 GMT+01:00 Philip Wadler : > >> That worked perfectly!!! Thank you, Ulf! Cheers, -- P >> >> . \ Philip Wadler, Professor of Theoretical Computer Science, >> . /\ School of Informatics, University of Edinburgh >> . / \ and Senior Research Fellow, IOHK >> . http://homepages.inf.ed.ac.uk/wadler/ >> >> On 28 February 2018 at 16:10, Ulf Norell wrote: >> >>> >>> On Wed, Feb 28, 2018 at 2:31 PM, Roman wrote: >>> >>>> The downside is that `agda-prelude` is not compatible with the standard >>>> library. >>> >>> >>> These days agda-prelude is compatible with the standard library. The >>> only wrinkle >>> is that the deriving Eq functionality gives you an implementation of the >>> agda-prelude >>> Eq record, but converting it to the standard library equivalent should >>> be straight-forward. >>> >>> In fact here's the code: >>> >>> \begin{code} >>> -- These two imports are from agda-prelude ( >>> https://github.com/UlfNorell/agda-prelude) >>> open import Tactic.Deriving.Eq using (deriveEq) >>> import Prelude >>> >>> instance >>> unquoteDecl EqType = deriveEq EqType (quote Type) >>> unquoteDecl EqEnv = deriveEq EqEnv (quote Env) >>> >>> ?To? : Prelude.? ? ? >>> ?To? () >>> >>> decToDec : ? {a} {A : Set a} ? Prelude.Dec A ? Dec A >>> decToDec (Prelude.yes x) = yes x >>> decToDec (Prelude.no nx) = no (?To? ? nx) >>> >>> _?T_ : ? (A B : Type) ? Dec (A ? B) >>> A ?T B = decToDec (A Prelude.== B) >>> >>> _?_ : ? (? ? : Env) ? Dec (? ? ?) >>> ? ? ? = decToDec (? Prelude.== ?) >>> \end{code} >>> >>> / Ulf >>> >> >> >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From howseeu at gmail.com Sun Mar 4 14:11:56 2018 From: howseeu at gmail.com (How Si Yu) Date: Sun, 4 Mar 2018 13:11:56 +0000 Subject: [Agda] Well-foundedness of list of well-founded elements In-Reply-To: References: Message-ID: Yes, I don't know why I make such a typo. On 3/4/18, Ulf Norell wrote: > I think there's something wrong with your definition of _?_. It doesn't > mention _<_, and it's clearly reflexive on non-empty lists: > > refl-? : ? xs ? ? (? x ? x ? xs) ? xs ? xs > refl-? xs non-empty = non-empty , ? _ i ? i > > Did you mean > > _?_ : Rel (List A) lzero > xs ? ys = ? (? x ? x ? ys) ? (? x ? x ? xs ? ? (? y ? y ? ys ? x < y)) > > ? > > / Ulf > > > On Sun, Mar 4, 2018 at 7:37 AM, How Si Yu wrote: > >> Hi, all. given a well-founded relation _<_ on A, define _?_ on List A >> where where xs ? ys = ? (? x ? x ? ys) ? (? x ? x ? xs ? x ? ys). Is >> it true that _?_ is well-founded? >> >> This is definitely true in classical logic since we can argue in the >> following way: Assume not. Then there exists an infinite sequence ... >> ? xs3 ? xs2 ? xs1 ? xs0. ? i, xs(n+1) ? xsn so ? x ? xsn. If n ? 0, ? >> y ? xs(n-1) st x < y. Continuiting moving rightwards we find a >> strictly increasing sequence starting at x and ends in xs0. Hence >> there must exist infinitely such sequences ending at xs0. Since xs0 is >> finite, ? x0 ? xs0 where infinitely many such sequences ending at x0. >> All such sequences besides one pass through xs1. Since xs1 is finite, >> ? x1 ? xs1 where infinitely many such sequences pass through x1. >> Continuing such construction we get an infinite descending chain in A. >> But _<_ is well-founded. Contradiction. >> >> Is this true constructively as well? Thanks a lot! I need it in doing >> induction in my proof in >> Agda. Below are codes to make precise my question. >> >> open import Data.List.Base using (List; []; _?_) >> open import Relation.Binary.Core using (Rel) >> open import Agda.Primitive using (lzero) >> open import Induction.WellFounded using (Well-founded) >> open import Data.Product using (?; _?_; _,_) >> >> postulate A : Set >> postulate _<_ : Rel A lzero >> >> data _?_ (x : A) : List A ? Set where >> here : ? {xs} ? x ? (x ? xs) >> there : ? {y xs} ? x ? xs ? x ? (y ? xs) >> >> _?_ : Rel (List A) lzero >> xs ? ys = ? (? x ? x ? ys) ? (? x ? x ? xs ? x ? ys) >> >> _?_-wf : Well-founded _<_ ? Well-founded _?_ >> _?_-wf = {!!} >> >> Regards, >> Si Yu >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> > From alex.ter.weele at gmail.com Sun Mar 4 17:45:29 2018 From: alex.ter.weele at gmail.com (Alex ter Weele) Date: Sun, 04 Mar 2018 10:45:29 -0600 Subject: [Agda] Packaging Agda and compiling it ahead of time Message-ID: <87sh9f7psm.fsf@librem.i-did-not-set--mail-host-address--so-tickle-me> Hello all, I am packaging Agda for Guix. With my package, when I try to load or compile an Agda file, I see $ agda test.agda /gnu/store/17lci61ny0c0fw54304s38bf8lq4nj8q-agda-2.5.3/share/x86_64-linux-ghc-8.0.2/Agda-2.5.3/lib/prim/Agda/Primitive.agdai: openBinaryFile: permission denied (Read-only file system) /gnu/store is the immutable store where Guix packages live and is mounted as read-only to regular users. It looks like the compiler is trying to write an interface file in its installed location in the store. Is there a way to generate all agdai files when compiling/installing Agda itself? TIA! From stvienna at gmail.com Mon Mar 5 08:23:12 2018 From: stvienna at gmail.com (stvienna wiener) Date: Mon, 5 Mar 2018 08:23:12 +0100 Subject: [Agda] Bug caused by new forcing translation Message-ID: Hi all, My formalization doesn't work because of the open bug: https://github.com/agda/agda/issues/2888 (Location of the error: Forcing.hs:230) Is there a work around so that I can keep on working? What agda commit should I revert to? (I.e., in which commit was the new forcing translation introduced?) Best, Stephan From ulf.norell at gmail.com Mon Mar 5 09:02:15 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Mon, 5 Mar 2018 09:02:15 +0100 Subject: [Agda] Bug caused by new forcing translation In-Reply-To: References: Message-ID: You can revert to b8eb5098, which is when the code was added, but before it was actually run. / Ulf On Mon, Mar 5, 2018 at 8:23 AM, stvienna wiener wrote: > Hi all, > > My formalization doesn't work because of the open bug: > https://github.com/agda/agda/issues/2888 > > (Location of the error: Forcing.hs:230) > > > Is there a work around so that I can keep on working? > What agda commit should I revert to? (I.e., in which commit was the > new forcing translation introduced?) > > Best, > Stephan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From james.wood.100 at strath.ac.uk Mon Mar 5 11:01:56 2018 From: james.wood.100 at strath.ac.uk (James Wood) Date: Mon, 5 Mar 2018 10:01:56 +0000 Subject: [Agda] Packaging Agda and compiling it ahead of time In-Reply-To: <87sh9f7psm.fsf@librem.i-did-not-set--mail-host-address--so-tickle-me> References: <87sh9f7psm.fsf@librem.i-did-not-set--mail-host-address--so-tickle-me> Message-ID: <13027f10-83e7-1033-5a37-cfc3594d7e4d@strath.ac.uk> Hi Alex, The same problem comes up for Nix, and the answer is to compile all Agda files at the time of installation. The postInstall of the Agda package in https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/hackage-packages.nix is what you want. Best wishes, James On 04/03/18 16:45, Alex ter Weele wrote: > Hello all, > > I am packaging Agda for Guix. With my package, when I try to load or > compile an Agda file, I see > > $ agda test.agda > /gnu/store/17lci61ny0c0fw54304s38bf8lq4nj8q-agda-2.5.3/share/x86_64-linux-ghc-8.0.2/Agda-2.5.3/lib/prim/Agda/Primitive.agdai: > openBinaryFile: permission denied (Read-only file system) > > /gnu/store is the immutable store where Guix packages live and is > mounted as read-only to regular users. It looks like the compiler is > trying to write an interface file in its installed location in the > store. Is there a way to generate all agdai files when > compiling/installing Agda itself? > > TIA! > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda From Jesper at sikanda.be Mon Mar 5 15:04:10 2018 From: Jesper at sikanda.be (Jesper Cockx) Date: Mon, 5 Mar 2018 15:04:10 +0100 Subject: [Agda] rewriting before defining In-Reply-To: <5B39B17B-C3C0-48D8-B83F-E92970B2EF6C@exmail.nottingham.ac.uk> References: <5B39B17B-C3C0-48D8-B83F-E92970B2EF6C@exmail.nottingham.ac.uk> Message-ID: The problem is that if we allow a rewrite rule to be added before its definition, then you could just prove it using refl (since it is now reflexive, by virtue of adding the rewrite rule). So this doesn't actually give you any more guarantees than just postulating the rewrite rule outright. So I don't think it makes sense to allow this. If you can come up with a way to use a rewrite rule for other definitions but not for defining the rule itself, let us know (or even better: implement it and send us a pull request ;) ). -- Jesper On Thu, Mar 1, 2018 at 11:02 AM, Thorsten Altenkirch < Thorsten.Altenkirch at nottingham.ac.uk> wrote: > On 01/03/2018, 09:30, "Agda on behalf of Andreas Abel" < > agda-bounces at lists.chalmers.se on behalf of abela at chalmers.se> wrote: > > > >Well, the doctor could perform some surgery on Agda, take out the > >cancerous error message and see what happens. ;-) > > I was hoping that a surgeon who is better versed with the Agda source > would do this for me. :-) In particular I don?t really want to use a > non-standard version of Agda. > > >I wash my hands in innocence. For me, the intended use of REWRITE was > >to add a proven propositional equality to definitional equality; if you > >go beyond it, you have to worry about the semantics yourself. > > You are right. Basically REWRITE is a limited form of equality reflection. > I do prove this equality only I am proving it mutually with its use. This > you can certainly do when you have full equality reflection. I shouldn?t > need to introduce postulates here. > > This particular instance enables me to define semisimplicial types without > using a 2-level theory (the 2-level approach was described in our CSL 2016 > paper http://www.cs.nott.ac.uk/~psztxa/publ/csl16.pdf). The rewrite > version is both better from a pragmatic view (easier to use - I think) and > from a semantic point (there are interpretations or type theory that model > semisimplical types but not a (strong) 2-level theory where Nat is fibrant > - at least that is what Mike Shulman told me). > > In this setting we certainly do not want to have full equality reflection > because it would destroy proof relevance and hence it is in this form > incompatible with univalence. However, I claim that this instance of > equality reflection is harmless (this is a conjecture). > > We know that REWRITE can destroy soundness - so no difference here. > > Thorsten > > > > >Cheers, > >Andreas > > > >On 28.02.2018 19:07, Thorsten Altenkirch wrote: > >> Hi, > >> > >> I am mutually defining an equality and some other things. To be able to > >> type check the other things I need the equality as a rewriting rule but > >> agda doesn't let me. > >> > >> That is I get the error > >> Rewrite rule from function Skm-? cannot be added before the function > >> definition > >> when checking the pragma REWRITE Skm-? > >> when checking the attached file. > >> > >> I know that I am cheating but I want to do it. Can I tell it that I am a > >> doctor and I know what I am doing. Otherwise I shouldn't be allowed to > >> use Rewrite anyway. > >> > >> Yes, I can replace it by a postulate but that misses the point. > >> > >> Cheers, > >> Thorsten > >> > >> > >> This message and any attachment are intended solely for the addressee > >> and may contain confidential information. If you have received this > >> message in error, please contact the sender and delete the email and > >> attachment. > >> > >> Any views or opinions expressed by the author of this email do not > >> necessarily reflect the views of the University of Nottingham. Email > >> communications with the University of Nottingham may be monitored > >> where permitted by law. > >> > >> > >> > >> > >> > >> _______________________________________________ > >> Agda mailing list > >> Agda at lists.chalmers.se > >> https://lists.chalmers.se/mailman/listinfo/agda > >> > > > > > >-- > >Andreas Abel <>< Du bist der geliebte Mensch. > > > >Department of Computer Science and Engineering > >Chalmers and Gothenburg University, Sweden > > > >andreas.abel at gu.se > >http://www.cse.chalmers.se/~abela/ > >_______________________________________________ > >Agda mailing list > >Agda at lists.chalmers.se > >https://lists.chalmers.se/mailman/listinfo/agda > > > > This message and any attachment are intended solely for the addressee > and may contain confidential information. If you have received this > message in error, please contact the sender and delete the email and > attachment. > > Any views or opinions expressed by the author of this email do not > necessarily reflect the views of the University of Nottingham. Email > communications with the University of Nottingham may be monitored > where permitted by law. > > > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Thorsten.Altenkirch at nottingham.ac.uk Mon Mar 5 17:32:29 2018 From: Thorsten.Altenkirch at nottingham.ac.uk (Thorsten Altenkirch) Date: Mon, 5 Mar 2018 16:32:29 +0000 Subject: [Agda] rewriting before defining In-Reply-To: References: <5B39B17B-C3C0-48D8-B83F-E92970B2EF6C@exmail.nottingham.ac.uk> Message-ID: Hi Jesper, Yes, Paolo Capritti already pointed this out to me (I was going to write an update). Basically I should not be able to use the rewriting rule on the right hand side of a recursive definition but this certainly goes beyond the abilities of Agda?s rewrite mechanism (or only for structurally smaller indices). Cheers, Thorsten From: Agda on behalf of Jesper Cockx Date: Monday, 5 March 2018 at 14:04 To: Thorsten Altenkirch Cc: "andreas.abel at gu.se" , Agda mailing list , Nicolai Kraus Subject: Re: [Agda] rewriting before defining The problem is that if we allow a rewrite rule to be added before its definition, then you could just prove it using refl (since it is now reflexive, by virtue of adding the rewrite rule). So this doesn't actually give you any more guarantees than just postulating the rewrite rule outright. So I don't think it makes sense to allow this. If you can come up with a way to use a rewrite rule for other definitions but not for defining the rule itself, let us know (or even better: implement it and send us a pull request ;) ). -- Jesper On Thu, Mar 1, 2018 at 11:02 AM, Thorsten Altenkirch > wrote: On 01/03/2018, 09:30, "Agda on behalf of Andreas Abel" on behalf of abela at chalmers.se> wrote: >Well, the doctor could perform some surgery on Agda, take out the >cancerous error message and see what happens. ;-) I was hoping that a surgeon who is better versed with the Agda source would do this for me. :-) In particular I don?t really want to use a non-standard version of Agda. >I wash my hands in innocence. For me, the intended use of REWRITE was >to add a proven propositional equality to definitional equality; if you >go beyond it, you have to worry about the semantics yourself. You are right. Basically REWRITE is a limited form of equality reflection. I do prove this equality only I am proving it mutually with its use. This you can certainly do when you have full equality reflection. I shouldn?t need to introduce postulates here. This particular instance enables me to define semisimplicial types without using a 2-level theory (the 2-level approach was described in our CSL 2016 paper http://www.cs.nott.ac.uk/~psztxa/publ/csl16.pdf). The rewrite version is both better from a pragmatic view (easier to use - I think) and from a semantic point (there are interpretations or type theory that model semisimplical types but not a (strong) 2-level theory where Nat is fibrant - at least that is what Mike Shulman told me). In this setting we certainly do not want to have full equality reflection because it would destroy proof relevance and hence it is in this form incompatible with univalence. However, I claim that this instance of equality reflection is harmless (this is a conjecture). We know that REWRITE can destroy soundness - so no difference here. Thorsten > >Cheers, >Andreas > >On 28.02.2018 19:07, Thorsten Altenkirch wrote: >> Hi, >> >> I am mutually defining an equality and some other things. To be able to >> type check the other things I need the equality as a rewriting rule but >> agda doesn't let me. >> >> That is I get the error >> Rewrite rule from function Skm-? cannot be added before the function >> definition >> when checking the pragma REWRITE Skm-? >> when checking the attached file. >> >> I know that I am cheating but I want to do it. Can I tell it that I am a >> doctor and I know what I am doing. Otherwise I shouldn't be allowed to >> use Rewrite anyway. >> >> Yes, I can replace it by a postulate but that misses the point. >> >> Cheers, >> Thorsten >> >> >> This message and any attachment are intended solely for the addressee >> and may contain confidential information. If you have received this >> message in error, please contact the sender and delete the email and >> attachment. >> >> Any views or opinions expressed by the author of this email do not >> necessarily reflect the views of the University of Nottingham. Email >> communications with the University of Nottingham may be monitored >> where permitted by law. >> >> >> >> >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> > > >-- >Andreas Abel <>< Du bist der geliebte Mensch. > >Department of Computer Science and Engineering >Chalmers and Gothenburg University, Sweden > >andreas.abel at gu.se >http://www.cse.chalmers.se/~abela/ >_______________________________________________ >Agda mailing list >Agda at lists.chalmers.se >https://lists.chalmers.se/mailman/listinfo/agda This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please contact the sender and delete the email and attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. Email communications with the University of Nottingham may be monitored where permitted by law. _______________________________________________ Agda mailing list Agda at lists.chalmers.se https://lists.chalmers.se/mailman/listinfo/agda This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please contact the sender and delete the email and attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. Email communications with the University of Nottingham may be monitored where permitted by law. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at cse.gu.se Tue Mar 6 11:14:05 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Tue, 6 Mar 2018 11:14:05 +0100 Subject: [Agda] INLINE-pragma In-Reply-To: References: Message-ID: <4cfbe55d-1c07-394b-a526-bf8a5c489716@cse.gu.se> On 2018-03-02 16:26, Frederik Hangh?j Iversen wrote: > Is it possible to normalize something to the first visible > constructors? I don't think there's any support for that at the moment. Perhaps you could try to implement it yourself. -- /NAD From andrei.paskevich at lri.fr Tue Mar 6 14:25:21 2018 From: andrei.paskevich at lri.fr (Andrei Paskevich) Date: Tue, 6 Mar 2018 14:25:21 +0100 Subject: [Agda] VerifyThis 2018: Call for Participation and Travel Grants Message-ID: <20180306132521.GA22545@tikki.lri.fr> ******************************************************************************** VerifyThis Verification Competition 2018 CALL FOR PARTICIPATION -- TRAVEL GRANTS Competition to be held at ETAPS 2018 http://verifythis.ethz.ch ******************************************************************************** IMPORTANT DATES Grant application deadline: March 12, 2018 Competition: April 14 and 15, 2018 ABOUT VerifyThis 2018 is a program verification competition taking place as part of the European Joint Conferences on Theory and Practice of Software (ETAPS 2018) on April 14-15, 2018 in Thessaloniki, Greece. It is the 7th event in the VerifyThis competition series. The competition will offer a number of challenges presented in natural language and pseudo code. Participants have to formalize the requirements, implement a solution, and formally verify the implementation for adherence to the specification. There are no restrictions on the programming language and verification technology used. The correctness properties posed in problems will have the input-output behaviour of programs in focus. Solutions will be judged for correctness, completeness, and elegance. PARTICIPATION: Participation is open for anybody interested. Teams of up to two people are allowed. Registration for ETAPS workshops and physical presence on site is required. We particularly encourage participation of: - student teams (this includes PhD students) - non-developer teams using a tool someone else developed - several teams using the same tool TRAVEL GRANTS: The competition has funds for a limited number of travel grants. A grant covers the incurred travel and accommodation costs up to a certain limit. The expected limit is EUR 350 for those coming from Europe and EUR 600 for those coming from outside Europe. To apply for a travel grant, send an email to verifythis at cs.nuim.ie by March 12, 2018. The application should include: - your name - your affiliation - the verification system(s) you plan to use at the competition - the planned composition of your team - a short letter of motivation explaining your involvement with formal verification so far - if you are a student, please state the academic degree you are seeking and have your supervisor send a brief letter of support to verifythis at cs.nuim.ie ORGANIZERS * Marieke Huisman, University of Twente, the Netherlands * Rosemary Monahan, Maynooth University, Ireland * Peter M?ller, ETH Z?rich, Switzerland * Andrei Paskevich, Paris-Sud University, France * Gidon Ernst, National Institute of Informatics Tokyo, Japan CONTACT Email: verifythis at cs.nuim.ie Web: http://verifythis.ethz.ch From matthewdaggitt at gmail.com Tue Mar 6 15:08:07 2018 From: matthewdaggitt at gmail.com (Matthew Daggitt) Date: Tue, 6 Mar 2018 14:08:07 +0000 Subject: [Agda] Feedback on upcoming version of the standard library Message-ID: Dear all, Version 0.15 of the Agda standard library will be released next Monday. The release candidate can be found on the master branch of the Github repository, and the changes are detailed in the CHANGELOG . No further major changes are envisaged between now and release. If any potential early adopters would like to try it out, we would welcome any feedback between now and Monday. -- Matthew, on behalf of the Agda team -------------- next part -------------- An HTML attachment was scrubbed... URL: From apostolis.xekoukoulotakis at gmail.com Tue Mar 6 20:36:44 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Tue, 6 Mar 2018 21:36:44 +0200 Subject: [Agda] debugPrint : Does it work correctly? Message-ID: I do know how verbosity levels work. According to https://github.com/agda/agda/blob/9ff3310f27a006675656d453d3338df233e4ca78/CHANGELOG.md#reflection the String at debugPrint seems to act like a filter. I have tested it with multiple values and it does not seem to filter the logs at the *Agda debug* buffer. Am I misinterpreting something? -------------- next part -------------- An HTML attachment was scrubbed... URL: From wadler at inf.ed.ac.uk Tue Mar 6 21:12:06 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Tue, 6 Mar 2018 17:12:06 -0300 Subject: [Agda] Checking the types of terms Message-ID: A construct like the following would be handy, especially for literate Agda. \begin{code} check term_1 : type_1 ... term_n : type_n \end{code} Agda checks that each given term has the given type, and typesets the code, but it introduces no new identifiers and has no effect on the other code. Such a construct can allow one to include examples in the text that are checked by Agda, and hence make the text more reliable. Another use might be to give types for identifiers imported from elsewhere, making the code easier to read and allowing Agda to catch any misunderstandings. Is a feature like this available? Would it be hard to add? Adding `check` as a keyword would harm backward compatibility, is there another choice that might be better? Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From larrytheliquid at gmail.com Tue Mar 6 21:30:57 2018 From: larrytheliquid at gmail.com (Larrytheliquid) Date: Tue, 6 Mar 2018 14:30:57 -0600 Subject: [Agda] Checking the types of terms In-Reply-To: References: Message-ID: Agda does have underscore definitions, which do not add new identifiers: \begin{code} _ : type_1 _ = term_1 ... _ : type_n _ = term_n \end{code} On Tue, Mar 6, 2018 at 2:12 PM, Philip Wadler wrote: > A construct like the following would be handy, especially for literate > Agda. > \begin{code} > check > term_1 : type_1 > ... > term_n : type_n > \end{code} > Agda checks that each given term has the given type, and typesets the > code, but it introduces no new identifiers and has no effect on the other > code. > > Such a construct can allow one to include examples in the text that are > checked by Agda, and hence make the text more reliable. Another use might > be to give types for identifiers imported from elsewhere, making the code > easier to read and allowing Agda to catch any misunderstandings. > > Is a feature like this available? Would it be hard to add? > > Adding `check` as a keyword would harm backward compatibility, is there > another choice that might be better? > > Cheers, -- P > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -- Respectfully, Larry Diehl -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell at gmail.com Tue Mar 6 21:45:02 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Tue, 6 Mar 2018 21:45:02 +0100 Subject: [Agda] debugPrint : Does it work correctly? In-Reply-To: References: Message-ID: What values did you try? Setting the option `-v X.Y.Z:N` (in an OPTIONS pragma for instance) should enable any debugPrints with arguments "X.Y.Z*" M with M =< N. For instance, this works as expected for me (prints DEBUG in the *Agda debug* buffer): {-# OPTIONS -v test:20 #-} open import Agda.Builtin.Reflection open import Agda.Builtin.Unit open import Agda.Builtin.String open import Agda.Builtin.Nat open import Agda.Builtin.List macro foo : Term ? TC ? foo _ = debugPrint "test.debug" 10 (strErr "DEBUG" ? []) A : Set A = foo Changing the verbosity level to below 10 (or to a different label like test.foo) makes it not print anything. / Ulf On Tue, Mar 6, 2018 at 8:36 PM, Apostolis Xekoukoulotakis < apostolis.xekoukoulotakis at gmail.com> wrote: > I do know how verbosity levels work. > > According to > https://github.com/agda/agda/blob/9ff3310f27a006675656d453d3338d > f233e4ca78/CHANGELOG.md#reflection > > the String at debugPrint seems to act like a filter. > > I have tested it with multiple values and it does not seem to filter the > logs at the *Agda debug* buffer. > > Am I misinterpreting something? > > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apostolis.xekoukoulotakis at gmail.com Tue Mar 6 22:15:04 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Tue, 6 Mar 2018 23:15:04 +0200 Subject: [Agda] debugPrint : Does it work correctly? In-Reply-To: References: Message-ID: It works if you put an option on the file itself. I was changing the "Agda2 Program Args" from emacs. I have "-v test:20" and "--caching" With your example without the Options pragma, I do not get any output. On Tue, Mar 6, 2018 at 10:45 PM, Ulf Norell wrote: > What values did you try? Setting the option `-v X.Y.Z:N` (in an OPTIONS > pragma for instance) should enable any debugPrints with arguments "X.Y.Z*" > M with M =< N. > > For instance, this works as expected for me (prints DEBUG in the *Agda > debug* buffer): > > {-# OPTIONS -v test:20 #-} > > open import Agda.Builtin.Reflection > open import Agda.Builtin.Unit > open import Agda.Builtin.String > open import Agda.Builtin.Nat > open import Agda.Builtin.List > > macro > foo : Term ? TC ? > foo _ = debugPrint "test.debug" 10 (strErr "DEBUG" ? []) > > A : Set > A = foo > > Changing the verbosity level to below 10 (or to a different label like > test.foo) makes it not print anything. > > / Ulf > > On Tue, Mar 6, 2018 at 8:36 PM, Apostolis Xekoukoulotakis < > apostolis.xekoukoulotakis at gmail.com> wrote: > >> I do know how verbosity levels work. >> >> According to >> https://github.com/agda/agda/blob/9ff3310f27a006675656d453d3 >> 338df233e4ca78/CHANGELOG.md#reflection >> >> the String at debugPrint seems to act like a filter. >> >> I have tested it with multiple values and it does not seem to filter the >> logs at the *Agda debug* buffer. >> >> Am I misinterpreting something? >> >> >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wadler at inf.ed.ac.uk Tue Mar 6 22:27:27 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Tue, 6 Mar 2018 18:27:27 -0300 Subject: [Agda] Checking the types of terms In-Reply-To: References: Message-ID: Aha! Good point. I hadn't noticed that underscore lets me achieve my goal. Unfortunately, using underscore takes up twice as many lines. That's not a big deal for a single expression, but is a problem if I want to, for instance, give a checked signature for every import from a module. Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 6 March 2018 at 17:30, Larrytheliquid wrote: > Agda does have underscore definitions, which do not add new identifiers: > > \begin{code} > _ : type_1 > _ = term_1 > ... > _ : type_n > _ = term_n > \end{code} > > > On Tue, Mar 6, 2018 at 2:12 PM, Philip Wadler wrote: > >> A construct like the following would be handy, especially for literate >> Agda. >> \begin{code} >> check >> term_1 : type_1 >> ... >> term_n : type_n >> \end{code} >> Agda checks that each given term has the given type, and typesets the >> code, but it introduces no new identifiers and has no effect on the other >> code. >> >> Such a construct can allow one to include examples in the text that are >> checked by Agda, and hence make the text more reliable. Another use might >> be to give types for identifiers imported from elsewhere, making the code >> easier to read and allowing Agda to catch any misunderstandings. >> >> Is a feature like this available? Would it be hard to add? >> >> Adding `check` as a keyword would harm backward compatibility, is there >> another choice that might be better? >> >> Cheers, -- P >> >> . \ Philip Wadler, Professor of Theoretical Computer Science, >> . /\ School of Informatics, University of Edinburgh >> . / \ and Senior Research Fellow, IOHK >> . http://homepages.inf.ed.ac.uk/wadler/ >> >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > > > -- > Respectfully, > Larry Diehl > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From guillaume.brunerie at gmail.com Tue Mar 6 23:49:16 2018 From: guillaume.brunerie at gmail.com (Guillaume Brunerie) Date: Tue, 6 Mar 2018 17:49:16 -0500 Subject: [Agda] Checking the types of terms In-Reply-To: References: Message-ID: You could define a function has-type : (A : Set) (a : A) -> Unit has-type A a = tt and then _ = has-type type1 term1 _ = has-type type2 term2 and so on. Using the syntax mechanism and an infix symbol, you can even get _ = term1 :> type1 _ = term2 :> type2 or whatever other symbol you choose. Guillaume On Tue, Mar 6, 2018 at 4:27 PM, Philip Wadler wrote: > Aha! Good point. I hadn't noticed that underscore lets me achieve my goal. > > Unfortunately, using underscore takes up twice as many lines. That's not a > big deal for a single expression, but is a problem if I want to, for > instance, give a checked signature for every import from a module. > > Cheers, -- P > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > On 6 March 2018 at 17:30, Larrytheliquid wrote: >> >> Agda does have underscore definitions, which do not add new identifiers: >> >> \begin{code} >> _ : type_1 >> _ = term_1 >> ... >> _ : type_n >> _ = term_n >> \end{code} >> >> >> On Tue, Mar 6, 2018 at 2:12 PM, Philip Wadler wrote: >>> >>> A construct like the following would be handy, especially for literate >>> Agda. >>> \begin{code} >>> check >>> term_1 : type_1 >>> ... >>> term_n : type_n >>> \end{code} >>> Agda checks that each given term has the given type, and typesets the >>> code, but it introduces no new identifiers and has no effect on the other >>> code. >>> >>> Such a construct can allow one to include examples in the text that are >>> checked by Agda, and hence make the text more reliable. Another use might be >>> to give types for identifiers imported from elsewhere, making the code >>> easier to read and allowing Agda to catch any misunderstandings. >>> >>> Is a feature like this available? Would it be hard to add? >>> >>> Adding `check` as a keyword would harm backward compatibility, is there >>> another choice that might be better? >>> >>> Cheers, -- P >>> >>> . \ Philip Wadler, Professor of Theoretical Computer Science, >>> . /\ School of Informatics, University of Edinburgh >>> . / \ and Senior Research Fellow, IOHK >>> . http://homepages.inf.ed.ac.uk/wadler/ >>> >>> The University of Edinburgh is a charitable body, registered in >>> Scotland, with registration number SC005336. >>> >>> _______________________________________________ >>> Agda mailing list >>> Agda at lists.chalmers.se >>> https://lists.chalmers.se/mailman/listinfo/agda >>> >> >> >> >> -- >> Respectfully, >> Larry Diehl > > > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > From wadler at inf.ed.ac.uk Tue Mar 6 23:51:42 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Tue, 6 Mar 2018 19:51:42 -0300 Subject: [Agda] Checking the types of terms In-Reply-To: References: Message-ID: Thanks, Guillaume, that solves my problem neatly. Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 6 March 2018 at 19:49, Guillaume Brunerie wrote: > You could define a function > > has-type : (A : Set) (a : A) -> Unit > has-type A a = tt > > and then > > _ = has-type type1 term1 > _ = has-type type2 term2 > > and so on. > Using the syntax mechanism and an infix symbol, you can even get > > _ = term1 :> type1 > _ = term2 :> type2 > > or whatever other symbol you choose. > > Guillaume > > On Tue, Mar 6, 2018 at 4:27 PM, Philip Wadler wrote: > > Aha! Good point. I hadn't noticed that underscore lets me achieve my > goal. > > > > Unfortunately, using underscore takes up twice as many lines. That's not > a > > big deal for a single expression, but is a problem if I want to, for > > instance, give a checked signature for every import from a module. > > > > Cheers, -- P > > > > . \ Philip Wadler, Professor of Theoretical Computer Science, > > . /\ School of Informatics, University of Edinburgh > > . / \ and Senior Research Fellow, IOHK > > . http://homepages.inf.ed.ac.uk/wadler/ > > > > On 6 March 2018 at 17:30, Larrytheliquid > wrote: > >> > >> Agda does have underscore definitions, which do not add new identifiers: > >> > >> \begin{code} > >> _ : type_1 > >> _ = term_1 > >> ... > >> _ : type_n > >> _ = term_n > >> \end{code} > >> > >> > >> On Tue, Mar 6, 2018 at 2:12 PM, Philip Wadler > wrote: > >>> > >>> A construct like the following would be handy, especially for literate > >>> Agda. > >>> \begin{code} > >>> check > >>> term_1 : type_1 > >>> ... > >>> term_n : type_n > >>> \end{code} > >>> Agda checks that each given term has the given type, and typesets the > >>> code, but it introduces no new identifiers and has no effect on the > other > >>> code. > >>> > >>> Such a construct can allow one to include examples in the text that are > >>> checked by Agda, and hence make the text more reliable. Another use > might be > >>> to give types for identifiers imported from elsewhere, making the code > >>> easier to read and allowing Agda to catch any misunderstandings. > >>> > >>> Is a feature like this available? Would it be hard to add? > >>> > >>> Adding `check` as a keyword would harm backward compatibility, is there > >>> another choice that might be better? > >>> > >>> Cheers, -- P > >>> > >>> . \ Philip Wadler, Professor of Theoretical Computer Science, > >>> . /\ School of Informatics, University of Edinburgh > >>> . / \ and Senior Research Fellow, IOHK > >>> . http://homepages.inf.ed.ac.uk/wadler/ > >>> > >>> The University of Edinburgh is a charitable body, registered in > >>> Scotland, with registration number SC005336. > >>> > >>> _______________________________________________ > >>> Agda mailing list > >>> Agda at lists.chalmers.se > >>> https://lists.chalmers.se/mailman/listinfo/agda > >>> > >> > >> > >> > >> -- > >> Respectfully, > >> Larry Diehl > > > > > > > > The University of Edinburgh is a charitable body, registered in > > Scotland, with registration number SC005336. > > > > _______________________________________________ > > Agda mailing list > > Agda at lists.chalmers.se > > https://lists.chalmers.se/mailman/listinfo/agda > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ulf.norell at gmail.com Wed Mar 7 06:56:23 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Wed, 7 Mar 2018 06:56:23 +0100 Subject: [Agda] debugPrint : Does it work correctly? In-Reply-To: References: Message-ID: You need to get rid of the space after -v or put test:20 on its own line. Each line in the Agda2 Program Args is treated as a single argument so what you have is equivalent to the command-line agda --caching "-v test:20" This is actually still a valid option and gets parsed as setting the verbosity level for the label " test" (with a leading space). You can verify this by adding a space also in the argument to debugPrint. / Ulf On Tue, Mar 6, 2018 at 10:15 PM, Apostolis Xekoukoulotakis < apostolis.xekoukoulotakis at gmail.com> wrote: > It works if you put an option on the file itself. > > I was changing the "Agda2 Program Args" from emacs. > > I have "-v test:20" > and "--caching" > > With your example without the Options pragma, I do not get any output. > > On Tue, Mar 6, 2018 at 10:45 PM, Ulf Norell wrote: > >> What values did you try? Setting the option `-v X.Y.Z:N` (in an OPTIONS >> pragma for instance) should enable any debugPrints with arguments "X.Y.Z*" >> M with M =< N. >> >> For instance, this works as expected for me (prints DEBUG in the *Agda >> debug* buffer): >> >> {-# OPTIONS -v test:20 #-} >> >> open import Agda.Builtin.Reflection >> open import Agda.Builtin.Unit >> open import Agda.Builtin.String >> open import Agda.Builtin.Nat >> open import Agda.Builtin.List >> >> macro >> foo : Term ? TC ? >> foo _ = debugPrint "test.debug" 10 (strErr "DEBUG" ? []) >> >> A : Set >> A = foo >> >> Changing the verbosity level to below 10 (or to a different label like >> test.foo) makes it not print anything. >> >> / Ulf >> >> On Tue, Mar 6, 2018 at 8:36 PM, Apostolis Xekoukoulotakis < >> apostolis.xekoukoulotakis at gmail.com> wrote: >> >>> I do know how verbosity levels work. >>> >>> According to >>> https://github.com/agda/agda/blob/9ff3310f27a006675656d453d3 >>> 338df233e4ca78/CHANGELOG.md#reflection >>> >>> the String at debugPrint seems to act like a filter. >>> >>> I have tested it with multiple values and it does not seem to filter the >>> logs at the *Agda debug* buffer. >>> >>> Am I misinterpreting something? >>> >>> >>> >>> _______________________________________________ >>> Agda mailing list >>> Agda at lists.chalmers.se >>> https://lists.chalmers.se/mailman/listinfo/agda >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From frederic.blanqui at inria.fr Wed Mar 7 07:58:00 2018 From: frederic.blanqui at inria.fr (=?UTF-8?B?RnLDqWTDqXJpYyBCbGFucXVp?=) Date: Wed, 7 Mar 2018 07:58:00 +0100 Subject: [Agda] LFMTP'18: Logical Frameworks and Meta Languages: Theory and Practice - Call for Papers In-Reply-To: References: Message-ID: <6b9cf937-f2d9-9121-56d9-f8bf1dccb8c3@inria.fr> ======================================================================= ?????????????????????????? Call for papers Logical Frameworks and Meta-Languages: Theory and Practice ??????????????????????????? LFMTP 2018 Oxford, UK, 7 July 2018 ???????????????? Affiliated with FSCD 2018 (part of FLoC) http://lfmtp.org/workshops/2018/ ======================================================================= ??? ??? ??? ??? ??? Abstract submission deadline:? 8 April 2018 ????????? ?? ??? ? ? ?? Paper submission deadline: 15 April 2018 Logical frameworks and meta-languages form a common substrate for representing, implementing and reasoning about a wide variety of deductive systems of interest in logic and computer science. Their design, implementation and their use in reasoning tasks, ranging from the correctness of software to the properties of formal systems, have been the focus of considerable research over the last two decades. This workshop will bring together designers, implementors and practitioners to discuss various aspects impinging on the structure and utility of logical frameworks, including the treatment of variable binding, inductive and co-inductive reasoning techniques and the expressiveness and lucidity of the reasoning process. LFMTP 2018 will provide researchers a forum to present state-of-the-art techniques and discuss progress in areas such as the following: * Encoding and reasoning about the meta-theory of programming languages, ? logical systems and related formally specified systems. * Theoretical and practical issues concerning the treatment of variable ? binding, especially the representation of, and reasoning about, ? datatypes defined from binding signatures. * Logical treatments of inductive and co-inductive definitions and ? associated reasoning techniques, including inductive types of higher ? dimension in homotopy type theory * Graphical languages for building proofs, applications in geometry, ? equational reasoning and category theory. * New theory contributions: canonical and substructural frameworks, ? contextual frameworks, proof-theoretic foundations supporting ? binders, functional programming over logical frameworks, ? homotopy and cubical type theory. * Applications of logical frameworks: proof-carrying architectures, proof ? exchange and transformation, program refactoring, etc. * Techniques for programming with binders in functional programming ? languages such as Haskell, OCaml or Agda, and logic programming ? languages such as lambda Prolog or Alpha-Prolog. Invited Speakers * Delia Kesner (Universit? Paris Diderot, France) * Kuen-Bang Hou, alias Favonia (Institute for Advanced Study, Princeton, USA) * Grigore Rosu (University of Illinois at Urbana-Champaign, USA) Important Dates Abstract submission deadline: Sunday?? April? 8th Submission deadline:????????? Sunday ? April 15th Notification to authors:????? Tuesday? May?? 15th Final version due:??????????? Friday?? May?? 25th Workshop date:??????????????? Saturday July?? 7th Submission In addition to regular papers, we accept the submission of "work in progress" reports, in a broad sense.? Those do not need to report fully polished research results, but should be of interest for the community at large. Submitted papers should be in PDF, formatted using the EPTCS style guidelines. The length is restricted to 15 pages for regular papers and 8 pages for "Work in Progress" papers.? Submission is via EasyChair: https://easychair.org/conferences/?conf=lfmtp18. Proceedings Accepted regular papers will be included in the proceedings of LMFTP 2018, whose mode of publication will be determined shortly. Program Committee * Mar?a Alpuente (Universitat Polit?cnica de Val?ncia, Spain) * Andrej Bauer (University of Ljubljana, Slovenia) * Fr?d?ric Blanqui (Inria, France), co-chair * Ana Bove (Chalmers University of Technology, Sweden) * St?phane Graham-Lengrand (CNRS, France) * Makoto Hamana (Gunma University, Japan) * Chantal Keller (Universit? Paris-Sud, France) * Carlos Olarte (Universidade Federal do Rio grande do Norte, Brazil) * Giselle Reis (CMU Qatar), co-chair * Aaron Stump (University of Iowa, USA) * Yuting Wang (Yale University, USA) -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at cse.gu.se Wed Mar 7 10:01:49 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Wed, 7 Mar 2018 10:01:49 +0100 Subject: [Agda] Checking the types of terms In-Reply-To: References: Message-ID: <56fa7201-0c3e-6908-d780-72df21697314@cse.gu.se> On 2018-03-06 23:49, Guillaume Brunerie wrote: > Using the syntax mechanism and an infix symbol, you can even get > > _ = term1 :> type1 > _ = term2 :> type2 > > or whatever other symbol you choose. And you can hide parts of the code: \begin{code}[hide] _ = \end{code} \begin{code} term1 :> type1 \end{code} (This is assuming that you are using the development version of Agda. Agda 2.5.3 provides a different syntax for hiding code, see http://agda.readthedocs.io/en/v2.5.3/tools/generating-latex.html#features.) -- /NAD From bove at chalmers.se Wed Mar 7 12:06:38 2018 From: bove at chalmers.se (Ana Bove) Date: Wed, 7 Mar 2018 12:06:38 +0100 Subject: [Agda] LFMTP - call for papers Message-ID: <76190b8f-aa00-d0ad-e938-701227e865aa@chalmers.se> ======================================================================= ?????????????????????????? Call for papers Logical Frameworks and Meta-Languages: Theory and Practice ??????????????????????????? LFMTP 2018 Oxford, UK, 7 July 2018 ???????????????? Affiliated with FSCD 2018 (part of FLoC) http://lfmtp.org/workshops/2018/ ======================================================================= ????????????? Abstract submission deadline:? 8 April 2018 ???????????????? Paper submission deadline: 15 April 2018 Logical frameworks and meta-languages form a common substrate for representing, implementing and reasoning about a wide variety of deductive systems of interest in logic and computer science. Their design, implementation and their use in reasoning tasks, ranging from the correctness of software to the properties of formal systems, have been the focus of considerable research over the last two decades. This workshop will bring together designers, implementors and practitioners to discuss various aspects impinging on the structure and utility of logical frameworks, including the treatment of variable binding, inductive and co-inductive reasoning techniques and the expressiveness and lucidity of the reasoning process. LFMTP 2018 will provide researchers a forum to present state-of-the-art techniques and discuss progress in areas such as the following: * Encoding and reasoning about the meta-theory of programming languages, ? logical systems and related formally specified systems. * Theoretical and practical issues concerning the treatment of variable ? binding, especially the representation of, and reasoning about, ? datatypes defined from binding signatures. * Logical treatments of inductive and co-inductive definitions and ? associated reasoning techniques, including inductive types of higher ? dimension in homotopy type theory * Graphical languages for building proofs, applications in geometry, ? equational reasoning and category theory. * New theory contributions: canonical and substructural frameworks, ? contextual frameworks, proof-theoretic foundations supporting ? binders, functional programming over logical frameworks, ? homotopy and cubical type theory. * Applications of logical frameworks: proof-carrying architectures, proof ? exchange and transformation, program refactoring, etc. * Techniques for programming with binders in functional programming ? languages such as Haskell, OCaml or Agda, and logic programming ? languages such as lambda Prolog or Alpha-Prolog. Invited Speakers * Delia Kesner (Universit? Paris Diderot, France) * Kuen-Bang Hou, alias Favonia (Institute for Advanced Study, Princeton, USA) * Grigore Rosu (University of Illinois at Urbana-Champaign, USA) Important Dates Abstract submission deadline: Sunday?? April? 8th Submission deadline:????????? Sunday ? April 15th Notification to authors:????? Tuesday? May?? 15th Final version due:??????????? Friday?? May?? 25th Workshop date:??????????????? Saturday July?? 7th Submission In addition to regular papers, we accept the submission of "work in progress" reports, in a broad sense.? Those do not need to report fully polished research results, but should be of interest for the community at large. Submitted papers should be in PDF, formatted using the EPTCS style guidelines. The length is restricted to 15 pages for regular papers and 8 pages for "Work in Progress" papers.? Submission is via EasyChair: https://easychair.org/conferences/?conf=lfmtp18. Proceedings Accepted regular papers will be included in the proceedings of LMFTP 2018, whose mode of publication will be determined shortly. Program Committee * Mar?a Alpuente (Universitat Polit?cnica de Val?ncia, Spain) * Andrej Bauer (University of Ljubljana, Slovenia) * Fr?d?ric Blanqui (Inria, France), co-chair * Ana Bove (Chalmers University of Technology, Sweden) * St?phane Graham-Lengrand (CNRS, France) * Makoto Hamana (Gunma University, Japan) * Chantal Keller (Universit? Paris-Sud, France) * Carlos Olarte (Universidade Federal do Rio grande do Norte, Brazil) * Giselle Reis (CMU Qatar), co-chair * Aaron Stump (University of Iowa, USA) * Yuting Wang (Yale University, USA) -------------- next part -------------- An HTML attachment was scrubbed... URL: From Thorsten.Altenkirch at nottingham.ac.uk Wed Mar 7 14:58:12 2018 From: Thorsten.Altenkirch at nottingham.ac.uk (Thorsten Altenkirch) Date: Wed, 7 Mar 2018 13:58:12 +0000 Subject: [Agda] coinductively defined families Message-ID: Using coinductive types as records I can write record Stream (A : Set) : Set where coinductive field hd : A tl : Stream A and then use copatterns to define cons (after open Stream) _?_ : {A : Set} ? A ? Stream A ? Stream A hd (x ? xs) = x tl (x ? xs) = xs Actually I wouldn't mind writing record Stream (A : Set) : Set where coinductive field hd : Stream A ? A tl : Stream A ? Stream A as in inductive definitions we also write the codomain even though we know what it has to be. However, this is more interesting for families because we should be able to write record Vec (A : Set) : ? ? Set where coinductive field hd : ?{n} ? Vec A (suc n) ? A tl : ?{n} ? Vec A (suc n) ? Vec A n and we can derive [] and cons by copatterns: [] : Vec A zero [] () _?_ : {A : Set} ? A ? Vec A n ? Vec A (suc n) hd (x ? xs) = x tl (x ? xs) = xs here [] is defined as a trivial copattern (no destructor applies). Actually in this case the inductive and the coinductive vectors are isomorphic. A more interesting use case would be to define coinductive vectors indexed by conatural numbers. And I have others. :-) Maybe this has been discussed already? I haven't been able to go to AIMs for a while. Thorsten This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please contact the sender and delete the email and attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. Email communications with the University of Nottingham may be monitored where permitted by law. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jesper at sikanda.be Wed Mar 7 15:20:05 2018 From: Jesper at sikanda.be (Jesper Cockx) Date: Wed, 7 Mar 2018 15:20:05 +0100 Subject: [Agda] coinductively defined families In-Reply-To: References: Message-ID: Probably you know you can already write this: open import Agda.Builtin.Nat open import Agda.Builtin.Equality record Vec (A : Set) (n : Nat) : Set where inductive field hd : ? {m} ? n ? suc m ? A tl : ? {m} ? n ? suc m ? Vec A m open Vec [] : ? {A} ? Vec A 0 [] .hd () [] .tl () _?_ : ? {A n} ? A ? Vec A n ? Vec A (suc n) (x ? xs) .hd refl = x (x ? xs) .tl refl = xs but I agree that having syntax for indexed records would be a nice thing to have. One problem with it is that your proposed syntax would break all existing code with records in it. I was actually thinking recently of going in the opposite direction and making indexed datatypes behave more like records, so you could have projections and eta-laws when there's only a single possible constructor for the given indices (as would be the case for vectors). -- Jesper On Wed, Mar 7, 2018 at 2:58 PM, Thorsten Altenkirch < Thorsten.Altenkirch at nottingham.ac.uk> wrote: > Using coinductive types as records I can write > > record Stream (A : Set) : Set where > coinductive > field > hd : A > tl : Stream A > > and then use copatterns to define cons (after open Stream) > > _?_ : {A : Set} ? A ? Stream A ? Stream A > hd (x ? xs) = x > tl (x ? xs) = xs > > Actually I wouldn't mind writing > > record Stream (A : Set) : Set where > coinductive > field > hd : Stream A ? A > tl : Stream A ? Stream A > > as in inductive definitions we also write the codomain even though we know > what it has to be. However, this is more interesting for families because > we should be able to write > > record Vec (A : Set) : ? ? Set where > coinductive > field > hd : ?{n} ? Vec A (suc n) ? A > tl : ?{n} ? Vec A (suc n) ? Vec A n > > and we can derive [] and cons by copatterns: > > [] : Vec A zero > [] () > > _?_ : {A : Set} ? A ? Vec A n ? Vec A (suc n) > hd (x ? xs) = x > tl (x ? xs) = xs > > here [] is defined as a trivial copattern (no destructor applies). > Actually in this case the inductive and the coinductive vectors are > isomorphic. A more interesting use case would be to define coinductive > vectors indexed by conatural numbers. And I have others. :-) > > Maybe this has been discussed already? I haven't been able to go to AIMs > for a while. > Thorsten > > > > This message and any attachment are intended solely for the addressee > and may contain confidential information. If you have received this > message in error, please contact the sender and delete the email and > attachment. > > Any views or opinions expressed by the author of this email do not > necessarily reflect the views of the University of Nottingham. Email > communications with the University of Nottingham may be monitored > where permitted by law. > > > > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From P.Achten at cs.ru.nl Wed Mar 7 15:23:27 2018 From: P.Achten at cs.ru.nl (Peter Achten) Date: Wed, 7 Mar 2018 15:23:27 +0100 Subject: [Agda] 1st call for papers: Trends in Functional Programming, 11-13 june 2018, Chalmers Campus Johanneberg, Gothenburg Message-ID: ----------------------------- C A L L F O R P A P E R S ----------------------------- ======== TFP 2018 =========== 19th Symposium on Trends in Functional Programming 11-13 June, 2018 Chalmers Campus Johanneberg, Gothenburg http://www.cse.chalmers.se/~myreen/tfp2018/index.html The symposium on Trends in Functional Programming (TFP) is an international forum for researchers with interests in all aspects of functional programming, taking a broad view of current and future trends in the area. It aspires to be a lively environment for presenting the latest research results, and other contributions (see below at scope). Please be aware that TFP uses two distinct rounds of submissions (see below at submission details). TFP 2018 will be the main event of a pair of functional programming events. TFP 2018 will be accompanied by the International Workshop on Trends in Functional Programming in Education (TFPIE), which will take place on June 14. == SCOPE == The symposium recognizes that new trends may arise through various routes. As part of the Symposium's focus on trends we therefore identify the following five article categories. High-quality articles are solicited in any of these categories: Research Articles: Leading-edge, previously unpublished research work Position Articles: On what new trends should or should not be Project Articles: Descriptions of recently started new projects Evaluation Articles: What lessons can be drawn from a finished project Overview Articles: Summarizing work with respect to a trendy subject. Articles must be original and not simultaneously submitted for publication to any other forum. They may consider any aspect of functional programming: theoretical, implementation-oriented, or experience-oriented. Applications of functional programming techniques to other languages are also within the scope of the symposium. Topics suitable for the symposium include, but are not limited to: Functional programming and multicore/manycore computing Functional programming in the cloud High performance functional computing Extra-functional (behavioural) properties of functional programs Dependently typed functional programming Validation and verification of functional programs Debugging and profiling for functional languages Functional programming in different application areas: security, mobility, telecommunications applications, embedded systems, global computing, grids, etc. Interoperability with imperative programming languages Novel memory management techniques Program analysis and transformation techniques Empirical performance studies Abstract/virtual machines and compilers for functional languages (Embedded) domain specific languages New implementation strategies Any new emerging trend in the functional programming area If you are in doubt on whether your article is within the scope of TFP, please contact the TFP 2018 program chairs, Micha? Pa?ka and Magnus Myreen. == Best Paper Awards == To reward excellent contributions, TFP awards a prize for the best paper accepted for the formal proceedings. TFP traditionally pays special attention to research students, acknowledging that students are almost by definition part of new subject trends. A student paper is one for which the authors state that the paper is mainly the work of students, the students are listed as first authors, and a student would present the paper. A prize for the best student paper is awarded each year. In both cases, it is the PC of TFP that awards the prize. In case the best paper happens to be a student paper, that paper will then receive both prizes. == Paper Submissions == We use EasyChair for the refereeing process. The link to the submission page is: https://easychair.org/conferences/?conf=tfp2018 Authors of papers have the choice of having their contributions formally reviewed either before or after the Symposium. == Pre-symposium formal review == Papers to be formally reviewed before the symposium should be submitted before an early deadline and receive their reviews and notification of acceptance for both presentation and publication before the symposium. A paper that has been rejected in this process may still be accepted for presentation at the symposium, but will not be considered for the post-symposium formal review. == Post-symposium formal review == Draft papers will receive minimal reviews and notification of acceptance for presentation at the symposium. Authors of draft papers will be invited to submit revised papers based on the feedback receive at the symposium. A post-symposium refereeing process will then select a subset of these articles for formal publication. == Paper categories == Draft papers and papers submitted for formal review are submitted as extended abstracts (4 to 10 pages in length) or full papers (20 pages). The submission must clearly indicate which category it belongs to: research, position, project, evaluation, or overview paper. It should also indicate which authors are research students, and whether the main author(s) are students. A draft paper for which all authors are students will receive additional feedback by one of the PC members shortly after the symposium has taken place. == Format == Papers must be written in English, and written using the LNCS style. For more information about formatting please consult the Springer LNCS web site. == Important Dates == Submission (pre-symposium review): March 26, 2018 Submission (draft, post-symposium review): April 26, 2018 Notification (pre- and post-symposium review): May 3, 2018 Registration: June 3, 2018 TFP Symposium: June 11-13, 2018 TFPIE Workshop: June 14, 2018 Student papers feedback: June 21, 2018 Submission (post-symposium review): August 14, 2018 Notification (post-symposium review): September 20, 2018 Camera-ready paper (pre- and post-symposium review): November 30, 2018 == Program Committee == Program Co-chairs Micha? Pa?ka, Chalmers University of Technology (SE) Magnus Myreen, Chalmers University of Technology (SE) Program Committee Soichiro Hidaka, Hosei University (JP) Meng Wang, University of Bristol (UK) Sam Tobin-Hochstadt, Indiana University Bloomington (US) Tiark Rompf, Purdue University (US) Patricia Johann, Appalachian State University (US) Neil Sculthorpe, Nottingham Trent University (UK) Andres L?h, Well-Typed LLP (UK) Tarmo Uustalu, Tallinn University of Technology (EE) Cosmin E. Oancea, University of Copenhagen (DK) Mauro Jaskelioff, Universidad Nacional de Rosario (AR) Peter Achten, Radboud University (NL) Dimitrios Vytiniotis, Microsoft Research (UK) Alberto Pardo, Universidad de la Rep?blica (UY) Natalia Chechina, University of Glasgow (UK) Peter Sestoft, IT University of Copenhagen (DK) Scott Owens, University of Kent (UK) From Jesper at sikanda.be Wed Mar 7 15:29:08 2018 From: Jesper at sikanda.be (Jesper Cockx) Date: Wed, 7 Mar 2018 15:29:08 +0100 Subject: [Agda] coinductively defined families In-Reply-To: References: Message-ID: Oh, and here's the CoVec example: open import Agda.Builtin.Bool open import Agda.Builtin.Equality record CoNat : Set where coinductive field iszero : Bool pred : iszero ? false ? CoNat open CoNat zero : CoNat zero .iszero = true zero .pred () suc : CoNat ? CoNat suc x .iszero = false suc x .pred refl = x inf : CoNat inf .iszero = false inf .pred refl = inf record CoVec (A : Set) (n : CoNat) : Set where coinductive field hd : n .iszero ? false ? A tl : (pf : n .iszero ? false) ? CoVec A (n .pred pf) open CoVec [] : {A : Set} ? CoVec A zero [] .hd () [] .tl () _?_ : {A : Set} {n : CoNat} ? A ? CoVec A n ? CoVec A (suc n) (x ? xs) .hd refl = x (x ? xs) .tl refl = xs repeat : {A : Set} ? A ? CoVec A inf repeat x .hd refl = x repeat x .tl refl = repeat x -- Jesper On Wed, Mar 7, 2018 at 3:20 PM, Jesper Cockx wrote: > Probably you know you can already write this: > > open import Agda.Builtin.Nat > open import Agda.Builtin.Equality > > record Vec (A : Set) (n : Nat) : Set where > inductive > field > hd : ? {m} ? n ? suc m ? A > tl : ? {m} ? n ? suc m ? Vec A m > open Vec > > [] : ? {A} ? Vec A 0 > [] .hd () > [] .tl () > > _?_ : ? {A n} ? A ? Vec A n ? Vec A (suc n) > (x ? xs) .hd refl = x > (x ? xs) .tl refl = xs > > but I agree that having syntax for indexed records would be a nice thing > to have. One problem with it is that your proposed syntax would break all > existing code with records in it. > > I was actually thinking recently of going in the opposite direction and > making indexed datatypes behave more like records, so you could have > projections and eta-laws when there's only a single possible constructor > for the given indices (as would be the case for vectors). > > -- Jesper > > > On Wed, Mar 7, 2018 at 2:58 PM, Thorsten Altenkirch nottingham.ac.uk> wrote: > >> Using coinductive types as records I can write >> >> record Stream (A : Set) : Set where >> coinductive >> field >> hd : A >> tl : Stream A >> >> and then use copatterns to define cons (after open Stream) >> >> _?_ : {A : Set} ? A ? Stream A ? Stream A >> hd (x ? xs) = x >> tl (x ? xs) = xs >> >> Actually I wouldn't mind writing >> >> record Stream (A : Set) : Set where >> coinductive >> field >> hd : Stream A ? A >> tl : Stream A ? Stream A >> >> as in inductive definitions we also write the codomain even though we >> know what it has to be. However, this is more interesting for families >> because we should be able to write >> >> record Vec (A : Set) : ? ? Set where >> coinductive >> field >> hd : ?{n} ? Vec A (suc n) ? A >> tl : ?{n} ? Vec A (suc n) ? Vec A n >> >> and we can derive [] and cons by copatterns: >> >> [] : Vec A zero >> [] () >> >> _?_ : {A : Set} ? A ? Vec A n ? Vec A (suc n) >> hd (x ? xs) = x >> tl (x ? xs) = xs >> >> here [] is defined as a trivial copattern (no destructor applies). >> Actually in this case the inductive and the coinductive vectors are >> isomorphic. A more interesting use case would be to define coinductive >> vectors indexed by conatural numbers. And I have others. :-) >> >> Maybe this has been discussed already? I haven't been able to go to AIMs >> for a while. >> Thorsten >> >> >> This message and any attachment are intended solely for the addressee >> and may contain confidential information. If you have received this >> message in error, please contact the sender and delete the email and >> attachment. >> >> Any views or opinions expressed by the author of this email do not >> necessarily reflect the views of the University of Nottingham. Email >> communications with the University of Nottingham may be monitored >> where permitted by law. >> >> >> >> >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas.abel at ifi.lmu.de Wed Mar 7 15:31:17 2018 From: andreas.abel at ifi.lmu.de (Andreas Abel) Date: Wed, 7 Mar 2018 15:31:17 +0100 Subject: [Agda] coinductively defined families In-Reply-To: References: Message-ID: <7f0d5181-347a-7b7d-30dd-77cc0cc35a65@ifi.lmu.de> > A more interesting use case would be to define coinductive > vectors indexed by conatural numbers. And I have others. :-) A reason against indexed coinductive records was that indexing was resolved by propositional equality and that was too weak for interesting indices such as conatural numbers. However, with extensional equality such as in cubical, indexed records become more interesting again. Maybe for now, Jesper's workaround is sufficient. Then you can also work with bisimilarity of CoNats instead of propositional equality and that works in vanilla Agda as well. Cheers, Andreas On 07.03.2018 14:58, Thorsten Altenkirch wrote: > Using coinductive types as records I can write > > ? ? record Stream (A : Set) : Set where > ? ? ? ? coinductive > ? ? ? ? field > ? ? ? ? ? hd : A > ? ? ? ? ? tl : Stream A > > and then use copatterns to define cons (after open Stream) > > ? ? _?_ : {A : Set} ? A ? Stream A ? Stream A > ? ? hd (x ? xs) = x > ? ? tl (x ? xs) = xs > > Actually I wouldn't mind writing > > ? ? record Stream (A : Set) : Set where > ? ? ? coinductive > ? ? ? field > ? ? ? ? hd : Stream A ? A > ? ? ? ? tl : Stream A ? Stream A > > as in inductive definitions we also write the codomain even though we > know what it has to be. However, this is more interesting for families > because we should be able to write > > ? ? record Vec (A : Set) : ? ? Set where > ? ? ? coinductive > ? ? ? field > ? ? ? ? hd : ?{n} ? Vec A (suc n) ? A > ? ? ? ? tl : ?{n} ? Vec A (suc n) ? Vec A n > > and we can derive [] and cons by copatterns: > > ? ? [] : Vec A zero > ? ? [] () > > ? ? _?_ : {A : Set} ? A ? Vec A n ? Vec A (suc n) > ? ? hd (x ? xs) = x > ? ? tl (x ? xs) = xs > > here [] is defined as a trivial copattern (no destructor applies). > Actually in this case the inductive and the coinductive vectors are > isomorphic. A more interesting use case would be to define coinductive > vectors indexed by conatural numbers. And I have others. :-) > > Maybe this has been discussed already? I haven't been able to go to AIMs > for a while. > Thorsten > > > > This message and any attachment are intended solely for the addressee > and may contain confidential information. If you have received this > message in error, please contact the sender and delete the email and > attachment. > > Any views or opinions expressed by the author of this email do not > necessarily reflect the views of the University of Nottingham. Email > communications with the University of Nottingham may be monitored > where permitted by law. > > > > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel at gu.se http://www.cse.chalmers.se/~abela/ From Thorsten.Altenkirch at nottingham.ac.uk Wed Mar 7 15:52:58 2018 From: Thorsten.Altenkirch at nottingham.ac.uk (Thorsten Altenkirch) Date: Wed, 7 Mar 2018 14:52:58 +0000 Subject: [Agda] coinductively defined families In-Reply-To: References: Message-ID: One problem with it is that your proposed syntax would break all existing code with records in it. Yes, I just thought about that. One would need to write "destructor" instead of "field". if one wants to include the domain. Thorsten From: Jesper Cockx > Date: Wednesday, 7 March 2018 at 14:20 To: Thorsten Altenkirch > Cc: Agda mailing list > Subject: Re: [Agda] coinductively defined families Probably you know you can already write this: open import Agda.Builtin.Nat open import Agda.Builtin.Equality record Vec (A : Set) (n : Nat) : Set where inductive field hd : ? {m} ? n ? suc m ? A tl : ? {m} ? n ? suc m ? Vec A m open Vec [] : ? {A} ? Vec A 0 [] .hd () [] .tl () _?_ : ? {A n} ? A ? Vec A n ? Vec A (suc n) (x ? xs) .hd refl = x (x ? xs) .tl refl = xs but I agree that having syntax for indexed records would be a nice thing to have. One problem with it is that your proposed syntax would break all existing code with records in it. I was actually thinking recently of going in the opposite direction and making indexed datatypes behave more like records, so you could have projections and eta-laws when there's only a single possible constructor for the given indices (as would be the case for vectors). -- Jesper On Wed, Mar 7, 2018 at 2:58 PM, Thorsten Altenkirch > wrote: Using coinductive types as records I can write record Stream (A : Set) : Set where coinductive field hd : A tl : Stream A and then use copatterns to define cons (after open Stream) _?_ : {A : Set} ? A ? Stream A ? Stream A hd (x ? xs) = x tl (x ? xs) = xs Actually I wouldn't mind writing record Stream (A : Set) : Set where coinductive field hd : Stream A ? A tl : Stream A ? Stream A as in inductive definitions we also write the codomain even though we know what it has to be. However, this is more interesting for families because we should be able to write record Vec (A : Set) : ? ? Set where coinductive field hd : ?{n} ? Vec A (suc n) ? A tl : ?{n} ? Vec A (suc n) ? Vec A n and we can derive [] and cons by copatterns: [] : Vec A zero [] () _?_ : {A : Set} ? A ? Vec A n ? Vec A (suc n) hd (x ? xs) = x tl (x ? xs) = xs here [] is defined as a trivial copattern (no destructor applies). Actually in this case the inductive and the coinductive vectors are isomorphic. A more interesting use case would be to define coinductive vectors indexed by conatural numbers. And I have others. :-) Maybe this has been discussed already? I haven't been able to go to AIMs for a while. Thorsten This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please contact the sender and delete the email and attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. Email communications with the University of Nottingham may be monitored where permitted by law. _______________________________________________ Agda mailing list Agda at lists.chalmers.se https://lists.chalmers.se/mailman/listinfo/agda This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please contact the sender and delete the email and attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. Email communications with the University of Nottingham may be monitored where permitted by law. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sandro.stucki at gmail.com Thu Mar 8 09:02:20 2018 From: sandro.stucki at gmail.com (Sandro Stucki) Date: Thu, 8 Mar 2018 09:02:20 +0100 Subject: [Agda] Partiality/delay monad [was: proofs for (NON)TERMINATING] Message-ID: I have a follow-up question about the partiality/delay monad. A while ago, I wrote some code using the Partiality monad from the standard library (Category.Monad.Partiality). But that module uses old coinduction, which seems deprecated now: https://agda.readthedocs.io/en/v2.5.3/language/coinduction.html#old-coinduction If I want to future-proof my code, what is the recommended way to go? NAD says > The standard library contains an implementation in > Category.Monad.Partiality. I would not recommend that you use this > implementation. I have another implementation that uses sized types, and > which is therefore in my opinion easier to use (the delay-monad library, > available from http://www.cse.chalmers.se/~nad/software.html). However, > this implementation depends on a different library, which is set up in a > somewhat roundabout way in order to cater to a certain experiment. I > believe others have also implemented the delay monad using sized types. So that is definitely an alternative, but as NAD points out, it adds some extra dependencies, which I'd like to avoid. Are there any plans to "upgrade" Category.Monad.Partiality to use coinductive records and/or sized types? > Here's an example of how one can implement an interpreter for the > untyped ?-calculus using the delay monad: > > http://www.cse.chalmers.se/~nad/listings/partiality-monad/Lambda.Simplified.Delay-monad.Interpreter.html I get a 404 error following that link. /Sandro On Wed, Jan 24, 2018 at 9:43 AM, Nils Anders Danielsson wrote: > On 2018-01-23 19:54, Sergei Meshveliani wrote: >> >> Please, where it is described the delay monad ? > > > Venanzio Capretta > General Recursion via Coinductive Types > https://doi.org/10.2168/LMCS-1(2:1)2005 > > The standard library contains an implementation in > Category.Monad.Partiality. I would not recommend that you use this > implementation. I have another implementation that uses sized types, and > which is therefore in my opinion easier to use (the delay-monad library, > available from http://www.cse.chalmers.se/~nad/software.html). However, > this implementation depends on a different library, which is set up in a > somewhat roundabout way in order to cater to a certain experiment. I > believe others have also implemented the delay monad using sized types. > > Here's an example of how one can implement an interpreter for the > untyped ?-calculus using the delay monad: > > > http://www.cse.chalmers.se/~nad/listings/partiality-monad/Lambda.Simplified.Delay-monad.Interpreter.html > > -- > /NAD > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda From henning at basold.eu Thu Mar 8 12:09:19 2018 From: henning at basold.eu (Henning Basold) Date: Thu, 8 Mar 2018 12:09:19 +0100 Subject: [Agda] coinductively defined families In-Reply-To: <7f0d5181-347a-7b7d-30dd-77cc0cc35a65@ifi.lmu.de> References: <7f0d5181-347a-7b7d-30dd-77cc0cc35a65@ifi.lmu.de> Message-ID: <512dd968-32ec-89c5-ac16-a690523f26d8@basold.eu> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 07/03/18 15:31, Andreas Abel wrote: >> A more interesting use case would be to define coinductive >> vectors indexed by conatural numbers. And I have others. :-) > > A reason against indexed coinductive records was that indexing was > resolved by propositional equality and that was too weak for > interesting indices such as conatural numbers. > > However, with extensional equality such as in cubical, indexed > records become more interesting again. > > Maybe for now, Jesper's workaround is sufficient. Then you can > also work with bisimilarity of CoNats instead of propositional > equality and that works in vanilla Agda as well. I had at some point talked about this at the AIM. Indeed, it would be nice to have indexed coinductive types, but as Andreas mentions in an intensional type theory this does not work well. Instead, one needs a type theory, in which bisimilarity would be included in the propositional equality (observational type theory any one?). With this in mind, one would implement covectors, or partial streams as I call them, just like one would implement indexed inductive types by using equality. See the code below. open import Data.Unit open import Data.Sum record ?? : Set where coinductive field pred : ? ? ?? open ?? public data Lift {A B : Set} (R : A ? B ? Set) : ? ? A ? ? ? B ? Set where inl : Lift R (inj? tt) (inj? tt) inr : ? a b ? R a b ? Lift R (inj? a) (inj? b) record _~_ (m n : ??) : Set where coinductive field pred~ : Lift _~_ (pred m) (pred n) _?_ : ? ? ?? ? ? ? ?? ? Set _?_ = Lift _~_ record PStream (A : Set) (n : ??) : Set where coinductive field hd : ? m ? pred n ? inj? m ? A tl : ? m ? pred n ? inj? m ? PStream A m Cheers, Henning > > Cheers, Andreas > > On 07.03.2018 14:58, Thorsten Altenkirch wrote: >> Using coinductive types as records I can write >> >> record Stream (A : Set) : Set where coinductive field hd : A tl : >> Stream A >> >> and then use copatterns to define cons (after open Stream) >> >> _?_ : {A : Set} ? A ? Stream A ? Stream A hd (x ? xs) = x tl (x ? >> xs) = xs >> >> Actually I wouldn't mind writing >> >> record Stream (A : Set) : Set where coinductive field hd : Stream >> A ? A tl : Stream A ? Stream A >> >> as in inductive definitions we also write the codomain even >> though we know what it has to be. However, this is more >> interesting for families because we should be able to write >> >> record Vec (A : Set) : ? ? Set where coinductive field hd : ?{n} >> ? Vec A (suc n) ? A tl : ?{n} ? Vec A (suc n) ? Vec A n >> >> and we can derive [] and cons by copatterns: >> >> [] : Vec A zero [] () >> >> _?_ : {A : Set} ? A ? Vec A n ? Vec A (suc n) hd (x ? xs) = x tl >> (x ? xs) = xs >> >> here [] is defined as a trivial copattern (no destructor >> applies). Actually in this case the inductive and the coinductive >> vectors are isomorphic. A more interesting use case would be to >> define coinductive vectors indexed by conatural numbers. And I >> have others. :-) >> >> Maybe this has been discussed already? I haven't been able to go >> to AIMs for a while. Thorsten >> >> >> >> This message and any attachment are intended solely for the >> addressee and may contain confidential information. If you have >> received this message in error, please contact the sender and >> delete the email and attachment. >> >> Any views or opinions expressed by the author of this email do >> not necessarily reflect the views of the University of >> Nottingham. Email communications with the University of >> Nottingham may be monitored where permitted by law. >> >> >> >> >> >> _______________________________________________ Agda mailing >> list Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> > > -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEMnUmuprSDishxVMiatBsEc2xMm4FAlqhGdoACgkQatBsEc2x Mm6+iBAAlaDis0XXJFEPPFrrKECZC44XaWAVDj6xQtK4VkOed/e2m5BJdlhdhlCr /w7QzGUYSj1R6/hz3poWgaPEX/Z8y7Q6PDg9sdwJIkDvW126pXzRdX6jk2m2n8Iu y3eLWHMXhwridyaueNStcOip8EKjDmmEudSeWN6f2QOZeYW/G8q/ffkfl+81wTht nuhoyLuczA1aHko0DCp5hYPVPZaHDSaWJsZzio2Tyhe+uvXF+G5oPj8yrh0pjTit rsHZk7H2+E5ZR5WA3jW6CpC11CLYnzTpVNCDcfh0km4b//KKW9WeL0ZS1kTmZzaB +j3k5jAZHoLyX7f2+xOyXLPRPSMoZYJqWBk04WmvJTFAyFVOJPTrDeqWVv6Pq+q/ opU8La2F1N+6CEpugz4YXUc/CND6KaiZW7Am3lEoHwDYc3kRwvDKcTsYVG25Hy7+ u2nB91jc20AyXS+BShQK4QhVEWkXzFjgbLNJgiZJIrbnaJlRc/b5mQ4EchyT6VSH gqurqweFZk6d1jfX84b6aWc4Sc/QBCbExj3RjKETdsq7z3y8uX3OOjwa+nrXwVdj 8Z5gnetoXHP7y05HQg7ddZQU0wUfW/VUo6FlI4tp5rHmCg7sxXOJ8rGh2ZYCE3AE YSMB8819siBnUNPyKWWRIE0jZdcWN64/DNJE71Q8FprS76709cg= =O/lm -----END PGP SIGNATURE----- From nad at cse.gu.se Thu Mar 8 13:00:54 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Thu, 8 Mar 2018 13:00:54 +0100 Subject: [Agda] Partiality/delay monad [was: proofs for (NON)TERMINATING] In-Reply-To: References: Message-ID: <7353eb22-00d4-46a5-9c10-3d42c9f8c6f5@cse.gu.se> On 2018-03-08 09:02, Sandro Stucki wrote: >> Here's an example of how one can implement an interpreter for the >> untyped ?-calculus using the delay monad: >> >> http://www.cse.chalmers.se/~nad/listings/partiality-monad/Lambda.Simplified.Delay-monad.Interpreter.html > > I get a 404 error following that link. I had rearranged my code, but I decided to undo this rearrangement, so the link should work again now. -- /NAD From guillaume.allais at ens-lyon.org Thu Mar 8 14:20:22 2018 From: guillaume.allais at ens-lyon.org (Guillaume Allais) Date: Thu, 8 Mar 2018 14:20:22 +0100 Subject: [Agda] Partiality/delay monad [was: proofs for (NON)TERMINATING] In-Reply-To: References: Message-ID: <7b825b47-3815-35ed-5088-c9e9c0e59e7f@ens-lyon.org> Hi Sandro, This pushed me to finally start the "codata" project on agda-stdlib to make use of copattern-based sized codatatypes: https://github.com/agda/agda-stdlib/projects/1 I have pushed a first few modules to the codata branch to start the discussion one of which is Codata.Delay: https://github.com/agda/agda-stdlib/blob/codata/src/Codata/Delay.agda There is no guarantee whatsoever that this is the version that will eventually land in the stdlib but it should hopefully give you an idea of how these things work. Best, -- gallais On 08/03/18 09:02, Sandro Stucki wrote: > I have a follow-up question about the partiality/delay monad. > > A while ago, I wrote some code using the Partiality monad from the > standard library (Category.Monad.Partiality). But that module uses old > coinduction, which seems deprecated now: > > https://agda.readthedocs.io/en/v2.5.3/language/coinduction.html#old-coinduction > > If I want to future-proof my code, what is the recommended way to go? > > NAD says > >> The standard library contains an implementation in >> Category.Monad.Partiality. I would not recommend that you use this >> implementation. I have another implementation that uses sized types, and >> which is therefore in my opinion easier to use (the delay-monad library, >> available from http://www.cse.chalmers.se/~nad/software.html). However, >> this implementation depends on a different library, which is set up in a >> somewhat roundabout way in order to cater to a certain experiment. I >> believe others have also implemented the delay monad using sized types. > So that is definitely an alternative, but as NAD points out, it adds > some extra dependencies, which I'd like to avoid. Are there any plans > to "upgrade" Category.Monad.Partiality to use coinductive records > and/or sized types? > >> Here's an example of how one can implement an interpreter for the >> untyped ?-calculus using the delay monad: >> >> http://www.cse.chalmers.se/~nad/listings/partiality-monad/Lambda.Simplified.Delay-monad.Interpreter.html > I get a 404 error following that link. > > /Sandro > > > On Wed, Jan 24, 2018 at 9:43 AM, Nils Anders Danielsson wrote: >> On 2018-01-23 19:54, Sergei Meshveliani wrote: >>> Please, where it is described the delay monad ? >> >> Venanzio Capretta >> General Recursion via Coinductive Types >> https://doi.org/10.2168/LMCS-1(2:1)2005 >> >> The standard library contains an implementation in >> Category.Monad.Partiality. I would not recommend that you use this >> implementation. I have another implementation that uses sized types, and >> which is therefore in my opinion easier to use (the delay-monad library, >> available from http://www.cse.chalmers.se/~nad/software.html). However, >> this implementation depends on a different library, which is set up in a >> somewhat roundabout way in order to cater to a certain experiment. I >> believe others have also implemented the delay monad using sized types. >> >> Here's an example of how one can implement an interpreter for the >> untyped ?-calculus using the delay monad: >> >> >> http://www.cse.chalmers.se/~nad/listings/partiality-monad/Lambda.Simplified.Delay-monad.Interpreter.html >> >> -- >> /NAD >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From Thorsten.Altenkirch at nottingham.ac.uk Thu Mar 8 14:27:13 2018 From: Thorsten.Altenkirch at nottingham.ac.uk (Thorsten Altenkirch) Date: Thu, 8 Mar 2018 13:27:13 +0000 Subject: [Agda] coinductively defined families In-Reply-To: <512dd968-32ec-89c5-ac16-a690523f26d8@basold.eu> References: <7f0d5181-347a-7b7d-30dd-77cc0cc35a65@ifi.lmu.de> <512dd968-32ec-89c5-ac16-a690523f26d8@basold.eu> Message-ID: <5E739595-CE44-45FD-BD47-3BD3B48E1CD1@exmail.nottingham.ac.uk> I would assume this as the default by now. Intensional equality for infinite objects is just wrong. Ok, the implementation is a bit behind but we don?t take every bug as a principle, do we? Thorsten On 08/03/2018, 11:09, "Agda on behalf of Henning Basold" wrote: Instead, one needs a type theory, in which bisimilarity would be included in the propositional equality (observational type theory any one?). This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please contact the sender and delete the email and attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. Email communications with the University of Nottingham may be monitored where permitted by law. From icfp.publicity at googlemail.com Thu Mar 8 21:08:33 2018 From: icfp.publicity at googlemail.com (Lindsey Kuper) Date: Thu, 08 Mar 2018 12:08:33 -0800 Subject: [Agda] Final Call for Papers: PACMPL issue ICFP 2018 Message-ID: <5aa19841d8ac2_a4e93fdb36057bec203e3@landin.local.mail> PACMPL Volume 2, Issue ICFP 2018 Call for Papers accepted papers to be invited for presentation at The 23rd ACM SIGPLAN International Conference on Functional Programming St. Louis, Missouri, USA http://icfp18.sigplan.org/ ### Important dates Submissions due: 16 March 2018 (Friday) Anywhere on Earth https://icfp18.hotcrp.com Author response: 2 May (Wednesday) - 4 May (Friday) 14:00 UTC Notification: 18 May (Friday) Final copy due: 22 June (Friday) Conference: 24 September (Monday) - 26 September (Wednesday) ### About PACMPL Proceedings of the ACM on Programming Languages (PACMPL ) is a Gold Open Access journal publishing research on all aspects of programming languages, from design to implementation and from mathematical formalisms to empirical studies. Each issue of the journal is devoted to a particular subject area within programming languages and will be announced through publicized Calls for Papers, like this one. ### Scope [PACMPL](https://pacmpl.acm.org/) issue ICFP 2018 seeks original papers on the art and science of functional programming. Submissions are invited on all topics from principles to practice, from foundations to features, and from abstraction to application. The scope includes all languages that encourage functional programming, including both purely applicative and imperative languages, as well as languages with objects, concurrency, or parallelism. Topics of interest include (but are not limited to): * *Language Design*: concurrency, parallelism, and distribution; modules; components and composition; metaprogramming; type systems; interoperability; domain-specific languages; and relations to imperative, object-oriented, or logic programming. * *Implementation*: abstract machines; virtual machines; interpretation; compilation; compile-time and run-time optimization; garbage collection and memory management; multi-threading; exploiting parallel hardware; interfaces to foreign functions, services, components, or low-level machine resources. * *Software-Development Techniques*: algorithms and data structures; design patterns; specification; verification; validation; proof assistants; debugging; testing; tracing; profiling. * *Foundations*: formal semantics; lambda calculus; rewriting; type theory; monads; continuations; control; state; effects; program verification; dependent types. * *Analysis and Transformation*: control-flow; data-flow; abstract interpretation; partial evaluation; program calculation. * *Applications*: symbolic computing; formal-methods tools; artificial intelligence; systems programming; distributed-systems and web programming; hardware design; databases; XML processing; scientific and numerical computing; graphical user interfaces; multimedia and 3D graphics programming; scripting; system administration; security. * *Education*: teaching introductory programming; parallel programming; mathematical proof; algebra. Submissions will be evaluated according to their relevance, correctness, significance, originality, and clarity. Each submission should explain its contributions in both general and technical terms, clearly identifying what has been accomplished, explaining why it is significant, and comparing it with previous work. The technical content should be accessible to a broad audience. PACMPL issue ICFP 2018 also welcomes submissions in two separate categories — Functional Pearls and Experience Reports — that must be marked as such at the time of submission and that need not report original research results. Detailed guidelines on both categories are given at the end of this call. Please contact the principal editor if you have questions or are concerned about the appropriateness of a topic. ### Preparation of submissions **Deadline**: The deadline for submissions is Friday, March 16, 2018, Anywhere on Earth (). This deadline will be strictly enforced. **Formatting**: Submissions must be in PDF format, printable in black and white on US Letter sized paper, and interpretable by common PDF tools. All submissions must adhere to the "ACM Small" template that is available (in both LaTeX and Word formats) from . For authors using LaTeX, a lighter-weight package, including only the essential files, is available from . There is a limit of 27 pages for a full paper or 14 pages for an Experience Report; in either case, the bibliography will not be counted against these limits. These page limits have been chosen to allow essentially the same amount of content with the new single-column format as was possible with the two-column format used in past ICFP conferences. Submissions that exceed the page limits or, for other reasons, do not meet the requirements for formatting, will be summarily rejected. See also PACMPL's Information and Guidelines for Authors at . **Submission**: Submissions will be accepted at Improved versions of a paper may be submitted at any point before the submission deadline using the same web interface. **Author Response Period**: Authors will have a 72-hour period, starting at 14:00 UTC on Wednesday, May 2, 2018, to read reviews and respond to them. **Supplementary Materials**: Authors have the option to attach supplementary material to a submission, on the understanding that reviewers may choose not to look at it. The material should be uploaded at submission time, as a single pdf or a tarball, not via a URL. This supplementary material may or may not be anonymized; if not anonymized, it will only be revealed to reviewers after they have submitted their review of the paper and learned the identity of the author(s). **Authorship Policies**: All submissions are expected to comply with the ACM Policies for Authorship that are detailed at . **Republication Policies**: Each submission must adhere to SIGPLAN's republication policy, as explained on the web at . **Resubmitted Papers**: Authors who submit a revised version of a paper that has previously been rejected by another conference have the option to attach an annotated copy of the reviews of their previous submission(s), explaining how they have addressed these previous reviews in the present submission. If a reviewer identifies him/herself as a reviewer of this previous submission and wishes to see how his/her comments have been addressed, the principal editor will communicate to this reviewer the annotated copy of his/her previous review. Otherwise, no reviewer will read the annotated copies of the previous reviews. ### Review Process This section outlines the two-stage process with lightweight double-blind reviewing that will be used to select papers for PACMPL issue ICFP 2018. We anticipate that there will be a need to clarify and expand on this process, and we will maintain a list of frequently asked questions and answers on the conference website to address common concerns. **PACMPL issue ICFP 2018 will employ a two-stage review process.** The first stage in the review process will assess submitted papers using the criteria stated above and will allow for feedback and input on initial reviews through the author response period mentioned previously. At the review meeting, a set of papers will be conditionally accepted and all other papers will be rejected. Authors will be notified of these decisions on May 18, 2018. Authors of conditionally accepted papers will be provided with committee reviews (just as in previous conferences) along with a set of mandatory revisions. After five weeks (June 22, 2018), the authors will provide a second submission. The second and final reviewing phase assesses whether the mandatory revisions have been adequately addressed by the authors and thereby determines the final accept/reject status of the paper. The intent and expectation is that the mandatory revisions can be addressed within five weeks and hence that conditionally accepted papers will in general be accepted in the second phase. The second submission should clearly identify how the mandatory revisions were addressed. To that end, the second submission must be accompanied by a cover letter mapping each mandatory revision request to specific parts of the paper. The cover letter will facilitate a quick second review, allowing for confirmation of final acceptance within two weeks. Conversely, the absence of a cover letter will be grounds for the paper?s rejection. **PACMPL issue ICFP 2018 will employ a lightweight double-blind reviewing process.** To facilitate this, submitted papers must adhere to two rules: 1. **author names and institutions must be omitted**, and 2. **references to authors' own related work should be in the third person** (e.g., not "We build on our previous work ..." but rather "We build on the work of ..."). The purpose of this process is to help the reviewers come to an initial judgement about the paper without bias, not to make it impossible for them to discover the authors if they were to try. Nothing should be done in the name of anonymity that weakens the submission or makes the job of reviewing the paper more difficult (e.g., important background references should not be omitted or anonymized). In addition, authors should feel free to disseminate their ideas or draft versions of their paper as they normally would. For instance, authors may post drafts of their papers on the web or give talks on their research ideas. ### Information for Authors of Accepted Papers * As a condition of acceptance, final versions of all papers must adhere to the new ACM Small format. The page limits for final versions of papers will be increased to ensure that authors have space to respond to reviewer comments and mandatory revisions. * Authors of accepted submissions will be required to agree to one of the three ACM licensing options: open access on payment of a fee (**recommended**, and SIGPLAN can cover the cost as described next); copyright transfer to ACM; or retaining copyright but granting ACM exclusive publication rights. Further information about ACM author rights is available from . * PACMPL is a Gold Open Access journal. It will be archived in ACM?s Digital Library, but no membership or fee is required for access. Gold Open Access has been made possible by generous funding through ACM SIGPLAN, which will cover all open access costs in the event authors cannot. Authors who can cover the costs may do so by paying an Article Processing Charge (APC). PACMPL, SIGPLAN, and ACM Headquarters are committed to exploring routes to making Gold Open Access publication both affordable and sustainable. * ACM offers authors a range of copyright options, one of which is Creative Commons CC-BY publication; this is the option recommended by the PACMPL editorial board. A reasoned argument in favour of this option can be found in the article [Why CC-BY?](https://oaspa.org/why-cc-by/) published by OASPA, the Open Access Scholarly Publishers Association. * We intend that the papers will be freely available for download from the ACM Digital Library in perpetuity via the OpenTOC mechanism. * ACM Author-Izer is a unique service that enables ACM authors to generate and post links on either their home page or institutional repository for visitors to download the definitive version of their articles from the ACM Digital Library at no charge. Downloads through Author-Izer links are captured in official ACM statistics, improving the accuracy of usage and impact measurements. Consistently linking to the definitive version of an ACM article should reduce user confusion over article versioning. After an article has been published and assigned to the appropriate ACM Author Profile pages, authors should visit to learn how to create links for free downloads from the ACM DL. * At least one author of each accepted submissions will be expected to attend and present their paper at the conference. The schedule for presentations will be determined and shared with authors after the full program has been selected. Presentations will be videotaped and released online if the presenter consents. * The official publication date is the date the papers are made available in the ACM Digital Library. This date may be up to *two weeks prior* to the first day of the conference. The official publication date affects the deadline for any patent filings related to published work. ### Artifact Evaluation Authors of papers that are conditionally accepted in the first phase of the review process will be encouraged (but not required) to submit supporting materials for Artifact Evaluation. These items will then be reviewed by an Artifact Evaluation Committee, separate from the paper Review Committee, whose task is to assess how the artifacts support the work described in the associated paper. Papers that go through the Artifact Evaluation process successfully will receive a seal of approval printed on the papers themselves. Authors of accepted papers will be encouraged to make the supporting materials publicly available upon publication of the papers, for example, by including them as "source materials" in the ACM Digital Library. An additional seal will mark papers whose artifacts are made available, as outlined in the ACM guidelines for artifact badging. Participation in Artifact Evaluation is voluntary and will not influence the final decision regarding paper acceptance. Further information about the motivations and expectations for Artifact Evaluation can be found at . ### Special categories of papers In addition to research papers, PACMPL issue ICFP solicits two kinds of papers that do not require original research contributions: Functional Pearls, which are full papers, and Experience Reports, which are limited to half the length of a full paper. Authors submitting such papers should consider the following guidelines. #### Functional Pearls A Functional Pearl is an elegant essay about something related to functional programming. Examples include, but are not limited to: * a new and thought-provoking way of looking at an old idea * an instructive example of program calculation or proof * a nifty presentation of an old or new data structure * an interesting application of functional programming techniques * a novel use or exposition of functional programming in the classroom While pearls often demonstrate an idea through the development of a short program, there is no requirement or expectation that they do so. Thus, they encompass the notions of theoretical and educational pearls. Functional Pearls are valued as highly and judged as rigorously as ordinary papers, but using somewhat different criteria. In particular, a pearl is not required to report original research, but, it should be concise, instructive, and entertaining. A pearl is likely to be rejected if its readers get bored, if the material gets too complicated, if too much specialized knowledge is needed, or if the writing is inelegant. The key to writing a good pearl is polishing. A submission that is intended to be treated as a pearl must be marked as such on the submission web page, and should contain the words "Functional Pearl" somewhere in its title or subtitle. These steps will alert reviewers to use the appropriate evaluation criteria. Pearls will be combined with ordinary papers, however, for the purpose of computing the conference's acceptance rate. #### Experience Reports The purpose of an Experience Report is to help create a body of published, refereed, citable evidence that functional programming really works — or to describe what obstacles prevent it from working. Possible topics for an Experience Report include, but are not limited to: * insights gained from real-world projects using functional programming * comparison of functional programming with conventional programming in the context of an industrial project or a university curriculum * project-management, business, or legal issues encountered when using functional programming in a real-world project * curricular issues encountered when using functional programming in education * real-world constraints that created special challenges for an implementation of a functional language or for functional programming in general An Experience Report is distinguished from a normal PACMPL issue ICFP paper by its title, by its length, and by the criteria used to evaluate it. * Both in the papers and in any citations, the title of each accepted Experience Report must begin with the words "Experience Report" followed by a colon. The acceptance rate for Experience Reports will be computed and reported separately from the rate for ordinary papers. * Experience Report submissions can be at most 12 pages long, excluding bibliography. * Each accepted Experience Report will be presented at the conference, but depending on the number of Experience Reports and regular papers accepted, authors of Experience reports may be asked to give shorter talks. * Because the purpose of Experience Reports is to enable our community to accumulate a body of evidence about the efficacy of functional programming, an acceptable Experience Report need not add to the body of knowledge of the functional-programming community by presenting novel results or conclusions. It is sufficient if the Report states a clear thesis and provides supporting evidence. The thesis must be relevant to ICFP, but it need not be novel. The review committee will accept or reject Experience Reports based on whether they judge the evidence to be convincing. Anecdotal evidence will be acceptable provided it is well argued and the author explains what efforts were made to gather as much evidence as possible. Typically, more convincing evidence is obtained from papers which show how functional programming was used than from papers which only say that functional programming was used. The most convincing evidence often includes comparisons of situations before and after the introduction or discontinuation of functional programming. Evidence drawn from a single person's experience may be sufficient, but more weight will be given to evidence drawn from the experience of groups of people. An Experience Report should be short and to the point: it should make a claim about how well functional programming worked on a particular project and why, and produce evidence to substantiate this claim. If functional programming worked in this case in the same ways it has worked for others, the paper need only summarize the results — the main part of the paper should discuss how well it worked and in what context. Most readers will not want to know all the details of the project and its implementation, but the paper should characterize the project and its context well enough so that readers can judge to what degree this experience is relevant to their own projects. The paper should take care to highlight any unusual aspects of the project. Specifics about the project are more valuable than generalities about functional programming; for example, it is more valuable to say that the team delivered its software a month ahead of schedule than it is to say that functional programming made the team more productive. If the paper not only describes experience but also presents new technical results, or if the experience refutes cherished beliefs of the functional-programming community, it may be better off submitted it as a full paper, which will be judged by the usual criteria of novelty, originality, and relevance. The principal editor will be happy to advise on any concerns about which category to submit to. ### ICFP Organizers General Chair: Robby Findler (Northwestern University, USA) Artifact Evaluation Co-Chairs: Simon Marlow (Facebook, UK) Ryan R. Newton (Indiana University, USA) Industrial Relations Chair: Alan Jeffrey (Mozilla Research, USA) Programming Contest Organiser: Matthew Fluet (Rochester Institute of Technology, USA) Publicity and Web Chair: Lindsey Kuper (Intel Labs, USA) Student Research Competition Chair: Ilya Sergey (University College London, UK) Video Co-Chairs: Jose Calderon (Galois, Inc., USA) Nicolas Wu (University of Bristol, UK) Workshops Co-Chair: David Christiansen (Indiana University, USA) Christophe Scholliers (Universiteit Gent, Belgium) ### PACMPL Volume 2, Issue ICFP 2018 Principal Editor: Matthew Flatt (Univesity of Utah, USA) Review Committee: Sandrine Blazy (IRISA, University of Rennes 1, France) David Christiansen (Indiana University, USA) Martin Elsman (University of Copenhagen, Denmark) Marco Gaboardi (University at Buffalo, CUNY, USA) Sam Lindley (University of Edinburgh, UK) Heather Miller (Northweastern University, USA / EPFL, Switzerland) J. Garrett Morris (University of Kansas, USA) Henrik Nilsson (University of Nottingham, UK) Fran?ois Pottier (Inria, France) Alejandro Russo (Chalmers University of Technology, Sweden) Ilya Sergey (University College London, UK) Michael Sperber (Active Group GmbH, Germany) Wouter Swierstra (Utrecht University, UK) ?ric Tanter (University of Chile, Chile) Katsuhiro Ueno (Tohoku University, Japan) Niki Vazou (University of Maryland, USA) Jeremy Yallop (University of Cambridge, UK) External Review Committee: Michael D. Adams (University of Utah, USA) Amal Ahmed (Northeastern University, USA) Nada Amin (University of Cambridge, USA) Zena Ariola (University of Oregon) Lars Bergstrom (Mozilla Research) Lars Birkedal (Aarhus University, Denmark) Edwin Brady ( University of St. Andrews, UK) William Byrd (University of Alabama at Birmingham, USA) Giuseppe Castagna (CRNS / University of Paris Diderot, France) Sheng Chen (University of Louisiana at Lafayette, USA) Koen Claessen (Chalmers University ot Technology, Sweden) Ugo Dal Lago (University of Bologna, Italy / Inria, France) David Darais (University of Vermont, USA) Joshua Dunfield (Queen?s University, Canada) Richard Eisenberg (Bryn Mawr College, USA) Matthew Fluet (Rochester Institute of Technology, USA) Nate Foster (Cornell University, USA) Jurriaan Hage (Utrecht University, Netherlands) David Van Horn (University of Maryland, USA) Zhenjiang Hu (National Institute of Informatics, Japan) Suresh Jagannathan (Purdue University, USA) Simon Peyton Jones (Microsoft Research, UK) Naoki Kobayashi (University of Tokyo, Japan) Neelakantan Krishnaswami (University of Cambridge, UK) Kazutaka Matsuda (Tohoku University, Japan) Trevor McDonell (University of New South Wales, Australia) Hernan Melgratti (University of Buenos Aires, Argentina) Akimasa Morihata (University of Tokyo, Japan) Aleksandar Nanevski (IMDEA Software Institute, Spain) Kim Nguy?n (University of Paris-Sud, France) Cosmin Oancea (DIKU, University of Copenhagen, Denmark) Bruno C. d. S. Oliveira (University of Hong Kong, China) Tomas Petricek (University of Cambridge, UK) Benjamin Pierce (University of Pennsylvania, USA) Christine Rizkallah (University of Pennsylvania, USA) Tom Schrijvers (KU Leuven, Belgium) Manuel Serrano (Inria, France) Jeremy Siek (Indiana University, USA) Josef Svenningsson (Chalmers University of Technology, Sweden) Nicolas Tabareau (Inria, France) Dimitrios Vytiniotis (Microsoft Research, UK) Philip Wadler (University of Edinburgh, UK) Meng Wang (University of Kent, UK) From mechvel at botik.ru Sat Mar 10 21:28:01 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Sat, 10 Mar 2018 23:28:01 +0300 Subject: [Agda] module _{a b} Message-ID: <1520713681.2832.3.camel@one.mechvel.pereslavl.ru> I do not know, this looks like a typo in Standard library Data.List.All.Properties : -- map module _{a b} ... (it works, though). -- SM From matthewdaggitt at gmail.com Sun Mar 11 00:10:59 2018 From: matthewdaggitt at gmail.com (Matthew Daggitt) Date: Sat, 10 Mar 2018 23:10:59 +0000 Subject: [Agda] module _{a b} In-Reply-To: <1520713681.2832.3.camel@one.mechvel.pereslavl.ru> References: <1520713681.2832.3.camel@one.mechvel.pereslavl.ru> Message-ID: Yes, you're right. There could be a space there. I'll add it in at some point. Nice spot. On Sat, Mar 10, 2018 at 8:28 PM, Sergei Meshveliani wrote: > I do not know, this looks like a typo in Standard library > Data.List.All.Properties : > > -- map > > module _{a b} ... > > (it works, though). > > -- > SM > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Graham.Hutton at nottingham.ac.uk Mon Mar 12 10:50:21 2018 From: Graham.Hutton at nottingham.ac.uk (Graham Hutton) Date: Mon, 12 Mar 2018 09:50:21 +0000 Subject: [Agda] Midlands Graduate School 2018 - final call for participation Message-ID: <7DA52F66-67FD-4E95-9DBE-A5858D014156@exmail.nottingham.ac.uk> Dear all, There are just a few days left now to register for this years Midlands Graduate School (MGS) in Nottingham: eight fantastic courses on dependently typed programming, categories, lambda calculus, semantics, and more. Registration closes on Friday 16th March. Please share! http://tinyurl.com/MGS18NOTT Best wishes, Graham Hutton and Henrik Nilsson ========================================================== Midlands Graduate School 2018 9-13 April 2018, Nottingham, UK http://tinyurl.com/MGS18NOTT BACKGROUND: The Midlands Graduate School (MGS) in the Foundations of Computing Science provides an intensive course of lectures on the mathematical foundations of computing. The MGS has been running since 1999, and is aimed at PhD students in their first or second year of study, but the school is open to everyone, and has increasingly seen participation from industry. We welcome participants from all over the world! COURSES: Eight courses will be given. Participants usually take all the introductory courses and choose additional options from the advanced courses depending on their interests. Invited course - Type-Driven Development with Idris, Edwin Brady Introductory courses - Lambda Calculus, Venanzio Capretta - Category Theory, Roy Crole - Domain Theory and Denotational Semantics, Achim Jung Advanced courses - Univalent Foundations, Benedikt Ahrens - Coalgebra, Alexander Kurz - Separation Logic, Georg Struth - Machine Learning, Michel Valstar REGISTRATION: Registration is ?550 for student, academic and independent participants, and ?850 for industry participants. The fee includes 5 nights single en-suite accommodation (Sun-Thu), lunch and coffee breaks, and the conference dinner. The registration deadline is ** Friday 16th March **. Spaces are limited, so please register early to secure your place. SPONSORSHIP: We offer a range of sponsorship opportunities for industry (bronze, silver, gold and platinum), each with specific benefits. Please see the website for further details. ========================================================== This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please contact the sender and delete the email and attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. Email communications with the University of Nottingham may be monitored where permitted by law. From matthewdaggitt at gmail.com Mon Mar 12 17:21:56 2018 From: matthewdaggitt at gmail.com (Matthew Daggitt) Date: Mon, 12 Mar 2018 16:21:56 +0000 Subject: [Agda] [ANNOUNCE] Standard library 0.15 Message-ID: ------------------------------ Dear all, The Agda Team is very pleased to announce the release of the standard library 0.15. The library has been tested using Agda 2.5.3. The library, CHANGELOG and README are available at http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Libraries.StandardLibrary Although we try our best to minimise non-compatible changes, no guarantees are made about backwards or forwards compatibility, as the library is still at an experimental stage. Enjoy the standard library 0.15. -- Matthew, on behalf of the Agda Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From publicityifl at gmail.com Tue Mar 13 08:48:54 2018 From: publicityifl at gmail.com (Jurriaan Hage) Date: Tue, 13 Mar 2018 00:48:54 -0700 Subject: [Agda] 1st CfP: IFL 2018 (30th Symposium on Implementation and Application of Functional Languages) Message-ID: Hello, Please, find below the first call for papers for IFL 2018. Please forward these to anyone you think may be interested. Apologies for any duplicates you may receive. best regards, Jurriaan Hage Publicity Chair of IFL --- ================================================================================ IFL 2018 30th Symposium on Implementation and Application of Functional Languages University of Massachusetts Lowell, MA, USA September 5th-7th, 2018 http://iflconference.org ================================================================================ ### Scope The goal of the IFL symposia is to bring together researchers actively engaged in the implementation and application of functional and function-based programming languages. IFL 2018 will be a venue for researchers to present and discuss new ideas and concepts, work in progress, and publication-ripe results related to the implementation and application of functional languages and function-based programming. Topics of interest to IFL include, but are not limited to: - language concepts - type systems, type checking, type inferencing - compilation techniques - staged compilation - run-time function specialization - run-time code generation - partial evaluation - (abstract) interpretation - metaprogramming - generic programming - automatic program generation - array processing - concurrent/parallel programming - concurrent/parallel program execution - embedded systems - web applications - (embedded) domain specific languages - security - novel memory management techniques - run-time profiling performance measurements - debugging and tracing - virtual/abstract machine architectures - validation, verification of functional programs - tools and programming techniques - (industrial) applications ### Submissions and peer-review Differently from previous editions of IFL, IFL 2018 solicits two kinds of submissions: * Regular papers (12 pages including references) * Draft papers for presentations ('weak' limit between 8 and 15 pages) Regular papers will undergo a rigorous review by the program committee, and will be evaluated according to their correctness, novelty, originality, relevance, significance, and clarity. A set of regular papers will be conditionally accepted for publication. Authors of conditionally accepted papers will be provided with committee reviews along with a set of mandatory revisions. Regular papers not accepted for publication will be considered as draft papers, at the request of the author. Draft papers will be screened to make sure that they are within the scope of IFL, and will be accepted for presentation or rejected accordingly. Prior to the symposium: Authors of conditionally accepted papers and accepted presentations will submit a pre-proceedings version of their work that will appear in the draft proceedings distributed at the symposium. The draft proceedings does not constitute a formal publication. We require that at least one of the authors present the work at IFL 2018. After the symposium: Authors of conditionally accepted papers will submit a revised versions of their paper for the formal post-proceedings. The program committee will assess whether the mandatory revisions have been adequately addressed by the authors and thereby determines the final accept/reject status of the paper. Our interest is to ultimately accept all conditionally accepted papers. If you are an author of a conditionally accepted paper, please make sure that you address all the concerns of the reviewers. Authors of accepted presentations will be given the opportunity to incorporate the feedback from discussions at the symposium and will be invited to submit a revised full article for the formal post-proceedings. The program committee will evaluate these submissions according to their correctness, novelty, originality, relevance, significance, and clarity, and will thereby determine whether the paper is accepted or rejected. ### Publication The formal proceedings will appear in the International Conference Proceedings Series of the ACM Digital Library. At no time may work submitted to IFL be simultaneously submitted to other venues; submissions must adhere to ACM SIGPLAN's republication policy: http://www.sigplan.org/Resources/Policies/Republication ### Important dates Submission of regular papers: May 25, 2018 Submission of draft papers: July 17, 2018 Regular and draft papers notification: July 20, 2018 Deadline for early registration: August 8, 2018 Submission of pre-proceedings version: August 29, 2018 IFL Symposium: September 5-7, 2018 Submission of papers for post-proceedings: November 7, 2018 Notification of acceptance: December 22, 2018 Camera-ready version: February 10, 2019 ### Submission details All contributions must be written in English. Papers must use the ACM two columns conference format, which can be found at: http://www.acm.org/publications/proceedings-template Authors submit through EasyChair: https://easychair.org/conferences/?conf=ifl2018 ### Peter Landin Prize The Peter Landin Prize is awarded to the best paper presented at the symposium every year. The honored article is selected by the program committee based on the submissions received for the formal review process. The prize carries a cash award equivalent to 150 Euros. ### Organization and Program committee Chairs: Jay McCarthy & Matteo Cimini, University of Massachusetts Lowell, USA Program Committee: * Arthur Chargu??raud, Inria, FR * Ben Delaware, Purdue University, USA * Christos Dimoulas, Northwestern University, USA * David Darais, University of Vermont, USA * Dominic Orchard, University of Kent, UK * Ekaterina Komendantskaya, Heriot-Watt University, UK * Garrett Morris, University of Kansas, USA * Heather Miller, EPFL & Northeastern University, CH & USA * Jeremy Yallop, University of Cambridge, UK * Keiko Nakata, SAP Innovation Center Potsdam, DE * Laura Castro, University of A Coru??a, ESP * Magnus Myreen, Chalmers University of Technology, SWE * Natalia Chechina, Bournemouth University, UK * Peter Achten, Radboud Universiteit Nijmegen, NL * Peter-Michael Osera, Grinnell College, USA * Richard Eisenberg, Bryn Mawr College, USA * Trevor McDonell, University of New South Wales, AUS * Yukiyoshi Kameyama, University of Tsukuba, JAP ### Venue The 30th IFL will take place at the UMass Lowell Inn & Conference Center in Lowell (MA), in association with the University of Massachusetts Lowell. The City of Lowell is located at the heart of the Merrimack Valley just 30 miles northwest of Boston. Lowell can be easily reached by train or taxi. See the website for more information on the venue. ### Acknowledgments This call-for-papers is an adaptation and evolution of content from previous instances of IFL. We are grateful to prior organizers for their work, which is reused here. A part of IFL 2018 format and CFP language that describes conditionally accepted papers has been adapted from call-for-papers of OOPSLA conferences. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mechvel at botik.ru Tue Mar 13 21:12:17 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Tue, 13 Mar 2018 23:12:17 +0300 Subject: [Agda] +-*- swap in library Message-ID: <1520971937.2502.7.camel@one.mechvel.pereslavl.ru> Dear Standard library developers, I see in lib-0.15 Data.Nat.Properties.*-+-commutativeSemiring and Data.Integer.Properties.+-*-commutativeRing I do not know, may be it has sense to have the same order of +-* in such names (there are several occurrences). Regards, ------ Sergei From grewe at st.informatik.tu-darmstadt.de Wed Mar 14 18:32:46 2018 From: grewe at st.informatik.tu-darmstadt.de (Sylvia Grewe) Date: Wed, 14 Mar 2018 18:32:46 +0100 Subject: [Agda] Call for Participation: 2018 in Nice Message-ID: <078196e3-2126-a3e4-82fa-d4871f611400@st.informatik.tu-darmstadt.de> ----------------------------------------------------------------------- ? 2018 : The Art, Science, and Engineering of Programming ?? April 9-12, 2018, Nice, France https://2018.programming-conference.org/ ----------------------------------------------------------------------- We are excited to welcome you to 2018, the second edition of a young conference on everything to do with programming. It takes place at the Boscolo B4 Plaza in Nice, France on April 9-12. The conference is closely associated with the open-access journal "The Art, Science, and Engineering of Programming". The journal's first two issues are freely accessible at http://programming-journal.org/ and form part of the conference's research track.? Along with the research track, 2018 features a program with two main keynotes, several workshops, a coding dojo, and a student research competition. *********************************************************************** ?Program highlights *********************************************************************** Main conference: ?- Keynote: "The Recurring Rainfall Problem" by Shriram Krishnamurthi ?- Keynote: "Static Analysis of Android Applications for Finding Bugs and Security Vulnerabilities" by Sukyoung Ryu Co-located events: - Bx 2018: Seventh International Workshop on Bidirectional Transformations, with 12 talks - MoreVMs 2018: Workshop on Modern Language Runtimes, Ecosystems, and VMs, with 9 talks - PASS 2018: Programming Across the System Stack, with 3 paper talks and two invited talks by Christa Lopes and Ludovic Henrio - PX/18: 4th Edition of the Programming Experience Workshop - ProWeb 2018: Programming Technology for the Future Web, with 4 paper talks and one invited talk by Manuel Serrano - Salon des Refus?s 2018 workshop - CoCoDo 2018, Compiler Coding Dojo Social events: ?- Banquet at Restaurant of the Plage Beau Rivage (April 11) *********************************************************************** ?Registration, attendance and accommodation *********************************************************************** ?- You can register for 2018 at: https://2018.programming-conference.org/attending/registration ?- Early registration ends soon! Please register before March 16th to obtain the early-bird discount. ?- More information on attending the conference is available at: https://2018.programming-conference.org/attending/reaching-the-conference ?- More information on accommodation is available at: https://2018.programming-conference.org/attending/accommodation *********************************************************************** ?About Nice *********************************************************************** Nice, Capital of the French Riviera, is a charming city between sea and mountains, which has a strong cultural heritage. You will discover the French gastronomy and specialities from Nice, the numerous museums (Mus?e Matisse, Mus?e des Arts Asiatiques, Mus?e des Beaux Arts, Mus?e d?Art Moderne et d?Art Contemporain (MAMAC), Mus?e Chagall?) and of course various places like ?la promenade des Anglais? or ?le Vieux Nice?. In ?La Promenade des Anglais?, you may practice sports like running, roller skating or cycling, enjoy the beauty of the Meditterean Sea and spend some time on the beach. You can also walk downtown to do some shopping or just discover the city by using the Tramway which allows you to go about everywhere in Nice. There are many places to go out to enjoy your evenings in the Vieux Nice, around the harbor or downtown. ----------------------------------------------------------------------- For more information, please visit https://2018.programming-conference.org/ You can also find us on Twitter (twitter.com/programmingconf ) and Facebook (facebook.com/programmingconf ) Looking forward to seeing you in Nice, Manuel Serrano (General chair), Tamara Rezk (Organizing chair), Guido Salvaneschi (Program chair), Sylvia Grewe, Philipp Haller, Etienne Lozes, Stefan Marr, Minh Ngo, Tobias Pape, Yves Roudier, and Jennifer B. Sartor -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthewdaggitt at gmail.com Thu Mar 15 15:23:14 2018 From: matthewdaggitt at gmail.com (Matthew Daggitt) Date: Thu, 15 Mar 2018 14:23:14 +0000 Subject: [Agda] +-*- swap in library In-Reply-To: <1520971937.2502.7.camel@one.mechvel.pereslavl.ru> References: <1520971937.2502.7.camel@one.mechvel.pereslavl.ru> Message-ID: Yes, it would make much more sense to have a standardised +-* ordering. It'd be great if you could open an issue to remind me on Github. Thanks, Matthew On Tue, Mar 13, 2018 at 8:12 PM, Sergei Meshveliani wrote: > Dear Standard library developers, > > I see in lib-0.15 > > Data.Nat.Properties.*-+-commutativeSemiring > and Data.Integer.Properties.+-*-commutativeRing > > I do not know, may be it has sense to have the same order of +-* in such > names (there are several occurrences). > > Regards, > > ------ > Sergei > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palmgren at math.su.se Thu Mar 15 18:41:15 2018 From: palmgren at math.su.se (Erik Palmgren) Date: Thu, 15 Mar 2018 18:41:15 +0100 Subject: [Agda] Tenure track Assistant Professor in Computer Science directed towards Logic of Programs (Deadline: April 3) In-Reply-To: <0f1bc306-79f4-b96c-f976-af300ff87b01@inria.fr> References: <0f1bc306-79f4-b96c-f976-af300ff87b01@inria.fr> Message-ID: <08dda5e1-4ddf-0765-6dfe-6f19be3651a1@math.su.se> Here is a position that might be of interest to the readers of the Agda and Coq lists. The Department of Mathematics, at Stockholm University is offering a tenure track position as Assistant Professor in Computer Science directed towards Logic of Programs. Some features - The subject of the position includes program verification, implementation of proof systems, and applications of proof theory in programming, functional programming, and semantics of programming languages. - Possibilities to work with the wellknown logic/type theory group - The teaching load is at most 30 % for the first 4 years. - Proficiency in Swedish is not a requirement at the time of appointment, but the candidate should be prepared to carry out teaching and administrative duties that require proficiency in Swedish within two years of employment. ?Full announcement: https://www.researchgate.net/job/906901_Assistant_Professor_in_Computer_Science_directed_towards_Logic_of_Programs?source=jml&viewIds%5B0%5D=Ehy4AzSnzrQZHF80a9Lo1VhP Erik Palmgren Professor of Mathematical Logic https://www.math.su.se/english/research/research-groups/research-group-in-mathematical-logic-1.330078 From avigad at cmu.edu Thu Mar 15 18:30:01 2018 From: avigad at cmu.edu (Jeremy Avigad) Date: Thu, 15 Mar 2018 11:30:01 -0600 Subject: [Agda] Federated Logic Conference student travel support Message-ID: Friends, As program committee co-chairs of Interactive Theorem Proving 2018, we would like to share the information below. We have also added it to the ITP web pages: https://itp2018.inria.fr/venue/ The FLoC web pages are here: http://www.floc2018.org/ Best wishes, Jeremy Avigad and Assia Mahboubi ***** FLoC?18 Travel Support Application Deadline: 18 May 2018 Applicants will be informed of decision by 1 June 2018 FLoC has some funds to provide travel grants of up to $1000 (USD) for student attendees of FLoC?18. Funds can be requested to cover airfare and lodging (registration fees and meals will not be funded). We expect to award about 100 grants. The application deadline is May 18, 2018, and recipients will be notified by June 1. Funds will be provided after the conference, upon submission of receipts and a short report detailing the student?s experience at and benefit from FLoC?18 (these reports will be used to compile a final report to our sponsors). Awardees are expected to spend up to one day during the meeting helping with logistics. Applicants? advisors should send a brief statement certifying their educational status and describing their financial need, and merits. Special efforts will be made to bring to FLoC students from under-represented groups. Applications must be received by the deadline. Applicants are required to apply using the following web form: https://goo.gl/forms/5WyCcf6J5zVwoFwJ3 Advisor letters (plain text only) should be sent to floc18student at gmail.com by May 18, 2018. If you have questions, please contact floc18student at gmail.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From apostolis.xekoukoulotakis at gmail.com Fri Mar 16 13:35:34 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Fri, 16 Mar 2018 14:35:34 +0200 Subject: [Agda] Cannot unquote non-canonical type checking computation Message-ID: What is a canonical type checking computation? My code that fails : https://github.com/xekoukou/Protocol/blob/16866832963d7f495073485f0c3620c8cb7d9874/test1.agda#L17 https://github.com/xekoukou/Protocol/blob/16866832963d7f495073485f0c3620c8cb7d9874/TypeCheck.agda#L298 ".../Protocol/test1.agda:17,9-23 Cannot unquote non-canonical type checking computation findAllNamesRec .Agda.Builtin.List.List.[] (quote test) when checking that the expression unquote (typeCheck (quote test)) has type ?" -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell at gmail.com Fri Mar 16 13:51:16 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Fri, 16 Mar 2018 13:51:16 +0100 Subject: [Agda] Cannot unquote non-canonical type checking computation In-Reply-To: References: Message-ID: It means that evaluation got stuck without producing a primitive TC operation (i.e. a canonical value of type TC A). In your case `findAllNamesRec` didn't reduce. This is because you marked it {-# NON_TERMINATING #-}, which tells the type checker that it's not safe to unfold it. If you use {-# TERMINATING #-} instead, this tells the type checker that, although it might not look like it, it is in fact perfectly safe to unfold the function and it would never ever loop (honest!). / Ulf On Fri, Mar 16, 2018 at 1:35 PM, Apostolis Xekoukoulotakis < apostolis.xekoukoulotakis at gmail.com> wrote: > What is a canonical type checking computation? > > My code that fails : > https://github.com/xekoukou/Protocol/blob/16866832963d7f495073485f0c3620 > c8cb7d9874/test1.agda#L17 > https://github.com/xekoukou/Protocol/blob/16866832963d7f495073485f0c3620 > c8cb7d9874/TypeCheck.agda#L298 > > > ".../Protocol/test1.agda:17,9-23 > Cannot unquote non-canonical type checking computation > findAllNamesRec .Agda.Builtin.List.List.[] (quote test) > when checking that the expression unquote (typeCheck (quote test)) > has type ?" > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Andrzej.Murawski at cs.ox.ac.uk Sat Mar 17 01:01:27 2018 From: Andrzej.Murawski at cs.ox.ac.uk (Andrzej Murawski) Date: Fri, 16 Mar 2018 20:01:27 -0400 Subject: [Agda] FoPPS Logic and Learning School (Oxford, July 1-6) Message-ID: LOGIC & LEARNING SCHOOL July 1-6, 2018 (immediately before FLoC 2018) Oxford, UK **The early bird registration deadline is April 15.** School website: https://www.mimuw.edu.pl/~fopss18/ FLoC website: http://www.floc2018.org/ The Logic & Learning School is an opportunity to learn from, and interact with, the world's experts leading recent progress in understanding the relationships between logic and learning. These experts come from both academia and some of the leading industrial research labs (Amazon Research and DeepMind). In the last few decades, logic has emerged as a fundamental paradigm for understanding complex systems. It has turned out to be instrumental in formal methods such as program verification, reasoning about hardware, reasoning about real-time systems and, more recently, probabilistic systems. Machine learning has recently had spectacular successes in fields such as image recognition, game playing, and many areas that involve the extraction of information from large datasets. The use of statistical approaches yields practical solutions to problems that seemed out of reach just a few years ago. The understanding of why these approaches are so successful has lagged behind the empirical successes. Using logic as the foundation to understand machine learning to obtain the best of both worlds is a major challenge. The programme of the Logic & Learning School consists of eleven lectures of three hours each, starting with five introductory courses on computational and statistical learning theory, reinforcement learning, Bayesian inference, and automata learning and six advanced courses on exciting and recent developments relating logic and learning. The lectures target an audience of logicians and computer scientists broadly construed and do not assume any knowledge on machine learning. Accordingly, the School represents a perfect opportunity to learn for both students and working researchers. The School will take place in St Anne's College in the centre of Oxford, an ideal learning environment with accommodation and lunches provided on site. The lectures will be from Sunday 1 July in the morning to Friday 6 July in the afternoon, which is the week before the main activities of FLoC. The Summer School on Foundations of Programming and Software Systems (FoPSS) was jointly created by ETAPS, SIGLOG, SIGPLAN and EATCS. It is additionally sponsored by the Department of Computer Science at Oxford. Complete list of speakers Borja Balle (Amazon Research Cambridge) Spectral algorithms for automata learning Richard Evans (DeepMind) Inductive logic programming and deep learning Hado van Hasslet (DeepMind) Reinforcement learning Nina Gierasimczuk (Technical University of Danemark) Learning and epistemic modal logic Varun Kanade (University of Oxford) Statistical learning theory Guy Katz (Stanford University and Hebrew University of Jerusalem) Verification of machine learning programs Jan K?et?nsk? (Technical University of Munich) Learning for verification Stephen H. Muggleton (Imperial College London) Inductive logic programming Doina Precup (McGill University and DeepMind) Reinforcement learning Dan Roy (University of Toronto) Bayesian learning James Worrell (University of Oxford) Computational learning theory Registration The summer school is a residential course held at St Anne's College, Oxford. The registration fee includes bed & breakfast accommodation for 6 days (1-6th July 2018), buffet lunches and evening meals. There will be a banquet on 4th July at St Johns College. Arrivals are on 30th June 2018 and departures on 6th July. As the number of rooms available at St Anne's is very limited, early registration is strongly advised to avoid disappointment. Registration fees are: Early bird ?750 15 April, 2018 Late ?850 15 May, 2018 The summer school is perfectly aligned for students who want to attend the four-yearly Federated Logic Conference (FLOC) taking place in Oxford after the summer school. FLOC will feature a number of AI-related events, including a public lecture by Stuart Russell at the Sheldonian Theatre (http://www.floc2018.org/speaker/stuart-russell/ ), a Debate in the Oxford Union Chamber on Ethics for Robots (http://www.floc2018.org/speaker/debate/ ), and the Summit on Machine Learning Meets Formal Methods (http://www.floc2018.org/summit-on-machine-learning/ ). Students and postdocs may also be interested in the FLOC Volunteer Programme: http://www.floc2018.org/volunteer/ For registration and further information about the Logic & Learning School (opens early February) see: http://www.floc2018.org/fopss/ Information about FLOC 2018 can be found at: http://www.floc2018.org/ [image: beacon] -------------- next part -------------- An HTML attachment was scrubbed... URL: From apostolis.xekoukoulotakis at gmail.com Sat Mar 17 15:56:19 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Sat, 17 Mar 2018 16:56:19 +0200 Subject: [Agda] Cannot unquote non-canonical type checking computation In-Reply-To: References: Message-ID: Ok, I removed NON_TERMINATING with TERMINATING and it does not produce that error. I was honest. I now have another issue which is probably related to this issue : https://github.com/agda/agda/issues/2119 Is there a way to work with functions that have universe vars? I could remove the vars if it is not possible. I get this error (in another test function): " Set? is not a valid type when checking that the expression {? : .Agda.Primitive.Level} {A : Set ?} ? A has type _317 " agda debug : " term _315 r :DirEq .Agda.Primitive.lzero term _315 r :DirEq .Agda.Primitive.lzero solving _315 := ? r ? f ? ? g? ? ? e? ? ? .Agda.Primitive.lzero compareTerm Set =< Set : Set (.Agda.Primitive.lsuc .Agda.Primitive.lzero) Solving awake constraints. 0 remaining. } coerce term v = (r : RoleA) ? f : PF ar ? (? z ? Nat) tm r ? ? g = g? : PF br ? (? z ? Nat) tm r ? ? e = e? : PF cr (Nat ? Nat ? Nat) (? z ? Nat) tm r ? ? PF cr Nat (? z ? Nat) tm r from type t1 = Set to type t2 = _310 term _309 :DirEq .Agda.Primitive.lsuc .Agda.Primitive.lzero term _309 :DirEq .Agda.Primitive.lsuc .Agda.Primitive.lzero solving _309 := .Agda.Primitive.lsuc .Agda.Primitive.lzero compareTerm Set =< _310 : Set? term _310 :DirGeq Set term _310 :DirGeq Set solving _310 := Set Solving awake constraints. 0 remaining. } { checkExpr { checkExpr inferred def .Agda.Primitive.Level : Set --> .Agda.Primitive.Level term _318 :DirEq .Agda.Primitive.lzero term _318 :DirEq .Agda.Primitive.lzero solving _318 := .Agda.Primitive.lzero compareTerm Set =< Set : Set? Solving awake constraints. 0 remaining. } { checkExpr coerce term v = ? from type t1 = .Agda.Primitive.Level to type t2 = .Agda.Primitive.Level compareTerm .Agda.Primitive.Level =< .Agda.Primitive.Level : Set Solving awake constraints. 0 remaining. } { checkExpr term _319 :DirEq ? term _319 :DirEq ? solving _319 := ? {?} {A} ? ? compareTerm Set ? =< Set ? : Set (.Agda.Primitive.lsuc ?) Solving awake constraints. 0 remaining. } coerce term v = {? : .Agda.Primitive.Level} {A : Set ?} ? A from type t1 = Set? to type t2 = _317 term _316 :DirEq Set? term _316 :DirEq Set? solving _316 := Set? compareTerm Set? =< _317 : Set? term _317 :DirGeq Set? term _317 :DirGeq Set? term _317 :DirGeq Set? term _317 :DirGeq Set? } } } cacheCurrentTypeCheckLog " On Fri, Mar 16, 2018 at 2:51 PM, Ulf Norell wrote: > It means that evaluation got stuck without producing a primitive TC > operation (i.e. a canonical value of type TC A). In your case > `findAllNamesRec` didn't reduce. This is because you marked it {-# > NON_TERMINATING #-}, which tells the type checker that it's not safe to > unfold it. If you use {-# TERMINATING #-} instead, this tells the type > checker that, although it might not look like it, it is in fact perfectly > safe to unfold the function and it would never ever loop (honest!). > > / Ulf > > On Fri, Mar 16, 2018 at 1:35 PM, Apostolis Xekoukoulotakis < > apostolis.xekoukoulotakis at gmail.com> wrote: > >> What is a canonical type checking computation? >> >> My code that fails : >> https://github.com/xekoukou/Protocol/blob/16866832963d7f4950 >> 73485f0c3620c8cb7d9874/test1.agda#L17 >> https://github.com/xekoukou/Protocol/blob/16866832963d7f4950 >> 73485f0c3620c8cb7d9874/TypeCheck.agda#L298 >> >> >> ".../Protocol/test1.agda:17,9-23 >> Cannot unquote non-canonical type checking computation >> findAllNamesRec .Agda.Builtin.List.List.[] (quote test) >> when checking that the expression unquote (typeCheck (quote test)) >> has type ?" >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wadler at inf.ed.ac.uk Sat Mar 17 18:59:05 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Sat, 17 Mar 2018 14:59:05 -0300 Subject: [Agda] Bug in simplification? Message-ID: Why does the attached not work? Is there a workaround, or a repair on the horizon? Note particularly the "1" in the error message, which appears spurious. Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: DecidableBroken.agda Type: application/octet-stream Size: 1123 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From kovacsahun at hotmail.com Sat Mar 17 19:22:56 2018 From: kovacsahun at hotmail.com (=?UTF-8?B?QW5kcsOhcyBLb3bDoWNz?=) Date: Sat, 17 Mar 2018 19:22:56 +0100 Subject: [Agda] Bug in simplification? In-Reply-To: References: Message-ID: Hi, As far as I know, the issue is that 1. Agda elaborates pattern matching lambdas to new top-level definitions with machine-generated names 2. Agda does not look into bodies of pattern matching functions when checking definitional equality Hence, Agda doesn't know that two pattern matching lambdas which look the same in the source are equal. People tolerate this limitation because we rarely rely on the rather fragile intensional equality of functions. Instead we postulate function extensionality when required. If you'd like to have a bit more intensional function equality, you can use top-level lemmas instead of pattern lambdas, like this . If you'd like to have as much as possible intensional function equality, you need to write all of your functions in terms of eliminators, thereby making all of your function bodies visible to Agda, as induction method arguments to eliminators. 2018-03-17 18:59 GMT+01:00 Philip Wadler : > Why does the attached not work? Is there a workaround, or a repair on the > horizon? Note particularly the "1" in the error message, which appears > spurious. Cheers, -- P > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wadler at inf.ed.ac.uk Sat Mar 17 21:28:33 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Sat, 17 Mar 2018 17:28:33 -0300 Subject: [Agda] Bug in simplification? In-Reply-To: References: Message-ID: Thanks, that works! My final solution is attached. The '1' that appears in printing the function body in my original message appears to be a bug, and should be fixed. If it's not on a list of known bugs, what would I do to add it? Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 17 March 2018 at 15:22, Andr?s Kov?cs wrote: > Hi, > > As far as I know, the issue is that > > 1. Agda elaborates pattern matching lambdas to new top-level definitions > with machine-generated names > 2. Agda does not look into bodies of pattern matching functions when > checking definitional equality > > Hence, Agda doesn't know that two pattern matching lambdas which look the > same in the source are equal. > > People tolerate this limitation because we rarely rely on the rather > fragile intensional equality of functions. Instead we postulate function > extensionality when required. > > If you'd like to have a bit more intensional function equality, you can > use top-level lemmas instead of pattern lambdas, like this > . > > If you'd like to have as much as possible intensional function equality, > you need to write all of your functions in terms of eliminators, thereby > making all of your function bodies visible to Agda, as induction method > arguments to eliminators. > > 2018-03-17 18:59 GMT+01:00 Philip Wadler : > >> Why does the attached not work? Is there a workaround, or a repair on the >> horizon? Note particularly the "1" in the error message, which appears >> spurious. Cheers, -- P >> >> . \ Philip Wadler, Professor of Theoretical Computer Science, >> . /\ School of Informatics, University of Edinburgh >> . / \ and Senior Research Fellow, IOHK >> . http://homepages.inf.ed.ac.uk/wadler/ >> >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: DecidableFixed.agda Type: application/octet-stream Size: 806 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ulf.norell at gmail.com Sat Mar 17 22:02:18 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Sat, 17 Mar 2018 22:02:18 +0100 Subject: [Agda] Bug in simplification? In-Reply-To: References: Message-ID: You can report it by clicking the "New Issue" button here: https://github.com/agda/agda/issues / Ulf On Sat, Mar 17, 2018 at 9:28 PM, Philip Wadler wrote: > Thanks, that works! My final solution is attached. > > The '1' that appears in printing the function body in my original message > appears to be a bug, and should be fixed. If it's not on a list of known > bugs, what would I do to add it? > > Cheers, -- P > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > On 17 March 2018 at 15:22, Andr?s Kov?cs wrote: > >> Hi, >> >> As far as I know, the issue is that >> >> 1. Agda elaborates pattern matching lambdas to new top-level definitions >> with machine-generated names >> 2. Agda does not look into bodies of pattern matching functions when >> checking definitional equality >> >> Hence, Agda doesn't know that two pattern matching lambdas which look the >> same in the source are equal. >> >> People tolerate this limitation because we rarely rely on the rather >> fragile intensional equality of functions. Instead we postulate function >> extensionality when required. >> >> If you'd like to have a bit more intensional function equality, you can >> use top-level lemmas instead of pattern lambdas, like this >> . >> >> If you'd like to have as much as possible intensional function equality, >> you need to write all of your functions in terms of eliminators, thereby >> making all of your function bodies visible to Agda, as induction method >> arguments to eliminators. >> >> 2018-03-17 18:59 GMT+01:00 Philip Wadler : >> >>> Why does the attached not work? Is there a workaround, or a repair on >>> the horizon? Note particularly the "1" in the error message, which appears >>> spurious. Cheers, -- P >>> >>> . \ Philip Wadler, Professor of Theoretical Computer Science, >>> . /\ School of Informatics, University of Edinburgh >>> . / \ and Senior Research Fellow, IOHK >>> . http://homepages.inf.ed.ac.uk/wadler/ >>> >>> The University of Edinburgh is a charitable body, registered in >>> Scotland, with registration number SC005336. >>> >>> _______________________________________________ >>> Agda mailing list >>> Agda at lists.chalmers.se >>> https://lists.chalmers.se/mailman/listinfo/agda >>> >>> >> > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wadler at inf.ed.ac.uk Sun Mar 18 01:15:05 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Sat, 17 Mar 2018 21:15:05 -0300 Subject: [Agda] Confused about rewriting Message-ID: Attached find a program that gives two proofs that if n is even, then there exists an m such that n equals 2*m. Or rather, a proof and a non-proof. The equation I need to prove is suc (suc (m + (m + 0))) ? suc (m + suc (m + 0)) (*) If I use sym (+-suc m (m + 0)) : suc (m + (m + 0)) ? m + suc (m + 0) to rewrite then it works perfectly, rewriting the lhs of (*). But if I remove the sym then it fails to work, even though it should rewrite the rhs of (*). What am I doing wrong? Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: RewriteWTF.agda Type: application/octet-stream Size: 1253 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From a.g.setzer at swansea.ac.uk Sun Mar 18 01:21:55 2018 From: a.g.setzer at swansea.ac.uk (Setzer A.G.) Date: Sun, 18 Mar 2018 00:21:55 +0000 Subject: [Agda] Posts in security in Swansea (possibly connected to Agda) deadline Fri 22/3/18 Message-ID: <93C88F3B5A59424B85B9E392D781F7C6025BCDAC0E@ISS-MBX04.tawe.swan.ac.uk> Dear researchers, we have here in Swansea a strong theory group, and I in particular have been starting to explore the use of Agda in verifying security. So the following posts might be of interest to some of you: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Four permanent academic posts in Computer Science aligned to Cyber Security at Swansea University, UK (deadline 22 March 2018) Computer Science at Swansea University has embarked on a ?31M programme of work ? the Computational Foundry (http://www.swansea.ac.uk/science/computationalfoundry/) ? to make Swansea a beacon for Computer Science, attracting and retaining world class researchers, building up a talented future workforce who will innovate, and providing a purpose-built set of labs and innovation spaces on Swansea University's recently opened ?450M Bay Campus. This call for 4 permanent academic positions in the area of Cyber Security is part of this expansion programme. Computer Science at Swansea University has a growing group on Cyber Security, where scientists have made contributions, e.g., in the digital economy, on crypto currencies, on security and privacy of personal data, on cyberterrorism and cyber crime, on mobile security, to name but a few. In this, Swansea Computer Science takes a holistic and interdisciplinary approach, bringing together expertise in fields as diverse as formal modelling, data mining, visual analytics and information security management, and reaching out, e.g., to Swansea's Hillary Rodham Clinton School of Law. UK Computer Science is very strong in global terms and is a magnet for outstanding staff and students. The Computer Science Department at Swansea University is highly ranked for both teaching and research: The Guardian University Guide 2018 placed it 5th in the UK and 1st in Wales, and top in the UK for careers (employment after 6 months, with 97%); the Times Good University Guide 2018 placed it 13th in the UK and 1st in Wales; the National Student Survey 2017 ranked it as 5th in the UK with 94% overall satisfaction, and 1st in Wales; and in the Research Excellence Framework (REF) 2014 it was ranked 18th in the UK and 1st in Wales. Based on these successes, Swansea Computer Science has embarked on the Computational Foundry programme to make Swansea a beacon for Computer Science. The Department will be moving into the Computational Foundry building on Bay Campus in August 2018. This building comprises nearly 7,500 m2 of purpose built Computer Science facilities and includes extensive up to date research and teaching laboratories and spaces. The Department has longstanding major projects in engaging with business, education and civic society. Currently, our Technocamps Unit is a driving force for educational reform in computing in Wales. We provide industrial education. The Department has recently been selected as the home for one of the UK?s Digital Economy Centres. More information on these positions can be found following the links. 1 Associate Professor (Research) in Cyber Security - https://tinyurl.com/SU-APsecurity2018 1 Lecturer in Computer Science (Research) aligned to Cyber Security - https://tinyurl.com/SU-CSsecurity2018 1 Lecturer in Human-Computer Interaction (Research) aligned to Cyber Security - https://tinyurl.com/SU-HCIsecurity2018 1 Lecturer in Computer Science (Teaching) aligned to Cyber Security - https://tinyurl.com/SU-CSsecurityTeaching2018 -------------- next part -------------- An HTML attachment was scrubbed... URL: From icfp.publicity at googlemail.com Sun Mar 18 05:07:25 2018 From: icfp.publicity at googlemail.com (Lindsey Kuper) Date: Sat, 17 Mar 2018 21:07:25 -0700 Subject: [Agda] Call for Tutorial Proposals: ICFP 2018 Message-ID: <5aade5fd9a436_d12c3ffd2e057bf09376f@landin.local.mail> CALL FOR TUTORIAL PROPOSALS ICFP 2018 23rd ACM SIGPLAN International Conference on Functional Programming September 23-29, 2018 St. Louis, Missouri, United States http://conf.researchr.org/home/icfp-2018 The 23rd ACM SIGPLAN International Conference on Functional Programming will be held in St. Louis, Missouri, United States on September 23-29, 2018. ICFP provides a forum for researchers and developers to hear about the latest work on the design, implementations, principles, and uses of functional programming. Proposals are invited for tutorials to be presented during ICFP and its co-located workshops and other events. These tutorials are the successor to the CUFP tutorials from previous years, but we also welcome tutorials whose primary audience is researchers rather than practitioners. Tutorials may focus either on a concrete technology or on a theoretical or mathematical tool. Ideally, tutorials will have a concrete result, such as "Learn to do X with Y" rather than "Learn language Y". Tutorials may occur in parallel to both ICFP and its co-located workshops, from September 23 through September 29. Additionally, ICFP is co-located with Strange Loop this year, and this will be taken into account when scheduling tutorials. ---------------------------------------------------------------------- Submission details Deadline for submission: April 9, 2018 Notification of acceptance: April 16, 2018 Prospective organizers of tutorials are invited to submit a completed tutorial proposal form in plain text format to the ICFP 2018 workshop co-chairs (Christophe Scholliers and David Christiansen), via email to icfp-workshops-2018 at googlegroups.com by April 9, 2018. Please note that this is a firm deadline. Organizers will be notified if their event proposal is accepted by April 16, 2018. The proposal form is available at: http://www.icfpconference.org/icfp2018-files/icfp18-tutorials-form.txt ---------------------------------------------------------------------- Selection committee The proposals will be evaluated by a committee comprising the following members of the ICFP 2018 organizing committee. Workshop Co-Chair: Christophe Scholliers (University of Ghent) Workshop Co-Chair: David Christiansen (Galois, Inc.) General Chair: Robby Findler (Northwestern University) Program Chair: Matthew Flatt (University of Utah) ---------------------------------------------------------------------- Further information Any queries should be addressed to the workshop co-chairs (Christophe Scholliers and David Christiansen), via email to icfp-workshops-2018 at googlegroups.com From ulf.norell at gmail.com Sun Mar 18 08:16:48 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Sun, 18 Mar 2018 08:16:48 +0100 Subject: [Agda] Confused about rewriting In-Reply-To: References: Message-ID: The problem is that at the point you invoke the rewrite the goal isn't (*), but ?[ m? ] (suc (suc (m + (m + 0))) ? m? + (m? + 0)) (**) with a fresh variable m? in the right-hand side. / Ulf On Sun, Mar 18, 2018 at 1:15 AM, Philip Wadler wrote: > Attached find a program that gives two proofs that if n is even, then > there exists an m such that n equals 2*m. Or rather, a proof and a > non-proof. The equation I need to prove is > > suc (suc (m + (m + 0))) ? suc (m + suc (m + 0)) (*) > > If I use > > sym (+-suc m (m + 0)) : suc (m + (m + 0)) ? m + suc (m + 0) > > to rewrite then it works perfectly, rewriting the lhs of (*). But if I > remove the sym then it fails to work, even though it should rewrite the rhs > of (*). What am I doing wrong? > > Cheers, -- P > > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wadler at inf.ed.ac.uk Sun Mar 18 13:46:08 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Sun, 18 Mar 2018 09:46:08 -0300 Subject: [Agda] Confused about rewriting In-Reply-To: References: Message-ID: Thanks, Ulf. I see---the problem is that the rewrite happens before m1 is instantiated to (suc m). So, is the proof that worked the best one, or is there a neater way to do it? Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 18 March 2018 at 04:16, Ulf Norell wrote: > The problem is that at the point you invoke the rewrite the goal isn't > (*), but > > ?[ m? ] (suc (suc (m + (m + 0))) ? m? + (m? + 0)) (**) > > with a fresh variable m? in the right-hand side. > > / Ulf > > > On Sun, Mar 18, 2018 at 1:15 AM, Philip Wadler > wrote: > >> Attached find a program that gives two proofs that if n is even, then >> there exists an m such that n equals 2*m. Or rather, a proof and a >> non-proof. The equation I need to prove is >> >> suc (suc (m + (m + 0))) ? suc (m + suc (m + 0)) (*) >> >> If I use >> >> sym (+-suc m (m + 0)) : suc (m + (m + 0)) ? m + suc (m + 0) >> >> to rewrite then it works perfectly, rewriting the lhs of (*). But if I >> remove the sym then it fails to work, even though it should rewrite the rhs >> of (*). What am I doing wrong? >> >> Cheers, -- P >> >> >> . \ Philip Wadler, Professor of Theoretical Computer Science, >> . /\ School of Informatics, University of Edinburgh >> . / \ and Senior Research Fellow, IOHK >> . http://homepages.inf.ed.ac.uk/wadler/ >> >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From wadler at inf.ed.ac.uk Sun Mar 18 13:55:35 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Sun, 18 Mar 2018 09:55:35 -0300 Subject: [Agda] Bug in simplification? In-Reply-To: References: Message-ID: Thank you. Done! -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 17 March 2018 at 18:02, Ulf Norell wrote: > You can report it by clicking the "New Issue" button here: > https://github.com/agda/agda/issues > > / Ulf > > On Sat, Mar 17, 2018 at 9:28 PM, Philip Wadler > wrote: > >> Thanks, that works! My final solution is attached. >> >> The '1' that appears in printing the function body in my original message >> appears to be a bug, and should be fixed. If it's not on a list of known >> bugs, what would I do to add it? >> >> Cheers, -- P >> >> . \ Philip Wadler, Professor of Theoretical Computer Science, >> . /\ School of Informatics, University of Edinburgh >> . / \ and Senior Research Fellow, IOHK >> . http://homepages.inf.ed.ac.uk/wadler/ >> >> On 17 March 2018 at 15:22, Andr?s Kov?cs wrote: >> >>> Hi, >>> >>> As far as I know, the issue is that >>> >>> 1. Agda elaborates pattern matching lambdas to new top-level definitions >>> with machine-generated names >>> 2. Agda does not look into bodies of pattern matching functions when >>> checking definitional equality >>> >>> Hence, Agda doesn't know that two pattern matching lambdas which look >>> the same in the source are equal. >>> >>> People tolerate this limitation because we rarely rely on the rather >>> fragile intensional equality of functions. Instead we postulate function >>> extensionality when required. >>> >>> If you'd like to have a bit more intensional function equality, you can >>> use top-level lemmas instead of pattern lambdas, like this >>> . >>> >>> If you'd like to have as much as possible intensional function equality, >>> you need to write all of your functions in terms of eliminators, thereby >>> making all of your function bodies visible to Agda, as induction method >>> arguments to eliminators. >>> >>> 2018-03-17 18:59 GMT+01:00 Philip Wadler : >>> >>>> Why does the attached not work? Is there a workaround, or a repair on >>>> the horizon? Note particularly the "1" in the error message, which appears >>>> spurious. Cheers, -- P >>>> >>>> . \ Philip Wadler, Professor of Theoretical Computer Science, >>>> . /\ School of Informatics, University of Edinburgh >>>> . / \ and Senior Research Fellow, IOHK >>>> . http://homepages.inf.ed.ac.uk/wadler/ >>>> >>>> The University of Edinburgh is a charitable body, registered in >>>> Scotland, with registration number SC005336. >>>> >>>> _______________________________________________ >>>> Agda mailing list >>>> Agda at lists.chalmers.se >>>> https://lists.chalmers.se/mailman/listinfo/agda >>>> >>>> >>> >> >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From wadler at inf.ed.ac.uk Sun Mar 18 14:22:24 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Sun, 18 Mar 2018 10:22:24 -0300 Subject: [Agda] Syntax declarations Message-ID: It's great that Agda now has syntax declarations! I'm confused by the design. What is implemented is: infixr 40 bindsyntax bind e? (? x ? e?) = x ? e? , e? Whereas what I would have expected is: infixr 40 _?_,_ syntax x ? e? , e? = bind e? (? x ? e?) Can someone please enlighten me as to the rationale behind the current design? Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From adam at sandbergericsson.se Sun Mar 18 14:27:07 2018 From: adam at sandbergericsson.se (Adam Sandberg Eriksson) Date: Sun, 18 Mar 2018 13:27:07 +0000 Subject: [Agda] Syntax declarations In-Reply-To: References: Message-ID: Ulf gave a rationale last year on this list: https://lists.chalmers.se/pipermail/agda/2017/009810.html ?Adam > On 18 Mar 2018, at 13:22, Philip Wadler wrote: > > It's great that Agda now has syntax declarations! > > I'm confused by the design. What is implemented is: > infixr 40 > bind > > syntax bind e? (? x ? e?) = x ? e? , e? > Whereas what I would have expected is: > infixr 40 _?_,_ > syntax x ? e? , e? = bind e? (? x ? e?) > Can someone please enlighten me as to the rationale behind the current design? Cheers, -- P > > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda From wadler at inf.ed.ac.uk Sun Mar 18 20:50:14 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Sun, 18 Mar 2018 16:50:14 -0300 Subject: [Agda] Syntax declarations In-Reply-To: References: Message-ID: Adam, Thanks for the pointer. I admit to still being confused. Let me explain why. If syntax declarations were written as follows infixr 40 _?_,_ syntax x ? e? , e? = bind e? (? x ? e?) Then the parser could look for _?_,_ with precedence 40 (and right associative), exactly the same way it parses everything else. Further, it would be fine to provide alternate syntaxes for the same thing infixr 30 _:=_,_ syntax x := e? , e? = bind e? (? x ? e?) Instead we write infixr 40 bindsyntax bind e? (? x ? e?) = x ? e? , e? Now the parser has to look for _?_,_ but give it the precedence of bind, and it is harder to provide alternative syntaxes. The design seems backward to me, but I suspect there are good reasons why it is the way it is. It would help me to understand syntax declarations if I knew what they are, but the note cited doesn't explain. Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 18 March 2018 at 10:27, Adam Sandberg Eriksson wrote: > Ulf gave a rationale last year on this list: https://lists.chalmers.se/ > pipermail/agda/2017/009810.html > > ?Adam > > > On 18 Mar 2018, at 13:22, Philip Wadler wrote: > > > > It's great that Agda now has syntax declarations! > > > > I'm confused by the design. What is implemented is: > > infixr 40 > > bind > > > > syntax bind e? (? x ? e?) = x ? e? , e? > > Whereas what I would have expected is: > > infixr 40 _?_,_ > > syntax x ? e? , e? = bind e? (? x ? e?) > > Can someone please enlighten me as to the rationale behind the current > design? Cheers, -- P > > > > > > . \ Philip Wadler, Professor of Theoretical Computer Science, > > . /\ School of Informatics, University of Edinburgh > > . / \ and Senior Research Fellow, IOHK > > . http://homepages.inf.ed.ac.uk/wadler/ > > The University of Edinburgh is a charitable body, registered in > > Scotland, with registration number SC005336. > > _______________________________________________ > > Agda mailing list > > Agda at lists.chalmers.se > > https://lists.chalmers.se/mailman/listinfo/agda > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ulf.norell at gmail.com Mon Mar 19 06:55:12 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Mon, 19 Mar 2018 06:55:12 +0100 Subject: [Agda] Syntax declarations In-Reply-To: References: Message-ID: On Sun, Mar 18, 2018 at 8:50 PM, Philip Wadler wrote: > The design seems backward to me, but I suspect there are good reasons why > it is the way it is. It would help me to understand syntax declarations if > I knew what they are, but the note cited doesn't explain. > The main reason for it being this way around it that it means we don't need a separate kind of entity of syntaxes for the scope checker to manage, which simplified the implementation quite a lot. It also (sort of) matches the way mixfix operators work: the fact that you can write `x + y` for `_+_ x y` is a property of the name `_+_` and not a separate entity that may or may not be in scope. / Ulf -------------- next part -------------- An HTML attachment was scrubbed... URL: From abela at chalmers.se Mon Mar 19 10:54:16 2018 From: abela at chalmers.se (Andreas Abel) Date: Mon, 19 Mar 2018 10:54:16 +0100 Subject: [Agda] Syntax declarations In-Reply-To: References: Message-ID: Phil, rest assured that you are not the only one stumbling over this design choice. My explanation attempt: syntax bind e?(? x? e?) = x ? e? , e? can be read as print "bind e?(? x? e?)" as "x ? e? , e?". This reading emphasizes the uniqueness condition for syntax-attachments to a identifier ("bind"). And then, as a bonus, the parser can also handle "x ? e? , e?" and treat it as "bind e?(? x? e?)". Best, Andreas On 18.03.2018 14:22, Philip Wadler wrote: > It's great that Agda now has syntax declarations! > > I'm confused by the design. What is implemented is: > > infixr 40 bind > syntax bind e?(? x? e?) = x ? e? , e? > > Whereas what I would have expected is: > > infixr 40 _?_,_ > syntax x ? e? , e? = bind e?(? x? e?) > > Can someone please enlighten me as to the rationale behind the current > design? Cheers, -- P > > > . ? \ Philip Wadler, Professor of Theoretical Computer Science, > . ? /\ School of Informatics, University of Edinburgh > .? /? \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ -- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel at gu.se http://www.cse.chalmers.se/~abela/ From Graham.Hutton at nottingham.ac.uk Mon Mar 19 15:46:05 2018 From: Graham.Hutton at nottingham.ac.uk (Graham Hutton) Date: Mon, 19 Mar 2018 14:46:05 +0000 Subject: [Agda] Midlands Graduate School - extended registration deadline Message-ID: <1CFBA5B7-89B4-40BA-A437-DF9DB76946ED@exmail.nottingham.ac.uk> Dear all, The registration deadline for this years Midlands Graduate School (MGS) in Nottingham has been extended until Friday 23rd March. We only have a few spaces left now so make sure to register early to guarantee your place! Best wishes, Graham Hutton and Henrik Nilsson ========================================================== Midlands Graduate School 2018 9-13 April 2018, Nottingham, UK http://tinyurl.com/MGS18NOTT BACKGROUND: The Midlands Graduate School (MGS) in the Foundations of Computing Science provides an intensive course of lectures on the mathematical foundations of computing. The MGS has been running since 1999, and is aimed at PhD students in their first or second year of study, but the school is open to everyone, and has increasingly seen participation from industry. We welcome participants from all over the world! COURSES: Eight courses will be given. Participants usually take all the introductory courses and choose additional options from the advanced courses depending on their interests. Invited course - Type-Driven Development with Idris, Edwin Brady Introductory courses - Lambda Calculus, Venanzio Capretta - Category Theory, Roy Crole - Domain Theory and Denotational Semantics, Achim Jung Advanced courses - Univalent Foundations, Benedikt Ahrens - Coalgebra, Alexander Kurz - Separation Logic, Georg Struth - Machine Learning, Michel Valstar REGISTRATION: The registration deadline is ** Friday 23rd March **. Registration is ?550 for student, academic and independent participants, and ?850 for industry participants. The fee includes 5 nights single en-suite accommodation (Sun-Thu), lunch and coffee breaks, and the conference dinner. ========================================================== This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please contact the sender and delete the email and attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. Email communications with the University of Nottingham may be monitored where permitted by law. From nad at cse.gu.se Tue Mar 20 11:37:48 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Tue, 20 Mar 2018 11:37:48 +0100 Subject: [Agda] Partiality/delay monad In-Reply-To: <7b825b47-3815-35ed-5088-c9e9c0e59e7f@ens-lyon.org> References: <7b825b47-3815-35ed-5088-c9e9c0e59e7f@ens-lyon.org> Message-ID: <812e3d51-4be7-1f89-4259-fc826d30ec5c@cse.gu.se> On 2018-03-08 14:20, Guillaume Allais wrote: > I have pushed a first few modules to the codata branch to start the > discussion one of which is Codata.Delay: > https://github.com/agda/agda-stdlib/blob/codata/src/Codata/Delay.agda Feel free to port parts of my library (git clone http://www.cse.chalmers.se/~nad/repos/delay-monad/). Note that an important feature of/problem with the delay monad is that transitivity is not fully size-preserving for weak bisimilarity and expansion. I have proved that a number of variants of transitivity cannot be implemented: http://www.cse.chalmers.se/~nad/listings/delay-monad/Delay-monad.Bisimilarity.Negative.html However, some variants can be implemented: http://www.cse.chalmers.se/~nad/listings/delay-monad/Delay-monad.Bisimilarity.html The standard library's equational reasoning framework was not designed to handle "heterogeneous" forms of transitivity. I have experimented with a more general framework: http://www.cse.chalmers.se/~nad/listings/up-to/Equational-reasoning.html However, I am not entirely happy with it. Too much overloading can make code harder to read and harder for Agda to type-check. In the delay-monad library I defined a set of combinators that is used only for strong and weak bisimilarity and expansion. -- /NAD From nad at cse.gu.se Tue Mar 20 11:53:20 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Tue, 20 Mar 2018 11:53:20 +0100 Subject: [Agda] Confused about rewriting In-Reply-To: References: Message-ID: On 2018-03-18 13:46, Philip Wadler wrote: > So, is the proof that worked the best one, or is there a neater way to > do it? I suggest that you replace "2 * m" with "m * 2". Then the following proof works: ?-even : ? {n : ?} ? even n ? ?[ m ] (n ? m * 2) ?-odd : ? {n : ?} ? odd n ? ?[ m ] (n ? 1 + m * 2) ?-even even-zero = zero , refl ?-even (even-suc o) = map suc (cong suc) (?-odd o) ?-odd (odd-suc e) = map id (cong suc) (?-even e) (The map function here comes from Data.Product.) -- /NAD From wadler at inf.ed.ac.uk Tue Mar 20 15:02:29 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Tue, 20 Mar 2018 11:02:29 -0300 Subject: [Agda] Syntax declarations In-Reply-To: References: Message-ID: Thanks, Ulf and Andreas. Thinking of it in terms of printing an internal tree, rather than parsing to create an internal tree, explains a lot. It also (sort of) matches the way mixfix operators work: the fact that you > can write `x + y` for `_+_ x y` is a property of the name `_+_` and not a > separate entity that may or may not be in scope. I'm still confused by this. Wouldn't infixr 40 _?_,_ fit the pattern you describe better than infixr 40 bind ? Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 19 March 2018 at 06:54, Andreas Abel wrote: > Phil, rest assured that you are not the only one stumbling over this > design choice. > > My explanation attempt: > > syntax bind e?(? x? e?) = x ? e? , e? > > can be read as > > print "bind e?(? x? e?)" as "x ? e? , e?". > > This reading emphasizes the uniqueness condition for syntax-attachments to > a identifier ("bind"). > > And then, as a bonus, the parser can also handle "x ? e? , e?" and treat > it as "bind e?(? x? e?)". > > Best, > Andreas > > > On 18.03.2018 14:22, Philip Wadler wrote: > >> It's great that Agda now has syntax declarations! >> >> I'm confused by the design. What is implemented is: >> >> infixr 40 bind >> syntax bind e?(? x? e?) = x ? e? , e? >> >> Whereas what I would have expected is: >> >> infixr 40 _?_,_ >> syntax x ? e? , e? = bind e?(? x? e?) >> >> Can someone please enlighten me as to the rationale behind the current >> design? Cheers, -- P >> >> >> . \ Philip Wadler, Professor of Theoretical Computer Science, >> . /\ School of Informatics, University of Edinburgh >> . / \ and Senior Research Fellow, IOHK >> . http://homepages.inf.ed.ac.uk/wadler/ >> > > > -- > Andreas Abel <>< Du bist der geliebte Mensch. > > Department of Computer Science and Engineering > Chalmers and Gothenburg University, Sweden > > andreas.abel at gu.se > http://www.cse.chalmers.se/~abela/ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From guillaume.allais at ens-lyon.org Tue Mar 20 16:10:25 2018 From: guillaume.allais at ens-lyon.org (Guillaume Allais) Date: Tue, 20 Mar 2018 16:10:25 +0100 Subject: [Agda] Partiality/delay monad In-Reply-To: <812e3d51-4be7-1f89-4259-fc826d30ec5c@cse.gu.se> References: <7b825b47-3815-35ed-5088-c9e9c0e59e7f@ens-lyon.org> <812e3d51-4be7-1f89-4259-fc826d30ec5c@cse.gu.se> Message-ID: <1e6353bb-b592-5fed-fe4d-beeefc5d1dba@ens-lyon.org> Thanks! That's a lot of content! I haven't implemented anything regarding weak bisimilarity yet because it's notoriously hard. One thing I'm wondering as a complete newcomer is whether it'd make sense to have a stricter notion of proofs of weak bisimilarity and then recover some of the current constructor's types as lemmas. E.g. (reusing your notations, forgetting about the very general setting for the moment) would it make sense to have: ? data [_]_?_ (i : Size) : ?????????? Delay A ? ? Delay A ? ? Set a where ????? now??? : ? {k x} ? [ i ] now x ? now x ????? later? : ? {k x y} ? ?????????????? [ i ] force x ?? force y ? ?????????????? [ i ] later x ? later y ????? later-now : ? {k x y} ? ?????????????? [ i ] force x ? now y ? ?????????????? [ i ] later x ? now y ????? now-later : ? {x y} ? ?????????????? [ i ] now x ? force y ? ?????????????? [ i ] now x ? later y ? Have you experimented with such a definition in the past? Cheers, -- gallais On 20/03/18 11:37, Nils Anders Danielsson wrote: > On 2018-03-08 14:20, Guillaume Allais wrote: >> I have pushed a first few modules to the codata branch to start the >> discussion one of which is Codata.Delay: >> https://github.com/agda/agda-stdlib/blob/codata/src/Codata/Delay.agda > > Feel free to port parts of my library (git clone > http://www.cse.chalmers.se/~nad/repos/delay-monad/). > > Note that an important feature of/problem with the delay monad is that > transitivity is not fully size-preserving for weak bisimilarity and > expansion. I have proved that a number of variants of transitivity > cannot be implemented: > > ? > http://www.cse.chalmers.se/~nad/listings/delay-monad/Delay-monad.Bisimilarity.Negative.html > > However, some variants can be implemented: > > ? > http://www.cse.chalmers.se/~nad/listings/delay-monad/Delay-monad.Bisimilarity.html > > The standard library's equational reasoning framework was not designed > to handle "heterogeneous" forms of transitivity. I have experimented > with a more general framework: > > ? > http://www.cse.chalmers.se/~nad/listings/up-to/Equational-reasoning.html > > However, I am not entirely happy with it. Too much overloading can make > code harder to read and harder for Agda to type-check. In the > delay-monad library I defined a set of combinators that is used only for > strong and weak bisimilarity and expansion. > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From ulf.norell at gmail.com Tue Mar 20 16:34:00 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Tue, 20 Mar 2018 16:34:00 +0100 Subject: [Agda] Syntax declarations In-Reply-To: References: Message-ID: On Tue, Mar 20, 2018 at 3:02 PM, Philip Wadler wrote: > Thanks, Ulf and Andreas. Thinking of it in terms of printing an internal > tree, rather than parsing to create an internal tree, explains a lot. > > It also (sort of) matches the way mixfix operators work: the fact that you >> can write `x + y` for `_+_ x y` is a property of the name `_+_` and not a >> separate entity that may or may not be in scope. > > > I'm still confused by this. Wouldn't > > infixr 40 _?_,_ > > fit the pattern you describe better than > > infixr 40 bind > > ? > I simply meant that the infix notation of _+_ isn't something separate from the function _+_. Writing infixr 40 _?_,_ would require _?_,_ to be a thing that you could talk about, which (for better or for worse) is not how syntax declarations were designed. / Ulf > On 19 March 2018 at 06:54, Andreas Abel wrote: > >> Phil, rest assured that you are not the only one stumbling over this >> design choice. >> >> My explanation attempt: >> >> syntax bind e?(? x? e?) = x ? e? , e? >> >> can be read as >> >> print "bind e?(? x? e?)" as "x ? e? , e?". >> >> This reading emphasizes the uniqueness condition for syntax-attachments >> to a identifier ("bind"). >> >> And then, as a bonus, the parser can also handle "x ? e? , e?" and treat >> it as "bind e?(? x? e?)". >> >> Best, >> Andreas >> >> >> On 18.03.2018 14:22, Philip Wadler wrote: >> >>> It's great that Agda now has syntax declarations! >>> >>> I'm confused by the design. What is implemented is: >>> >>> infixr 40 bind >>> syntax bind e?(? x? e?) = x ? e? , e? >>> >>> Whereas what I would have expected is: >>> >>> infixr 40 _?_,_ >>> syntax x ? e? , e? = bind e?(? x? e?) >>> >>> Can someone please enlighten me as to the rationale behind the current >>> design? Cheers, -- P >>> >>> >>> . \ Philip Wadler, Professor of Theoretical Computer Science, >>> . /\ School of Informatics, University of Edinburgh >>> . / \ and Senior Research Fellow, IOHK >>> . http://homepages.inf.ed.ac.uk/wadler/ >>> >> >> >> -- >> Andreas Abel <>< Du bist der geliebte Mensch. >> >> Department of Computer Science and Engineering >> Chalmers and Gothenburg University, Sweden >> >> andreas.abel at gu.se >> http://www.cse.chalmers.se/~abela/ >> >> > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wadler at inf.ed.ac.uk Tue Mar 20 17:35:24 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Tue, 20 Mar 2018 13:35:24 -0300 Subject: [Agda] Confused about rewriting In-Reply-To: References: Message-ID: Thanks, Nils! I had spotted that I should avoid 2 * m + 1 and instead write 1 + 2 *m, but not that 1 + m * 2 eliminates the need for my lemma. Cheers! -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 20 March 2018 at 07:53, Nils Anders Danielsson wrote: > On 2018-03-18 13:46, Philip Wadler wrote: > >> So, is the proof that worked the best one, or is there a neater way to >> do it? >> > > I suggest that you replace "2 * m" with "m * 2". Then the following > proof works: > > ?-even : ? {n : ?} ? even n ? ?[ m ] (n ? m * 2) > ?-odd : ? {n : ?} ? odd n ? ?[ m ] (n ? 1 + m * 2) > > ?-even even-zero = zero , refl > ?-even (even-suc o) = map suc (cong suc) (?-odd o) > ?-odd (odd-suc e) = map id (cong suc) (?-even e) > > (The map function here comes from Data.Product.) > > -- > /NAD > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From wadler at inf.ed.ac.uk Tue Mar 20 17:47:14 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Tue, 20 Mar 2018 13:47:14 -0300 Subject: [Agda] Syntax declarations In-Reply-To: References: Message-ID: OK, thanks for the clarification. I assume, though, that somewhere there is a table that records _?_,_ as syntax to parse with precedence 40? Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 20 March 2018 at 12:34, Ulf Norell wrote: > > On Tue, Mar 20, 2018 at 3:02 PM, Philip Wadler > wrote: > >> Thanks, Ulf and Andreas. Thinking of it in terms of printing an internal >> tree, rather than parsing to create an internal tree, explains a lot. >> >> It also (sort of) matches the way mixfix operators work: the fact that >>> you can write `x + y` for `_+_ x y` is a property of the name `_+_` and not >>> a separate entity that may or may not be in scope. >> >> >> I'm still confused by this. Wouldn't >> >> infixr 40 _?_,_ >> >> fit the pattern you describe better than >> >> infixr 40 bind >> >> ? >> > > I simply meant that the infix notation of _+_ isn't something separate > from the function _+_. > > Writing > > infixr 40 _?_,_ > > would require _?_,_ to be a thing that you could talk about, which (for > better or for worse) is not how > syntax declarations were designed. > > / Ulf > > >> On 19 March 2018 at 06:54, Andreas Abel wrote: >> >>> Phil, rest assured that you are not the only one stumbling over this >>> design choice. >>> >>> My explanation attempt: >>> >>> syntax bind e?(? x? e?) = x ? e? , e? >>> >>> can be read as >>> >>> print "bind e?(? x? e?)" as "x ? e? , e?". >>> >>> This reading emphasizes the uniqueness condition for syntax-attachments >>> to a identifier ("bind"). >>> >>> And then, as a bonus, the parser can also handle "x ? e? , e?" and treat >>> it as "bind e?(? x? e?)". >>> >>> Best, >>> Andreas >>> >>> >>> On 18.03.2018 14:22, Philip Wadler wrote: >>> >>>> It's great that Agda now has syntax declarations! >>>> >>>> I'm confused by the design. What is implemented is: >>>> >>>> infixr 40 bind >>>> syntax bind e?(? x? e?) = x ? e? , e? >>>> >>>> Whereas what I would have expected is: >>>> >>>> infixr 40 _?_,_ >>>> syntax x ? e? , e? = bind e?(? x? e?) >>>> >>>> Can someone please enlighten me as to the rationale behind the current >>>> design? Cheers, -- P >>>> >>>> >>>> . \ Philip Wadler, Professor of Theoretical Computer Science, >>>> . /\ School of Informatics, University of Edinburgh >>>> . / \ and Senior Research Fellow, IOHK >>>> . http://homepages.inf.ed.ac.uk/wadler/ >>>> >>> >>> >>> -- >>> Andreas Abel <>< Du bist der geliebte Mensch. >>> >>> Department of Computer Science and Engineering >>> Chalmers and Gothenburg University, Sweden >>> >>> andreas.abel at gu.se >>> http://www.cse.chalmers.se/~abela/ >>> >>> >> >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From nad at cse.gu.se Tue Mar 20 18:39:15 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Tue, 20 Mar 2018 18:39:15 +0100 Subject: [Agda] Partiality/delay monad In-Reply-To: <1e6353bb-b592-5fed-fe4d-beeefc5d1dba@ens-lyon.org> References: <7b825b47-3815-35ed-5088-c9e9c0e59e7f@ens-lyon.org> <812e3d51-4be7-1f89-4259-fc826d30ec5c@cse.gu.se> <1e6353bb-b592-5fed-fe4d-beeefc5d1dba@ens-lyon.org> Message-ID: <5eff82c3-d112-3f07-c1c4-6048395bc5c5@cse.gu.se> On 2018-03-20 16:10, Guillaume Allais wrote: > E.g. (reusing your notations, forgetting about the very general setting > for the moment) would it make sense to have: > > data [_]_?_ (i : Size) : > Delay A ? ? Delay A ? ? Set a where > now : ? {k x} ? [ i ] now x ? now x > later : ? {k x y} ? > [ i ] force x ?? force y ? > [ i ] later x ? later y > later-now : ? {k x y} ? > [ i ] force x ? now y ? > [ i ] later x ? now y > now-later : ? {x y} ? > [ i ] now x ? force y ? > [ i ] now x ? later y > > ? Have you experimented with such a definition in the past? This definition reminds me of Venanzio Capretta's definition of weak bisimilarity. I have proved that his definition (defined using sized types) is pointwise logically equivalent to the one that I use, in a size-preserving way: http://www.cse.chalmers.se/~nad/listings/delay-monad/Delay-monad.Bisimilarity.Alternative.html I guess that this also holds for your definition. I have no strong argument for preferring one definition over the others. There is another definition (also discussed by Venanzio) that has the advantage of being propositional in the HoTT sense, assuming extensionality, when the carrier type is a set (this observation is possibly due to Thorsten Altenkirch): ? v ? x ? v ? y ? v Here "x???v" means that x terminates with the value v; _?_ is defined inductively. This relation is also pointwise logically equivalent to the others. However, it is not defined using sized types, so the translations are not size-preserving, and I suspect (without any hard evidence) that it would be tiresome to work directly with this type. -- /NAD From sattler.christian at gmail.com Tue Mar 20 23:12:27 2018 From: sattler.christian at gmail.com (Christian Sattler) Date: Tue, 20 Mar 2018 23:12:27 +0100 Subject: [Agda] nullary copattern matching Message-ID: What is the syntax for copattern matching on a record with zero fields? I could not find anything in the documentation. For pattern matching on a data type with zero constructors, we have syntax for denoting an impossible case, but what about the analogous situation for copatterns? Note that C-c C-c will happily produce invalid code ("missing definition"). Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From abela at chalmers.se Wed Mar 21 00:20:43 2018 From: abela at chalmers.se (Andreas Abel) Date: Wed, 21 Mar 2018 00:20:43 +0100 Subject: [Agda] nullary copattern matching In-Reply-To: References: Message-ID: > What is the syntax for copattern matching on a record with zero fields? There isn't any yet, although Jesper and I discussed adding it: record True : Set where triv : True triv .() The syntax would be a post-fix absurd projection pattern. Do you have an interesting application for it? With eta-equality, there is not so much use it seems, since the same can be obtained by triv = _ Cheers, Andreas On 20.03.2018 23:12, Christian Sattler wrote: > What is the syntax for copattern matching on a record with zero fields? > I could not find anything in the documentation. For pattern matching on > a data type with zero constructors, we have syntax for denoting an > impossible case, but what about the analogous situation for copatterns? > Note that C-c C-c will happily produce invalid code ("missing definition"). > > Christian > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel at gu.se http://www.cse.chalmers.se/~abela/ From ulf.norell at gmail.com Wed Mar 21 06:42:06 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Wed, 21 Mar 2018 06:42:06 +0100 Subject: [Agda] Syntax declarations In-Reply-To: References: Message-ID: On Tue, Mar 20, 2018 at 5:47 PM, Philip Wadler wrote: > OK, thanks for the clarification. I assume, though, that somewhere there > is a table that records _?_,_ as syntax to parse with precedence 40? > Cheers, -- P > Of course. There's a field for syntax associated with each name. If you're curious it's here: https://github.com/agda/agda/blob/b9461927b33d4b93005e723033be87ac0f01d5c8/src/full/Agda/Syntax/Abstract/Name.hs#L48 and the definition of Fixity' here: https://github.com/agda/agda/blob/b9461927b33d4b93005e723033be87ac0f01d5c8/src/full/Agda/Syntax/Fixity.hs#L39 / Ulf On 20 March 2018 at 12:34, Ulf Norell wrote: > >> >> On Tue, Mar 20, 2018 at 3:02 PM, Philip Wadler >> wrote: >> >>> Thanks, Ulf and Andreas. Thinking of it in terms of printing an internal >>> tree, rather than parsing to create an internal tree, explains a lot. >>> >>> It also (sort of) matches the way mixfix operators work: the fact that >>>> you can write `x + y` for `_+_ x y` is a property of the name `_+_` and not >>>> a separate entity that may or may not be in scope. >>> >>> >>> I'm still confused by this. Wouldn't >>> >>> infixr 40 _?_,_ >>> >>> fit the pattern you describe better than >>> >>> infixr 40 bind >>> >>> ? >>> >> >> I simply meant that the infix notation of _+_ isn't something separate >> from the function _+_. >> >> Writing >> >> infixr 40 _?_,_ >> >> would require _?_,_ to be a thing that you could talk about, which (for >> better or for worse) is not how >> syntax declarations were designed. >> >> / Ulf >> >> >>> On 19 March 2018 at 06:54, Andreas Abel wrote: >>> >>>> Phil, rest assured that you are not the only one stumbling over this >>>> design choice. >>>> >>>> My explanation attempt: >>>> >>>> syntax bind e?(? x? e?) = x ? e? , e? >>>> >>>> can be read as >>>> >>>> print "bind e?(? x? e?)" as "x ? e? , e?". >>>> >>>> This reading emphasizes the uniqueness condition for syntax-attachments >>>> to a identifier ("bind"). >>>> >>>> And then, as a bonus, the parser can also handle "x ? e? , e?" and >>>> treat it as "bind e?(? x? e?)". >>>> >>>> Best, >>>> Andreas >>>> >>>> >>>> On 18.03.2018 14:22, Philip Wadler wrote: >>>> >>>>> It's great that Agda now has syntax declarations! >>>>> >>>>> I'm confused by the design. What is implemented is: >>>>> >>>>> infixr 40 bind >>>>> syntax bind e?(? x? e?) = x ? e? , e? >>>>> >>>>> Whereas what I would have expected is: >>>>> >>>>> infixr 40 _?_,_ >>>>> syntax x ? e? , e? = bind e?(? x? e?) >>>>> >>>>> Can someone please enlighten me as to the rationale behind the current >>>>> design? Cheers, -- P >>>>> >>>>> >>>>> . \ Philip Wadler, Professor of Theoretical Computer Science, >>>>> . /\ School of Informatics, University of Edinburgh >>>>> . / \ and Senior Research Fellow, IOHK >>>>> . http://homepages.inf.ed.ac.uk/wadler/ >>>>> >>>> >>>> >>>> -- >>>> Andreas Abel <>< Du bist der geliebte Mensch. >>>> >>>> Department of Computer Science and Engineering >>>> Chalmers and Gothenburg University, Sweden >>>> >>>> andreas.abel at gu.se >>>> http://www.cse.chalmers.se/~abela/ >>>> >>>> >>> >>> The University of Edinburgh is a charitable body, registered in >>> Scotland, with registration number SC005336. >>> >>> _______________________________________________ >>> Agda mailing list >>> Agda at lists.chalmers.se >>> https://lists.chalmers.se/mailman/listinfo/agda >>> >>> >> > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Thorsten.Altenkirch at nottingham.ac.uk Wed Mar 21 12:00:21 2018 From: Thorsten.Altenkirch at nottingham.ac.uk (Thorsten Altenkirch) Date: Wed, 21 Mar 2018 11:00:21 +0000 Subject: [Agda] nullary copattern matching In-Reply-To: References: Message-ID: <323269DB-74AC-44A2-B709-4B9BCD30A2D7@exmail.nottingham.ac.uk> It would be relevant if we allow indexed records and coinductive types as discussed recently. Thorsten ?On 20/03/2018, 23:21, "Agda on behalf of Andreas Abel" wrote: > What is the syntax for copattern matching on a record with zero fields? There isn't any yet, although Jesper and I discussed adding it: record True : Set where triv : True triv .() The syntax would be a post-fix absurd projection pattern. Do you have an interesting application for it? With eta-equality, there is not so much use it seems, since the same can be obtained by triv = _ Cheers, Andreas On 20.03.2018 23:12, Christian Sattler wrote: > What is the syntax for copattern matching on a record with zero fields? > I could not find anything in the documentation. For pattern matching on > a data type with zero constructors, we have syntax for denoting an > impossible case, but what about the analogous situation for copatterns? > Note that C-c C-c will happily produce invalid code ("missing definition"). > > Christian > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel at gu.se http://www.cse.chalmers.se/~abela/ _______________________________________________ Agda mailing list Agda at lists.chalmers.se https://lists.chalmers.se/mailman/listinfo/agda This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please contact the sender and delete the email and attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. Email communications with the University of Nottingham may be monitored where permitted by law. From wadler at inf.ed.ac.uk Wed Mar 21 18:08:17 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Wed, 21 Mar 2018 14:08:17 -0300 Subject: [Agda] Syntax declarations In-Reply-To: References: Message-ID: Thank you! Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 21 March 2018 at 02:42, Ulf Norell wrote: > On Tue, Mar 20, 2018 at 5:47 PM, Philip Wadler > wrote: > >> OK, thanks for the clarification. I assume, though, that somewhere there >> is a table that records _?_,_ as syntax to parse with precedence 40? >> Cheers, -- P >> > > Of course. There's a field for syntax associated with each name. > > If you're curious it's here: > > https://github.com/agda/agda/blob/b9461927b33d4b93005e723033be87 > ac0f01d5c8/src/full/Agda/Syntax/Abstract/Name.hs#L48 > > and the definition of Fixity' here: > > https://github.com/agda/agda/blob/b9461927b33d4b93005e723033be87 > ac0f01d5c8/src/full/Agda/Syntax/Fixity.hs#L39 > > / Ulf > > On 20 March 2018 at 12:34, Ulf Norell wrote: >> >>> >>> On Tue, Mar 20, 2018 at 3:02 PM, Philip Wadler >>> wrote: >>> >>>> Thanks, Ulf and Andreas. Thinking of it in terms of printing an >>>> internal tree, rather than parsing to create an internal tree, explains a >>>> lot. >>>> >>>> It also (sort of) matches the way mixfix operators work: the fact that >>>>> you can write `x + y` for `_+_ x y` is a property of the name `_+_` and not >>>>> a separate entity that may or may not be in scope. >>>> >>>> >>>> I'm still confused by this. Wouldn't >>>> >>>> infixr 40 _?_,_ >>>> >>>> fit the pattern you describe better than >>>> >>>> infixr 40 bind >>>> >>>> ? >>>> >>> >>> I simply meant that the infix notation of _+_ isn't something separate >>> from the function _+_. >>> >>> Writing >>> >>> infixr 40 _?_,_ >>> >>> would require _?_,_ to be a thing that you could talk about, which (for >>> better or for worse) is not how >>> syntax declarations were designed. >>> >>> / Ulf >>> >>> >>>> On 19 March 2018 at 06:54, Andreas Abel wrote: >>>> >>>>> Phil, rest assured that you are not the only one stumbling over this >>>>> design choice. >>>>> >>>>> My explanation attempt: >>>>> >>>>> syntax bind e?(? x? e?) = x ? e? , e? >>>>> >>>>> can be read as >>>>> >>>>> print "bind e?(? x? e?)" as "x ? e? , e?". >>>>> >>>>> This reading emphasizes the uniqueness condition for >>>>> syntax-attachments to a identifier ("bind"). >>>>> >>>>> And then, as a bonus, the parser can also handle "x ? e? , e?" and >>>>> treat it as "bind e?(? x? e?)". >>>>> >>>>> Best, >>>>> Andreas >>>>> >>>>> >>>>> On 18.03.2018 14:22, Philip Wadler wrote: >>>>> >>>>>> It's great that Agda now has syntax declarations! >>>>>> >>>>>> I'm confused by the design. What is implemented is: >>>>>> >>>>>> infixr 40 bind >>>>>> syntax bind e?(? x? e?) = x ? e? , e? >>>>>> >>>>>> Whereas what I would have expected is: >>>>>> >>>>>> infixr 40 _?_,_ >>>>>> syntax x ? e? , e? = bind e?(? x? e?) >>>>>> >>>>>> Can someone please enlighten me as to the rationale behind the >>>>>> current design? Cheers, -- P >>>>>> >>>>>> >>>>>> . \ Philip Wadler, Professor of Theoretical Computer Science, >>>>>> . /\ School of Informatics, University of Edinburgh >>>>>> . / \ and Senior Research Fellow, IOHK >>>>>> . http://homepages.inf.ed.ac.uk/wadler/ >>>>>> >>>>> >>>>> >>>>> -- >>>>> Andreas Abel <>< Du bist der geliebte Mensch. >>>>> >>>>> Department of Computer Science and Engineering >>>>> Chalmers and Gothenburg University, Sweden >>>>> >>>>> andreas.abel at gu.se >>>>> http://www.cse.chalmers.se/~abela/ >>>>> >>>>> >>>> >>>> The University of Edinburgh is a charitable body, registered in >>>> Scotland, with registration number SC005336. >>>> >>>> _______________________________________________ >>>> Agda mailing list >>>> Agda at lists.chalmers.se >>>> https://lists.chalmers.se/mailman/listinfo/agda >>>> >>>> >>> >> >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From wadler at inf.ed.ac.uk Thu Mar 22 21:55:19 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Thu, 22 Mar 2018 17:55:19 -0300 Subject: [Agda] Right Distributivity Message-ID: In Algebra.FunctionProperties one finds the definitions: _DistributesOver?_ : Op? A ? Op? A ? Set _ > _*_ DistributesOver? _+_ = > ? x y z ? (x * (y + z)) ? ((x * y) + (x * z)) > > _DistributesOver?_ : Op? A ? Op? A ? Set _ > _*_ DistributesOver? _+_ = > ? x y z ? ((y + z) * x) ? ((y * x) + (z * x)) > To me, the second of these appears ass-backwards. I would expect _DistributesOver?_ : Op? A ? Op? A ? Set _ > _*_ DistributesOver? _+_ = > ? x y z ? ((x + y) * z) ? ((x * z) + (y * z)) > What is the rationale for the current definition? Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From nad at cse.gu.se Thu Mar 22 22:22:23 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Thu, 22 Mar 2018 22:22:23 +0100 Subject: [Agda] Right Distributivity In-Reply-To: References: Message-ID: On 2018-03-22 21:55, Philip Wadler wrote: > In Algebra.FunctionProperties one finds the definitions: > > _DistributesOver?_ : Op? A ? Op? A ? Set _ > _*_ DistributesOver? _+_ = > ? x y z ? (x * (y + z)) ? ((x * y) + (x * z)) > > _DistributesOver?_ : Op? A ? Op? A ? Set _ > _*_ DistributesOver? _+_ = > ? x y z ? ((y + z) * x) ? ((y * x) + (z * x)) > > To me, the second of these appears ass-backwards. I would expect > > _DistributesOver?_ : Op? A ? Op? A ? Set _ > _*_ DistributesOver? _+_ = > ? x y z ? ((x + y) * z) ? ((x * z) + (y * z)) > > > What is the rationale for the current definition? I wrote that code more than ten years ago. My guess would be that I copied the first definition, (x * (y + z)) ? ((x * y) + (x * z)), and then simply swapped the arguments of every instance of _*_: ((y + z) * x) ? ((y * x) + (z * x)). -- /NAD From wadler at inf.ed.ac.uk Thu Mar 22 22:51:05 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Thu, 22 Mar 2018 18:51:05 -0300 Subject: [Agda] Right Distributivity In-Reply-To: References: Message-ID: Thanks, Nils. I can see how that definition makes a little of the code easier to write, but it makes the library harder to use. I'd be happy to update the relevant files appropriately, but I don't know how much that would break elsewhere. Do you think it would be worthwhile to attempt a fix? Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 22 March 2018 at 18:22, Nils Anders Danielsson wrote: > On 2018-03-22 21:55, Philip Wadler wrote: > >> In Algebra.FunctionProperties one finds the definitions: >> >> _DistributesOver?_ : Op? A ? Op? A ? Set _ >> _*_ DistributesOver? _+_ = >> ? x y z ? (x * (y + z)) ? ((x * y) + (x * z)) >> >> _DistributesOver?_ : Op? A ? Op? A ? Set _ >> _*_ DistributesOver? _+_ = >> ? x y z ? ((y + z) * x) ? ((y * x) + (z * x)) >> >> To me, the second of these appears ass-backwards. I would expect >> >> _DistributesOver?_ : Op? A ? Op? A ? Set _ >> _*_ DistributesOver? _+_ = >> ? x y z ? ((x + y) * z) ? ((x * z) + (y * z)) >> >> >> What is the rationale for the current definition? >> > > I wrote that code more than ten years ago. My guess would be that I > copied the first definition, > > (x * (y + z)) ? ((x * y) + (x * z)), > > and then simply swapped the arguments of every instance of _*_: > > ((y + z) * x) ? ((y * x) + (z * x)). > > -- > /NAD > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From matthewdaggitt at gmail.com Thu Mar 22 23:50:51 2018 From: matthewdaggitt at gmail.com (Matthew Daggitt) Date: Thu, 22 Mar 2018 22:50:51 +0000 Subject: [Agda] Right Distributivity In-Reply-To: References: Message-ID: Hi Philip, I agree, it should be the other way round, but I'm afraid changing it would not only break large sections of the library, it'd also break everyone else's code. I'm afraid it's just one of those things we're going to have to live with and chalk up to being sub-optimal. Apologies, Matthew On Thu, Mar 22, 2018 at 9:51 PM, Philip Wadler wrote: > Thanks, Nils. I can see how that definition makes a little of the code > easier to write, but it makes the library harder to use. I'd be happy to > update the relevant files appropriately, but I don't know how much that > would break elsewhere. Do you think it would be worthwhile to attempt a > fix? Cheers, -- P > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > On 22 March 2018 at 18:22, Nils Anders Danielsson wrote: > >> On 2018-03-22 21:55, Philip Wadler wrote: >> >>> In Algebra.FunctionProperties one finds the definitions: >>> >>> _DistributesOver?_ : Op? A ? Op? A ? Set _ >>> _*_ DistributesOver? _+_ = >>> ? x y z ? (x * (y + z)) ? ((x * y) + (x * z)) >>> >>> _DistributesOver?_ : Op? A ? Op? A ? Set _ >>> _*_ DistributesOver? _+_ = >>> ? x y z ? ((y + z) * x) ? ((y * x) + (z * x)) >>> >>> To me, the second of these appears ass-backwards. I would expect >>> >>> _DistributesOver?_ : Op? A ? Op? A ? Set _ >>> _*_ DistributesOver? _+_ = >>> ? x y z ? ((x + y) * z) ? ((x * z) + (y * z)) >>> >>> >>> What is the rationale for the current definition? >>> >> >> I wrote that code more than ten years ago. My guess would be that I >> copied the first definition, >> >> (x * (y + z)) ? ((x * y) + (x * z)), >> >> and then simply swapped the arguments of every instance of _*_: >> >> ((y + z) * x) ? ((y * x) + (z * x)). >> >> -- >> /NAD >> >> > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wadler at inf.ed.ac.uk Fri Mar 23 00:49:27 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Thu, 22 Mar 2018 20:49:27 -0300 Subject: [Agda] Right Distributivity In-Reply-To: References: Message-ID: Fair enough. Thanks! -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 22 March 2018 at 19:50, Matthew Daggitt wrote: > Hi Philip, > I agree, it should be the other way round, but I'm afraid changing it > would not only break large sections of the library, it'd also break > everyone else's code. I'm afraid it's just one of those things we're going > to have to live with and chalk up to being sub-optimal. > Apologies, > Matthew > > On Thu, Mar 22, 2018 at 9:51 PM, Philip Wadler > wrote: > >> Thanks, Nils. I can see how that definition makes a little of the code >> easier to write, but it makes the library harder to use. I'd be happy to >> update the relevant files appropriately, but I don't know how much that >> would break elsewhere. Do you think it would be worthwhile to attempt a >> fix? Cheers, -- P >> >> . \ Philip Wadler, Professor of Theoretical Computer Science, >> . /\ School of Informatics, University of Edinburgh >> . / \ and Senior Research Fellow, IOHK >> . http://homepages.inf.ed.ac.uk/wadler/ >> >> On 22 March 2018 at 18:22, Nils Anders Danielsson wrote: >> >>> On 2018-03-22 21:55, Philip Wadler wrote: >>> >>>> In Algebra.FunctionProperties one finds the definitions: >>>> >>>> _DistributesOver?_ : Op? A ? Op? A ? Set _ >>>> _*_ DistributesOver? _+_ = >>>> ? x y z ? (x * (y + z)) ? ((x * y) + (x * z)) >>>> >>>> _DistributesOver?_ : Op? A ? Op? A ? Set _ >>>> _*_ DistributesOver? _+_ = >>>> ? x y z ? ((y + z) * x) ? ((y * x) + (z * x)) >>>> >>>> To me, the second of these appears ass-backwards. I would expect >>>> >>>> _DistributesOver?_ : Op? A ? Op? A ? Set _ >>>> _*_ DistributesOver? _+_ = >>>> ? x y z ? ((x + y) * z) ? ((x * z) + (y * z)) >>>> >>>> >>>> What is the rationale for the current definition? >>>> >>> >>> I wrote that code more than ten years ago. My guess would be that I >>> copied the first definition, >>> >>> (x * (y + z)) ? ((x * y) + (x * z)), >>> >>> and then simply swapped the arguments of every instance of _*_: >>> >>> ((y + z) * x) ? ((y * x) + (z * x)). >>> >>> -- >>> /NAD >>> >>> >> >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From mechvel at botik.ru Sat Mar 24 11:33:03 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Sat, 24 Mar 2018 13:33:03 +0300 Subject: [Agda] `Pointwise' over Setoid Message-ID: <1521887583.3033.26.camel@one.mechvel.pereslavl.ru> Dear Standard library developers, (I am sorry, if this was discussed earlier) Standard library provides map-cong, map-id, map-compose as related to the propositional equality _?_. But the case of List over Setoid is highly usable. And I suggest this: ----------------------------------------------------------------------- module OfMapsToSetoid {? ? ?=} (A : Set ?) (S : Setoid ? ?=) where open Setoid S using (_?_) renaming (Carrier to B; reflexive to ?reflexive; refl to ?refl; sym to ?sym; trans to ?trans) infixl 2 _??_ _??_ : Rel (A ? B) _ f ?? g = (x : A) ? f x ? g x ??refl : Reflexive _??_ ??refl _ = ?refl ??reflexive : _?_ ? _??_ ??reflexive {x} refl = ??refl {x} ??sym : Symmetric _??_ ??sym f??g = ?sym ? f??g ??trans : Transitive _??_ ??trans f??g g??h x = ?trans (f??g x) (g??h x) ??Equiv : IsEquivalence _??_ ??Equiv = record{ refl = \{x} ? ??refl {x} ; sym = \{x} {y} ? ??sym {x} {y} ; trans = \{x} {y} {z} ? ??trans {x} {y} {z} } ??Setoid : Setoid (? ? ?) (? ? ?=) ??Setoid = record{ Carrier = A ? B ; _?_ = _??_ ; isEquivalence = ??Equiv } lSetoid = ListPoint.setoid S open Setoid lSetoid using () renaming (_?_ to _=l_; refl to =l-refl) gen-map-cong : {f g : A ? B} ? f ?? g ? (xs : List A) ? map f xs =l map g xs gen-map-cong _ [] = =l-refl gen-map-cong f??g (x ? xs) = (f??g x) ?p (gen-map-cong f??g xs) ... ---------------------------------------------------------- Regards, ------ Sergei From matthewdaggitt at gmail.com Sat Mar 24 14:02:40 2018 From: matthewdaggitt at gmail.com (Matthew Daggitt) Date: Sat, 24 Mar 2018 13:02:40 +0000 Subject: [Agda] `Pointwise' over Setoid In-Reply-To: <1521887583.3033.26.camel@one.mechvel.pereslavl.ru> References: <1521887583.3033.26.camel@one.mechvel.pereslavl.ru> Message-ID: Hi Sergei, Can you open standard library suggestions like this on the stdlib git repository? Probably a better place to discuss them. Thanks, Matthew On Sat, Mar 24, 2018 at 10:33 AM, Sergei Meshveliani wrote: > Dear Standard library developers, > > (I am sorry, if this was discussed earlier) > > Standard library provides map-cong, map-id, map-compose > as related to the propositional equality _?_. > But the case of List over Setoid is highly usable. > > And I suggest this: > > ----------------------------------------------------------------------- > module OfMapsToSetoid {? ? ?=} (A : Set ?) (S : Setoid ? ?=) > where > open Setoid S using (_?_) > renaming (Carrier to B; reflexive to ?reflexive; > refl to ?refl; sym to ?sym; trans to ?trans) > infixl 2 _??_ > > _??_ : Rel (A ? B) _ > f ?? g = (x : A) ? f x ? g x > > ??refl : Reflexive _??_ > ??refl _ = ?refl > > ??reflexive : _?_ ? _??_ > ??reflexive {x} refl = ??refl {x} > > ??sym : Symmetric _??_ > ??sym f??g = ?sym ? f??g > > ??trans : Transitive _??_ > ??trans f??g g??h x = ?trans (f??g x) (g??h x) > > ??Equiv : IsEquivalence _??_ > ??Equiv = record{ refl = \{x} ? ??refl {x} > ; sym = \{x} {y} ? ??sym {x} {y} > ; trans = \{x} {y} {z} ? ??trans {x} {y} {z} } > > ??Setoid : Setoid (? ? ?) (? ? ?=) > ??Setoid = record{ Carrier = A ? B > ; _?_ = _??_ > ; isEquivalence = ??Equiv } > > lSetoid = ListPoint.setoid S > > open Setoid lSetoid using () renaming (_?_ to _=l_; refl to =l-refl) > > gen-map-cong : {f g : A ? B} ? f ?? g ? (xs : List A) ? > map f xs =l map g xs > gen-map-cong _ [] = =l-refl > gen-map-cong f??g (x ? xs) = (f??g x) ?p (gen-map-cong f??g xs) > > ... > ---------------------------------------------------------- > > > Regards, > > ------ > Sergei > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.krejsa at gmail.com Tue Mar 27 01:15:47 2018 From: dan.krejsa at gmail.com (Dan Krejsa) Date: Mon, 26 Mar 2018 16:15:47 -0700 Subject: [Agda] Is bottom initial without functional extensionality? Message-ID: Hi, If ? is the prototypical empty type, is it possible in Agda to prove from?uniq : ? {i} {A : Set i} (f g : ? -> A) -> f ? g (where ? is propositional equality) without assuming extra postulates such as functional extensionality? My instinct is to doubt it, but the emptiness of the domain gives me pause... - Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jesper at sikanda.be Tue Mar 27 11:09:52 2018 From: Jesper at sikanda.be (Jesper Cockx) Date: Tue, 27 Mar 2018 11:09:52 +0200 Subject: [Agda] Is bottom initial without functional extensionality? In-Reply-To: References: Message-ID: It's possible to build models of an Agda-like theory that explicitly refute funext (see https://www.p?drot.fr/articles/cpp2017.pdf ), and this seems like it could be specialized to the case where the domain is the empty type. So I would strongly doubt this is provable in Agda (without exploiting some kind of bug). -- Jesper On Tue, Mar 27, 2018 at 1:15 AM, Dan Krejsa wrote: > Hi, > > If ? is the prototypical empty type, is it possible in Agda to prove > > from?uniq : ? {i} {A : Set i} (f g : ? -> A) -> f ? g > > (where ? is propositional equality) without assuming extra postulates > such as functional extensionality? > My instinct is to doubt it, but the emptiness of the domain gives me > pause... > > - Dan > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apostolis.xekoukoulotakis at gmail.com Wed Mar 28 06:39:31 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Wed, 28 Mar 2018 07:39:31 +0300 Subject: [Agda] Instance resolution question Message-ID: ``` module Test2 where data A : Set where CPF : Set CPF = {{a : A}} ? A postulate fun : CPF ? CPF e : CPF bob : CPF bob {{ctx}} = fun (e {{ctx}}) rob : CPF rob = fun e ``` I wonder if there is a way to write "rob" instead of "bob". Keep in mind that the candidates are definitionally equal. (it seems) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell at gmail.com Wed Mar 28 07:14:57 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Wed, 28 Mar 2018 07:14:57 +0200 Subject: [Agda] Instance resolution question In-Reply-To: References: Message-ID: The candidates are not equal. This is what `rob` expands to: rob : CPF rob {{ctx}} = fun (? {{ctx'}} ? e) ctx and ctx' are distinct variables. / Ulf On Wed, Mar 28, 2018 at 6:39 AM, Apostolis Xekoukoulotakis < apostolis.xekoukoulotakis at gmail.com> wrote: > ``` > module Test2 where > > > data A : Set where > > > CPF : Set > CPF = {{a : A}} ? A > > postulate > fun : CPF ? CPF > e : CPF > > > bob : CPF > bob {{ctx}} = fun (e {{ctx}}) > > > rob : CPF > rob = fun e > > ``` > > I wonder if there is a way to write "rob" instead of "bob". > > Keep in mind that the candidates are definitionally equal. (it seems) > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apostolis.xekoukoulotakis at gmail.com Wed Mar 28 07:36:22 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Wed, 28 Mar 2018 08:36:22 +0300 Subject: [Agda] Instance resolution question In-Reply-To: References: Message-ID: https://lists.chalmers.se/pipermail/agda/2017/009802.html >From a previous discussion with Andreas, hidden/instance arguments are inserted eagerly. I wonder if I can disable this specifically for "{{ctx}}". On Wed, Mar 28, 2018 at 8:14 AM, Ulf Norell wrote: > The candidates are not equal. This is what `rob` expands to: > > rob : CPF > rob {{ctx}} = fun (? {{ctx'}} ? e) > > ctx and ctx' are distinct variables. > > / Ulf > > On Wed, Mar 28, 2018 at 6:39 AM, Apostolis Xekoukoulotakis < > apostolis.xekoukoulotakis at gmail.com> wrote: > >> ``` >> module Test2 where >> >> >> data A : Set where >> >> >> CPF : Set >> CPF = {{a : A}} ? A >> >> postulate >> fun : CPF ? CPF >> e : CPF >> >> >> bob : CPF >> bob {{ctx}} = fun (e {{ctx}}) >> >> >> rob : CPF >> rob = fun e >> >> ``` >> >> I wonder if there is a way to write "rob" instead of "bob". >> >> Keep in mind that the candidates are definitionally equal. (it seems) >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.norell at gmail.com Wed Mar 28 08:30:45 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Wed, 28 Mar 2018 08:30:45 +0200 Subject: [Agda] Instance resolution question In-Reply-To: References: Message-ID: You can wrap CPF in data type/record: record CPF : Set where constructor mkCPF field unCPF : {{a : A}} ? A postulate fun : CPF ? CPF e : CPF rob : CPF rob = fun e But note that if it's really `bob` you want, not inserting the {{ctx}} will give you `cob`, which is not the same as `bob`: cob : CPF cob {{ctx}} = fun (? {{ctx'}} ? e {{ctx'}}) {{ctx}} / Ulf On Wed, Mar 28, 2018 at 7:36 AM, Apostolis Xekoukoulotakis < apostolis.xekoukoulotakis at gmail.com> wrote: > https://lists.chalmers.se/pipermail/agda/2017/009802.html > > From a previous discussion with Andreas, hidden/instance arguments are > inserted eagerly. > I wonder if I can disable this specifically for "{{ctx}}". > > On Wed, Mar 28, 2018 at 8:14 AM, Ulf Norell wrote: > >> The candidates are not equal. This is what `rob` expands to: >> >> rob : CPF >> rob {{ctx}} = fun (? {{ctx'}} ? e) >> >> ctx and ctx' are distinct variables. >> >> / Ulf >> >> On Wed, Mar 28, 2018 at 6:39 AM, Apostolis Xekoukoulotakis < >> apostolis.xekoukoulotakis at gmail.com> wrote: >> >>> ``` >>> module Test2 where >>> >>> >>> data A : Set where >>> >>> >>> CPF : Set >>> CPF = {{a : A}} ? A >>> >>> postulate >>> fun : CPF ? CPF >>> e : CPF >>> >>> >>> bob : CPF >>> bob {{ctx}} = fun (e {{ctx}}) >>> >>> >>> rob : CPF >>> rob = fun e >>> >>> ``` >>> >>> I wonder if there is a way to write "rob" instead of "bob". >>> >>> Keep in mind that the candidates are definitionally equal. (it seems) >>> >>> _______________________________________________ >>> Agda mailing list >>> Agda at lists.chalmers.se >>> https://lists.chalmers.se/mailman/listinfo/agda >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apostolis.xekoukoulotakis at gmail.com Wed Mar 28 09:23:37 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Wed, 28 Mar 2018 10:23:37 +0300 Subject: [Agda] Instance resolution question In-Reply-To: References: Message-ID: This might work. (I do want cob and not bob). On Wed, Mar 28, 2018 at 9:30 AM, Ulf Norell wrote: > You can wrap CPF in data type/record: > > record CPF : Set where > constructor mkCPF > field unCPF : {{a : A}} ? A > > postulate > fun : CPF ? CPF > e : CPF > > rob : CPF > rob = fun e > > But note that if it's really `bob` you want, not inserting the {{ctx}} > will give you `cob`, which > is not the same as `bob`: > > cob : CPF > cob {{ctx}} = fun (? {{ctx'}} ? e {{ctx'}}) {{ctx}} > > / Ulf > > On Wed, Mar 28, 2018 at 7:36 AM, Apostolis Xekoukoulotakis < > apostolis.xekoukoulotakis at gmail.com> wrote: > >> https://lists.chalmers.se/pipermail/agda/2017/009802.html >> >> From a previous discussion with Andreas, hidden/instance arguments are >> inserted eagerly. >> I wonder if I can disable this specifically for "{{ctx}}". >> >> On Wed, Mar 28, 2018 at 8:14 AM, Ulf Norell wrote: >> >>> The candidates are not equal. This is what `rob` expands to: >>> >>> rob : CPF >>> rob {{ctx}} = fun (? {{ctx'}} ? e) >>> >>> ctx and ctx' are distinct variables. >>> >>> / Ulf >>> >>> On Wed, Mar 28, 2018 at 6:39 AM, Apostolis Xekoukoulotakis < >>> apostolis.xekoukoulotakis at gmail.com> wrote: >>> >>>> ``` >>>> module Test2 where >>>> >>>> >>>> data A : Set where >>>> >>>> >>>> CPF : Set >>>> CPF = {{a : A}} ? A >>>> >>>> postulate >>>> fun : CPF ? CPF >>>> e : CPF >>>> >>>> >>>> bob : CPF >>>> bob {{ctx}} = fun (e {{ctx}}) >>>> >>>> >>>> rob : CPF >>>> rob = fun e >>>> >>>> ``` >>>> >>>> I wonder if there is a way to write "rob" instead of "bob". >>>> >>>> Keep in mind that the candidates are definitionally equal. (it seems) >>>> >>>> _______________________________________________ >>>> Agda mailing list >>>> Agda at lists.chalmers.se >>>> https://lists.chalmers.se/mailman/listinfo/agda >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mechvel at botik.ru Wed Mar 28 10:54:48 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Wed, 28 Mar 2018 11:54:48 +0300 Subject: [Agda] strictness place Message-ID: <1522227288.2431.27.camel@one.mechvel.pereslavl.ru> Dear Agda developers, can you, please explain, what is the relation between laziness and strictness in Agda? Which is the default? Which is favorite? Have they equal rights? Where strictness can appear? Does the type checker process strictness? Does the compiler process strictness? Is Agda ready to take the option "do everything strict in type checking and in the executable code" ? what will be a real effect? (As I recall, Haskell needs to define `strict' separately for each particular constructor or function application, so that `lazy' and `strict' have not equal rights). Is it true that Agda only transmits strictness annotations to the Haskell code, and then GHC processes these annotation according to the Haskell rules? So far, I am not going to use strictness explicitly. But sometimes I say "Agda has lazy evaluation", and some people object as "no, it also has a strict back-end ...". So that I need to have an idea. Probably, it needs to be "Agda has lazy evaluation as default and favorite" (?) Thanks, ------ Sergei From nad at cse.gu.se Wed Mar 28 11:34:56 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Wed, 28 Mar 2018 11:34:56 +0200 Subject: [Agda] strictness place In-Reply-To: <1522227288.2431.27.camel@one.mechvel.pereslavl.ru> References: <1522227288.2431.27.camel@one.mechvel.pereslavl.ru> Message-ID: <557a57c0-f880-7cfa-4d31-18425396bfb0@cse.gu.se> On 2018-03-28 10:54, Sergei Meshveliani wrote: > can you, please explain, what is the relation between laziness and > strictness in Agda? Agda is a language in which every program is productive (in the absence of bugs, when the termination checker has not been turned off, etc.). This gives quite a bit of freedom to those implementing compiler backends for Agda, and different backends take different approaches. I think you are mainly using the GHC backend. This backend uses lazy evaluation. > Is Agda ready to take the option "do everything strict in type checking > and in the executable code" ? what will be a real effect? It would be easy to make all *inductive* constructors strict in the GHC backend. This might be beneficial for code written in a certain way, but it could also hurt performance for code that includes proof terms that are not erased. I guess it would also be possible to make more function applications strict. However, if you make, say, if_then_else_ strict, then you could incur a substantial performance penalty. -- /NAD From ulf.norell at gmail.com Wed Mar 28 11:52:40 2018 From: ulf.norell at gmail.com (Ulf Norell) Date: Wed, 28 Mar 2018 11:52:40 +0200 Subject: [Agda] strictness place In-Reply-To: <557a57c0-f880-7cfa-4d31-18425396bfb0@cse.gu.se> References: <1522227288.2431.27.camel@one.mechvel.pereslavl.ru> <557a57c0-f880-7cfa-4d31-18425396bfb0@cse.gu.se> Message-ID: Both the type checker and the GHC backend are lazy by default. For the type checker it would be disastrous to be strict everywhere, since you'd end up evaluating expensive proof terms that you don't need to look at. For the run time it's slightly better since many of those proof terms will get erased. It is not possible to compile an Agda program with (the ghc flag) -XStrict since the GHC backend relies on laziness. You can manually control strictness using Agda.Builtin.Strict.primForce. This forces evaluation of its argument both at compile time and at run time. There is currently no way to declare strict constructors like in Haskell. / Ulf On Wed, Mar 28, 2018 at 11:34 AM, Nils Anders Danielsson wrote: > On 2018-03-28 10:54, Sergei Meshveliani wrote: > >> can you, please explain, what is the relation between laziness and >> strictness in Agda? >> > > Agda is a language in which every program is productive (in the absence > of bugs, when the termination checker has not been turned off, etc.). > This gives quite a bit of freedom to those implementing compiler > backends for Agda, and different backends take different approaches. > > I think you are mainly using the GHC backend. This backend uses lazy > evaluation. > > Is Agda ready to take the option "do everything strict in type checking >> and in the executable code" ? what will be a real effect? >> > > It would be easy to make all *inductive* constructors strict in the GHC > backend. This might be beneficial for code written in a certain way, but > it could also hurt performance for code that includes proof terms that > are not erased. > > I guess it would also be possible to make more function applications > strict. However, if you make, say, if_then_else_ strict, then you could > incur a substantial performance penalty. > > -- > /NAD > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.hausmann at 314.ch Wed Mar 28 13:56:22 2018 From: philipp.hausmann at 314.ch (Philipp Hausmann) Date: Wed, 28 Mar 2018 13:56:22 +0200 Subject: [Agda] strictness place In-Reply-To: References: <1522227288.2431.27.camel@one.mechvel.pereslavl.ru> <557a57c0-f880-7cfa-4d31-18425396bfb0@cse.gu.se> Message-ID: <10b1baf7-b4c7-5deb-e53b-a60bfa10ecf0@314.ch> The JavaScript backend is the only exception here I guess, it uses strict evaluation. The main reason is that having strict semantics matches the JS evaluation model much more closely which simplified the backend implementation. While this is permitted by Agdas semantics, I suspect most existing Agda code assumes laziness and there are probably some performance problems lurking around when using e.g. the stdlib with a strict evaluation model. Philipp On 03/28/2018 11:52 AM, Ulf Norell wrote: > Both the type checker and the GHC backend are lazy by default. For the > type checker > it would be disastrous to be strict everywhere, since you'd end up > evaluating expensive > proof terms that you don't need to look at. For the run time it's > slightly better since many > of those proof terms will get erased. It is not possible to compile an > Agda program with > (the ghc flag) -XStrict since the GHC backend relies on laziness. > > You can manually control strictness using > Agda.Builtin.Strict.primForce. This forces > evaluation of its argument both at compile time and at run time. There > is currently no way > to declare strict constructors like in Haskell. > > / Ulf > > > > > On Wed, Mar 28, 2018 at 11:34 AM, Nils Anders Danielsson > > wrote: > > On 2018-03-28 10:54, Sergei Meshveliani wrote: > > can you, please explain, what is the relation between laziness and > strictness in Agda? > > > Agda is a language in which every program is productive (in the > absence > of bugs, when the termination checker has not been turned off, etc.). > This gives quite a bit of freedom to those implementing compiler > backends for Agda, and different backends take different approaches. > > I think you are mainly using the GHC backend. This backend uses lazy > evaluation. > > Is Agda ready to take the option "do everything strict in type > checking > and in the executable code" ? what will be a real effect? > > > It would be easy to make all *inductive* constructors strict in > the GHC > backend. This might be beneficial for code written in a certain > way, but > it could also hurt performance for code that includes proof terms that > are not erased. > > I guess it would also be possible to make more function applications > strict. However, if you make, say, if_then_else_ strict, then you > could > incur a substantial performance penalty. > > -- > /NAD > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > > > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda -------------- next part -------------- An HTML attachment was scrubbed... URL: From mechvel at botik.ru Wed Mar 28 14:27:36 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Wed, 28 Mar 2018 15:27:36 +0300 Subject: [Agda] literature on Coq page Message-ID: <1522240056.6872.43.camel@scico.botik.ru> I am sorry for a bit irrelevant question. Can anybody advice of where to find the literature references on the Coq www page related to the programs on various sections in algebra? For example, I see the coq-algebra package on https://github.com/coq-contribs/algebra And there are the program modules on GitHub. Only the program code. Generally, it is expected that a program for some method is accompanied by references to books and papers. Each section in a huge program library is somehow supposed to provide the literature references. But I do not see such references on the Coq page. I wonder of what I am missing. Thanks, ------ Sergei From kahl at cas.mcmaster.ca Wed Mar 28 17:45:34 2018 From: kahl at cas.mcmaster.ca (Wolfram Kahl) Date: Wed, 28 Mar 2018 11:45:34 -0400 Subject: [Agda] strictness place In-Reply-To: <557a57c0-f880-7cfa-4d31-18425396bfb0@cse.gu.se> References: <1522227288.2431.27.camel@one.mechvel.pereslavl.ru> <557a57c0-f880-7cfa-4d31-18425396bfb0@cse.gu.se> Message-ID: <20180328154534.GY8130@ritchie.cas.mcmaster.ca> On Wed, Mar 28, 2018 at 11:34:56AM +0200, Nils Anders Danielsson wrote: > On 2018-03-28 10:54, Sergei Meshveliani wrote: > >can you, please explain, what is the relation between laziness and > >strictness in Agda? > > Agda is a language in which every program is productive (in the absence > of bugs, when the termination checker has not been turned off, etc.). > This gives quite a bit of freedom to those implementing compiler > backends for Agda, and different backends take different approaches. > > I think you are mainly using the GHC backend. This backend uses lazy > evaluation. (To be more precise, it uses lazy evaluation on a translation of the original code that eliminates most of the sharing a Haskell programmer would expect, see e.g.: https://github.com/agda/agda/issues/1895 I hope I'll get back to working on that some time this summer... ) Wolfram From 19786654 at qq.com Thu Mar 29 13:28:10 2018 From: 19786654 at qq.com (=?utf-8?B?VmluYUx4?=) Date: Thu, 29 Mar 2018 19:28:10 +0800 Subject: [Agda] Confusion about rewrite mechanism Message-ID: Hi everyone! I'm new to agda and was trying to prove some property related to Data.List.partition like this partition-++ : ? {?} {A : Set ?} {xs l r} {p} {P : A ? Set p} {p : Decidable P} ? (l , r) ? partition p xs ? SomeProperty A xs (l ++ r) And I pattern-match on xs, and encountered the problem in the [] case, I try to use rewrite and Data.Product.,-injective as follow: partition-++ {xs = []} p rewrite ,-injective? p | ,-injective? p = ? -- no but Agda complained about .l != [] as ,-injective? required. And I somehow figured out a way out of it: partition-++ {xs = []} p with ,-injective? p ... | l?[] rewrite l?[] | ,-injective? p = ? In this case Agda managed to replace .l with [] and ,-injective? p type checked. And my question is: What's the difference between the first rewrite and the second, why the second rewriting can apply to .l inside of p while the first can't ? What role does with play here? In this scenario what's the correct solution to this? I don't feel right about mine. -------------- next part -------------- An HTML attachment was scrubbed... URL: From carlos.camarao at gmail.com Thu Mar 29 14:07:39 2018 From: carlos.camarao at gmail.com (Carlos Camarao) Date: Thu, 29 Mar 2018 09:07:39 -0300 Subject: [Agda] SBLP 2018 second call for papers Message-ID: Universidade de S?o Paulo - ICMC/USP S?o Carlos, Brazil, September 20-21, 2018 Conference website http://www.sbc.org.br/cbsoft2018 Submission link https://easychair.org/conferences/?conf=sblp2018 SBLP 2018 is the 22nd edition of the Brazilian Symposium on Programming Languages. It is promoted by the Brazilian Computer Society (SBC) and constitutes a forum for researchers, students and professionals to present and discuss ideas and innovations in the design, definition, analysis, implementation and practical use of programming languages. SBLP's first edition was in 1996. Since 2010, it is part of CBSoft, the Brazilian Conference on Software: Theory and Practice (http://cbsoft.org/cbsoft2018/). Submission Guidelines ________________________________________________________________________________ Papers can be written in Portuguese or English. Submission in English is strongly encouraged since the symposium proceedings are indexed in the ACM Digital Library. The acceptance of a paper implies that at least one of its authors will register for the symposium to present it. Papers must be original and not simultaneously submitted to another journal or conference. Papers must be submitted electronically (in PDF format) via the Easychair System: http://www.easychair.org/conferences/?conf=sblp2018 The following paper categories are welcome (page limits include figures, references and appendices): Full papers: up to 8 pages long in ACM 2-column conference format, available at http://www.acm.org/publications/proceedings-template Short papers: up to 3 pages in the same format, can discuss new ideas which are at an early stage of development or can report partial results of on-going dissertations or theses. List of Topics (related but not limited to the following) ________________________________________________________________________________ ? Programming paradigms and styles, scripting and domain-specific languages and support for real-time, service-oriented, multi-threaded, parallel, and distributed programming ? Program generation and transformation ? Formal semantics and theoretical foundations: denotational, operational, algebraic and categorical ? Program analysis and verification, type systems, static analysis and abstract interpretation ? Programming language design and implementation, programming language environments, compilation and interpretation techniques Publication ________________________________________________________________________________ SBLP proceedings will be published in ACM's digital library. As in previous editions, after the conference authors of selected regular papers will be invited to submit an extended version of their work to be considered for publication in a journal's special issue. Since 2009, selected papers of each SBLP edition are being published in a special issue of Science of Computer Programming, by Elsevier. Important dates ________________________________________________________________________________ Abstract submission: April 29th 2018 Paper submission: May 6th 2018 Author notification: June 22nd 2018 Camera ready deadline: July 8th 2018 Program Committee ________________________________________________________________________________ Mariza Bigonha Universidade Federal de Minas Gerais Roberto Bigonha Universidade Federal de Minas Gerais Andre R. Du Bois Universidade Federal de Pelotas Christiano Braga Universidade Federal Fluminense Carlos Camar?o Universidade Federal de Minas Gerais (chair) Fernando Castor Universidade Federal de Pernambuco Renato Cerqueira IBM Research, Brazil Jo?o Fernandes Universidade de Coimbra Jo?o Ferreira Teesside University Luc?lia Figueiredo Universidade Federal de Ouro Preto Ismael Figueroa Pontif?cia Universidad Cat?lica de Valparaiso Alex Garcia Instituto Militar de Engenharia Francisco Heron Universidade Federal do Cear? Roberto Ierusalimschy Pontif?cia Universidade Cat?lica do Rio de Janeiro Yu David Liu State University of New York at Binghamton Hans-Wolfgang Loidl Heriot-Watt University Marcelo Maia Universidade Federal de Uberl?ndia Andr? M. Maidl Pontif?cia Universidade Cat?lica do Paran? Manuel A. Martins Universidade de Aveiro F?bio Mascarenhas Universidade Federal do Rio de Janeiro S?rgio Medeiros Universidade Federal do Rio Grande do Norte Victor Miraldo University of Utrecht ?lvaro Moreira Universidade Federal do Rio Grande do Sul Anamaria M. Moreira Universidade Federal do Rio de Janeiro Peter Mosses Swansea University Martin Musicante Universidade Federal do Rio Grande do Norte Alberto Pardo Universidad de la Rep?blica Fernando Pereira Universidade Federal de Minas Gerais Gustavo Pinto Universidade Federal do Par? Louis-Noel Pouchet Ohio State University Zongyan Qiu Peking University Henrique R?belo Universidade Federal de Pernambuco Leonardo Reis Universidade Federal de Ouro Preto Rodrigo Ribeiro Universidade Federal de Ouro Preto Noemi Rodriguez Pontif?cia Universidade Cat?lica do Rio de Janeiro Francisco Sant'Anna Universidade Estadual do Rio de Janeiro Jo?o Saraiva Universidade do Minho Martin Sulzmann Hochschule Karlsruhe - Technik und Wirtschaft (chair) Leopoldo Teixeira Universidade Federal de Pernambuco Simon Thompson University of Kent Cristiano Vasconcellos Universidade do Estado de Santa Catarina Varmo Vene University of Tartu Invited Speaker ________________________________________________________________________________ Martin Sulzmann, Hochschule Karlsruhe - Technik und Wirtschaft, Germany Contact ________________________________________________________________________________ All questions about submissions should be emailed to Carlos Camar?o (camarao at dcc.ufmg.br) -------------- next part -------------- An HTML attachment was scrubbed... URL: From divipp at gmail.com Thu Mar 29 14:13:48 2018 From: divipp at gmail.com (Peter Divianszky) Date: Thu, 29 Mar 2018 14:13:48 +0200 Subject: [Agda] new generalize feature, first version Message-ID: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> Dear Agda users and implementors, I implemented a first version of forall-generalization, and I would like to get feedback on it. For users --------- An example Agda file can be found at https://github.com/divipp/agda/blob/master/test/Succeed/Generalize.agda Suppose that the following Set formers were postulated: postulate Con : Set Ty : (? : Con) ? Set Sub : (? ? : Con) ? Set Tm : (? : Con)(A : Ty ?) ? Set There is a new keyword 'generalize', which accept declarations like 'field' for records: generalize {? ? ?} : Con {A B C} : Ty _ {? ? ?} : Sub _ _ {t u v} : Tm _ _ After these 12 declarations (1) ?, ? and ? behave as Con-typed terms, but they are automatically forall-generalized, so, for example postulate id : Sub ? ? _?_ : Sub ? ? ? Sub ? ? ? Sub ? ? means postulate id : ? {?} ? Sub ? ? _?_ : ? {? ? ?} ? Sub ? ? ? Sub ? ? ? Sub ? ? (2) A, B and C behaves as (Ty _)-typed terms (their types contain a dedicated metavariable for each of them), and they are also automatically forall-generalized. For example, postulate _?_ : ? ? ? Ty ? ? Con ?? : Sub ? (? ? A) ? Sub ? ? means _?_ : ? ? ? Ty ? ? Con ?? : ?{? ?}{A : Ty ?} ? Sub ? (? ? A) ? Sub ? ? (3) The metavariables of generalizable variables are also automatically generalized. For example, postulate ass : (? ? ?) ? ? ? ? ? (? ? ?) means postulate ass : ?{? ? ? ?}{? : Sub ? ?}{? : Sub ? ?}{? : Sub ? ?} ? ((? ? ?) ? ?) ? (? ? (? ? ?)) (4) The place and order of generalized variables are fixed by the following rules: A) generalized bindings are placed at the front of the type signature B) the dependencies between the generalized variables are always respected C) whenever possible, introduce A before B if A < B - for non-metas, A < B if A was declared before B with a 'generalize' keyword - a meta is smaller than a non-meta - for metas, A < B if A was declared before B with a 'generalize' keyword. For example, ? : Sub _1 _2 was declared before ? : Sub _3 _4 so instances of _1, _2, _3, _4 are ordered according to the indices. ---- The design goals were the following: - make type signatures shorter - the type schema of generalizable variables helps to make even more guesses by the type system - avoid accidental generalization - only the given names are generalized - the type of generalizable variables are checked against the given schema, which adds extra safety - make generalized type signatures reliable (the ordering, and also the naming, see later) Question: - What should be the keyword? 'notation' seems also good for me. The idea behind 'notation' is that this language construct makes informal sentences like "Let ? ? ? denote contexts." formal. Plans (not implemented yet) - automatic generalization of record fields and constructor types - allow 'generalize' keyword in submodules and between record fields - make generalizable variables importable? - Name the generalized metavariables also according by the given generalizable variables. For example, if _1 : Con, then take the first freely available : Con, where was defined by 'generalize'. If no more names are available, stop with an error message. You can try the current implementation with my fork: https://github.com/divipp/agda For Agda implementors --------------------- The main patch is https://github.com/divipp/agda/commit/d172d1ade15abe26be19311300f7d640563a6a57 It contains several hacks, I'm not sure that this is the right thing to do: - metavariables of generalizable variables are solved locally during typechecking of terms and reverted later - generalizable variables are stored in the signature as if they were introduced by 'postulate' The Generalize.agda file succeeds when I load it into emacs, but fails if I call Agda directly. Somehow I could not filter out metavariables introduced by 'generalize', so Agda tries to serialize them. It would great if you could help me to let this feature in. Best Regards, Peter From wadler at inf.ed.ac.uk Thu Mar 29 14:31:54 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Thu, 29 Mar 2018 09:31:54 -0300 Subject: [Agda] Operational and Denotational, Typed and Untyped Lambda Calculus Message-ID: What is your favourite way to define lambda calculus in Agda? I am looking for solutions both operational and denotational, and both typed and untyped. My favourite denotational untyped solution so far is due to Nils Anders Danielsson: http://www.cse.chalmers.se/~nad/listings/partiality-monad/Lambda.Simplified.Delay-monad.Interpreter.html It defines values as closures, a syntactic approach. What would be even better is to define values semantically: data value where fun : (value -> Delay value) -> value But this does not work because value appears in a negative position. Is there a way to model a denotational description of values in Agda, perhaps by mimicking one of the constructions of domain theory? Thank you for your help! Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From nad at cse.gu.se Thu Mar 29 17:19:25 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Thu, 29 Mar 2018 17:19:25 +0200 Subject: [Agda] Operational and Denotational, Typed and Untyped Lambda Calculus In-Reply-To: References: Message-ID: <0303b315-dd64-9bac-e77c-1ea0e0330d6d@cse.gu.se> On 2018-03-29 14:31, Philip Wadler wrote: > My favourite denotational untyped solution so far is due to Nils Anders Danielsson: > > http://www.cse.chalmers.se/~nad/listings/partiality-monad/Lambda.Simplified.Delay-monad.Interpreter.html > > It defines values as closures, a syntactic approach. This definition is similar to a standard big-step operational semantics, and it is not defined compositionally (i.e. using recursion on the structure of terms). Hence I see this as an operational, rather than denotational, semantics. I made this argument in "Operational Semantics Using the Partiality Monad": http://www.cse.chalmers.se/~nad/publications/danielsson-semantics-partiality-monad.html > What would be even better is to define values semantically: > > data value where > fun : (value -> Delay value) -> value > > But this does not work because value appears in a negative position. > Is there a way to model a denotational description of values in Agda, > perhaps by mimicking one of the constructions of domain theory? In a typed setting you could perhaps define value by recursion on the structure of the types. Benton, Kennedy and Varming used the delay monad to define the lifting construction on ?-CPOs, and they used this to define a denotational semantics for an untyped language: Some Domain Theory and Denotational Semantics in Coq https://doi.org/10.1007/978-3-642-03359-9_10 There is also preliminary work in this direction that uses higher inductive types to define, roughly speaking, the delay monad quotiented by weak bisimilarity: Domain Theory in Type Theory via QIITs Altenkirch, Capriotti and Reus http://types2017.elte.hu/proc.pdf#page=24 Note that higher inductive types are not (yet?) supported directly by Agda. A different approach might be to use step-indexing. An alternative to that would be to use guarded recursive types, which would allow you to define something like value directly. However, I'm not aware of any mature implementations of guarded recursive types. -- /NAD From nad at cse.gu.se Thu Mar 29 18:23:31 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Thu, 29 Mar 2018 18:23:31 +0200 Subject: [Agda] new generalize feature, first version In-Reply-To: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> Message-ID: On 2018-03-29 14:13, Peter Divianszky wrote: > I implemented a first version of forall-generalization, and I would > like to get feedback on it. I've wanted something like this for quite some time now. I sometimes omit implicit argument declarations when presenting Agda code in papers, and I'd prefer to be able to present actual Agda code snippets. > There is a new keyword 'generalize', which accept declarations like > 'field' for records: > > generalize > {? ? ?} : Con > {A B C} : Ty _ > {? ? ?} : Sub _ _ > {t u v} : Tm _ _ Do you also allow ? : Con and ? ? ? : Con? > - avoid accidental generalization > - only the given names are generalized > - the type of generalizable variables are checked > against the given schema, which adds extra safety I wonder what happens if some name like ? is both declared to be generalizable and declared as a regular name (perhaps in another module). Is this treated as an error? > - Name the generalized metavariables also according by the given > generalizable variables. For example, if _1 : Con, then take the > first freely available : Con, where was defined by > 'generalize'. If no more names are available, stop with an error > message. I think that I might prefer more easily predictable types. If we skip the magic underscores, then we get that, at the cost of more verbosity: generalize {? ? ?} : Con {A B} : Ty ? {C} : Ty ? Now it is obvious what the names of the arguments are and how they are ordered: just drop the parts of the telescope that are unused. This also allows you to have regular underscores in the types: generalize {p} : tt ? _ > - What should be the keyword? The variant that I have described is similar to sections in Coq. Perhaps the following notation (which introduces a block) could be used: section {? : Ctxt} ? where This is similar to "module _ where", but with the "drop unused bindings" semantics. > For Agda implementors Would the changes I suggested above make the implementation easier for you? > Plans (not implemented yet) > > - automatic generalization of record fields and constructor types Jesper Cockx and I discussed sections recently, and came to the conclusion that it might be nice to allow sections inside data and record type declarations: data D (A : Set) : Set where ? data P {A : Set} : D A ? D A ? Set where section {x y : D A} where c? : P x x c? : P x y ? P y x ? Note that this isn't quite code that I would like to present in a paper: I would probably often hide the section line. However, hiding the section line is easy when using agda --latex (and could presumably be automated), whereas hacks like the following one are complicated and error prone: \begin{code}[hide] module Hack {x y : D A} where \end{code} \begin{code} data P {A : Set} : D A ? D A ? Set where c? : P x x c? : P x y ? P y x \end{code} \begin{code}[hide] data P {A : Set} : D A ? D A ? Set where c? : ? {x} ? P x x c? : ? {x y} ? P x y ? P y x \end{code} -- /NAD From m.escardo at cs.bham.ac.uk Thu Mar 29 18:47:20 2018 From: m.escardo at cs.bham.ac.uk (Martin Escardo) Date: Thu, 29 Mar 2018 17:47:20 +0100 Subject: [Agda] new generalize feature, first version In-Reply-To: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> Message-ID: I like this, Peter! It should simplify a lot of my code. M. On 29/03/18 13:13, divipp at gmail.com wrote: > Dear Agda users and implementors, > > I implemented a first version of forall-generalization, and I would like > to get feedback on it. > > > For users > --------- > > An example Agda file can be found at > https://github.com/divipp/agda/blob/master/test/Succeed/Generalize.agda > > Suppose that the following Set formers were postulated: > > postulate > ? Con :?????????????????????? Set > ? Ty? : (? : Con) ??????????? Set > ? Sub : (? ? : Con) ????????? Set > ? Tm? : (? : Con)(A : Ty ?) ? Set > > There is a new keyword 'generalize', which accept declarations like > 'field' for records: > > generalize > ? {? ? ?} : Con > ? {A B C} : Ty _ > ? {? ? ?} : Sub _ _ > ? {t u v} : Tm _ _ > > After these 12 declarations > > (1) ?, ? and ? behave as Con-typed terms, but they are automatically > forall-generalized, so, for example > > postulate > ? id? : Sub ? ? > ? _?_ : Sub ? ? ? Sub ? ? ? Sub ? ? > > means > > postulate > ? id? : ? {?} ? Sub ? ? > ? _?_ : ? {? ? ?} ? Sub ? ? ? Sub ? ? ? Sub ? ? > > (2) A, B and C behaves as (Ty _)-typed terms (their types contain a > dedicated metavariable for each of them), > and they are also automatically forall-generalized. > For example, > > postulate > ? _?_ : ? ? ? Ty ? ? Con > ? ?? : Sub ? (? ? A) ? Sub ? ? > > means > ? _?_ : ? ? ? Ty ? ? Con > ? ?? : ?{? ?}{A : Ty ?} ? Sub ? (? ? A) ? Sub ? ? > > (3) The metavariables of generalizable variables are also automatically > generalized. > For example, > > postulate > ? ass : (? ? ?) ? ? ? ? ? (? ? ?) > > means > > postulate > ? ass?? : ?{? ? ? ?}{? : Sub ? ?}{? : Sub ? ?}{? : Sub ? ?} > ??????? ? ((? ? ?) ? ?) ? (? ? (? ? ?)) > > (4) The place and order of generalized variables are fixed by the > following rules: > > A) generalized bindings are placed at the front of the type signature > B) the dependencies between the generalized variables are always respected > C) whenever possible, introduce A before B if A < B > - for non-metas, A < B if A was declared before B with a 'generalize' > keyword > - a meta is smaller than a non-meta > - for metas, A < B if A was declared before B with a 'generalize' > keyword. For example, ? : Sub _1 _2 was declared before ? : Sub _3 _4 so > instances of _1, _2, _3, _4 are ordered according to the indices. > > ---- > > The design goals were the following: > > - make type signatures shorter > ? - the type schema of generalizable variables helps > ??? to make even more guesses by the type system > - avoid accidental generalization > ? - only the given names are generalized > ? - the type of generalizable variables are checked > ??? against the given schema, which adds extra safety > - make generalized type signatures reliable > ? (the ordering, and also the naming, see later) > > Question: > > - What should be the keyword? > ? 'notation' seems also good for me. > ? The idea behind 'notation' is that this language construct > ? makes informal sentences like "Let ? ? ? denote contexts." formal. > > Plans (not implemented yet) > > - automatic generalization of record fields and constructor types > - allow 'generalize' keyword in submodules and between record fields > - make generalizable variables importable? > - Name the generalized metavariables also according by the given > generalizable variables. For example, if _1 : Con, then take the first > freely available : Con, where was defined by 'generalize'. > If no more names are available, stop with an error message. > > You can try the current implementation with my fork: > https://github.com/divipp/agda > > > For Agda implementors > --------------------- > > The main patch is > > https://github.com/divipp/agda/commit/d172d1ade15abe26be19311300f7d640563a6a57 > > > It contains several hacks, I'm not sure that this is the right thing to do: > - metavariables of generalizable variables are solved locally during > typechecking of terms and reverted later > - generalizable variables are stored in the signature as if they were > introduced by 'postulate' > > The Generalize.agda file succeeds when I load it into emacs, but fails > if I call Agda directly. Somehow I could not filter out metavariables > introduced by 'generalize', so Agda tries to serialize them. > > It would great if you could help me to let this feature in. > > > Best Regards, > > Peter > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda -- Martin Escardo http://www.cs.bham.ac.uk/~mhe From Thorsten.Altenkirch at nottingham.ac.uk Thu Mar 29 19:24:16 2018 From: Thorsten.Altenkirch at nottingham.ac.uk (Thorsten Altenkirch) Date: Thu, 29 Mar 2018 17:24:16 +0000 Subject: [Agda] new generalize feature, first version In-Reply-To: References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> Message-ID: I like it too. Also one wouldn't need to doctor agda code anymore to make it publishable (destroying the literate idea in the process). Thorsten ?On 29/03/2018, 17:47, "Agda on behalf of Martin Escardo" wrote: I like this, Peter! It should simplify a lot of my code. M. On 29/03/18 13:13, divipp at gmail.com wrote: > Dear Agda users and implementors, > > I implemented a first version of forall-generalization, and I would like > to get feedback on it. > > > For users > --------- > > An example Agda file can be found at > https://github.com/divipp/agda/blob/master/test/Succeed/Generalize.agda > > Suppose that the following Set formers were postulated: > > postulate > Con : Set > Ty : (? : Con) ? Set > Sub : (? ? : Con) ? Set > Tm : (? : Con)(A : Ty ?) ? Set > > There is a new keyword 'generalize', which accept declarations like > 'field' for records: > > generalize > {? ? ?} : Con > {A B C} : Ty _ > {? ? ?} : Sub _ _ > {t u v} : Tm _ _ > > After these 12 declarations > > (1) ?, ? and ? behave as Con-typed terms, but they are automatically > forall-generalized, so, for example > > postulate > id : Sub ? ? > _?_ : Sub ? ? ? Sub ? ? ? Sub ? ? > > means > > postulate > id : ? {?} ? Sub ? ? > _?_ : ? {? ? ?} ? Sub ? ? ? Sub ? ? ? Sub ? ? > > (2) A, B and C behaves as (Ty _)-typed terms (their types contain a > dedicated metavariable for each of them), > and they are also automatically forall-generalized. > For example, > > postulate > _?_ : ? ? ? Ty ? ? Con > ?? : Sub ? (? ? A) ? Sub ? ? > > means > _?_ : ? ? ? Ty ? ? Con > ?? : ?{? ?}{A : Ty ?} ? Sub ? (? ? A) ? Sub ? ? > > (3) The metavariables of generalizable variables are also automatically > generalized. > For example, > > postulate > ass : (? ? ?) ? ? ? ? ? (? ? ?) > > means > > postulate > ass : ?{? ? ? ?}{? : Sub ? ?}{? : Sub ? ?}{? : Sub ? ?} > ? ((? ? ?) ? ?) ? (? ? (? ? ?)) > > (4) The place and order of generalized variables are fixed by the > following rules: > > A) generalized bindings are placed at the front of the type signature > B) the dependencies between the generalized variables are always respected > C) whenever possible, introduce A before B if A < B > - for non-metas, A < B if A was declared before B with a 'generalize' > keyword > - a meta is smaller than a non-meta > - for metas, A < B if A was declared before B with a 'generalize' > keyword. For example, ? : Sub _1 _2 was declared before ? : Sub _3 _4 so > instances of _1, _2, _3, _4 are ordered according to the indices. > > ---- > > The design goals were the following: > > - make type signatures shorter > - the type schema of generalizable variables helps > to make even more guesses by the type system > - avoid accidental generalization > - only the given names are generalized > - the type of generalizable variables are checked > against the given schema, which adds extra safety > - make generalized type signatures reliable > (the ordering, and also the naming, see later) > > Question: > > - What should be the keyword? > 'notation' seems also good for me. > The idea behind 'notation' is that this language construct > makes informal sentences like "Let ? ? ? denote contexts." formal. > > Plans (not implemented yet) > > - automatic generalization of record fields and constructor types > - allow 'generalize' keyword in submodules and between record fields > - make generalizable variables importable? > - Name the generalized metavariables also according by the given > generalizable variables. For example, if _1 : Con, then take the first > freely available : Con, where was defined by 'generalize'. > If no more names are available, stop with an error message. > > You can try the current implementation with my fork: > https://github.com/divipp/agda > > > For Agda implementors > --------------------- > > The main patch is > > https://github.com/divipp/agda/commit/d172d1ade15abe26be19311300f7d640563a6a57 > > > It contains several hacks, I'm not sure that this is the right thing to do: > - metavariables of generalizable variables are solved locally during > typechecking of terms and reverted later > - generalizable variables are stored in the signature as if they were > introduced by 'postulate' > > The Generalize.agda file succeeds when I load it into emacs, but fails > if I call Agda directly. Somehow I could not filter out metavariables > introduced by 'generalize', so Agda tries to serialize them. > > It would great if you could help me to let this feature in. > > > Best Regards, > > Peter > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda -- Martin Escardo http://www.cs.bham.ac.uk/~mhe _______________________________________________ Agda mailing list Agda at lists.chalmers.se https://lists.chalmers.se/mailman/listinfo/agda This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please contact the sender and delete the email and attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. Email communications with the University of Nottingham may be monitored where permitted by law. From robby at eecs.northwestern.edu Thu Mar 29 19:39:14 2018 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu, 29 Mar 2018 12:39:14 -0500 Subject: [Agda] new generalize feature, first version In-Reply-To: References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> Message-ID: On Thu, Mar 29, 2018 at 12:24 PM, Thorsten Altenkirch wrote: > I like it too. Also one wouldn't need to doctor agda code anymore to make it publishable (destroying the literate idea in the process). Yay! "Run your research" support in Agda! I love it. More generally, while I'm a total newbie compared to most people here, I really do love the design of Agda. It is so ... I don't have a good word for it ... *human*. I love the idea that it gets features that make it easier to show sensible and yet accurate code snippets in papers. Robby From apostolis.xekoukoulotakis at gmail.com Fri Mar 30 00:07:53 2018 From: apostolis.xekoukoulotakis at gmail.com (Apostolis Xekoukoulotakis) Date: Fri, 30 Mar 2018 01:07:53 +0300 Subject: [Agda] new generalize feature, first version In-Reply-To: References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> Message-ID: I agree with Nils points, i think that it is better to return an error if you try to generalize a name that already exists. In idris, where every implicit argument is generalized, you get into problems because of that. You want your function to get a specific value, but instead it assumes that it is an implicit argument. http://docs.idris-lang.org/en/latest/tutorial/typesfuns.html#using-notation (Check the "important section" there) So, if it returns an error in such a case and since generalization are local, this might work. On Thu, Mar 29, 2018 at 8:39 PM, Robby Findler wrote: > On Thu, Mar 29, 2018 at 12:24 PM, Thorsten Altenkirch > wrote: > > I like it too. Also one wouldn't need to doctor agda code anymore to > make it publishable (destroying the literate idea in the process). > > Yay! "Run your research" support in Agda! I love it. > > More generally, while I'm a total newbie compared to most people here, > I really do love the design of Agda. It is so ... I don't have a good > word for it ... *human*. I love the idea that it gets features that > make it easier to show sensible and yet accurate code snippets in > papers. > > Robby > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -------------- next part -------------- An HTML attachment was scrubbed... URL: From divipp at gmail.com Fri Mar 30 10:25:42 2018 From: divipp at gmail.com (Peter Divianszky) Date: Fri, 30 Mar 2018 10:25:42 +0200 Subject: [Agda] new generalize feature, first version In-Reply-To: References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> Message-ID: <2a29ae73-116d-13d3-ae4a-c9b834e6b2b0@gmail.com> > Do you also allow ? : Con and ? ? ? : Con? Yes, it is also allowed. For example, generalize A {B .C} : Set will generalize A as non-implicit, B as implicit and C as implicit an hidden. 'generalize' allows anything which is allowed after a 'field' keyword. > I wonder what happens if some name like ? is both declared to be > generalizable and declared as a regular name (perhaps in another > module). Is this treated as an error? Yes, this is treated as an error. 'generalize' introduce new definitions into the scope like 'postulate'. > I think that I might prefer more easily predictable types. If we skip > the magic underscores, then we get that, at the cost of more verbosity: > > generalize > {? ? ?} : Con > {A B} : Ty ? > {C} : Ty ? > > Now it is obvious what the names of the arguments are and how they are > ordered: just drop the parts of the telescope that are unused. > > This also allows you to have regular underscores in the types: > > generalize > {p} : tt ? _ The implementation does exactly this. Your examples are already valid. Both recursive generalize (like in your first example) and generalize with meta (like in your second example) is valid. About sections: I am not familiar with sections, can you point to a documentation? Are the following statements true for sections? (they are true for 'generalize') 1) if you generalize over A, B and C but you use only A then only A is added to the signature 2) metavariables are solved on-demand for example, A and B is generalized, both of type (Ty _) then '_' may or may not coincide or refer to each-other, depending on the usage of A and B in the type signature 3) unsolved metavariables can be generalized (in a controlled way) On 2018-03-29 18:23, Nils Anders Danielsson wrote: > On 2018-03-29 14:13, Peter Divianszky wrote: >> I implemented a first version of forall-generalization, and I would >> like to get feedback on it. > > I've wanted something like this for quite some time now. I sometimes > omit implicit argument declarations when presenting Agda code in papers, > and I'd prefer to be able to present actual Agda code snippets. > >> There is a new keyword 'generalize', which accept declarations like >> 'field' for records: >> >> generalize >> ?? {? ? ?} : Con >> ?? {A B C} : Ty _ >> ?? {? ? ?} : Sub _ _ >> ?? {t u v} : Tm _ _ > > Do you also allow ? : Con and ? ? ? : Con? > >> - avoid accidental generalization >> ?? - only the given names are generalized >> ?? - the type of generalizable variables are checked >> ???? against the given schema, which adds extra safety > > I wonder what happens if some name like ? is both declared to be > generalizable and declared as a regular name (perhaps in another > module). Is this treated as an error? > >> - Name the generalized metavariables also according by the given >> ? generalizable variables. For example, if _1 : Con, then take the >> ? first freely available : Con, where was defined by >> ? 'generalize'. If no more names are available, stop with an error >> ? message. > > I think that I might prefer more easily predictable types. If we skip > the magic underscores, then we get that, at the cost of more verbosity: > > ? generalize > ??? {? ? ?} : Con > ??? {A B}?? : Ty ? > ??? {C}???? : Ty ? > > Now it is obvious what the names of the arguments are and how they are > ordered: just drop the parts of the telescope that are unused. > > This also allows you to have regular underscores in the types: > > ? generalize > ??? {p} : tt ? _ > >> - What should be the keyword? > > The variant that I have described is similar to sections in Coq. Perhaps > the following notation (which introduces a block) could be used: > > ? section {? : Ctxt} ? where > > This is similar to "module _ where", but with the "drop > unused bindings" semantics. > >> For Agda implementors > > Would the changes I suggested above make the implementation easier for > you? > >> Plans (not implemented yet) >> >> - automatic generalization of record fields and constructor types > > Jesper Cockx and I discussed sections recently, and came to the > conclusion that it might be nice to allow sections inside data and > record type declarations: > > ? data D (A : Set) : Set where > ??? ? > > ? data P {A : Set} : D A ? D A ? Set where > ??? section {x y : D A} where > ????? c? : P x x > ????? c? : P x y ? P y x > ????? ? > > Note that this isn't quite code that I would like to present in a paper: > I would probably often hide the section line. However, hiding the > section line is easy when using agda --latex (and could presumably be > automated), whereas hacks like the following one are complicated and > error prone: > > ? \begin{code}[hide] > ??? module Hack {x y : D A} where > ? \end{code} > ? \begin{code} > ????? data P {A : Set} : D A ? D A ? Set where > ??????? c? : P x x > ??????? c? : P x y ? P y x > ? \end{code} > ? \begin{code}[hide] > ??? data P {A : Set} : D A ? D A ? Set where > ????? c? : ? {x} ? P x x > ????? c? : ? {x y} ? P x y ? P y x > ? \end{code} > From divipp at gmail.com Fri Mar 30 10:34:04 2018 From: divipp at gmail.com (Peter Divianszky) Date: Fri, 30 Mar 2018 10:34:04 +0200 Subject: [Agda] new generalize feature, first version In-Reply-To: References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> Message-ID: <078856df-de08-bdbe-bd6b-a6f3dbc7973d@gmail.com> It's great that you like this feature. My motivation was that now I am working with Ambrus Kaposi on type-theory-in-type-theory, and I have to formalize his work in Agda. A little part of the basics, without and with forall-generalization (the second covers more type formers): https://bitbucket.org/akaposi/tt-in-tt/src/6f71db610e9d27147abcf743cbe1731ed5c9ca0a/TTR.agda?at=master&fileviewer=file-view-default https://github.com/divipp/agda/blob/master/test/Succeed/Generalize.agda If you look at the type of ,? for example, you will notice the difference. By the way, I fixed an error in the implementation and now all Agda tests are OK including the new one. These tasks are also ready now: - automatic generalization of record fields and constructor types - allow 'generalize' keyword in submodules Best, Peter On 2018-03-29 19:39, Robby Findler wrote: > On Thu, Mar 29, 2018 at 12:24 PM, Thorsten Altenkirch > wrote: >> I like it too. Also one wouldn't need to doctor agda code anymore to make it publishable (destroying the literate idea in the process). > > Yay! "Run your research" support in Agda! I love it. > > More generally, while I'm a total newbie compared to most people here, > I really do love the design of Agda. It is so ... I don't have a good > word for it ... *human*. I love the idea that it gets features that > make it easier to show sensible and yet accurate code snippets in > papers. > > Robby > From mail at joachim-breitner.de Fri Mar 30 16:24:04 2018 From: mail at joachim-breitner.de (Joachim Breitner) Date: Fri, 30 Mar 2018 10:24:04 -0400 Subject: [Agda] new generalize feature, first version In-Reply-To: References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> Message-ID: <1522419844.19454.5.camel@joachim-breitner.de> Hi, Am Donnerstag, den 29.03.2018, 18:23 +0200 schrieb Nils Anders Danielsson: > > - What should be the keyword? > > The variant that I have described is similar to sections in Coq. Perhaps > the following notation (which introduces a block) could be used: > > section {? : Ctxt} ? where > > This is similar to "module _ where", but with the "drop > unused bindings" semantics. a question from the sidelines: There seems to be a crucial difference to Coq?s section feature, if I am not mistaken: In Coq, you write Section Foo. Context {x : nat}. Definition bar := x + 1. Definition baz := bar + 2. End Foo. Definition foo := bar 1 + 2. So within the section, x is not generalized, and bar has type nat, but outside the section, bar has type (nat -> nat). This forbids calling bar within the Section with a different parameter: Section Foo. Context {x : nat}. Definition bar := x + 1. Definition baz := bar 2. (* type error *) End Foo. If I read Peter?s description of his `generalize` feature correctly, then this generalizes the variables _in each type signature_, and you can call bar from baz with different arguments for the generalized parameter. If I read this correctly, then it would maybe more confusing than helpful to call it section. Cheers, Joachim -- Joachim Breitner mail at joachim-breitner.de http://www.joachim-breitner.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part URL: From jannis at limperg.de Fri Mar 30 17:17:39 2018 From: jannis at limperg.de (Jannis Limperg) Date: Fri, 30 Mar 2018 17:17:39 +0200 Subject: [Agda] new generalize feature, first version In-Reply-To: <1522419844.19454.5.camel@joachim-breitner.de> References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> <1522419844.19454.5.camel@joachim-breitner.de> Message-ID: Agda's unnamed modules are closer to Coq's sections than this new feature, working pretty much exactly like Joachim describes. Hence, I would also find 'sections' confusing. For the same reason, I don't like 'notation' too much, since it invokes Coq's notation feature, which is Agda's 'syntax' on steroids. Of course, it is not exactly an absolute imperative that Agda stay consistent with Coq's usage of these terms, but it's something to consider. Peter's new feature, if I understand it correctly, is closest to Coq's implicit generalization [1, Section 2.7.19] (which is frequently handy, so add my voice to the choir of fans of this feature.) To summarise Coq's design: - You can declare variable names as generalizable using `Generalizable Variables x y z` or `Generalizable All Variables`. This roughly corresponds to Peter's `generalize` declaration. - Contrary to Peter's design, generalization only takes effect if the generalizable variables are mentioned in a special binder that enables generalization, of the form `(P : n = n) or `{P : n = n} (the backtick is part of the binder). Given the above binders, n would be generalized if it was previously declared generalizable. I have no strong opinion on requiring this additional step; perhaps one could ask on Coq-Club why the Coq implementors chose to do so. An example: Generalizable Variables A. Definition id `(x : A) : A := x. About id. (* id : forall A : Type, A -> A Argument A is implicit and maximally inserted [...] *) [1] https://coq.inria.fr/refman/gallina-ext.html#Implicit%20Arguments From nad at cse.gu.se Fri Mar 30 18:36:59 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Fri, 30 Mar 2018 18:36:59 +0200 Subject: [Agda] new generalize feature, first version In-Reply-To: <1522419844.19454.5.camel@joachim-breitner.de> References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> <1522419844.19454.5.camel@joachim-breitner.de> Message-ID: <0bdab6b0-dfba-f650-bfc7-d305dab059f4@cse.gu.se> On 2018-03-30 16:24, Joachim Breitner wrote: > If I read Peter?s description of his `generalize` feature correctly, > then this generalizes the variables _in each type signature_, and you > can call bar from baz with different arguments for the generalized > parameter. > > If I read this correctly, then it would maybe more confusing than > helpful to call it section. That's a good point. -- /NAD From nad at cse.gu.se Fri Mar 30 19:19:46 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Fri, 30 Mar 2018 19:19:46 +0200 Subject: [Agda] new generalize feature, first version In-Reply-To: <2a29ae73-116d-13d3-ae4a-c9b834e6b2b0@gmail.com> References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> <2a29ae73-116d-13d3-ae4a-c9b834e6b2b0@gmail.com> Message-ID: <86642717-e342-be8a-a9f6-70208d18b284@cse.gu.se> On 2018-03-30 10:25, Peter Divianszky wrote: > For example, > > generalize A {B .C} : Set > > will generalize A as non-implicit, B as implicit and C as implicit an hidden. Hidden? Do you mean irrelevant? > > I think that I might prefer more easily predictable types. If we skip > > the magic underscores, then we get that, at the cost of more verbosity: > > > > generalize > > {? ? ?} : Con > > {A B} : Ty ? > > {C} : Ty ? > > > > Now it is obvious what the names of the arguments are and how they are > > ordered: just drop the parts of the telescope that are unused. > > > > This also allows you to have regular underscores in the types: > > > > generalize > > {p} : tt ? _ > > The implementation does exactly this. > Your examples are already valid. Both recursive generalize (like in > your first example) and generalize with meta (like in your second > example) is valid. What does the following code expand to? generalize {x} : ? p : tt ? _ postulate foo : p ? p Is it something like postulate foo : {x : ?} (p : tt ? x) ? p ? p or postulate foo : (p : tt ? tt) ? p ? p? Anyway, my main point was that I want it to be easy to understand what the type of a definition is. The names of implicit arguments matter, as does the order of arguments. When we have discussed this kind of feature in the past some issues have come up: * Is the order of the arguments unknown (or hard to predict)? In that case it should (IMO) only be possible to give them by name, not by position. * Are the names automatically generated? In that case it should (IMO) not be possible to give the arguments by name. If you have arguments that can neither be given by position nor by name, then this can potentially lead to usability issues. > I am not familiar with sections, can you point to a documentation? https://coq.inria.fr/refman/gallina-ext.html#Section -- /NAD From wadler at inf.ed.ac.uk Fri Mar 30 20:36:21 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Fri, 30 Mar 2018 15:36:21 -0300 Subject: [Agda] Operational and Denotational, Typed and Untyped Lambda Calculus In-Reply-To: <0303b315-dd64-9bac-e77c-1ea0e0330d6d@cse.gu.se> References: <0303b315-dd64-9bac-e77c-1ea0e0330d6d@cse.gu.se> Message-ID: Thanks very much, Nils! No favourites from anyone else? That doesn't seem much like this list! Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 29 March 2018 at 12:19, Nils Anders Danielsson wrote: > On 2018-03-29 14:31, Philip Wadler wrote: > >> My favourite denotational untyped solution so far is due to Nils Anders >> Danielsson: >> >> http://www.cse.chalmers.se/~nad/listings/partiality-monad/La >> mbda.Simplified.Delay-monad.Interpreter.html >> >> It defines values as closures, a syntactic approach. >> > > This definition is similar to a standard big-step operational semantics, > and it is not defined compositionally (i.e. using recursion on the > structure of terms). Hence I see this as an operational, rather than > denotational, semantics. I made this argument in "Operational Semantics > Using the Partiality Monad": > > http://www.cse.chalmers.se/~nad/publications/danielsson-sema > ntics-partiality-monad.html > > What would be even better is to define values semantically: >> >> data value where >> fun : (value -> Delay value) -> value >> >> But this does not work because value appears in a negative position. >> Is there a way to model a denotational description of values in Agda, >> perhaps by mimicking one of the constructions of domain theory? >> > > In a typed setting you could perhaps define value by recursion on the > structure of the types. > > Benton, Kennedy and Varming used the delay monad to define the lifting > construction on ?-CPOs, and they used this to define a denotational > semantics for an untyped language: > > Some Domain Theory and Denotational Semantics in Coq > https://doi.org/10.1007/978-3-642-03359-9_10 > > There is also preliminary work in this direction that uses higher > inductive types to define, roughly speaking, the delay monad quotiented > by weak bisimilarity: > > Domain Theory in Type Theory via QIITs > Altenkirch, Capriotti and Reus > http://types2017.elte.hu/proc.pdf#page=24 > > Note that higher inductive types are not (yet?) supported directly by > Agda. > > A different approach might be to use step-indexing. An alternative to > that would be to use guarded recursive types, which would allow you to > define something like value directly. However, I'm not aware of any > mature implementations of guarded recursive types. > > -- > /NAD > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From larrytheliquid at gmail.com Fri Mar 30 21:28:43 2018 From: larrytheliquid at gmail.com (Larrytheliquid) Date: Fri, 30 Mar 2018 14:28:43 -0500 Subject: [Agda] Operational and Denotational, Typed and Untyped Lambda Calculus In-Reply-To: References: <0303b315-dd64-9bac-e77c-1ea0e0330d6d@cse.gu.se> Message-ID: I like the big-step normalization approach in terms of OPE's (order preserving embeddings) and environment closures used in James Chapman's thesis: https://jmchapman.github.io/papers/tait2.pdf Chantal and Thorsten's Agda version of using hereditary substitution via a canonical term syntax is also great, but it is more difficult to scale to additional typing constructs: http://www.cs.nott.ac.uk/~psztxa/publ/msfp10.pdf I'm also fond of some work I did extending James' work to define weak-head normal forms independently of expressions (by embedding other weak-head normal forms in closures, rather than expressions, and then defining the semantics as a version of a hereditary substituiton-based environment machine). Here is the code, which uses a normalization function as the semantics: https://github.com/larrytheliquid/sbe/blob/master/src/SBE/Intrinsic.agda And a technical report explaining it: http://www.larrytheliquid.com/drafts/sbe.pdf I also made a more serious version, closer to what appears in James' thesis, where the semantics is presented relationally + logical relations proofs, here is the code but I haven't had a chance to write about it: https://gist.github.com/larrytheliquid/6e7e9535d8f85f7a002f40f3d196cdc6 There is also a more efficient version that lazily computes conversion of weak-head normal forms by only expanding closures when necessary: https://gist.github.com/larrytheliquid/b2a9171fea3aa4e461ef3181f8ca6889 The nice thing about this approach is that you can define weak-head normal forms to be your "core" language, and then expose all the primitives in terms of a much simpler LF-like expression "surface" language with only the function type intro + elim rules (then you expose the intro + elim rules of other types via an initial environment, which may use your core language constructs). On Fri, Mar 30, 2018 at 1:36 PM, Philip Wadler wrote: > Thanks very much, Nils! > > No favourites from anyone else? That doesn't seem much like this list! > > Cheers, -- P > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > On 29 March 2018 at 12:19, Nils Anders Danielsson wrote: > >> On 2018-03-29 14:31, Philip Wadler wrote: >> >>> My favourite denotational untyped solution so far is due to Nils Anders >>> Danielsson: >>> >>> http://www.cse.chalmers.se/~nad/listings/partiality-monad/La >>> mbda.Simplified.Delay-monad.Interpreter.html >>> >>> It defines values as closures, a syntactic approach. >>> >> >> This definition is similar to a standard big-step operational semantics, >> and it is not defined compositionally (i.e. using recursion on the >> structure of terms). Hence I see this as an operational, rather than >> denotational, semantics. I made this argument in "Operational Semantics >> Using the Partiality Monad": >> >> http://www.cse.chalmers.se/~nad/publications/danielsson-sema >> ntics-partiality-monad.html >> >> What would be even better is to define values semantically: >>> >>> data value where >>> fun : (value -> Delay value) -> value >>> >>> But this does not work because value appears in a negative position. >>> Is there a way to model a denotational description of values in Agda, >>> perhaps by mimicking one of the constructions of domain theory? >>> >> >> In a typed setting you could perhaps define value by recursion on the >> structure of the types. >> >> Benton, Kennedy and Varming used the delay monad to define the lifting >> construction on ?-CPOs, and they used this to define a denotational >> semantics for an untyped language: >> >> Some Domain Theory and Denotational Semantics in Coq >> https://doi.org/10.1007/978-3-642-03359-9_10 >> >> There is also preliminary work in this direction that uses higher >> inductive types to define, roughly speaking, the delay monad quotiented >> by weak bisimilarity: >> >> Domain Theory in Type Theory via QIITs >> Altenkirch, Capriotti and Reus >> http://types2017.elte.hu/proc.pdf#page=24 >> >> Note that higher inductive types are not (yet?) supported directly by >> Agda. >> >> A different approach might be to use step-indexing. An alternative to >> that would be to use guarded recursive types, which would allow you to >> define something like value directly. However, I'm not aware of any >> mature implementations of guarded recursive types. >> >> -- >> /NAD >> >> > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -- Respectfully, Larry Diehl -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.escardo at cs.bham.ac.uk Fri Mar 30 21:35:13 2018 From: m.escardo at cs.bham.ac.uk (Martin Escardo) Date: Fri, 30 Mar 2018 20:35:13 +0100 Subject: [Agda] Operational and Denotational, Typed and Untyped Lambda Calculus In-Reply-To: References: <0303b315-dd64-9bac-e77c-1ea0e0330d6d@cse.gu.se> Message-ID: > No favourites from anyone else? That doesn't seem much like this list! (1) Of course, you can consider the type-theoretic incarnation of the "set-theoretic model" of Goedel's system T (simply typed lambda calculus with a base type for natural numbers, as you know). http://www.cs.bham.ac.uk/~mhe/dialogue/dialogue.pdf This also considers a "dialogue" "forcing" model of system T, and then a logical relation between this and the set-theoretical model to prove (in Agda) that all system T definable functions (N->N)->N of the set-theoretical model are continuous. The paper quoted above works with the SKI-combinatory version of system T, for simplicity of presentation. However, further accompanying Agda files consider the lambda-calculus version, and more: http://www.cs.bham.ac.uk/~mhe/dialogue/ (2) Again with system T, we can consider models in which all functions (of all types) are continuous (rather than just the definable ones of type (N->N)->N.) This is done by my former PhD student Chuangjie Xu. https://cj-xu.github.io/ (3) Following from (2), this is actually a manifestation of the Kleene-Kreisel continuous functionals from the 1950's, used at that time (and to this day) to model computation with higher types. This is in the above Agda code (2) and also in the paper http://www.cs.bham.ac.uk/~mhe/papers/kleene-kreisel.pdf (4) This hasn't been implemented in Agda yet, but it should: http://www.cs.bham.ac.uk/~mhe/papers/partial-elements-and-recursion.pdf And actually it needs a univalent extension of type theory, such as cubical Agda: https://agda.readthedocs.io/en/latest/language/cubical.html This last (4) is more in the vein of Dana Scott's ideas, but constructively performed (following the lead of many people, including Rosolini, Hyland, among others). Best wishes, Martin From divipp at gmail.com Fri Mar 30 22:27:36 2018 From: divipp at gmail.com (Peter Divianszky) Date: Fri, 30 Mar 2018 22:27:36 +0200 Subject: [Agda] new generalize feature, first version In-Reply-To: <86642717-e342-be8a-a9f6-70208d18b284@cse.gu.se> References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> <2a29ae73-116d-13d3-ae4a-c9b834e6b2b0@gmail.com> <86642717-e342-be8a-a9f6-70208d18b284@cse.gu.se> Message-ID: <8e215343-6423-7b72-dcba-bbcbc5bd61f4@gmail.com> >> For example, >> >> ?? generalize A {B .C} : Set >> >> will generalize A as non-implicit, B as implicit and C as implicit an >> hidden. > > Hidden? Do you mean irrelevant? I mean irrelevant, not hidden, you guessed it right. > What does the following code expand to? > > ? generalize > ??? {x} : ? > ??? p?? : tt ? _ > > ? postulate > ??? foo : p ? p > > Is it something like > > ? postulate > ??? foo : {x : ?} (p : tt ? x) ? p ? p > > or > > ? postulate > ??? foo : (p : tt ? tt) ? p ? p? The first one. I typed in {-# OPTIONS --generalize #-} data _?_ {A : Set}(x : A) : (x : A) ? Set where refl : x ? x data ? : Set where tt : ? generalize {x} : ? p : tt ? _ postulate foo : p ? p and Agda derived the following type for (foo): {x = x? : ?} (p? : tt ? x?) ? p? ? p? I guess the indices were added to make names less ambiguous because both x and p is in scope. I'll try to improve the result to be instead {x : ?} (p : tt ? x) ? p ? p Note that I had to add the name 'x' in (x : A) ? Set in the type of _?_ to achieve this naming. > Anyway, my main point was that I want it to be easy to understand what > the type of a definition is. The names of implicit arguments matter, as > does the order of arguments. When we have discussed this kind of feature > in the past some issues have come up: > > * Is the order of the arguments unknown (or hard to predict)? In that > ? case it should (IMO) only be possible to give them by name, not by > ? position. > > * Are the names automatically generated? In that case it should (IMO) > ? not be possible to give the arguments by name. > > If you have arguments that can neither be given by position nor by name, > then this can potentially lead to usability issues. The order of arguments are easy to predict. If you have generalize A B : Set then postulate f :: A ? B ? B means postulate f :: (A B : Set) ? A ? B ? B and postulate f :: B ? A ? A means postulate f :: (A B : Set) ? B ? A ? A The same holds for hidden arguments: If you have generalize A B : T _ then it means generalize A : T _ B : T _ so you have an ordering on metas too. The given order is respected as far as possible. The exact algorithm which decides the ordering given the prior ordering and the dependencies is easy to understand. See "smallest-numbered available vertex first" topological sorting at https://en.wikipedia.org/wiki/Topological_sorting#Examples I also have an idea how to give predictable, non-automatically-generated names to hidden arguments, but that is not implemented yet. So both of your wishes can be fulfilled, I hope. On 2018-03-30 19:19, Nils Anders Danielsson wrote: > On 2018-03-30 10:25, Peter Divianszky wrote: >> For example, >> >> generalize A {B .C} : Set >> >> will generalize A as non-implicit, B as implicit and C as implicit an >> hidden. > > Hidden? Do you mean irrelevant? > >> > I think that I might prefer more easily predictable types. If we skip >> > the magic underscores, then we get that, at the cost of more >> verbosity: >> > >> > generalize >> > {? ? ?} : Con >> > {A B} : Ty ? >> > {C} : Ty ? >> > >> > Now it is obvious what the names of the arguments are and how they are >> > ordered: just drop the parts of the telescope that are unused. >> > >> > This also allows you to have regular underscores in the types: >> > >> > generalize >> > {p} : tt ? _ >> >> The implementation does exactly this. >> Your examples are already valid. Both recursive generalize (like in >> your first example) and generalize with meta (like in your second >> example) is valid. > > What does the following code expand to? > > generalize > {x} : ? > p : tt ? _ > > postulate > foo : p ? p > > Is it something like > > postulate > foo : {x : ?} (p : tt ? x) ? p ? p > > or > > postulate > foo : (p : tt ? tt) ? p ? p? > > Anyway, my main point was that I want it to be easy to understand what > the type of a definition is. The names of implicit arguments matter, as > does the order of arguments. When we have discussed this kind of feature > in the past some issues have come up: > > * Is the order of the arguments unknown (or hard to predict)? In that > case it should (IMO) only be possible to give them by name, not by > position. > > * Are the names automatically generated? In that case it should (IMO) > not be possible to give the arguments by name. > > If you have arguments that can neither be given by position nor by name, > then this can potentially lead to usability issues. > >> I am not familiar with sections, can you point to a documentation? > > https://coq.inria.fr/refman/gallina-ext.html#Section > From nad at cse.gu.se Fri Mar 30 22:55:36 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Fri, 30 Mar 2018 22:55:36 +0200 Subject: [Agda] new generalize feature, first version In-Reply-To: <8e215343-6423-7b72-dcba-bbcbc5bd61f4@gmail.com> References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> <2a29ae73-116d-13d3-ae4a-c9b834e6b2b0@gmail.com> <86642717-e342-be8a-a9f6-70208d18b284@cse.gu.se> <8e215343-6423-7b72-dcba-bbcbc5bd61f4@gmail.com> Message-ID: <3be8b6a2-a557-cf57-8b02-b9f6920d65d2@cse.gu.se> On 2018-03-30 22:27, Peter Divianszky wrote: >> What does the following code expand to? >> >> [...] > > The first one. This means that meta-variables do not have their usual meaning under generalize. Perhaps it would be better to use a different notation for the magic meta-variables. > {x = x? : ?} (p? : tt ? x?) ? p? ? p? > > [...] > > {x : ?} (p : tt ? x) ? p ? p These two types are definitionally equal. > I also have an idea how to give predictable, > non-automatically-generated names to hidden arguments, but that is not > implemented yet. So both of your wishes can be fulfilled, I hope. One property I did not bring up was that of stability. I hope that we will not end up in a situation in which one can break lots of code by, say, adding one variable name to a generalize block. -- /NAD From divipp at gmail.com Fri Mar 30 23:46:01 2018 From: divipp at gmail.com (Peter Divianszky) Date: Fri, 30 Mar 2018 23:46:01 +0200 Subject: [Agda] new generalize feature, first version In-Reply-To: <86642717-e342-be8a-a9f6-70208d18b284@cse.gu.se> References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> <2a29ae73-116d-13d3-ae4a-c9b834e6b2b0@gmail.com> <86642717-e342-be8a-a9f6-70208d18b284@cse.gu.se> Message-ID: <3633fca3-5c73-d382-f46d-927913aa9aa9@gmail.com> >> I am not familiar with sections, can you point to a documentation? > > https://coq.inria.fr/refman/gallina-ext.html#Section I translated the given Coq example to Agda with 'generalize'. First try: {-# OPTIONS --generalize #-} data nat : Set where Z : nat S : nat ? nat _+_ : nat ? nat ? nat Z + m = m S n + m = S (n + m) -- actual example generalize x y : nat y' = y x' = S x x'' = x' + y' Agda complains that 'Generalizable variable y is not supported here' and points to the rhs of y' = y. This is because forall-generalize is supported only in type signatures. (It would be a separate feature to do something meaningful in the rhs of a definition.) Next try, trying to get as close as possible: {-# OPTIONS --generalize #-} data nat : Set where Z : nat S : nat ? nat _+_ : nat ? nat ? nat Z + m = m S n + m = S (n + m) record Sing {A : Set}(a : A) : Set where field sing : A open Sing -- actual example generalize x y : nat postulate y' : Sing y -- ^ like in Coq x' : Sing (S x) -- ^ like in Coq x'' : Sing (sing (x' x) + sing (y' y)) -- ^ unlike in Coq -- x'' : Sing (sing x' + sing y') {- derived types y' : (y? : nat) ? Sing y? -- ^ like in Coq x' : (x? : nat) ? Sing (S x?) -- ^ like in Coq x'' : (x? y? : nat) ? Sing (sing (x' x?) + sing (y' y?)) -- ^ unlike in Coq -- x'' : (x y : nat) ? Sing (sing (x' x) + y) -} The main difference is, that x' should be applied to x, unlike in Coq. As Joachim pointed out in another mail, 'this generalizes the variables _in each type signature_' unlike section which generalize at the end, once. So I also conclude that section is a different construct. On 2018-03-30 19:19, Nils Anders Danielsson wrote: > On 2018-03-30 10:25, Peter Divianszky wrote: >> For example, >> >> ?? generalize A {B .C} : Set >> >> will generalize A as non-implicit, B as implicit and C as implicit an >> hidden. > > Hidden? Do you mean irrelevant? > >> ?> I think that I might prefer more easily predictable types. If we skip >> ?> the magic underscores, then we get that, at the cost of more >> verbosity: >> ?> >> ?>??? generalize >> ?>????? {? ? ?} : Con >> ?>????? {A B}?? : Ty ? >> ?>????? {C}???? : Ty ? >> ?> >> ?> Now it is obvious what the names of the arguments are and how they are >> ?> ordered: just drop the parts of the telescope that are unused. >> ?> >> ?> This also allows you to have regular underscores in the types: >> ?> >> ?>??? generalize >> ?>????? {p} : tt ? _ >> >> The implementation does exactly this. >> Your examples are already valid. Both recursive generalize (like in >> your first example) and generalize with meta (like in your second >> example) is valid. > > What does the following code expand to? > > ? generalize > ??? {x} : ? > ??? p?? : tt ? _ > > ? postulate > ??? foo : p ? p > > Is it something like > > ? postulate > ??? foo : {x : ?} (p : tt ? x) ? p ? p > > or > > ? postulate > ??? foo : (p : tt ? tt) ? p ? p? > > Anyway, my main point was that I want it to be easy to understand what > the type of a definition is. The names of implicit arguments matter, as > does the order of arguments. When we have discussed this kind of feature > in the past some issues have come up: > > * Is the order of the arguments unknown (or hard to predict)? In that > ? case it should (IMO) only be possible to give them by name, not by > ? position. > > * Are the names automatically generated? In that case it should (IMO) > ? not be possible to give the arguments by name. > > If you have arguments that can neither be given by position nor by name, > then this can potentially lead to usability issues. > >> I am not familiar with sections, can you point to a documentation? > > https://coq.inria.fr/refman/gallina-ext.html#Section > From divipp at gmail.com Sat Mar 31 00:00:35 2018 From: divipp at gmail.com (Peter Divianszky) Date: Sat, 31 Mar 2018 00:00:35 +0200 Subject: [Agda] new generalize feature, first version In-Reply-To: <3be8b6a2-a557-cf57-8b02-b9f6920d65d2@cse.gu.se> References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> <2a29ae73-116d-13d3-ae4a-c9b834e6b2b0@gmail.com> <86642717-e342-be8a-a9f6-70208d18b284@cse.gu.se> <8e215343-6423-7b72-dcba-bbcbc5bd61f4@gmail.com> <3be8b6a2-a557-cf57-8b02-b9f6920d65d2@cse.gu.se> Message-ID: <3154581f-6d27-565a-0bb8-67327bdd3aa4@gmail.com> >>> [...] >> >> The first one. > > This means that meta-variables do not have their usual meaning under > generalize. Perhaps it would be better to use a different notation for > the magic meta-variables. All right, the syntax can be changed to be less confusing. >> {x = x? : ?} (p? : tt ? x?) ? p? ? p? >> >> [...] >> >> {x : ?} (p : tt ? x) ? p ? p > > These two types are definitionally equal. Right, I just wanted to be precise with naming. The former is the current type signature and the latter is the desired one. > One property I did not bring up was that of stability. I hope that we > will not end up in a situation in which one can break lots of code by, > say, adding one variable name to a generalize block. My idea would be stable in this sense. Adding a new variable to a generalize block would be conservative, so more programs would be accepted and previous code would not change. The idea is that type checking would halt with an error if not enough name suggestions were available. If you don't like the current syntax then it could be changed in a way which also make my idea easier to implement, like generalize p : tt ? _{x y z} Here we give name suggestions to generalized metas and at the same time one can notice that it is not like an ordinary meta. A bit less clean though. On 2018-03-30 22:55, Nils Anders Danielsson wrote: > On 2018-03-30 22:27, Peter Divianszky wrote: >>> What does the following code expand to? >>> >>> [...] >> >> The first one. > > This means that meta-variables do not have their usual meaning under > generalize. Perhaps it would be better to use a different notation for > the magic meta-variables. > >> ???? {x = x? : ?} (p? : tt ? x?) ? p? ? p? >> >> [...] >> >> ???? {x : ?} (p : tt ? x) ? p ? p > > These two types are definitionally equal. > >> I also have an idea how to give predictable, >> non-automatically-generated names to hidden arguments, but that is not >> implemented yet. So both of your wishes can be fulfilled, I hope. > > One property I did not bring up was that of stability. I hope that we > will not end up in a situation in which one can break lots of code by, > say, adding one variable name to a generalize block. > From nad at cse.gu.se Sat Mar 31 11:58:01 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Sat, 31 Mar 2018 11:58:01 +0200 Subject: [Agda] new generalize feature, first version In-Reply-To: <3154581f-6d27-565a-0bb8-67327bdd3aa4@gmail.com> References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> <2a29ae73-116d-13d3-ae4a-c9b834e6b2b0@gmail.com> <86642717-e342-be8a-a9f6-70208d18b284@cse.gu.se> <8e215343-6423-7b72-dcba-bbcbc5bd61f4@gmail.com> <3be8b6a2-a557-cf57-8b02-b9f6920d65d2@cse.gu.se> <3154581f-6d27-565a-0bb8-67327bdd3aa4@gmail.com> Message-ID: <2eaef015-22e6-7e58-f1e3-1d77a21817a8@cse.gu.se> On 2018-03-31 00:00, Peter Divianszky wrote: > >> {x = x? : ?} (p? : tt ? x?) ? p? ? p? > >> > >> [...] > >> > >> {x : ?} (p : tt ? x) ? p ? p > > > > These two types are definitionally equal. > > Right, I just wanted to be precise with naming. > The former is the current type signature and the latter is the desired one. There is no difference between these type signatures, even if you take the names of implicit arguments into account. Agda sometimes prints type signatures using the {x = y : A} notation in order to avoid issues related to shadowing. Here is one example: F : (Set ? Set) ? Set? F G = {A : Set} ? G A T : Set? T = {A : Set} ? F (? X ? A ? X) How should the normal form of T be printed? Agda prints {A : Set} {A = A? : Set} ? A ? A?. Note that this notation is not parsed by Agda. > > One property I did not bring up was that of stability. I hope that we > > will not end up in a situation in which one can break lots of code by, > > say, adding one variable name to a generalize block. > > My idea would be stable in this sense. You presented the following example in your first message: > For example, > > postulate > ass : (? ? ?) ? ? ? ? ? (? ? ?) > > means > > postulate > ass : ?{? ? ? ?}{? : Sub ? ?}{? : Sub ? ?}{? : Sub ? ?} > ? ((? ? ?) ? ?) ? (? ? (? ? ?)) This suggested to me that if I replaced {? ? ?} : Con with {? whatever ? ?} : Con, then the type signature would change. However, I see now that your example uses the names ? and ? which are not listed in any generalize block. I tried your example myself, and this is what you actually end up with: {? = ?? : Con} {? = ?? : Con} {? = ?? : Con} {? = ?? : Con} {? = ?? : Sub ?? ??} {? = ?? : Sub ?? ??} {? = ?? : Sub ?? ??} ? ((?? ? ??) ? ??) ? (?? ? (?? ? ??)) The telescope contains /three/ implicit arguments all named ?. (I'm not sure why the {x = y : A} notation is used for all the other implicit arguments. My guess would be that it has something to do with the implementation of generalize.) If you perform the change that I mentioned above, then you still end up with the type signature above. Thus the type signature is stable under this particular kind of change. After some experimentation I managed to figure out where the names in the type signature come from. If I replace Sub : (? ? : Con) ? Set with Sub : (? ? : Con) ? Set, then I get a different type signature: {? = ?? : Con} {? : Con} {? = ?? : Con} {? = ?? : Con} {? = ?? : Sub ?? ?} {? = ?? : Sub ?? ??} {? = ?? : Sub ?? ??} ? ((?? ? ??) ? ??) ? (?? ? (?? ? ??)) I still don't quite understand why you get one occurrence of ? but three occurrences of ?. Does it depend on arbitrary choices made by the unifier? Furthermore I'm not sure that it's a good idea to use names subject to ?-conversion (like ?-bound names) in a setting in which ?-conversion is not applicable (like in implicit ? binders). I tried to figure out what would happen if one of the bound names in the type signature of Sub shadowed another name by parametrising the module: module _ {? : Set} where However, this triggered some kind of error: meta var MetaId 48 was generalized CallStack (from HasCallStack): error, called at src/full/Agda/TypeChecking/Rules/Term.hs:1580:86 in [...] -- /NAD From arseniy.alekseyev at gmail.com Sat Mar 31 14:19:59 2018 From: arseniy.alekseyev at gmail.com (Arseniy Alekseyev) Date: Sat, 31 Mar 2018 13:19:59 +0100 Subject: [Agda] new generalize feature, first version In-Reply-To: <2eaef015-22e6-7e58-f1e3-1d77a21817a8@cse.gu.se> References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> <2a29ae73-116d-13d3-ae4a-c9b834e6b2b0@gmail.com> <86642717-e342-be8a-a9f6-70208d18b284@cse.gu.se> <8e215343-6423-7b72-dcba-bbcbc5bd61f4@gmail.com> <3be8b6a2-a557-cf57-8b02-b9f6920d65d2@cse.gu.se> <3154581f-6d27-565a-0bb8-67327bdd3aa4@gmail.com> <2eaef015-22e6-7e58-f1e3-1d77a21817a8@cse.gu.se> Message-ID: It's possible that I'm missing a key distinction, but this `generalize` keyword sounds like it's exactly the same as `variable` keyword in lean. These two pages give some (very simple) description: https://leanprover.github.io/reference/other_commands.html https://leanprover.github.io/theorem_proving_in_lean/dependent_type_theory.html#variables-and-sections I don't know where to find a more in-depth explanation of how this works. On 31 March 2018 at 10:58, Nils Anders Danielsson wrote: > On 2018-03-31 00:00, Peter Divianszky wrote: > >> >> {x = x? : ?} (p? : tt ? x?) ? p? ? p? >> >> >> >> [...] >> >> >> >> {x : ?} (p : tt ? x) ? p ? p >> > >> > These two types are definitionally equal. >> >> Right, I just wanted to be precise with naming. >> The former is the current type signature and the latter is the desired >> one. >> > > There is no difference between these type signatures, even if you take > the names of implicit arguments into account. Agda sometimes prints type > signatures using the {x = y : A} notation in order to avoid issues > related to shadowing. Here is one example: > > F : (Set ? Set) ? Set? > F G = {A : Set} ? G A > > T : Set? > T = {A : Set} ? F (? X ? A ? X) > > How should the normal form of T be printed? Agda prints > > {A : Set} {A = A? : Set} ? A ? A?. > > Note that this notation is not parsed by Agda. > > > One property I did not bring up was that of stability. I hope that we >> > will not end up in a situation in which one can break lots of code by, >> > say, adding one variable name to a generalize block. >> >> My idea would be stable in this sense. >> > > You presented the following example in your first message: > > For example, >> >> postulate >> ass : (? ? ?) ? ? ? ? ? (? ? ?) >> >> means >> >> postulate >> ass : ?{? ? ? ?}{? : Sub ? ?}{? : Sub ? ?}{? : Sub ? ?} >> ? ((? ? ?) ? ?) ? (? ? (? ? ?)) >> > > This suggested to me that if I replaced > > {? ? ?} : Con > > with > > {? whatever ? ?} : Con, > > then the type signature would change. However, I see now that your > example uses the names ? and ? which are not listed in any generalize > block. I tried your example myself, and this is what you actually end up > with: > > {? = ?? : Con} {? = ?? : Con} {? = ?? : Con} {? = ?? : Con} > {? = ?? : Sub ?? ??} {? = ?? : Sub ?? ??} {? = ?? : Sub ?? ??} ? > ((?? ? ??) ? ??) ? (?? ? (?? ? ??)) > > The telescope contains /three/ implicit arguments all named ?. > > (I'm not sure why the {x = y : A} notation is used for all the other > implicit arguments. My guess would be that it has something to do with > the implementation of generalize.) > > If you perform the change that I mentioned above, then you still end up > with the type signature above. Thus the type signature is stable under > this particular kind of change. > > After some experimentation I managed to figure out where the names in > the type signature come from. If I replace > > Sub : (? ? : Con) ? Set > > with > > Sub : (? ? : Con) ? Set, > > then I get a different type signature: > > {? = ?? : Con} {? : Con} {? = ?? : Con} {? = ?? : Con} > {? = ?? : Sub ?? ?} {? = ?? : Sub ?? ??} {? = ?? : Sub ?? ??} ? > ((?? ? ??) ? ??) ? (?? ? (?? ? ??)) > > I still don't quite understand why you get one occurrence of ? but three > occurrences of ?. Does it depend on arbitrary choices made by the > unifier? > > Furthermore I'm not sure that it's a good idea to use names subject to > ?-conversion (like ?-bound names) in a setting in which ?-conversion is > not applicable (like in implicit ? binders). > > I tried to figure out what would happen if one of the bound names in the > type signature of Sub shadowed another name by parametrising the > module: > > module _ {? : Set} where > > However, this triggered some kind of error: > > meta var MetaId 48 was generalized > CallStack (from HasCallStack): > error, called at src/full/Agda/TypeChecking/Rules/Term.hs:1580:86 in > [...] > > -- > /NAD > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hancock at fastmail.fm Sat Mar 31 14:36:54 2018 From: hancock at fastmail.fm (Peter Hancock) Date: Sat, 31 Mar 2018 13:36:54 +0100 Subject: [Agda] Checking the types of terms In-Reply-To: References: Message-ID: <074f9b6f-a59c-1097-35cd-84aa3b89eb1a@fastmail.fm> On 06/03/2018 20:30, Larrytheliquid wrote: > Agda does have underscore definitions, which do not add new identifiers: > > \begin{code} > _ : type_1 > _ = term_1 > ... > _ : type_n > _ = term_n > \end{code} Ah! The penny drops! That explains a lot of things I have been reading. Something I have come to appreciate about Haskell is its nice use of underscores, so you can read k x _ = x, without having to search through some enormous right-hand-side to see if some spuriously-invented name occurs there. Three cheers for that. Agda seems to take this further, from argument lists to the whole name-space. It seems a very nice feature. Remembering or thinking up names for things that are never going to be referenced is not fun. It is hard enough when they are referenced. Hank From divipp at gmail.com Sat Mar 31 21:11:34 2018 From: divipp at gmail.com (Peter Divianszky) Date: Sat, 31 Mar 2018 21:11:34 +0200 Subject: [Agda] new generalize feature, first version In-Reply-To: References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> <2a29ae73-116d-13d3-ae4a-c9b834e6b2b0@gmail.com> <86642717-e342-be8a-a9f6-70208d18b284@cse.gu.se> <8e215343-6423-7b72-dcba-bbcbc5bd61f4@gmail.com> <3be8b6a2-a557-cf57-8b02-b9f6920d65d2@cse.gu.se> <3154581f-6d27-565a-0bb8-67327bdd3aa4@gmail.com> <2eaef015-22e6-7e58-f1e3-1d77a21817a8@cse.gu.se> Message-ID: <12b54790-f5e3-2b38-6d05-a38dfb6dfb9c@gmail.com> Arseniy, thanks for the pointers. I checked them and indeed, 'generalize' and 'variable' in lean is quite similar. They both allow to specify the type of the generalizable variables. I think 'generalize' is strictly more powerful, because you can use holes inside the specified types like generalize any : _ -- possible in Lean -- this is idris-style generalization? generalize A : Ty _ -- not possible/not documented in Lean On 2018-03-31 14:19, Arseniy Alekseyev wrote: > It's possible that I'm missing a key distinction, but this `generalize` > keyword sounds like it's exactly the same as `variable` keyword in lean. > > These two pages give some (very simple) description: > https://leanprover.github.io/reference/other_commands.html > https://leanprover.github.io/theorem_proving_in_lean/dependent_type_theory.html#variables-and-sections > > I don't know where to find a more in-depth explanation of how this works. > > On 31 March 2018 at 10:58, Nils Anders Danielsson > wrote: > > On 2018-03-31 00:00, Peter Divianszky wrote: > > ?>>? ? ? {x = x? : ?} (p? : tt ? x?) ? p? ? p? > ?>> > ?>> [...] > ?>> > ?>>? ? ? {x : ?} (p : tt ? x) ? p ? p > ?> > ?> These two types are definitionally equal. > > Right, I just wanted to be precise with naming. > The former is the current type signature and the latter is the > desired one. > > > There is no difference between these type signatures, even if you take > the names of implicit arguments into account. Agda sometimes prints type > signatures using the {x = y : A} notation in order to avoid issues > related to shadowing. Here is one example: > > ? F : (Set ? Set) ? Set? > ? F G = {A : Set} ? G A > > ? T : Set? > ? T = {A : Set} ? F (? X ? A ? X) > > How should the normal form of T be printed? Agda prints > > ? {A : Set} {A = A? : Set} ? A ? A?. > > Note that this notation is not parsed by Agda. > > ?> One property I did not bring up was that of stability. I > hope that we > ?> will not end up in a situation in which one can break lots > of code by, > ?> say, adding one variable name to a generalize block. > > My idea would be stable in this sense. > > > You presented the following example in your first message: > > For example, > > postulate > ? ?ass : (? ? ?) ? ? ? ? ? (? ? ?) > > means > > postulate > ? ?ass? ?: ?{? ? ? ?}{? : Sub ? ?}{? : Sub ? ?}{? : Sub ? ?} > ? ? ? ? ?? ((? ? ?) ? ?) ? (? ? (? ? ?)) > > > This suggested to me that if I replaced > > ? {? ? ?} : Con > > with > > ? {? whatever ? ?} : Con, > > then the type signature would change. However, I see now that your > example uses the names ? and ? which are not listed in any generalize > block. I tried your example myself, and this is what you actually end up > with: > > ? {? = ?? : Con} {? = ?? : Con} {? = ?? : Con} {? = ?? : Con} > ? {? = ?? : Sub ?? ??} {? = ?? : Sub ?? ??} {? = ?? : Sub ?? ??} ? > ? ((?? ? ??) ? ??) ? (?? ? (?? ? ??)) > > The telescope contains /three/ implicit arguments all named ?. > > (I'm not sure why the {x = y : A} notation is used for all the other > implicit arguments. My guess would be that it has something to do with > the implementation of generalize.) > > If you perform the change that I mentioned above, then you still end up > with the type signature above. Thus the type signature is stable under > this particular kind of change. > > After some experimentation I managed to figure out where the names in > the type signature come from. If I replace > > ? Sub : (? ? : Con) ? Set > > with > > ? Sub : (? ? : Con) ? Set, > > then I get a different type signature: > > ? {? = ?? : Con} {? : Con} {? = ?? : Con} {? = ?? : Con} > ? {? = ?? : Sub ?? ?} {? = ?? : Sub ?? ??} {? = ?? : Sub ?? ??} ? > ? ((?? ? ??) ? ??) ? (?? ? (?? ? ??)) > > I still don't quite understand why you get one occurrence of ? but three > occurrences of ?. Does it depend on arbitrary choices made by the > unifier? > > Furthermore I'm not sure that it's a good idea to use names subject to > ?-conversion (like ?-bound names) in a setting in which ?-conversion is > not applicable (like in implicit ? binders). > > I tried to figure out what would happen if one of the bound names in the > type signature of Sub shadowed another name by parametrising the > module: > > ? module _ {? : Set} where > > However, this triggered some kind of error: > > ? meta var MetaId 48 was generalized > ? CallStack (from HasCallStack): > ? ? error, called at > src/full/Agda/TypeChecking/Rules/Term.hs:1580:86 in [...] > > -- > /NAD > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > > From bob.atkey at gmail.com Sat Mar 31 23:33:35 2018 From: bob.atkey at gmail.com (Robert Atkey) Date: Sat, 31 Mar 2018 22:33:35 +0100 Subject: [Agda] Mathematically Structured Functional Programming 2018: Final Call for Papers Message-ID: <3f7bb753-016a-a599-5d27-c7c98cb36736@gmail.com> Seventh Workshop on MATHEMATICALLY STRUCTURED FUNCTIONAL PROGRAMMING Sunday 8th July 2018, Oxford, UK A satellite workshop of FSCD 2018 http://msfp2018.bentnib.org/ ** New this time: additional talk proposal category ** ** Deadline: 5th April (abstract), 12th April (paper) ** The seventh workshop on Mathematically Structured Functional Programming is devoted to the derivation of functionality from structure. It is a celebration of the direct impact of Theoretical Computer Science on programs as we write them today. Modern programming languages, and in particular functional languages, support the direct expression of mathematical structures, equipping programmers with tools of remarkable power and abstraction. Where would Haskell be without monads? Functional reactive programming without temporal logic? Call-by-push-value without adjunctions? The list goes on. This workshop is a forum for researchers who seek to reflect mathematical phenomena in data and control. The first MSFP workshop was held in Kuressaare, Estonia, in July 2006, affiliated with MPC 2006 and AMAST 2006. The second MSFP workshop was held in Reykjavik, Iceland as part of ICALP 2008. The third MSFP workshop was held in Baltimore, USA, as part of ICFP 2010. The fourth workshop was held in Tallinn, Estonia, as part of ETAPS 2012. The fifth workshop was held in Grenoble, France, as part of ETAPS 2014. The sixth MSFP Workshop was held in April 2016, in Eindhoven, Netherlands, just after ETAPS 2016. Important Dates: ================ Abstract deadline: 5th April (Thursday) Paper deadline: 12th April (Thursday) Notification: 17th May (Thursday) Final version: 14th June (Thursday) Workshop: 8th July (Sunday) Invited Speakers: ================= - Tamara von Glehn, University of Cambridge, UK - Didier Remy, INRIA, France Program Committee: ================== Andreas Abel - Chalmers, Sweden Danel Ahman - INRIA Paris, France Robert Atkey - University of Strathclyde, UK (co-chair) Jeremy Gibbons - University of Oxford, UK Jennifer Hackett - University of Nottingham, UK Mauro Jaskelioff - Universidad Nacional de Rosario, Argentina Shin-ya Katsumata - National Institute of Informatics, Japan Sam Lindley - University of Edinburgh, UK (co-chair) Clare Martin - Oxford Brookes University, UK Shin-Cheng Mu - Academia Sinica, Taiwan Valeria de Paiva - Nuance Communications, US Alexandra Silva - University College London, UK Submission: =========== Submissions are welcomed on, but by no means restricted to, topics such as: structured effectful computation structured recursion structured corecursion structured tree and graph operations structured syntax with variable binding structured datatype-genericity structured search structured representations of functions structured quantum computation structure directed optimizations structured types structure derived from programs and data Please contact the programme chairs Robert Atkey and Sam Lindley if you have any questions about the scope of the workshop. (New this time) We accept two categories of submission: full papers of no more than 15 pages that will appear in the proceedings, and extended abstracts of no more than 2 pages which we will post on the website, but which do not constitute formal publications and will not appear in the proceedings. References and appendices are not included in page limits. Appendices may not be read by reviewers. Full papers (not two page talk abstracts) must report previously unpublished work and not be submitted concurrently to another conference with refereed proceedings. Accepted papers and talks must be presented at the workshop by at least one of the authors. The proceedings will be published under the auspices of EPTCS with a Creative Commons license. We are using EasyChair to manage submissions. To submit a paper, use this link: https://easychair.org/conferences/?conf=msfp2018. From divipp at gmail.com Sun Apr 1 01:20:30 2018 From: divipp at gmail.com (Peter Divianszky) Date: Sun, 1 Apr 2018 01:20:30 +0200 Subject: [Agda] new generalize feature, first version In-Reply-To: <2eaef015-22e6-7e58-f1e3-1d77a21817a8@cse.gu.se> References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> <2a29ae73-116d-13d3-ae4a-c9b834e6b2b0@gmail.com> <86642717-e342-be8a-a9f6-70208d18b284@cse.gu.se> <8e215343-6423-7b72-dcba-bbcbc5bd61f4@gmail.com> <3be8b6a2-a557-cf57-8b02-b9f6920d65d2@cse.gu.se> <3154581f-6d27-565a-0bb8-67327bdd3aa4@gmail.com> <2eaef015-22e6-7e58-f1e3-1d77a21817a8@cse.gu.se> Message-ID: <990330e3-e517-8498-387b-b93a71ffefa9@gmail.com> >> >> {x = x? : ?} (p? : tt ? x?) ? p? ? p? >> >> >> >> [...] >> >> >> >> {x : ?} (p : tt ? x) ? p ? p >> > >> > These two types are definitionally equal. >> >> Right, I just wanted to be precise with naming. >> The former is the current type signature and the latter is the desired >> one. > > There is no difference between these type signatures, even if you take > the names of implicit arguments into account. [...] Ok, I saw how {x = x? : ?} (p? : tt ? x?) ? p? ? p? is equal to {x : ?} (p? : tt ? x) ? p? ? p? but I missed that this is further equal to {x : ?} (p : tt ? x) ? p ? p because the second argument is not hidden. >> postulate >> ass : (? ? ?) ? ? ? ? ? (? ? ?) >> >> [...] > [...] and this is what you actually end up > with: > > {? = ?? : Con} {? = ?? : Con} {? = ?? : Con} {? = ?? : Con} > {? = ?? : Sub ?? ??} {? = ?? : Sub ?? ??} {? = ?? : Sub ?? ??} ? > ((?? ? ??) ? ??) ? (?? ? (?? ? ??)) > > The telescope contains /three/ implicit arguments all named ?. The naming of arguments is not yet fully implemented, only the ordering. I just implemented another simplified naming which is stable too. The result is: {?.? ?.? ?.? ?.? : Con} {? = ?? : Sub ?.? ?.?} {? = ?? : Sub ?.? ?.?} {? = ?? : Sub ?.? ?.?} ? (?? ? ??) ? ?? ? ?? ? (?? ? ??) if Sub : (? ? : Con) ? Set otherwise, if Sub : Con ? Con ? Set then it becomes {?.1 ?.2 ?.1 ?.1 : Con} {? = ?? : Sub ?.1 ?.2} {? = ?? : Sub ?.1 ?.1} {? = ?? : Sub ?.1 ?.1} ? (?? ? ??) ? ?? ? ?? ? (?? ? ??) > I still don't quite understand why you get one occurrence of ? but three > occurrences of ?. Does it depend on arbitrary choices made by the > unifier? It depends on the unifier, but not arbitrarily. Metavariables of generalized variables defined earlier wins. > Furthermore I'm not sure that it's a good idea to use names subject to > ?-conversion (like ?-bound names) in a setting in which ?-conversion is > not applicable (like in implicit ? binders). I'm also not sure. It is nice though that the naming of automatic implicit parameters can be influenced be existing syntactic constructs. > I tried to figure out what would happen if one of the bound names in the > type signature of Sub shadowed another name by parametrising the > module: > > module _ {? : Set} where > > However, this triggered some kind of error: > > meta var MetaId 48 was generalized > CallStack (from HasCallStack): > error, called at src/full/Agda/TypeChecking/Rules/Term.hs:1580:86 > in [...] This bug is fixed now. On 2018-03-31 11:58, Nils Anders Danielsson wrote: > On 2018-03-31 00:00, Peter Divianszky wrote: >> ?>>????? {x = x? : ?} (p? : tt ? x?) ? p? ? p? >> ?>> >> ?>> [...] >> ?>> >> ?>>????? {x : ?} (p : tt ? x) ? p ? p >> ?> >> ?> These two types are definitionally equal. >> >> Right, I just wanted to be precise with naming. >> The former is the current type signature and the latter is the desired >> one. > > There is no difference between these type signatures, even if you take > the names of implicit arguments into account. Agda sometimes prints type > signatures using the {x = y : A} notation in order to avoid issues > related to shadowing. Here is one example: > > ? F : (Set ? Set) ? Set? > ? F G = {A : Set} ? G A > > ? T : Set? > ? T = {A : Set} ? F (? X ? A ? X) > > How should the normal form of T be printed? Agda prints > > ? {A : Set} {A = A? : Set} ? A ? A?. > > Note that this notation is not parsed by Agda. > >> ?> One property I did not bring up was that of stability. I hope that we >> ?> will not end up in a situation in which one can break lots of code by, >> ?> say, adding one variable name to a generalize block. >> >> My idea would be stable in this sense. > > You presented the following example in your first message: > >> For example, >> >> postulate >> ?? ass : (? ? ?) ? ? ? ? ? (? ? ?) >> >> means >> >> postulate >> ?? ass?? : ?{? ? ? ?}{? : Sub ? ?}{? : Sub ? ?}{? : Sub ? ?} >> ???????? ? ((? ? ?) ? ?) ? (? ? (? ? ?)) > > This suggested to me that if I replaced > > ? {? ? ?} : Con > > with > > ? {? whatever ? ?} : Con, > > then the type signature would change. However, I see now that your > example uses the names ? and ? which are not listed in any generalize > block. I tried your example myself, and this is what you actually end up > with: > > ? {? = ?? : Con} {? = ?? : Con} {? = ?? : Con} {? = ?? : Con} > ? {? = ?? : Sub ?? ??} {? = ?? : Sub ?? ??} {? = ?? : Sub ?? ??} ? > ? ((?? ? ??) ? ??) ? (?? ? (?? ? ??)) > > The telescope contains /three/ implicit arguments all named ?. > > (I'm not sure why the {x = y : A} notation is used for all the other > implicit arguments. My guess would be that it has something to do with > the implementation of generalize.) > > If you perform the change that I mentioned above, then you still end up > with the type signature above. Thus the type signature is stable under > this particular kind of change. > > After some experimentation I managed to figure out where the names in > the type signature come from. If I replace > > ? Sub : (? ? : Con) ? Set > > with > > ? Sub : (? ? : Con) ? Set, > > then I get a different type signature: > > ? {? = ?? : Con} {? : Con} {? = ?? : Con} {? = ?? : Con} > ? {? = ?? : Sub ?? ?} {? = ?? : Sub ?? ??} {? = ?? : Sub ?? ??} ? > ? ((?? ? ??) ? ??) ? (?? ? (?? ? ??)) > > I still don't quite understand why you get one occurrence of ? but three > occurrences of ?. Does it depend on arbitrary choices made by the > unifier? > > Furthermore I'm not sure that it's a good idea to use names subject to > ?-conversion (like ?-bound names) in a setting in which ?-conversion is > not applicable (like in implicit ? binders). > > I tried to figure out what would happen if one of the bound names in the > type signature of Sub shadowed another name by parametrising the > module: > > ? module _ {? : Set} where > > However, this triggered some kind of error: > > ? meta var MetaId 48 was generalized > ? CallStack (from HasCallStack): > ??? error, called at src/full/Agda/TypeChecking/Rules/Term.hs:1580:86 > in [...] > From nad at cse.gu.se Sun Apr 1 10:35:33 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Sun, 1 Apr 2018 10:35:33 +0200 Subject: [Agda] new generalize feature, first version In-Reply-To: <990330e3-e517-8498-387b-b93a71ffefa9@gmail.com> References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> <2a29ae73-116d-13d3-ae4a-c9b834e6b2b0@gmail.com> <86642717-e342-be8a-a9f6-70208d18b284@cse.gu.se> <8e215343-6423-7b72-dcba-bbcbc5bd61f4@gmail.com> <3be8b6a2-a557-cf57-8b02-b9f6920d65d2@cse.gu.se> <3154581f-6d27-565a-0bb8-67327bdd3aa4@gmail.com> <2eaef015-22e6-7e58-f1e3-1d77a21817a8@cse.gu.se> <990330e3-e517-8498-387b-b93a71ffefa9@gmail.com> Message-ID: <432998e2-9249-ee49-e889-96564023d3c3@cse.gu.se> On 2018-04-01 01:20, Peter Divianszky wrote: > I just implemented another simplified naming which is stable too. > {?.? ?.? ?.? ?.? : Con} > {?.1 ?.2 ?.1 ?.1 : Con} These naming schemes have the advantage that one cannot give the arguments by name, so the names do not matter, but the type signatures are still readable. If one of these arguments needs to be given explicitly, then one can give it by position. However, this is rather clunky (f {_} {_} {_} {x}), and could lead to brittle code. -- /NAD From martin.stone.davis at gmail.com Sun Apr 1 15:01:54 2018 From: martin.stone.davis at gmail.com (Martin Stone Davis) Date: Sun, 1 Apr 2018 06:01:54 -0700 Subject: [Agda] new generalize feature, first version In-Reply-To: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> Message-ID: Peter, many accolades to you for developing and sharing. Now for the complaints! My trouble is shown in the code below, which is failing on the last line. Is this a bug in the new feature? ``` {-# OPTIONS --generalize #-} postulate ? Class : Set -> Set ? method : {X : Set} {{_ : Class X}} -> X -> Set ? Nat : Set ? Fin : Nat -> Set generalize ? {n} : Nat ? {x} : Fin _ postulate ? instance ClassFin : Class (Fin n) ? works1 : {x : Fin n} -> method x ? works2 : method {{ClassFin}} x ? works3 : method {X = Fin n} x ? fails? : method x {- Unsolved meta not generalized when checking that the expression method x has type Set _22 -} ``` On 03/29/2018 05:13 AM, Peter Divianszky wrote: > Dear Agda users and implementors, > > I implemented a first version of forall-generalization, and I would > like to get feedback on it. > > > For users > --------- > > An example Agda file can be found at > https://github.com/divipp/agda/blob/master/test/Succeed/Generalize.agda > > Suppose that the following Set formers were postulated: > > postulate > ? Con :?????????????????????? Set > ? Ty? : (? : Con) ??????????? Set > ? Sub : (? ? : Con) ????????? Set > ? Tm? : (? : Con)(A : Ty ?) ? Set > > There is a new keyword 'generalize', which accept declarations like > 'field' for records: > > generalize > ? {? ? ?} : Con > ? {A B C} : Ty _ > ? {? ? ?} : Sub _ _ > ? {t u v} : Tm _ _ > > After these 12 declarations > > (1) ?, ? and ? behave as Con-typed terms, but they are automatically > forall-generalized, so, for example > > postulate > ? id? : Sub ? ? > ? _?_ : Sub ? ? ? Sub ? ? ? Sub ? ? > > means > > postulate > ? id? : ? {?} ? Sub ? ? > ? _?_ : ? {? ? ?} ? Sub ? ? ? Sub ? ? ? Sub ? ? > > (2) A, B and C behaves as (Ty _)-typed terms (their types contain a > dedicated metavariable for each of them), > and they are also automatically forall-generalized. > For example, > > postulate > ? _?_ : ? ? ? Ty ? ? Con > ? ?? : Sub ? (? ? A) ? Sub ? ? > > means > ? _?_ : ? ? ? Ty ? ? Con > ? ?? : ?{? ?}{A : Ty ?} ? Sub ? (? ? A) ? Sub ? ? > > (3) The metavariables of generalizable variables are also > automatically generalized. > For example, > > postulate > ? ass : (? ? ?) ? ? ? ? ? (? ? ?) > > means > > postulate > ? ass?? : ?{? ? ? ?}{? : Sub ? ?}{? : Sub ? ?}{? : Sub ? ?} > ??????? ? ((? ? ?) ? ?) ? (? ? (? ? ?)) > > (4) The place and order of generalized variables are fixed by the > following rules: > > A) generalized bindings are placed at the front of the type signature > B) the dependencies between the generalized variables are always > respected > C) whenever possible, introduce A before B if A < B > - for non-metas, A < B if A was declared before B with a 'generalize' > keyword > - a meta is smaller than a non-meta > - for metas, A < B if A was declared before B with a 'generalize' > keyword. For example, ? : Sub _1 _2 was declared before ? : Sub _3 _4 so > instances of _1, _2, _3, _4 are ordered according to the indices. > > ---- > > The design goals were the following: > > - make type signatures shorter > ? - the type schema of generalizable variables helps > ??? to make even more guesses by the type system > - avoid accidental generalization > ? - only the given names are generalized > ? - the type of generalizable variables are checked > ??? against the given schema, which adds extra safety > - make generalized type signatures reliable > ? (the ordering, and also the naming, see later) > > Question: > > - What should be the keyword? > ? 'notation' seems also good for me. > ? The idea behind 'notation' is that this language construct > ? makes informal sentences like "Let ? ? ? denote contexts." formal. > > Plans (not implemented yet) > > - automatic generalization of record fields and constructor types > - allow 'generalize' keyword in submodules and between record fields > - make generalizable variables importable? > - Name the generalized metavariables also according by the given > generalizable variables. For example, if _1 : Con, then take the first > freely available : Con, where was defined by > 'generalize'. If no more names are available, stop with an error message. > > You can try the current implementation with my fork: > https://github.com/divipp/agda > > > For Agda implementors > --------------------- > > The main patch is > > https://github.com/divipp/agda/commit/d172d1ade15abe26be19311300f7d640563a6a57 > > > It contains several hacks, I'm not sure that this is the right thing > to do: > - metavariables of generalizable variables are solved locally during > typechecking of terms and reverted later > - generalizable variables are stored in the signature as if they were > introduced by 'postulate' > > The Generalize.agda file succeeds when I load it into emacs, but fails > if I call Agda directly. Somehow I could not filter out metavariables > introduced by 'generalize', so Agda tries to serialize them. > > It would great if you could help me to let this feature in. > > > Best Regards, > > Peter > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda From asr at eafit.edu.co Sun Apr 1 17:18:38 2018 From: asr at eafit.edu.co (=?UTF-8?B?QW5kcsOpcyBTaWNhcmQtUmFtw61yZXo=?=) Date: Sun, 1 Apr 2018 10:18:38 -0500 Subject: [Agda] new generalize feature, first version In-Reply-To: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> Message-ID: On 29 March 2018 at 07:13, Peter Divianszky wrote: > Dear Agda users and implementors, > > I implemented a first version of forall-generalization, and I would like > to get feedback on it. > > > For users > --------- > > An example Agda file can be found at > https://github.com/divipp/agda/blob/master/test/Succeed/Generalize.agda > > Suppose that the following Set formers were postulated: > > postulate > Con : Set > Ty : (? : Con) ? Set > Sub : (? ? : Con) ? Set > Tm : (? : Con)(A : Ty ?) ? Set > > There is a new keyword 'generalize', which accept declarations like > 'field' for records: > > generalize > {? ? ?} : Con > {A B C} : Ty _ > {? ? ?} : Sub _ _ > {t u v} : Tm _ _ > > After these 12 declarations > > (1) ?, ? and ? behave as Con-typed terms, but they are automatically > forall-generalized, so, for example > > postulate > id : Sub ? ? > _?_ : Sub ? ? ? Sub ? ? ? Sub ? ? > It seems that Coq also has a forall-generalisation mechanism (which I'm not familiarised). (* Tested with Coq 8.7.1. *) Require Import Unicode.Utf8. Axiom Con : Set. Axiom Sub : Con ? Con ? Set. Generalizable All Variables. Axiom id : `{Sub ? ?}. Axiom comp : `{Sub ? ? ? Sub ? ? ? Sub ? ?}. See Section 2.7.19 of https://github.com/coq/coq/releases/download/V8.7.2/coq-8.7.2-reference-manual.pdf (because Coq website ( https://coq.inria.fr/ ) seems down). -- Andr?s From divipp at gmail.com Sun Apr 1 20:02:14 2018 From: divipp at gmail.com (Peter Divianszky) Date: Sun, 1 Apr 2018 20:02:14 +0200 Subject: [Agda] new generalize feature, first version In-Reply-To: References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> Message-ID: Martin, thanks for testing and for the test case. This is a bug. I'll try to fix this. (The fix should be that the generalized type should be build up from outside to inside, adding outer bindings first. Currently it is done in the other way around, so metavariables are solved before the generalization begins, but not solved during the generalization.) On 2018-04-01 15:01, Martin Stone Davis wrote: > Peter, many accolades to you for developing and sharing. Now for the > complaints! > > My trouble is shown in the code below, which is failing on the last > line. Is this a bug in the new feature? > > ``` > {-# OPTIONS --generalize #-} > > postulate > ? Class : Set -> Set > ? method : {X : Set} {{_ : Class X}} -> X -> Set > ? Nat : Set > ? Fin : Nat -> Set > > generalize > ? {n} : Nat > ? {x} : Fin _ > > postulate > ? instance ClassFin : Class (Fin n) > ? works1 : {x : Fin n} -> method x > ? works2 : method {{ClassFin}} x > ? works3 : method {X = Fin n} x > ? fails? : method x > {- > Unsolved meta not generalized > when checking that the expression method x has type Set _22 > -} > ``` > > On 03/29/2018 05:13 AM, Peter Divianszky wrote: >> Dear Agda users and implementors, >> >> I implemented a first version of forall-generalization, and I would >> like to get feedback on it. >> >> >> For users >> --------- >> >> An example Agda file can be found at >> https://github.com/divipp/agda/blob/master/test/Succeed/Generalize.agda >> >> Suppose that the following Set formers were postulated: >> >> postulate >> ? Con :?????????????????????? Set >> ? Ty? : (? : Con) ??????????? Set >> ? Sub : (? ? : Con) ????????? Set >> ? Tm? : (? : Con)(A : Ty ?) ? Set >> >> There is a new keyword 'generalize', which accept declarations like >> 'field' for records: >> >> generalize >> ? {? ? ?} : Con >> ? {A B C} : Ty _ >> ? {? ? ?} : Sub _ _ >> ? {t u v} : Tm _ _ >> >> After these 12 declarations >> >> (1) ?, ? and ? behave as Con-typed terms, but they are automatically >> forall-generalized, so, for example >> >> postulate >> ? id? : Sub ? ? >> ? _?_ : Sub ? ? ? Sub ? ? ? Sub ? ? >> >> means >> >> postulate >> ? id? : ? {?} ? Sub ? ? >> ? _?_ : ? {? ? ?} ? Sub ? ? ? Sub ? ? ? Sub ? ? >> >> (2) A, B and C behaves as (Ty _)-typed terms (their types contain a >> dedicated metavariable for each of them), >> and they are also automatically forall-generalized. >> For example, >> >> postulate >> ? _?_ : ? ? ? Ty ? ? Con >> ? ?? : Sub ? (? ? A) ? Sub ? ? >> >> means >> ? _?_ : ? ? ? Ty ? ? Con >> ? ?? : ?{? ?}{A : Ty ?} ? Sub ? (? ? A) ? Sub ? ? >> >> (3) The metavariables of generalizable variables are also >> automatically generalized. >> For example, >> >> postulate >> ? ass : (? ? ?) ? ? ? ? ? (? ? ?) >> >> means >> >> postulate >> ? ass?? : ?{? ? ? ?}{? : Sub ? ?}{? : Sub ? ?}{? : Sub ? ?} >> ??????? ? ((? ? ?) ? ?) ? (? ? (? ? ?)) >> >> (4) The place and order of generalized variables are fixed by the >> following rules: >> >> A) generalized bindings are placed at the front of the type signature >> B) the dependencies between the generalized variables are always >> respected >> C) whenever possible, introduce A before B if A < B >> - for non-metas, A < B if A was declared before B with a 'generalize' >> keyword >> - a meta is smaller than a non-meta >> - for metas, A < B if A was declared before B with a 'generalize' >> keyword. For example, ? : Sub _1 _2 was declared before ? : Sub _3 _4 so >> instances of _1, _2, _3, _4 are ordered according to the indices. >> >> ---- >> >> The design goals were the following: >> >> - make type signatures shorter >> ? - the type schema of generalizable variables helps >> ??? to make even more guesses by the type system >> - avoid accidental generalization >> ? - only the given names are generalized >> ? - the type of generalizable variables are checked >> ??? against the given schema, which adds extra safety >> - make generalized type signatures reliable >> ? (the ordering, and also the naming, see later) >> >> Question: >> >> - What should be the keyword? >> ? 'notation' seems also good for me. >> ? The idea behind 'notation' is that this language construct >> ? makes informal sentences like "Let ? ? ? denote contexts." formal. >> >> Plans (not implemented yet) >> >> - automatic generalization of record fields and constructor types >> - allow 'generalize' keyword in submodules and between record fields >> - make generalizable variables importable? >> - Name the generalized metavariables also according by the given >> generalizable variables. For example, if _1 : Con, then take the first >> freely available : Con, where was defined by >> 'generalize'. If no more names are available, stop with an error message. >> >> You can try the current implementation with my fork: >> https://github.com/divipp/agda >> >> >> For Agda implementors >> --------------------- >> >> The main patch is >> >> https://github.com/divipp/agda/commit/d172d1ade15abe26be19311300f7d640563a6a57 >> >> >> It contains several hacks, I'm not sure that this is the right thing >> to do: >> - metavariables of generalizable variables are solved locally during >> typechecking of terms and reverted later >> - generalizable variables are stored in the signature as if they were >> introduced by 'postulate' >> >> The Generalize.agda file succeeds when I load it into emacs, but fails >> if I call Agda directly. Somehow I could not filter out metavariables >> introduced by 'generalize', so Agda tries to serialize them. >> >> It would great if you could help me to let this feature in. >> >> >> Best Regards, >> >> Peter >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda From divipp at gmail.com Sun Apr 1 20:04:24 2018 From: divipp at gmail.com (Peter Divianszky) Date: Sun, 1 Apr 2018 20:04:24 +0200 Subject: [Agda] new generalize feature, first version In-Reply-To: References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> Message-ID: <8ce6fd32-0eeb-9d66-3931-5b1bf762f565@gmail.com> Andr?s, thanks for the pointers. Yes, it seems that Coq also has a forall-generalisation. The main difference is that it is not possible to specify the types of the variables to be generalized. On 2018-04-01 17:18, Andr?s Sicard-Ram?rez wrote: > On 29 March 2018 at 07:13, Peter Divianszky wrote: >> Dear Agda users and implementors, >> >> I implemented a first version of forall-generalization, and I would like >> to get feedback on it. >> >> >> For users >> --------- >> >> An example Agda file can be found at >> https://github.com/divipp/agda/blob/master/test/Succeed/Generalize.agda >> >> Suppose that the following Set formers were postulated: >> >> postulate >> Con : Set >> Ty : (? : Con) ? Set >> Sub : (? ? : Con) ? Set >> Tm : (? : Con)(A : Ty ?) ? Set >> >> There is a new keyword 'generalize', which accept declarations like >> 'field' for records: >> >> generalize >> {? ? ?} : Con >> {A B C} : Ty _ >> {? ? ?} : Sub _ _ >> {t u v} : Tm _ _ >> >> After these 12 declarations >> >> (1) ?, ? and ? behave as Con-typed terms, but they are automatically >> forall-generalized, so, for example >> >> postulate >> id : Sub ? ? >> _?_ : Sub ? ? ? Sub ? ? ? Sub ? ? >> > > It seems that Coq also has a forall-generalisation mechanism (which > I'm not familiarised). > > (* Tested with Coq 8.7.1. *) > > Require Import Unicode.Utf8. > > Axiom Con : Set. > Axiom Sub : Con ? Con ? Set. > > Generalizable All Variables. > Axiom id : `{Sub ? ?}. > Axiom comp : `{Sub ? ? ? Sub ? ? ? Sub ? ?}. > > > See Section 2.7.19 of > https://github.com/coq/coq/releases/download/V8.7.2/coq-8.7.2-reference-manual.pdf > (because Coq website ( https://coq.inria.fr/ ) seems down). > From nad at cse.gu.se Sun Apr 1 21:38:28 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Sun, 1 Apr 2018 21:38:28 +0200 Subject: [Agda] new generalize feature, first version In-Reply-To: <8ce6fd32-0eeb-9d66-3931-5b1bf762f565@gmail.com> References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> <8ce6fd32-0eeb-9d66-3931-5b1bf762f565@gmail.com> Message-ID: On 2018-04-01 20:04, Peter Divianszky wrote: > Yes, it seems that Coq also has a forall-generalisation. The main > difference is that it is not possible to specify the types of the > variables to be generalized. Correct me if I'm wrong, but I don't think Coq has a first-class implicit function space like Agda does. (This function space has led to a number of problems.) -- /NAD From martin.stone.davis at gmail.com Mon Apr 2 03:01:36 2018 From: martin.stone.davis at gmail.com (Martin Stone Davis) Date: Sun, 1 Apr 2018 18:01:36 -0700 Subject: [Agda] new generalize feature, first version In-Reply-To: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> Message-ID: <4eba6e1c-370c-5fcc-0e43-47c662d0be8f@gmail.com> Respect the privacy of --generalize'd identifiers! ``` {-# OPTIONS --generalize #-} postulate ? Nat : Set ? Fin : Nat ? Set module _ where ? private ??? generalize ????? n : Nat ? {- ??? Using private here has no effect. Private applies only to ??? declarations that introduce new identifiers into the module, like ??? type signatures and data, record, and module declarations. ??? when scope checking the declaration ????? module _ where ? -} ? postulate foo : Fin n postulate n : Nat {- Multiple definitions of n. Previous definition at [snip] when scope checking the declaration ? n : Nat -} ``` On 03/29/2018 05:13 AM, Peter Divianszky wrote: > Dear Agda users and implementors, > > I implemented a first version of forall-generalization, and I would > like to get feedback on it. > > > For users > --------- > > An example Agda file can be found at > https://github.com/divipp/agda/blob/master/test/Succeed/Generalize.agda > > Suppose that the following Set formers were postulated: > > postulate > ? Con :?????????????????????? Set > ? Ty? : (? : Con) ??????????? Set > ? Sub : (? ? : Con) ????????? Set > ? Tm? : (? : Con)(A : Ty ?) ? Set > > There is a new keyword 'generalize', which accept declarations like > 'field' for records: > > generalize > ? {? ? ?} : Con > ? {A B C} : Ty _ > ? {? ? ?} : Sub _ _ > ? {t u v} : Tm _ _ > > After these 12 declarations > > (1) ?, ? and ? behave as Con-typed terms, but they are automatically > forall-generalized, so, for example > > postulate > ? id? : Sub ? ? > ? _?_ : Sub ? ? ? Sub ? ? ? Sub ? ? > > means > > postulate > ? id? : ? {?} ? Sub ? ? > ? _?_ : ? {? ? ?} ? Sub ? ? ? Sub ? ? ? Sub ? ? > > (2) A, B and C behaves as (Ty _)-typed terms (their types contain a > dedicated metavariable for each of them), > and they are also automatically forall-generalized. > For example, > > postulate > ? _?_ : ? ? ? Ty ? ? Con > ? ?? : Sub ? (? ? A) ? Sub ? ? > > means > ? _?_ : ? ? ? Ty ? ? Con > ? ?? : ?{? ?}{A : Ty ?} ? Sub ? (? ? A) ? Sub ? ? > > (3) The metavariables of generalizable variables are also > automatically generalized. > For example, > > postulate > ? ass : (? ? ?) ? ? ? ? ? (? ? ?) > > means > > postulate > ? ass?? : ?{? ? ? ?}{? : Sub ? ?}{? : Sub ? ?}{? : Sub ? ?} > ??????? ? ((? ? ?) ? ?) ? (? ? (? ? ?)) > > (4) The place and order of generalized variables are fixed by the > following rules: > > A) generalized bindings are placed at the front of the type signature > B) the dependencies between the generalized variables are always > respected > C) whenever possible, introduce A before B if A < B > - for non-metas, A < B if A was declared before B with a 'generalize' > keyword > - a meta is smaller than a non-meta > - for metas, A < B if A was declared before B with a 'generalize' > keyword. For example, ? : Sub _1 _2 was declared before ? : Sub _3 _4 so > instances of _1, _2, _3, _4 are ordered according to the indices. > > ---- > > The design goals were the following: > > - make type signatures shorter > ? - the type schema of generalizable variables helps > ??? to make even more guesses by the type system > - avoid accidental generalization > ? - only the given names are generalized > ? - the type of generalizable variables are checked > ??? against the given schema, which adds extra safety > - make generalized type signatures reliable > ? (the ordering, and also the naming, see later) > > Question: > > - What should be the keyword? > ? 'notation' seems also good for me. > ? The idea behind 'notation' is that this language construct > ? makes informal sentences like "Let ? ? ? denote contexts." formal. > > Plans (not implemented yet) > > - automatic generalization of record fields and constructor types > - allow 'generalize' keyword in submodules and between record fields > - make generalizable variables importable? > - Name the generalized metavariables also according by the given > generalizable variables. For example, if _1 : Con, then take the first > freely available : Con, where was defined by > 'generalize'. If no more names are available, stop with an error message. > > You can try the current implementation with my fork: > https://github.com/divipp/agda > > > For Agda implementors > --------------------- > > The main patch is > > https://github.com/divipp/agda/commit/d172d1ade15abe26be19311300f7d640563a6a57 > > > It contains several hacks, I'm not sure that this is the right thing > to do: > - metavariables of generalizable variables are solved locally during > typechecking of terms and reverted later > - generalizable variables are stored in the signature as if they were > introduced by 'postulate' > > The Generalize.agda file succeeds when I load it into emacs, but fails > if I call Agda directly. Somehow I could not filter out metavariables > introduced by 'generalize', so Agda tries to serialize them. > > It would great if you could help me to let this feature in. > > > Best Regards, > > Peter > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda From divipp at gmail.com Mon Apr 2 14:03:35 2018 From: divipp at gmail.com (Peter Divianszky) Date: Mon, 2 Apr 2018 14:03:35 +0200 Subject: [Agda] new generalize feature, first version In-Reply-To: <4eba6e1c-370c-5fcc-0e43-47c662d0be8f@gmail.com> References: <05b3a90d-fd82-1691-b9f7-ac76e1f29734@gmail.com> <4eba6e1c-370c-5fcc-0e43-47c662d0be8f@gmail.com> Message-ID: Thanks for this test case too! I'll add this also to the test suit. I think it will be easy to fix this one. Btw, I allowed issue tracking now on my fork: https://github.com/divipp/agda/issues My plan is to try to use gradually 'generalize' in a fork of std-lib. I guess that would be a good overall test case. On 2018-04-02 03:01, Martin Stone Davis wrote: > Respect the privacy of --generalize'd identifiers! > > ``` > {-# OPTIONS --generalize #-} > > postulate > ? Nat : Set > ? Fin : Nat ? Set > > module _ where > > ? private > ??? generalize > ????? n : Nat > ? {- > ??? Using private here has no effect. Private applies only to > ??? declarations that introduce new identifiers into the module, like > ??? type signatures and data, record, and module declarations. > ??? when scope checking the declaration > ????? module _ where > ? -} > > ? postulate foo : Fin n > > postulate n : Nat > {- > Multiple definitions of n. Previous definition at > [snip] > when scope checking the declaration > ? n : Nat > -} > ``` > > > On 03/29/2018 05:13 AM, Peter Divianszky wrote: >> Dear Agda users and implementors, >> >> I implemented a first version of forall-generalization, and I would >> like to get feedback on it. >> >> >> For users >> --------- >> >> An example Agda file can be found at >> https://github.com/divipp/agda/blob/master/test/Succeed/Generalize.agda >> >> Suppose that the following Set formers were postulated: >> >> postulate >> ? Con :?????????????????????? Set >> ? Ty? : (? : Con) ??????????? Set >> ? Sub : (? ? : Con) ????????? Set >> ? Tm? : (? : Con)(A : Ty ?) ? Set >> >> There is a new keyword 'generalize', which accept declarations like >> 'field' for records: >> >> generalize >> ? {? ? ?} : Con >> ? {A B C} : Ty _ >> ? {? ? ?} : Sub _ _ >> ? {t u v} : Tm _ _ >> >> After these 12 declarations >> >> (1) ?, ? and ? behave as Con-typed terms, but they are automatically >> forall-generalized, so, for example >> >> postulate >> ? id? : Sub ? ? >> ? _?_ : Sub ? ? ? Sub ? ? ? Sub ? ? >> >> means >> >> postulate >> ? id? : ? {?} ? Sub ? ? >> ? _?_ : ? {? ? ?} ? Sub ? ? ? Sub ? ? ? Sub ? ? >> >> (2) A, B and C behaves as (Ty _)-typed terms (their types contain a >> dedicated metavariable for each of them), >> and they are also automatically forall-generalized. >> For example, >> >> postulate >> ? _?_ : ? ? ? Ty ? ? Con >> ? ?? : Sub ? (? ? A) ? Sub ? ? >> >> means >> ? _?_ : ? ? ? Ty ? ? Con >> ? ?? : ?{? ?}{A : Ty ?} ? Sub ? (? ? A) ? Sub ? ? >> >> (3) The metavariables of generalizable variables are also >> automatically generalized. >> For example, >> >> postulate >> ? ass : (? ? ?) ? ? ? ? ? (? ? ?) >> >> means >> >> postulate >> ? ass?? : ?{? ? ? ?}{? : Sub ? ?}{? : Sub ? ?}{? : Sub ? ?} >> ??????? ? ((? ? ?) ? ?) ? (? ? (? ? ?)) >> >> (4) The place and order of generalized variables are fixed by the >> following rules: >> >> A) generalized bindings are placed at the front of the type signature >> B) the dependencies between the generalized variables are always >> respected >> C) whenever possible, introduce A before B if A < B >> - for non-metas, A < B if A was declared before B with a 'generalize' >> keyword >> - a meta is smaller than a non-meta >> - for metas, A < B if A was declared before B with a 'generalize' >> keyword. For example, ? : Sub _1 _2 was declared before ? : Sub _3 _4 so >> instances of _1, _2, _3, _4 are ordered according to the indices. >> >> ---- >> >> The design goals were the following: >> >> - make type signatures shorter >> ? - the type schema of generalizable variables helps >> ??? to make even more guesses by the type system >> - avoid accidental generalization >> ? - only the given names are generalized >> ? - the type of generalizable variables are checked >> ??? against the given schema, which adds extra safety >> - make generalized type signatures reliable >> ? (the ordering, and also the naming, see later) >> >> Question: >> >> - What should be the keyword? >> ? 'notation' seems also good for me. >> ? The idea behind 'notation' is that this language construct >> ? makes informal sentences like "Let ? ? ? denote contexts." formal. >> >> Plans (not implemented yet) >> >> - automatic generalization of record fields and constructor types >> - allow 'generalize' keyword in submodules and between record fields >> - make generalizable variables importable? >> - Name the generalized metavariables also according by the given >> generalizable variables. For example, if _1 : Con, then take the first >> freely available : Con, where was defined by >> 'generalize'. If no more names are available, stop with an error message. >> >> You can try the current implementation with my fork: >> https://github.com/divipp/agda >> >> >> For Agda implementors >> --------------------- >> >> The main patch is >> >> https://github.com/divipp/agda/commit/d172d1ade15abe26be19311300f7d640563a6a57 >> >> >> It contains several hacks, I'm not sure that this is the right thing >> to do: >> - metavariables of generalizable variables are solved locally during >> typechecking of terms and reverted later >> - generalizable variables are stored in the signature as if they were >> introduced by 'postulate' >> >> The Generalize.agda file succeeds when I load it into emacs, but fails >> if I call Agda directly. Somehow I could not filter out metavariables >> introduced by 'generalize', so Agda tries to serialize them. >> >> It would great if you could help me to let this feature in. >> >> >> Best Regards, >> >> Peter >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda From publicityifl at gmail.com Tue Apr 3 09:11:17 2018 From: publicityifl at gmail.com (Jurriaan Hage) Date: Tue, 3 Apr 2018 09:11:17 +0200 Subject: [Agda] 2nd CfP: IFL 2018 (30th Symposium on Implementation and Application of Functional Languages) Message-ID: Hello, Please, find below the second call for papers for IFL 2018. Please forward these to anyone you think may be interested. Apologies for any duplicates you may receive. best regards, Jurriaan Hage Publicity Chair of IFL --- ================================================================================ IFL 2018 30th Symposium on Implementation and Application of Functional Languages University of Massachusetts Lowell, MA, USA September 5th-7th, 2018 http://iflconference.org ================================================================================ ### Scope The goal of the IFL symposia is to bring together researchers actively engaged in the implementation and application of functional and function-based programming languages. IFL 2018 will be a venue for researchers to present and discuss new ideas and concepts, work in progress, and publication-ripe results related to the implementation and application of functional languages and function-based programming. Topics of interest to IFL include, but are not limited to: - language concepts - type systems, type checking, type inferencing - compilation techniques - staged compilation - run-time function specialization - run-time code generation - partial evaluation - (abstract) interpretation - metaprogramming - generic programming - automatic program generation - array processing - concurrent/parallel programming - concurrent/parallel program execution - embedded systems - web applications - (embedded) domain specific languages - security - novel memory management techniques - run-time profiling performance measurements - debugging and tracing - virtual/abstract machine architectures - validation, verification of functional programs - tools and programming techniques - (industrial) applications ### Keynote Speakers * Adam Chlipala, Massachusetts Institute of Technology CSAIL * Arjun Guha, University of Massachusetts Amherst ### Submissions and peer-review Differently from previous editions of IFL, IFL 2018 solicits two kinds of submissions: * Regular papers (12 pages including references) * Draft papers for presentations ('weak' limit between 8 and 15 pages) Regular papers will undergo a rigorous review by the program committee, and will be evaluated according to their correctness, novelty, originality, relevance, significance, and clarity. A set of regular papers will be conditionally accepted for publication. Authors of conditionally accepted papers will be provided with committee reviews along with a set of mandatory revisions. Regular papers not accepted for publication will be considered as draft papers, at the request of the author. Draft papers will be screened to make sure that they are within the scope of IFL, and will be accepted for presentation or rejected accordingly. Prior to the symposium: Authors of conditionally accepted papers and accepted presentations will submit a pre-proceedings version of their work that will appear in the draft proceedings distributed at the symposium. The draft proceedings does not constitute a formal publication. We require that at least one of the authors present the work at IFL 2018. After the symposium: Authors of conditionally accepted papers will submit a revised versions of their paper for the formal post-proceedings. The program committee will assess whether the mandatory revisions have been adequately addressed by the authors and thereby determines the final accept/reject status of the paper. Our interest is to ultimately accept all conditionally accepted papers. If you are an author of a conditionally accepted paper, please make sure that you address all the concerns of the reviewers. Authors of accepted presentations will be given the opportunity to incorporate the feedback from discussions at the symposium and will be invited to submit a revised full article for the formal post-proceedings. The program committee will evaluate these submissions according to their correctness, novelty, originality, relevance, significance, and clarity, and will thereby determine whether the paper is accepted or rejected. ### Publication The formal proceedings will appear in the International Conference Proceedings Series of the ACM Digital Library. At no time may work submitted to IFL be simultaneously submitted to other venues; submissions must adhere to ACM SIGPLAN's republication policy: http://www.sigplan.org/Resources/Policies/Republication ### Important dates Submission of regular papers: May 25, 2018 Submission of draft papers: July 17, 2018 Regular and draft papers notification: July 20, 2018 Deadline for early registration: August 8, 2018 Submission of pre-proceedings version: August 29, 2018 IFL Symposium: September 5-7, 2018 Submission of papers for post-proceedings: November 7, 2018 Notification of acceptance: December 22, 2018 Camera-ready version: February 10, 2019 ### Submission details All contributions must be written in English. Papers must use the ACM two columns conference format, which can be found at: http://www.acm.org/publications/proceedings-template Authors submit through EasyChair: https://easychair.org/conferences/?conf=ifl2018 ### Peter Landin Prize The Peter Landin Prize is awarded to the best paper presented at the symposium every year. The honored article is selected by the program committee based on the submissions received for the formal review process. The prize carries a cash award equivalent to 150 Euros. ### Organization and Program committee Chairs: Jay McCarthy & Matteo Cimini, University of Massachusetts Lowell, USA Program Committee: * Arthur Chargueraud, Inria, FR * Ben Delaware, Purdue University, USA * Christos Dimoulas, Northwestern University, USA * David Darais, University of Vermont, USA * Dominic Orchard, University of Kent, UK * Ekaterina Komendantskaya, Heriot-Watt University, UK * Garrett Morris, University of Kansas, USA * Heather Miller, EPFL & Northeastern University, CH & USA * Jeremy Yallop, University of Cambridge, UK * Keiko Nakata, SAP Innovation Center Potsdam, DE * Laura Castro, University of A Coruna, ESP * Magnus Myreen, Chalmers University of Technology, SWE * Natalia Chechina, Bournemouth University, UK * Peter Achten, Radboud Universiteit Nijmegen, NL * Peter-Michael Osera, Grinnell College, USA * Richard Eisenberg, Bryn Mawr College, USA * Trevor McDonell, University of New South Wales, AUS * Yukiyoshi Kameyama, University of Tsukuba, JAP ### Venue The 30th IFL is organized by the University of Massachusetts Lowell. The City of Lowell is located at the heart of the Merrimack Valley just 30 miles northwest of Boston. Lowell can be easily reached by train or taxi. See the website for more information on the venue. ### Acknowledgments This call-for-papers is an adaptation and evolution of content from previous instances of IFL. We are grateful to prior organizers for their work, which is reused here. A part of IFL 2018 format and CFP language that describes conditionally accepted papers has been adapted from call-for-papers of OOPSLA conferences. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wadler at inf.ed.ac.uk Tue Apr 3 15:22:54 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Tue, 3 Apr 2018 10:22:54 -0300 Subject: [Agda] Operational and Denotational, Typed and Untyped Lambda Calculus In-Reply-To: References: <0303b315-dd64-9bac-e77c-1ea0e0330d6d@cse.gu.se> Message-ID: Thank you for the further replies. I'm looking into them! Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 30 March 2018 at 16:35, Martin Escardo wrote: > No favourites from anyone else? That doesn't seem much like this list! >> > > (1) Of course, you can consider the type-theoretic incarnation of the > "set-theoretic model" of Goedel's system T (simply typed lambda calculus > with a base type for natural numbers, as you know). > > http://www.cs.bham.ac.uk/~mhe/dialogue/dialogue.pdf > > This also considers a "dialogue" "forcing" model of system T, and then a > logical relation between this and the set-theoretical model to prove (in > Agda) that all system T definable functions (N->N)->N of the > set-theoretical model are continuous. > > The paper quoted above works with the SKI-combinatory version of system T, > for simplicity of presentation. However, further accompanying Agda files > consider the lambda-calculus version, and more: > http://www.cs.bham.ac.uk/~mhe/dialogue/ > > (2) Again with system T, we can consider models in which all functions (of > all types) are continuous (rather than just the definable ones of type > (N->N)->N.) > > This is done by my former PhD student Chuangjie Xu. > https://cj-xu.github.io/ > > (3) Following from (2), this is actually a manifestation of the > Kleene-Kreisel continuous functionals from the 1950's, used at that time > (and to this day) to model computation with higher types. This is in the > above Agda code (2) and also in the paper > > http://www.cs.bham.ac.uk/~mhe/papers/kleene-kreisel.pdf > > (4) This hasn't been implemented in Agda yet, but it should: > http://www.cs.bham.ac.uk/~mhe/papers/partial-elements-and-recursion.pdf > > And actually it needs a univalent extension of type theory, such as > cubical Agda: https://agda.readthedocs.io/en/latest/language/cubical.html > > This last (4) is more in the vein of Dana Scott's ideas, but > constructively performed (following the lead of many people, including > Rosolini, Hyland, among others). > > Best wishes, > Martin > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From howseeu at gmail.com Thu Apr 5 04:36:21 2018 From: howseeu at gmail.com (How Si Yu) Date: Thu, 5 Apr 2018 10:36:21 +0800 Subject: [Agda] Encoding higher lambda calculus in agda Message-ID: Hi, There are numerous implementations of untyped lambda calculus and simply typed lambda calculus in Agda online. However, I can't find any mention of encoding of other "higher" lambda calculus in the lambda cube like ?2 or ?P in Agda. Is it because they are inherently impredicative and can't be represented in Agda? Thanks, Si Yu From fdhzs2010 at hotmail.com Thu Apr 5 05:01:58 2018 From: fdhzs2010 at hotmail.com (Jason -Zhong Sheng- Hu) Date: Thu, 5 Apr 2018 03:01:58 +0000 Subject: [Agda] Encoding higher lambda calculus in agda In-Reply-To: References: Message-ID: my intuition was there is nothing special about system F, and all terms and types should be just able to fit into Set along. and indeed, someone has done the work: https://github.com/sstucki/system-f-agda regarding stronger calculus, i do not see why they are not possible, except for dependent type itself(i.e. the strongest calculus of the cube). For example, it's straightforward to formalize Fsub in Coq: https://github.com/plclub/metalib/tree/master/Fsub The modelling calculus of Scala, (dependent object types, DOT), for example, has type dependent types, type dependent values, and a weak form of value dependent types, which can also be proved with terms and types in Set: https://github.com/samuelgruetter/dot-calculus https://github.com/amaurremi/dot-calculus Though in Coq, the terms and types are defined in Set, which roughly corresponds to Set in Agda, and that hopefully means you won't need to go above Set 2 to prove it's sound. For dependent type itself, I do not think it's possible, due to Goedel's incompleteness theorem. However, someone did it in Coq (which i've not checked, but, well, it's there) https://github.com/coq-contribs/coq-in-coq . The reason why it might be doable in Coq, is Prop type in Coq is impredicative, and therefore the calculus underneath (caculus of inductive constructions, CIC) is stronger than calculus of constructions(CoC). Indeed, the author represents typ to be Prop because he had no choice. https://github.com/coq-contribs/coq-in-coq/blob/master/Types.v Hope that helps. Sincerely Yours, Jason Hu ________________________________ From: Agda on behalf of How Si Yu Sent: April 4, 2018 10:36:21 PM To: agda at lists.chalmers.se Subject: [Agda] Encoding higher lambda calculus in agda Hi, There are numerous implementations of untyped lambda calculus and simply typed lambda calculus in Agda online. However, I can't find any mention of encoding of other "higher" lambda calculus in the lambda cube like ?2 or ?P in Agda. Is it because they are inherently impredicative and can't be represented in Agda? Thanks, Si Yu _______________________________________________ Agda mailing list Agda at lists.chalmers.se https://lists.chalmers.se/mailman/listinfo/agda -------------- next part -------------- An HTML attachment was scrubbed... URL: From kovacsahun at hotmail.com Thu Apr 5 08:33:04 2018 From: kovacsahun at hotmail.com (=?UTF-8?B?QW5kcsOhcyBLb3bDoWNz?=) Date: Thu, 5 Apr 2018 08:33:04 +0200 Subject: [Agda] Encoding higher lambda calculus in agda In-Reply-To: References: Message-ID: You can represent the syntax of pretty much every dependent and impredicative theory in Agda. However, that does not settle whether a particular proof or construction using a syntax is a) possible in base Agda b) feasible or convenient in base Agda. System F and F-omega syntax is easy to represent in Agda, in either intrinsic or extrinsic manner. Showing consistency or normalization would require an impredicative universe in Agda, so that's not possible without postulating stuff, but even without that there are many interesting things which you could do with the syntax. Predicative dependent type theories can be represented and proven consistent; this is the most advanced development I know of which only uses native Agda features (in this case, induction-recursion). Note though that formal handling of dependent types tends to be highly technically challenging. For dependent type itself, I do not think it's possible, due to Goedel's > incompleteness theorem. G?del doesn't enter the picture in any of the developments I know of, because the metatheories are stronger than object theories, due to having inductive families and/or induction/recursion. Also, G?del would only prevent consistency proofs, but doesn't preclude representing the syntax or doing a number of interesting things with it which don't imply consistency. is Prop type in Coq is impredicative, and therefore the calculus underneath > (caculus of inductive constructions, CIC) is stronger than calculus of > constructions(CoC) CoC has impredicative base Set. 2018-04-05 5:01 GMT+02:00 Jason -Zhong Sheng- Hu : > my intuition was there is nothing special about system F, and all terms > and types should be just able to fit into Set along. and indeed, someone > has done the work: https://github.com/sstucki/system-f-agda > > > regarding stronger calculus, i do not see why they are not possible, > except for dependent type itself(i.e. the strongest calculus of the cube). > For example, it's straightforward to formalize Fsub in Coq: > https://github.com/plclub/metalib/tree/master/Fsub > > > The modelling calculus of Scala, (dependent object types, DOT), for > example, has type dependent types, type dependent values, and a weak form > of value dependent types, which can also be proved with terms and types in > Set: https://github.com/samuelgruetter/dot-calculus ht > tps://github.com/amaurremi/dot-calculus > > > Though in Coq, the terms and types are defined in Set, which roughly > corresponds to Set in Agda, and that hopefully means you won't need to go > above Set 2 to prove it's sound. > > > For dependent type itself, I do not think it's possible, due to Goedel's > incompleteness theorem. However, someone did it in Coq (which i've not > checked, but, well, it's there) https://github.com/coq-contribs/coq-in-coq . > The reason why it might be doable in Coq, is Prop type in Coq is > impredicative, and therefore the calculus underneath (caculus of inductive > constructions, CIC) is stronger than calculus of constructions(CoC). > Indeed, the author represents typ to be Prop because he had no choice. > https://github.com/coq-contribs/coq-in-coq/blob/master/Types.v > > > Hope that helps. > > > > *Sincerely Yours, * > > * Jason Hu* > ------------------------------ > *From:* Agda on behalf of How Si Yu < > howseeu at gmail.com> > *Sent:* April 4, 2018 10:36:21 PM > *To:* agda at lists.chalmers.se > *Subject:* [Agda] Encoding higher lambda calculus in agda > > Hi, > > There are numerous implementations of untyped lambda calculus and > simply typed lambda calculus in Agda online. However, I can't find any > mention of encoding of other "higher" lambda calculus in the lambda > cube like ?2 or ?P in Agda. Is it because they are inherently > impredicative and can't be represented in Agda? > > Thanks, > Si Yu > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From henning at basold.eu Thu Apr 5 10:15:57 2018 From: henning at basold.eu (Henning Basold) Date: Thu, 5 Apr 2018 10:15:57 +0200 Subject: [Agda] Encoding higher lambda calculus in agda In-Reply-To: References: Message-ID: <54ef7ee1-e758-10ee-5913-217da6f78c79@basold.eu> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Hi, On 05/04/18 08:33, Andr?s Kov?cs wrote: > > You can represent the syntax of pretty much every dependent and > impredicative theory in Agda. However, that does not settle whether > a particular proof or construction using a syntax is a) possible in > base Agda b) feasible or convenient in base Agda. > > System F and F-omega syntax is easy to represent in Agda, in > either intrinsic or extrinsic manner. Showing consistency or > normalization would require an impredicative universe in Agda, so > that's not possible without postulating stuff, but even without > that there are many interesting things which you could do with the > syntax. > In fact, this applies to almost any type theory, because standard normalisation proofs are often impredicative, even for simple type theories. For an example of a predicative encoding of such a proof see, for example, [AA99]. As for the formalisation of dependent types in Agda: The main difficulty is the fact that the typing judgement involves the reduction relation of the theory, which leads to trouble especially with recursive types. One technique to overcome this is to define pre-terms, which are untyped terms or terms that have only informations about arities of constructors etc. In [Geu94], a strong normalisation proof is given, where the reduction relation is given in such a way. I used an extension of that technique to encode a dependent type theory of inductive-coinductive types in Agda (https://github.com/hbasold/CoindDepTypes). Finally, people have recently started to use higher inductive types to define the term equalities by using propositional equality rather by using reduction relations, see the thesis of Ambrus Kaposi [Kap17]. Best, Henning [AA99] Abel, Andreas, and Thorsten Altenkirch. 1999. ?A Predicative Strong Normalisation Proof for a Lambda-Calculus with Interleaving Inductive Types?. In TYPES?99, edited by Thierry Coquand, Peter Dybjer, Bengt Nordstr?m, and Jan M. Smith, 1956:21?40. LNCS. Springer. https://doi.org/10.1007/3-540-44557-9_2. [Geu94] Geuvers, Herman. 1994. ?A Short and Flexible Proof of Strong Normalization for the Calculus of Constructions?. In Types for Proofs and Programs, edited by Peter Dybjer, Bengt Nordstr?m, and Jan Smith, 14?38. LNCS 996. Springer Berlin Heidelberg. https://doi.org/10.1007/3-540-60579-7_2. [Kap17] Kaposi, Ambrus. 2017. ?Type Theory in a Type Theory with Quotient Inductive Types?. University of Nottingham, UK. http://ethos.bl.uk/OrderDetails.do?uin=uk.bl.ethos.713896. -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEMnUmuprSDishxVMiatBsEc2xMm4FAlrF2zkACgkQatBsEc2x Mm6y6w/+PUUbSZURaVySXKJ9iu+jD9QvNQEftvyzp7OZpjopwesiXAEvwSeLy4VJ wCLVTPAVAjyTzZXxwrCtNAqvHv9ql1L8/42a4o5bU23QbIbV1s5hVQ8GP+gSUpJD +0edLiD0vvROlvKlfnLWhPDpzcL7yFZiGfYgNLRw7nA6k0V7DzXPcBwch/JbMy2w i6KR9ZNKqLwLEXoFn32cgaZKWHBVj++ePiAiXs1wNyvfXVfzHnuQfi5fwj4CzmqL h7X7sf2Jp7GNLABstLk1pD7ce94P1d+bLslHr9P5sAYk/ApgBhgKaH+6AB2rR2U8 yK1UZNrACAcxq7Q3QnE9VXH/vpA8DnHDzOmBnhMLfkFSn+w4J4jE93xVjps258QV kvea3PVw0qiIW+Ev3UB3GtEkfYhu1D8yzWyLh81nPCHqg3c8giUNSzZVAEPVG+4m wn/iYsBK43vRAY6+WBLESQ1hMbCTRdyP/HvkdvCSSTQk6/1X269X+i8U732+BLdF Flr3ETTXq947vsq9SffW2aYEGBrhilU8p+LEyDVP5/OTTAcyHm7NceYVUcTVX28W ojQP0Tp/47+6alBnyqrXiwfu3pzJbFuCN+dkk9dlmXlmiXtntJeXP8HmlTm0M+XR MTWqiztovRe1qMZSx0cAS3PW/XVG5+9z1YTdmKcvLQGcBoHO+o8= =AxEr -----END PGP SIGNATURE----- From howseeu at gmail.com Thu Apr 5 10:18:31 2018 From: howseeu at gmail.com (How Si Yu) Date: Thu, 5 Apr 2018 16:18:31 +0800 Subject: [Agda] Encoding higher lambda calculus in agda In-Reply-To: References: Message-ID: Thanks for the links. Looking at https://github.com/sstucki/system-f-agda/blob/master/src/SystemF/WtTerm.agda , > data _?_?_ {m n} (? : Ctx m n) : Term m n ? Type n ? Set where I get why I was stuck because I was thinking along the line of data _?_ {m n} (? : Ctx m n) : Type n ? Set where which tries to make only well-typed term constructible instead of constructing terms then prove some of them are well-typed. > except for dependent type itself(i.e. the strongest calculus of the cube). By dependent type, do you mean COC? Usually one talks about dependent type, I'm expecting anything that is at least as strong as ?P. On 4/5/18, Andr?s Kov?cs wrote: > You can represent the syntax of pretty much every dependent and > impredicative theory in Agda. However, that does not settle whether a > particular proof or construction using a syntax is a) possible in base Agda > b) feasible or convenient in base Agda. > > System F and F-omega syntax is easy to represent in Agda, in either > intrinsic or extrinsic manner. Showing consistency or normalization would > require an impredicative universe in Agda, so that's not possible without > postulating stuff, but even without that there are many interesting things > which you could do with the syntax. > > Predicative dependent type theories can be represented and proven > consistent; this is the most > advanced development I know of which only uses native Agda features (in > this case, induction-recursion). Note though that formal handling of > dependent types tends to be highly technically challenging. > > For dependent type itself, I do not think it's possible, due to Goedel's >> incompleteness theorem. > > > G?del doesn't enter the picture in any of the developments I know of, > because the metatheories are stronger than object theories, due to having > inductive families and/or induction/recursion. Also, G?del would only > prevent consistency proofs, but doesn't preclude representing the syntax or > doing a number of interesting things with it which don't imply consistency. > > is Prop type in Coq is impredicative, and therefore the calculus underneath >> (caculus of inductive constructions, CIC) is stronger than calculus of >> constructions(CoC) > > > CoC has impredicative base Set. > > 2018-04-05 5:01 GMT+02:00 Jason -Zhong Sheng- Hu : > >> my intuition was there is nothing special about system F, and all terms >> and types should be just able to fit into Set along. and indeed, someone >> has done the work: https://github.com/sstucki/system-f-agda >> >> >> regarding stronger calculus, i do not see why they are not possible, >> except for dependent type itself(i.e. the strongest calculus of the >> cube). >> For example, it's straightforward to formalize Fsub in Coq: >> https://github.com/plclub/metalib/tree/master/Fsub >> >> >> The modelling calculus of Scala, (dependent object types, DOT), for >> example, has type dependent types, type dependent values, and a weak form >> of value dependent types, which can also be proved with terms and types >> in >> Set: https://github.com/samuelgruetter/dot-calculus ht >> tps://github.com/amaurremi/dot-calculus >> >> >> Though in Coq, the terms and types are defined in Set, which roughly >> corresponds to Set in Agda, and that hopefully means you won't need to go >> above Set 2 to prove it's sound. >> >> >> For dependent type itself, I do not think it's possible, due to Goedel's >> incompleteness theorem. However, someone did it in Coq (which i've not >> checked, but, well, it's there) https://github.com/coq-contribs/coq-in-coq >> . >> The reason why it might be doable in Coq, is Prop type in Coq is >> impredicative, and therefore the calculus underneath (caculus of >> inductive >> constructions, CIC) is stronger than calculus of constructions(CoC). >> Indeed, the author represents typ to be Prop because he had no choice. >> https://github.com/coq-contribs/coq-in-coq/blob/master/Types.v >> >> >> Hope that helps. >> >> >> >> *Sincerely Yours, * >> >> * Jason Hu* >> ------------------------------ >> *From:* Agda on behalf of How Si Yu < >> howseeu at gmail.com> >> *Sent:* April 4, 2018 10:36:21 PM >> *To:* agda at lists.chalmers.se >> *Subject:* [Agda] Encoding higher lambda calculus in agda >> >> Hi, >> >> There are numerous implementations of untyped lambda calculus and >> simply typed lambda calculus in Agda online. However, I can't find any >> mention of encoding of other "higher" lambda calculus in the lambda >> cube like ?2 or ?P in Agda. Is it because they are inherently >> impredicative and can't be represented in Agda? >> >> Thanks, >> Si Yu >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> _______________________________________________ >> Agda mailing list >> Agda at lists.chalmers.se >> https://lists.chalmers.se/mailman/listinfo/agda >> >> > From xu at math.lmu.de Sun Apr 8 02:05:15 2018 From: xu at math.lmu.de (Chuangjie Xu) Date: Sun, 08 Apr 2018 02:05:15 +0200 Subject: [Agda] Autumn school "Proof and Computation" Message-ID: <20180408020515.13274c6dspyjctrv@webmail.mathematik.uni-muenchen.de> Autumn school "Proof and Computation" Fischbachau, Germany, 16th to 22nd September 2018 http://www.mathematik.uni-muenchen.de/~schwicht/pc18.php An international autumn school "Proof and Computation" will be held from 16th to 22nd September 2018 at Aurachhof in Fischbachau near Munich. Its aim is to bring together young researchers in the field of Foundations of Mathematics, Computer Science and Philosophy. SCOPE -------------------- - Predicative Foundations - Constructive Mathematics and Type Theory - Computation in Higher Types - Extraction of Programs from Proofs COURSES -------------------- - Ulrich Berger on Program Extraction from Proofs - Martin Escardo on Continuity in Constructive Analysis - Graham Leigh on Truth Theories - Thomas Powell on Proof Mining - Michael Rathjen on Constructive Set Theory and Type Theory - Daniel Wessel on Constructive Algebra Schedule WORKING GROUPS -------------------- There will be an opportunity to form ad-hoc groups working on specific projects, but also to discuss in more general terms the vision of constructing correct programs from proofs. APPLICATIONS -------------------- Graduate or PhD students and young postdoctoral researches are invited to apply. Applications must be accompanied by a letter of recommendation, preferably from the thesis adviser, and should be sent to Chuangjie Xu (xu at math.lmu.de). Deadline for applications: **30th May 2018**. Applicants will be notified by 30th June 2018. FINANCIAL SUPPORT -------------------- The workshop is supported by the Udo Keller Stiftung (Hamburg), the CID (Computing with Infinite Data) programme of the European Commission and a JSPS core-to-core project. Successful applicants will be offered full-board accommodation for the days of the autumn school. There are no funds, however, to reimburse travel or further expenses, which successful applicants will have to cover otherwise. Klaus Mainzer Peter Schuster Helmut Schwichtenberg ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From andersmortberg at gmail.com Sun Apr 8 17:44:34 2018 From: andersmortberg at gmail.com (Anders Mortberg) Date: Sun, 8 Apr 2018 11:44:34 -0400 Subject: [Agda] Final Call for Contributions: Workshop on Homotopy Type Theory and Univalent Foundations (HoTT/UF'18) Message-ID: ========================================================== FINAL CALL FOR CONTRIBUTIONS Workshop on Homotopy Type Theory and Univalent Foundations (HoTT/UF, at FLoC 2018) ========================================================== NEWS: 1 week left until submission deadline! (April 15) NEWS: FLoC provides travel stipends for student attendees of FLoC?18 with application deadline May 18. For details see: http://www.floc2018.org/travel-stipend/ ------------------------------------------------------------------------ 4th Workshop on Homotopy Type Theory and Univalent Foundations July 7-8, 2018, Oxford, United Kingdom https://hott-uf.github.io/2018 Co-located with FSCD 2018 and part of FLoC 2018 http://www.cs.le.ac.uk/events/fscd2018/ http://www.floc2018.org/ Abstract submission deadline: April 15 ------------------------------------------------------------------------ Homotopy Type Theory is a young area of logic, combining ideas from several established fields: the use of dependent type theory as a foundation for mathematics, inspired by ideas and tools from abstract homotopy theory. Univalent Foundations are foundations of mathematics based on the homotopical interpretation of type theory. The goal of this workshop is to bring together researchers interested in all aspects of Homotopy Type Theory and Univalent Foundations: from the study of syntax and semantics of type theory to practical formalization in proof assistants based on univalent type theory. ================== # Invited talks * Mart?n Escard? (University of Birmingham) * Paige North (Ohio State University) * Andrew Pitts (University of Cambridge) ================ # Submissions * Abstract submission deadline: April 15 * Author notification: end of April Submissions should consist of a title and a 1-2 pages abstract, in pdf format, via https://easychair.org/conferences/?conf=hottuf18 Considering the broad background of the expected audience, we encourage authors to include information of pedagogical value in their abstract, such as motivation and context of their work. ====================== # Program committee * Benedikt Ahrens (University of Birmingham) * Paolo Capriotti (University of Nottingham) * Simon Huber (University of Gothenburg) * Chris Kapulkin (University of Western Ontario) * Nicolai Kraus (University of Nottingham) * Peter LeFanu Lumsdaine (Stockholm University) * Assia Mahboubi (Inria Saclay) * Anders M?rtberg (Carnegie Mellon University and University of Gothenburg) * Nicolas Tabareau (Inria Nantes) ================ # Organizers * Benedikt Ahrens (University of Birmingham) * Simon Huber (University of Gothenburg) * Anders M?rtberg (Carnegie Mellon University and University of Gothenburg) From thiemann at informatik.uni-freiburg.de Tue Apr 10 16:53:33 2018 From: thiemann at informatik.uni-freiburg.de (Peter Thiemann) Date: Tue, 10 Apr 2018 16:53:33 +0200 Subject: [Agda] Phd/PostDoc position on linear types and session types Message-ID: <8BCA33A1-1CCD-46C4-8978-59C94C0E1055@informatik.uni-freiburg.de> The programming languages group at University of Freiburg, Germany, has an opening for a research assistant to work on a DFG-funded project to create a version of OCaml with linear types and session types to start on July 1, 2018. The project entails work on the theory and on an implementation with the weighting adjusted according to the candidate?s profile, which would ideally complement the current group members. The position can be filled with a PhD student or with a PostDoc and we welcome applications of either kind. I am looking for strong candidates with PL background, preferably with demonstrated experience in functional programming and types. Background with OCaml and/or proof assistants (Coq, Agda) is an additional bonus. JOB DETAILS AND APPLICATION The salary is according to the TV-L E13 scale of German public service. The university of Freiburg aims at increasing the number of female employees and thus especially welcomes applications of female candidates. Applications of disabled candidates will be given priority, depending on their suitability. Applications in PDF format or informal enquiries by email are welcome. Applications will be considered until the position is filled. The starting date is negotiable. Check our research webpage http://proglang.informatik.uni-freiburg.de/research/ or the DBLP publication profile http://dblp.dagstuhl.de/pers/hd/t/Thiemann:Peter for more information. Best regards -Peter Thiemann From pedagand at gmail.com Tue Apr 10 22:36:35 2018 From: pedagand at gmail.com (Pierre-Evariste Dagand) Date: Tue, 10 Apr 2018 22:36:35 +0200 Subject: [Agda] ANN: "Evolution of a type-checker" & "Dependently-typed programming" Message-ID: Dear People of Agda, As part of a class on "Functional programming and type systems" (MPRI 2.4, for the connoisseurs), I have been given the opportunity to give a (somewhat opinionated) introduction to dependently-typed functional programming to 2nd year Masters students. I've made my teaching material available online. First, there is an introductory, standalone project entitled "The Evolution of a Typechecker" (inspired by the folklore "The Evolution of a Haskell Programmer") https://github.com/pedagand/typechecker-evolution that I use to ring as many of Agda's bells and whistles as possible while showing the transition from "idiomatic Haskell programmer" to "idiomatic Agda programmer" (a programmer who, clearly, would live somewhere around Glasgow). Second comes the Teacher version (*spoiler alert*) of my lectures notes, complete with exercises, their solutions and the infrastructure for producing the teaching version of the Agda files : https://github.com/pedagand/MPRI-2.4-DTP https://github.com/pedagand/MPRI-2.4-DTP/blob/master/Readme.lagda.rst It is literate Agda files all the way down : from the Agda files, I obtain a pdf (the lectures notes) and a program with holes (the lecture) that is discussed and elaborated in class using a wireless keyboard with touchpad. We are basically using Agda as an interactive whiteboard equipped with a type-checker. If you just want to play with the student version (with the exercises, without the answers), check out the files listed under Section "Dependently-typed Functional Programming" on the following page: https://gitlab.inria.fr/fpottier/mpri-2.4-public/blob/master/README.md Beware, I think that there is a problem with the implementation of Djinn monotonic and I haven't had time to fix it yet. Feel free to send a PR if you do! More generally, comments, suggestions and rants are more than welcome, either by mail or by PR. Many thanks to the Agda team, whose great work has made this sort of pedagogical experience possible and, actually, extremely pleasant! -- Pierre Dagand From Jesper at sikanda.be Wed Apr 11 11:37:50 2018 From: Jesper at sikanda.be (Jesper Cockx) Date: Wed, 11 Apr 2018 11:37:50 +0200 Subject: [Agda] =?utf-8?q?AIM_XXVII_-_G=C3=B6teborg=2C_4_=E2=80=93_9_June?= =?utf-8?q?_2018?= Message-ID: --------------------------------------------------------------- Agda Implementors' Meeting XXVII Call for participation http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.AIMXXVII --------------------------------------------------------------- The twenty-seventh Agda Implementors' Meeting will be held in G?teborg, Sweden June 4 ? 9 (Mon to Sat). Anyone with an interest in Agda is invited to attend. The meeting will be similar to previous ones: * Presentations concerning theory, implementation, and use cases of Agda and other Agda-like languages. * Discussions around issues related to the Agda language. * Plenty of time to work in, on, under or around Agda, in collaboration with other participants. Registration ------------ You can register for the meeting by filling out the form below and emailing it to Jesper . There is no registration fee. Coffee breaks might be included. Transportation, accommodation and meals are to be covered by the participant. -------8<-------------------------------------------------- Registration form for Agda Implementors' Meeting XXVII Name: Title and optionally abstract (if you want to give a talk or lead a discussion): Suggestions for code sprints (optional): Additional comments: -------------------------------------------------->8------- Note that if you want to stay at SGS Veckobost?der (see wiki) it may be wise to book a room as soon as possible. More information ---------------- Check out the wiki for travel suggestions and up-to-date information: http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.AIMXXV Please spread the word about this meeting. Best regards, Jesper -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jesper at sikanda.be Wed Apr 11 11:42:08 2018 From: Jesper at sikanda.be (Jesper Cockx) Date: Wed, 11 Apr 2018 11:42:08 +0200 Subject: [Agda] =?utf-8?q?AIM_XXVII_-_G=C3=B6teborg=2C_4_=E2=80=93_9_June?= =?utf-8?q?_2018?= In-Reply-To: References: Message-ID: Correction: the link at the bottom should be http://wiki.portal.chalmers.se /agda/pmwiki.php?n=Main.AIMXXVII Best regards, Jesper On Wed, Apr 11, 2018 at 11:37 AM, Jesper Cockx wrote: > --------------------------------------------------------------- > Agda Implementors' Meeting XXVII > Call for participation > http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.AIMXXVII > --------------------------------------------------------------- > > The twenty-seventh Agda Implementors' Meeting will be held in G?teborg, > Sweden June 4 ? 9 (Mon to Sat). Anyone with an interest in Agda is invited > to attend. The meeting will be similar to previous ones: > > * Presentations concerning theory, implementation, and use cases of Agda > and other Agda-like languages. > > * Discussions around issues related to the Agda language. > > * Plenty of time to work in, on, under or around Agda, in collaboration > with other participants. > > Registration > ------------ > > You can register for the meeting by filling out the form below and > emailing it to Jesper . > > There is no registration fee. Coffee breaks might be included. > Transportation, accommodation and meals are to be covered by the > participant. > > -------8<-------------------------------------------------- > > Registration form for Agda Implementors' Meeting XXVII > > Name: > > Title and optionally abstract (if you want to give a talk or lead a discussion): > > Suggestions for code sprints (optional): > > Additional comments: > > -------------------------------------------------->8------- > > Note that if you want to stay at SGS Veckobost?der (see wiki) it may be > wise to book a room as soon as possible. > More information > ---------------- > > Check out the wiki for travel suggestions and up-to-date information: > > http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.AIMXXV > > Please spread the word about this meeting. > > Best regards, > Jesper > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at cse.gu.se Wed Apr 11 11:43:07 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Wed, 11 Apr 2018 11:43:07 +0200 Subject: [Agda] =?utf-8?q?AIM_XXVII_-_G=C3=B6teborg=2C_4_=E2=80=93_9_June?= =?utf-8?q?_2018?= In-Reply-To: References: Message-ID: <50318cdc-faae-d7de-d1dc-6db584af0cc0@cse.gu.se> On 2018-04-11 11:37, Jesper Cockx wrote: > More information > ---------------- > > Check out the wiki for travel suggestions and up-to-date information: > > http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.AIMXXV This should presumably be http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.AIMXXVII. -- /NAD From bove at chalmers.se Fri Apr 13 12:51:30 2018 From: bove at chalmers.se (Ana Bove) Date: Fri, 13 Apr 2018 12:51:30 +0200 Subject: [Agda] LFMTP'18 deadline extension Message-ID: <455dfee2-fc96-adbe-855d-08ce417cbb95@chalmers.se> ======================================================================= ?????????????????????????? Call for papers Logical Frameworks and Meta-Languages: Theory and Practice ??????????????????????????? LFMTP 2018 Oxford, UK, 7 July 2018 ???????????????? Affiliated with FSCD 2018 (part of FLoC) http://lfmtp.org/workshops/2018/ ======================================================================= ??? ??? ??? ??? ??? Abstract submission deadline: 22 April 2018 ????????? ?? ??? ? ? ?? Paper submission deadline: 29 April 2018 Logical frameworks and meta-languages form a common substrate for representing, implementing and reasoning about a wide variety of deductive systems of interest in logic and computer science. Their design, implementation and their use in reasoning tasks, ranging from the correctness of software to the properties of formal systems, have been the focus of considerable research over the last two decades. This workshop will bring together designers, implementors and practitioners to discuss various aspects impinging on the structure and utility of logical frameworks, including the treatment of variable binding, inductive and co-inductive reasoning techniques and the expressiveness and lucidity of the reasoning process. LFMTP 2018 will provide researchers a forum to present state-of-the-art techniques and discuss progress in areas such as the following: * Encoding and reasoning about the meta-theory of programming languages, ? logical systems and related formally specified systems. * Theoretical and practical issues concerning the treatment of variable ? binding, especially the representation of, and reasoning about, ? datatypes defined from binding signatures. * Logical treatments of inductive and co-inductive definitions and ? associated reasoning techniques, including inductive types of higher ? dimension in homotopy type theory * Graphical languages for building proofs, applications in geometry, ? equational reasoning and category theory. * New theory contributions: canonical and substructural frameworks, ? contextual frameworks, proof-theoretic foundations supporting ? binders, functional programming over logical frameworks, ? homotopy and cubical type theory. * Applications of logical frameworks: proof-carrying architectures, proof ? exchange and transformation, program refactoring, etc. * Techniques for programming with binders in functional programming ? languages such as Haskell, OCaml or Agda, and logic programming ? languages such as lambda Prolog or Alpha-Prolog. Invited Speakers * Delia Kesner (Universit? Paris Diderot, France) * Kuen-Bang Hou, alias Favonia (Institute for Advanced Study, Princeton, USA) * Grigore Rosu (University of Illinois at Urbana-Champaign, USA) Important Dates ??? Sunday, April 22th: Abstract submission deadline ??? Sunday, April 29th: Submission deadline ??? Saturday, May 19th: Notification to authors ??? Monday, May 28th: Final version due ??? Saturday, July 7th: Workshop Submission In addition to regular papers, we accept the submission of "work in progress" reports, in a broad sense.? Those do not need to report fully polished research results, but should be of interest for the community at large. Submitted papers should be in PDF, formatted using the EPTCS style guidelines. The length is restricted to 15 pages for regular papers and 8 pages for "Work in Progress" papers.? Submission is via EasyChair: https://easychair.org/conferences/?conf=lfmtp18. Proceedings A selection of the presented papers will be published online in the Electronic Proceedings in Theoretical Computer Science (EPTCS). Program Committee * Mar?a Alpuente (Universitat Polit?cnica de Val?ncia, Spain) * Andrej Bauer (University of Ljubljana, Slovenia) * Fr?d?ric Blanqui (Inria, France), co-chair * Ana Bove (Chalmers University of Technology, Sweden) * St?phane Graham-Lengrand (CNRS, France) * Makoto Hamana (Gunma University, Japan) * Chantal Keller (Universit? Paris-Sud, France) * Carlos Olarte (Universidade Federal do Rio grande do Norte, Brazil) * Giselle Reis (CMU Qatar), co-chair * Aaron Stump (University of Iowa, USA) * Yuting Wang (Yale University, USA) -------------- next part -------------- An HTML attachment was scrubbed... URL: From carlos.camarao at gmail.com Mon Apr 16 00:59:06 2018 From: carlos.camarao at gmail.com (Carlos Camarao) Date: Sun, 15 Apr 2018 19:59:06 -0300 Subject: [Agda] SBLP 2018 last call for papers Message-ID: SBLP 2018 last call for papers ________________________________________________________________________________ Universidade de S?o Paulo - ICMC/USP S?o Carlos, Brazil, September 20-21, 2018 Conference website http://www.sbc.org.br/cbsoft2018 Submission link https://easychair.org/conferences/?conf=sblp2018 There are only 3 weeks left for the deadline of paper submission to SBLP 2018, the 22nd edition of the Brazilian Symposium on Programming Languages. The symposium is promoted by the Brazilian Computer Society (SBC) and provides a forum for researchers, students and professionals to present and discuss ideas and innovations in the design, definition, analysis, implementation and practical use of programming languages. Since 2010, it is part of CBSoft, the Brazilian Conference on Software: Theory and Practice (http://cbsoft.org/cbsoft2018/). Submission Guidelines ________________________________________________________________________________ Papers can be written in Portuguese or English. Submission in English is strongly encouraged since the symposium proceedings are indexed in the ACM Digital Library. The acceptance of a paper implies that at least one of its authors will register for the symposium to present it. Papers must be original and not simultaneously submitted to another journal or conference. Papers must be submitted electronically (in PDF format) via the Easychair System: http://www.easychair.org/conferences/?conf=sblp2018 The following paper categories are welcome (page limits include figures, references and appendices): Full papers: up to 8 pages long in ACM 2-column conference format, available at http://www.acm.org/publications/proceedings-template Short papers: up to 3 pages in the same format, can discuss new ideas which are at an early stage of development or can report partial results of on-going dissertations or theses. List of Topics (related but not limited to the following) ________________________________________________________________________________ ? Programming paradigms and styles, scripting and domain-specific languages and support for real-time, service-oriented, multi-threaded, parallel, and distributed programming ? Program generation and transformation ? Formal semantics and theoretical foundations: denotational, operational, algebraic and categorical ? Program analysis and verification, type systems, static analysis and abstract interpretation ? Programming language design and implementation, programming language environments, compilation and interpretation techniques Publication ________________________________________________________________________________ SBLP proceedings will be published in ACM's digital library. As in previous editions, after the conference authors of selected regular papers will be invited to submit an extended version of their work to be considered for publication in a journal's special issue. Since 2009, selected papers of each SBLP edition are being published in a special issue of Science of Computer Programming, by Elsevier. Important dates ________________________________________________________________________________ Abstract submission: April 29th 2018 Paper submission: May 6th 2018 Author notification: June 22nd 2018 Camera ready deadline: July 8th 2018 Program Committee ________________________________________________________________________________ Mariza Bigonha Universidade Federal de Minas Gerais Roberto Bigonha Universidade Federal de Minas Gerais Andre R. Du Bois Universidade Federal de Pelotas Christiano Braga Universidade Federal Fluminense Carlos Camar?o Universidade Federal de Minas Gerais (chair) Fernando Castor Universidade Federal de Pernambuco Renato Cerqueira IBM Research, Brazil Jo?o Fernandes Universidade de Coimbra Jo?o Ferreira Teesside University Luc?lia Figueiredo Universidade Federal de Ouro Preto Ismael Figueroa Pontif?cia Universidad Cat?lica de Valparaiso Alex Garcia Instituto Militar de Engenharia Francisco Heron Universidade Federal do Cear? Roberto Ierusalimschy Pontif?cia Universidade Cat?lica do Rio de Janeiro Yu David Liu State University of New York at Binghamton Hans-Wolfgang Loidl Heriot-Watt University Marcelo Maia Universidade Federal de Uberl?ndia Andr? M. Maidl Pontif?cia Universidade Cat?lica do Paran? Manuel A. Martins Universidade de Aveiro F?bio Mascarenhas Universidade Federal do Rio de Janeiro S?rgio Medeiros Universidade Federal do Rio Grande do Norte Victor Miraldo University of Utrecht ?lvaro Moreira Universidade Federal do Rio Grande do Sul Anamaria M. Moreira Universidade Federal do Rio de Janeiro Peter Mosses Swansea University Martin Musicante Universidade Federal do Rio Grande do Norte Alberto Pardo Universidad de la Rep?blica Fernando Pereira Universidade Federal de Minas Gerais Gustavo Pinto Universidade Federal do Par? Louis-Noel Pouchet Ohio State University Zongyan Qiu Peking University Henrique R?belo Universidade Federal de Pernambuco Leonardo Reis Universidade Federal de Ouro Preto Rodrigo Ribeiro Universidade Federal de Ouro Preto Noemi Rodriguez Pontif?cia Universidade Cat?lica do Rio de Janeiro Francisco Sant'Anna Universidade Estadual do Rio de Janeiro Jo?o Saraiva Universidade do Minho Martin Sulzmann Hochschule Karlsruhe - Technik und Wirtschaft (chair) Leopoldo Teixeira Universidade Federal de Pernambuco Simon Thompson University of Kent Cristiano Vasconcellos Universidade do Estado de Santa Catarina Varmo Vene University of Tartu Invited Speaker ________________________________________________________________________________ Martin Sulzmann, Hochschule Karlsruhe - Technik und Wirtschaft, Germany Contact ________________________________________________________________________________ All questions about submissions should be emailed to Carlos Camar?o (camarao at dcc.ufmg.br) -------------- next part -------------- An HTML attachment was scrubbed... URL: From P.Achten at cs.ru.nl Mon Apr 16 15:01:45 2018 From: P.Achten at cs.ru.nl (Peter Achten) Date: Mon, 16 Apr 2018 15:01:45 +0200 Subject: [Agda] 2nd call for papers: Trends in Functional Programming, 11-13 june 2018, Chalmers Campus Johanneberg, Gothenburg Message-ID: ?????????????? ------------------------------------- ?????????????? 2 N D?? C A L L?? F O R?? P A P E R S ?????????????? ------------------------------------- ??????????????????? ======== TFP 2018 =========== ????????? 19th Symposium on Trends in Functional Programming ?????????????????????????? 11-13 June, 2018 ???????????????????? Chalmers Campus Johanneberg, Gothenburg ?????????? http://www.cse.chalmers.se/~myreen/tfp2018/index.html The symposium on Trends in Functional Programming (TFP) is an international forum for researchers with interests in all aspects of functional programming, taking a broad view of current and future trends in the area. It aspires to be a lively environment for presenting the latest research results, and other contributions (see below at scope). Please be aware that TFP uses two distinct rounds of submissions (see below at submission details). TFP 2018 will be the main event of a pair of functional programming events. TFP 2018 will be accompanied by the International Workshop on Trends in Functional Programming in Education (TFPIE), which will take place on June 14. == SCOPE == The symposium recognizes that new trends may arise through various routes. As part of the Symposium's focus on trends we therefore identify the following five article categories. High-quality articles are solicited in any of these categories: Research Articles: ??? Leading-edge, previously unpublished research work Position Articles: ??? On what new trends should or should not be Project Articles: ??? Descriptions of recently started new projects Evaluation Articles: ??? What lessons can be drawn from a finished project Overview Articles: ??? Summarizing work with respect to a trendy subject. Articles must be original and not simultaneously submitted for publication to any other forum. They may consider any aspect of functional programming: theoretical, implementation-oriented, or experience-oriented. Applications of functional programming techniques to other languages are also within the scope of the symposium. Topics suitable for the symposium include, but are not limited to: ??? Functional programming and multicore/manycore computing ??? Functional programming in the cloud ??? High performance functional computing ??? Extra-functional (behavioural) properties of functional programs ??? Dependently typed functional programming ??? Validation and verification of functional programs ??? Debugging and profiling for functional languages ??? Functional programming in different application areas: ??? security, mobility, telecommunications applications, embedded ??? systems, global computing, grids, etc. ??? Interoperability with imperative programming languages ??? Novel memory management techniques ??? Program analysis and transformation techniques ??? Empirical performance studies ??? Abstract/virtual machines and compilers for functional languages ??? (Embedded) domain specific languages ??? New implementation strategies ??? Any new emerging trend in the functional programming area If you are in doubt on whether your article is within the scope of TFP, please contact the TFP 2018 program chairs, Micha? Pa?ka and Magnus Myreen. == Best Paper Awards == To reward excellent contributions, TFP awards a prize for the best paper accepted for the formal proceedings. TFP traditionally pays special attention to research students, acknowledging that students are almost by definition part of new subject trends. A student paper is one for which the authors state that the paper is mainly the work of students, the students are listed as first authors, and a student would present the paper. A prize for the best student paper is awarded each year. In both cases, it is the PC of TFP that awards the prize. In case the best paper happens to be a student paper, that paper will then receive both prizes. == Paper Submissions == We use EasyChair for the refereeing process. The link to the submission page is: https://easychair.org/conferences/?conf=tfp2018 Authors of papers have the choice of having their contributions formally reviewed either before or after the Symposium. == Pre-symposium formal review == Papers to be formally reviewed before the symposium should be submitted before an early deadline and receive their reviews and notification of acceptance for both presentation and publication before the symposium. A paper that has been rejected in this process may still be accepted for presentation at the symposium, but will not be considered for the post-symposium formal review. == Post-symposium formal review == Draft papers will receive minimal reviews and notification of acceptance for presentation at the symposium. Authors of draft papers will be invited to submit revised papers based on the feedback receive at the symposium. A post-symposium refereeing process will then select a subset of these articles for formal publication. == Paper categories == Draft papers and papers submitted for formal review are submitted as extended abstracts (4 to 10 pages in length) or full papers (20 pages). The submission must clearly indicate which category it belongs to: research, position, project, evaluation, or overview paper. It should also indicate which authors are research students, and whether the main author(s) are students. A draft paper for which all authors are students will receive additional feedback by one of the PC members shortly after the symposium has taken place. == Format == Papers must be written in English, and written using the LNCS style. For more information about formatting please consult the Springer LNCS web site. == Important Dates == Submission (pre-symposium review):?????????????????? March 26, 2018? -- passed -- Submission (draft, post-symposium review):?????????? April 26, 2018? --? open? -- Notification (pre- and post-symposium review):?????? May??? 3, 2018 Registration:??????????????????????????????????????? June?? 3, 2018 TFP Symposium:?????????????????????????????????????? June 11-13, 2018 TFPIE Workshop:????????????????????????????????????? June?? 14, 2018 Student papers feedback:???????????????????????????? June?? 21, 2018 Submission (post-symposium review):????????????????? August 14, 2018 Notification (post-symposium review):??????????????? September 20, 2018 Camera-ready paper (pre- and post-symposium review): November 30, 2018 == Program Committee == Program Co-chairs Micha? Pa?ka,??? Chalmers University of Technology (SE) Magnus Myreen,??? Chalmers University of Technology (SE) Program Committee Soichiro Hidaka,??????? Hosei University (JP) Meng Wang,????????????? University of Bristol (UK) Sam Tobin-Hochstadt,??? Indiana University Bloomington (US) Tiark Rompf,??????????? Purdue University (US) Patricia Johann,??????? Appalachian State University (US) Neil Sculthorpe,??????? Nottingham Trent University (UK) Andres L?h,???????????? Well-Typed LLP (UK) Tarmo Uustalu,????????? Tallinn University of Technology (EE) Cosmin E. Oancea,?????? University of Copenhagen (DK) Mauro Jaskelioff,?????? Universidad Nacional de Rosario (AR) Peter Achten,?????????? Radboud University (NL) Dimitrios Vytiniotis,?? Microsoft Research (UK) Alberto Pardo,????????? Universidad de la Rep?blica (UY) Natalia Chechina,?????? University of Glasgow (UK) Peter Sestoft,????????? IT University of Copenhagen (DK) Scott Owens,??????????? University of Kent (UK) From W.S.Swierstra at uu.nl Mon Apr 16 15:05:01 2018 From: W.S.Swierstra at uu.nl (Swierstra, W.S. (Wouter)) Date: Mon, 16 Apr 2018 13:05:01 +0000 Subject: [Agda] Call for Participation: AFP Summer School in Utrecht Message-ID: # Call for Participation SUMMER SCHOOL ON ADVANCED FUNCTIONAL PROGRAMMING Utrecht, the Netherlands, 27-31 August 2018 http://www.afp.school ## ABOUT The Advanced Functional Programming summer school has been running for more than ten years. We aim to educate aspiring Haskell programmers beyond the basic material covered by many textbooks. The lectures will cover several more advanced topics regarding the theory and practice of Haskell programming, including topics such as: * lambda calculus; * monads and monad transformers; * lazy evaluation; * generalized algebraic data types; * type families and type-level programming; * concurrency and parallelism. The summer school consists of a mix of lectures, labs, and a busy social program. ## LECTURERS Utrecht staff: * Johan Jeuring * Alejandro Serrano Mena * Doaitse Swierstra * Wouter Swierstra Guest lectures: * Manuel Chakravarty * Koen Claessen * Gabriele Keller ## PREREQUISITES We expect students to have a basic familiarity with Haskell already. You should be able to write recursive functions over algebraic data types, such as lists and trees. There is a great deal of material readily available that covers this material. If you?ve already started learning Haskell and are looking to take your functional programming skills to the next level, this is the course for you. ## DATES Registration deadline: 1 August, 2017 School: 27-31 August ## COSTS ?1700 - Housing and registration ?1500 - Registration only We offer a ?1000 discount for students and staff members affiliated with a university. ## SCHOLARSHIPS If you?re struggling to finance your trip to Utrecht, please let us know. We have a limited number of scholarships or discounts available for students that would not be able to attend otherwise, especially for women and under represented minorities. ## FURTHER INFORMATION Further information, including instructions on how to register, is available on our website: http://www.afp.school From mechvel at botik.ru Tue Apr 17 14:22:13 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Tue, 17 Apr 2018 15:22:13 +0300 Subject: [Agda] type of [] Message-ID: <1523967733.27375.13.camel@scico.botik.ru> People, In the proof take-n-[] : {n : ?} ? take n [] ? [] take-n-[] {0} = refl take-n-[] {suc _} = refl Agda cannot derive the type of []. I can fix the signature in two ways. (I) take-n-[] : ? {?} {A : Set ?} {n} ? let []A : List A -- lenghty []A = [] in take n []A ? [] (II) El : ? {a} (A : Set a) ? A ? A -- for common usage El A x = x -- -- syntax El A x = x ?: A -- take-n-[] : ? {?} {A : Set ?} {n} ? take n ([] ?: List A) ? [] What is a regular approach, please? ------ Sergei From Thorsten.Altenkirch at nottingham.ac.uk Tue Apr 17 14:52:36 2018 From: Thorsten.Altenkirch at nottingham.ac.uk (Thorsten Altenkirch) Date: Tue, 17 Apr 2018 12:52:36 +0000 Subject: [Agda] type of [] In-Reply-To: <1523967733.27375.13.camel@scico.botik.ru> References: <1523967733.27375.13.camel@scico.botik.ru> Message-ID: <8A8DC433-5D38-4D99-A15E-03C8A98DB7BA@exmail.nottingham.ac.uk> Not sure what is the "regular" way but could you not just supply the implicit argument to [] (or to take)? take-n-[] : ? {?} {A : Set ?} {n} ? take n ([] {A}) ? [] or take-n-[] : ? {?} {A : Set ?} {n} ? take {A} n [] ? [] ?On 17/04/2018, 13:45, "Agda on behalf of Sergei Meshveliani" wrote: People, In the proof take-n-[] : {n : ?} ? take n [] ? [] take-n-[] {0} = refl take-n-[] {suc _} = refl Agda cannot derive the type of []. I can fix the signature in two ways. (I) take-n-[] : ? {?} {A : Set ?} {n} ? let []A : List A -- lenghty []A = [] in take n []A ? [] (II) El : ? {a} (A : Set a) ? A ? A -- for common usage El A x = x -- -- syntax El A x = x ?: A -- take-n-[] : ? {?} {A : Set ?} {n} ? take n ([] ?: List A) ? [] What is a regular approach, please? ------ Sergei _______________________________________________ Agda mailing list Agda at lists.chalmers.se https://lists.chalmers.se/mailman/listinfo/agda This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please contact the sender and delete the email and attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. Email communications with the University of Nottingham may be monitored where permitted by law. From mechvel at botik.ru Tue Apr 17 22:04:49 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Tue, 17 Apr 2018 23:04:49 +0300 Subject: [Agda] type of [] In-Reply-To: <8A8DC433-5D38-4D99-A15E-03C8A98DB7BA@exmail.nottingham.ac.uk> References: <1523967733.27375.13.camel@scico.botik.ru> <8A8DC433-5D38-4D99-A15E-03C8A98DB7BA@exmail.nottingham.ac.uk> Message-ID: <1523995489.2301.5.camel@one.mechvel.pereslavl.ru> On Tue, 2018-04-17 at 12:52 +0000, Thorsten Altenkirch wrote: > Not sure what is the "regular" way but could you not just supply the implicit argument to [] (or to take)? > > take-n-[] : ? {?} {A : Set ?} {n} ? take n ([] {A}) ? [] > > or > > take-n-[] : ? {?} {A : Set ?} {n} ? take {A} n [] ? [] > Thank you. This is exactly what is needed. I knew that I was missing some simple point, but just did not recall that `take' or [] can be given implicit argument! ------ Sergei > ?On 17/04/2018, 13:45, "Agda on behalf of Sergei Meshveliani" wrote: > > People, > > In the proof > > take-n-[] : {n : ?} ? take n [] ? [] > take-n-[] {0} = refl > take-n-[] {suc _} = refl > > Agda cannot derive the type of []. > I can fix the signature in two ways. > [..] From wadler at inf.ed.ac.uk Wed Apr 18 20:50:35 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Wed, 18 Apr 2018 15:50:35 -0300 Subject: [Agda] Infix in Modules with Parameters Message-ID: Consider the following simple variant of an example in the user manual. --- open import Data.List using (List; _?_; []) open import Data.Bool using (Bool; true; false) module Sort(A : Set)(_?_ : A ? A ? Bool)(_?_ : A ? A ? A)(zero : A) where infix 1 _?_ infix 2 _?_ insert : A ? List A ? List A insert x [] = x ? [] insert x (y ? ys) with zero ? (y ? x) insert x (y ? ys) | true = x ? y ? ys insert x (y ? ys) | false = y ? insert x ys sort : List A ? List A sort [] = [] sort (x ? xs) = insert x (sort xs) --- This works fine. But now say I add infix declarations in so I can omit parentheses. --- open import Data.List using (List; _?_; []) open import Data.Bool using (Bool; true; false) module Sort(A : Set)(_?_ : A ? A ? Bool)(_?_ : A ? A ? A)(zero : A) where infix 1 _?_ infix 2 _?_ insert : A ? List A ? List A insert x [] = x ? [] insert x (y ? ys) with zero ? (y ? x) insert x (y ? ys) | true = x ? y ? ys insert x (y ? ys) | false = y ? insert x ys sort : List A ? List A sort [] = [] sort (x ? xs) = insert x (sort xs) --- This yields the error message: /Users/wadler/sf/src/extra/ModuleInfix.agda:8,11-14 > The following names are not declared in the same scope as their > syntax or fixity declaration (i.e., either not in scope at all, > imported from another module, or declared in a super module): _?_ > _?_ > when scope checking the declaration > module Sort (A : Set)(_?_ : A ? A ? Bool)(_?_ : A ? A ? A) > (zero : A) where Moving the infix declarations before the module yields a similar error message. 1. What is the right way to declare fixity of infix parameters to a module? 2. Where is this documented? Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From martin.stone.davis at gmail.com Thu Apr 19 01:56:48 2018 From: martin.stone.davis at gmail.com (Martin Stone Davis) Date: Wed, 18 Apr 2018 16:56:48 -0700 Subject: [Agda] Infix in Modules with Parameters In-Reply-To: References: Message-ID: I'm not sure if or where it's documented, but here's a trick I use: place a `let` declaration in with the module parameters. See `M2` below. ```agda module M1 (_<_ : Set ? Set ? Set) where ? postulate ??? A : Set ??? C : (A < A) < A module M2 (_<_ : Set ? Set ? Set) (let _<_ = _<_; infixl 5 _<_) where ? postulate ??? A : Set ??? C : A < A < A ``` On 04/18/2018 11:50 AM, Philip Wadler wrote: > Consider the following simple variant of an example in the user manual. > > --- > > open import Data.List using (List; _?_; []) > open import Data.Bool using (Bool; true; false) > > module Sort(A : Set)(_?_ : A ? A ? Bool)(_?_ : A ? A ? A)(zero : A) where > > ? infix 1 _?_ > ? infix 2 _?_ > > ? insert : A ? List A ? List A > ? insert x [] = x ? [] > ? insert x (y ? ys) with zero ? (y ? x) > ? insert x (y ? ys)? ? | true? = x ? y ? ys > ? insert x (y ? ys)? ? | false = y ? insert x ys > > ? sort : List A ? List A > ? sort []? ? ? ?= [] > ? sort (x ? xs) = insert x (sort xs) > > --- > > This works fine. But now say I add infix declarations in so I can omit > parentheses. > > --- > > open import Data.List using (List; _?_; []) > open import Data.Bool using (Bool; true; false) > > module Sort(A : Set)(_?_ : A ? A ? Bool)(_?_ : A ? A ? A)(zero : A) where > > ? infix 1 _?_ > ? infix 2 _?_ > > ? insert : A ? List A ? List A > ? insert x [] = x ? [] > ? insert x (y ? ys) with zero ? (y ? x) > ? insert x (y ? ys)? ? | true? = x ? y ? ys > ? insert x (y ? ys)? ? | false = y ? insert x ys > > ? sort : List A ? List A > ? sort []? ? ? ?= [] > ? sort (x ? xs) = insert x (sort xs) > > --- > > This yields the error message: > > /Users/wadler/sf/src/extra/ModuleInfix.agda:8,11-14 > The following names are not declared in the same scope as their > syntax or fixity declaration (i.e., either not in scope at all, > imported from another module, or declared in a super module): _?_ > _?_ > when scope checking the declaration > ? module Sort (A : Set)(_?_ : A ? A ? Bool)(_?_ : A ? A ? A) > ? ? ? ? ? ? ? (zero : A) where > > > Moving the infix declarations before the module yields a similar error > message. > > 1. What is the right way to declare fixity of infix parameters to a > module? > 2. Where is this documented? > > Cheers, -- P > > > > > . ? \ Philip Wadler, Professor of Theoretical Computer Science, > . ? /\ School of Informatics, University of Edinburgh > .? /? \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda -------------- next part -------------- An HTML attachment was scrubbed... URL: From wadler at inf.ed.ac.uk Thu Apr 19 14:31:55 2018 From: wadler at inf.ed.ac.uk (Philip Wadler) Date: Thu, 19 Apr 2018 09:31:55 -0300 Subject: [Agda] Infix in Modules with Parameters In-Reply-To: References: Message-ID: Thanks. Wow, that looks incredibly ugly. When invoking the module, what would one pass to instantiate the second parameter? Cheers, -- P . \ Philip Wadler, Professor of Theoretical Computer Science, . /\ School of Informatics, University of Edinburgh . / \ and Senior Research Fellow, IOHK . http://homepages.inf.ed.ac.uk/wadler/ On 18 April 2018 at 20:56, Martin Stone Davis wrote: > I'm not sure if or where it's documented, but here's a trick I use: place > a `let` declaration in with the module parameters. See `M2` below. > > ```agda > module M1 (_<_ : Set ? Set ? Set) where > postulate > A : Set > C : (A < A) < A > > module M2 (_<_ : Set ? Set ? Set) (let _<_ = _<_; infixl 5 _<_) where > postulate > A : Set > C : A < A < A > ``` > > On 04/18/2018 11:50 AM, Philip Wadler wrote: > > Consider the following simple variant of an example in the user manual. > > --- > > open import Data.List using (List; _?_; []) > open import Data.Bool using (Bool; true; false) > > module Sort(A : Set)(_?_ : A ? A ? Bool)(_?_ : A ? A ? A)(zero : A) where > > infix 1 _?_ > infix 2 _?_ > > insert : A ? List A ? List A > insert x [] = x ? [] > insert x (y ? ys) with zero ? (y ? x) > insert x (y ? ys) | true = x ? y ? ys > insert x (y ? ys) | false = y ? insert x ys > > sort : List A ? List A > sort [] = [] > sort (x ? xs) = insert x (sort xs) > > --- > > This works fine. But now say I add infix declarations in so I can omit > parentheses. > > --- > > open import Data.List using (List; _?_; []) > open import Data.Bool using (Bool; true; false) > > module Sort(A : Set)(_?_ : A ? A ? Bool)(_?_ : A ? A ? A)(zero : A) where > > infix 1 _?_ > infix 2 _?_ > > insert : A ? List A ? List A > insert x [] = x ? [] > insert x (y ? ys) with zero ? (y ? x) > insert x (y ? ys) | true = x ? y ? ys > insert x (y ? ys) | false = y ? insert x ys > > sort : List A ? List A > sort [] = [] > sort (x ? xs) = insert x (sort xs) > > --- > > This yields the error message: > > /Users/wadler/sf/src/extra/ModuleInfix.agda:8,11-14 >> The following names are not declared in the same scope as their >> syntax or fixity declaration (i.e., either not in scope at all, >> imported from another module, or declared in a super module): _?_ >> _?_ >> when scope checking the declaration >> module Sort (A : Set)(_?_ : A ? A ? Bool)(_?_ : A ? A ? A) >> (zero : A) where > > > Moving the infix declarations before the module yields a similar error > message. > > 1. What is the right way to declare fixity of infix parameters to a module? > 2. Where is this documented? > > Cheers, -- P > > > > > . \ Philip Wadler, Professor of Theoretical Computer Science, > . /\ School of Informatics, University of Edinburgh > . / \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > > > _______________________________________________ > Agda mailing listAgda at lists.chalmers.sehttps://lists.chalmers.se/mailman/listinfo/agda > > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From gergo at erdi.hu Thu Apr 19 14:48:15 2018 From: gergo at erdi.hu (Dr. ERDI Gergo) Date: Thu, 19 Apr 2018 20:48:15 +0800 (+08) Subject: [Agda] Infix in Modules with Parameters In-Reply-To: References: Message-ID: On Thu, 19 Apr 2018, Philip Wadler wrote: > Thanks. Wow, that looks incredibly ugly. When invoking the module, what would one pass > to instantiate the second parameter? Cheers, -- P Those lets are not parameters of the module, so if you have e.g. module X (A : Set) (_?_ : A ? A ? Bool)(let _?_ = _?_; infix 1 _?_)(_?_ : A ? A ? A)(let _?_ = _?_; infix 1 _?_)(zero : A) where you can still instantiate it with four arguments. From carette at mcmaster.ca Thu Apr 19 15:01:32 2018 From: carette at mcmaster.ca (Jacques Carette) Date: Thu, 19 Apr 2018 09:01:32 -0400 Subject: [Agda] Infix in Modules with Parameters In-Reply-To: References: Message-ID: <203f623d-cae2-ba52-89d3-82e5ca80f537@mcmaster.ca> On 2018-04-19 8:48 AM, Dr. ERDI Gergo wrote: > On Thu, 19 Apr 2018, Philip Wadler wrote: > >> Thanks. Wow, that looks incredibly ugly. When invoking the module, >> what would one pass >> to instantiate the second parameter? Cheers, -- P > > Those lets are not parameters of the module, so if you have e.g. > > module X (A : Set) (_?_ : A ? A ? Bool)(let _?_ = _?_; infix 1 > _?_)(_?_ : A ? A ? A)(let _?_ = _?_; infix 1 _?_)(zero : A) where > > you can still instantiate it with four arguments. Right - this kind of feature is exactly what I was asking about on the Types list in November 2016 [1].? Definitional extensions in telescopes are extremely useful.? They are in particular crucial for implementing 'theory morphisms'.? In Agda, this would translate to adaptors between modules, but as first-class. Jacques [1] http://types-list.seas.upenn.narkive.com/xzbVN1Jx/types-theories-with-first-class-definitional-extensions From guillaume.allais at ens-lyon.org Thu Apr 19 15:28:19 2018 From: guillaume.allais at ens-lyon.org (Guillaume Allais) Date: Thu, 19 Apr 2018 15:28:19 +0200 Subject: [Agda] Infix in Modules with Parameters In-Reply-To: References: Message-ID: For the record, this feature request has been around for close to 4 years now: https://github.com/agda/agda/issues/1235 It would indeed be really nice to have such a thing. Cheers, -- gallais On 18/04/18 20:50, Philip Wadler wrote: > Consider the following simple variant of an example in the user manual. > > --- > > open import Data.List using (List; _?_; []) > open import Data.Bool using (Bool; true; false) > > module Sort(A : Set)(_?_ : A ? A ? Bool)(_?_ : A ? A ? A)(zero : A) where > > ? infix 1 _?_ > ? infix 2 _?_ > > ? insert : A ? List A ? List A > ? insert x [] = x ? [] > ? insert x (y ? ys) with zero ? (y ? x) > ? insert x (y ? ys)? ? | true? = x ? y ? ys > ? insert x (y ? ys)? ? | false = y ? insert x ys > > ? sort : List A ? List A > ? sort []? ? ? ?= [] > ? sort (x ? xs) = insert x (sort xs) > > --- > > This works fine. But now say I add infix declarations in so I can omit > parentheses. > > --- > > open import Data.List using (List; _?_; []) > open import Data.Bool using (Bool; true; false) > > module Sort(A : Set)(_?_ : A ? A ? Bool)(_?_ : A ? A ? A)(zero : A) where > > ? infix 1 _?_ > ? infix 2 _?_ > > ? insert : A ? List A ? List A > ? insert x [] = x ? [] > ? insert x (y ? ys) with zero ? (y ? x) > ? insert x (y ? ys)? ? | true? = x ? y ? ys > ? insert x (y ? ys)? ? | false = y ? insert x ys > > ? sort : List A ? List A > ? sort []? ? ? ?= [] > ? sort (x ? xs) = insert x (sort xs) > > --- > > This yields the error message: > > /Users/wadler/sf/src/extra/ModuleInfix.agda:8,11-14 > The following names are not declared in the same scope as their > syntax or fixity declaration (i.e., either not in scope at all, > imported from another module, or declared in a super module): _?_ > _?_ > when scope checking the declaration > ? module Sort (A : Set)(_?_ : A ? A ? Bool)(_?_ : A ? A ? A) > ? ? ? ? ? ? ? (zero : A) where > > > Moving the infix declarations before the module yields a similar error > message. > > 1. What is the right way to declare fixity of infix parameters to a > module? > 2. Where is this documented? > > Cheers, -- P > > > > > . ? \ Philip Wadler, Professor of Theoretical Computer Science, > . ? /\ School of Informatics, University of Edinburgh > .? /? \ and Senior Research Fellow, IOHK > . http://homepages.inf.ed.ac.uk/wadler/ > > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From david.wahlstedt at gmail.com Fri Apr 20 17:06:56 2018 From: david.wahlstedt at gmail.com (David Wahlstedt) Date: Fri, 20 Apr 2018 17:06:56 +0200 Subject: [Agda] ASN.1 and type theory Message-ID: Hello, I wonder if any of you in this list knows anything about ASN.1, and if you happen to know about are any tools to translate a given ASN.1 specification into an algebraic datatype(perhaps also with dependent types)? Or maybe some type theorist have written about ASN.1 anywhere? Best regards, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at cse.gu.se Sun Apr 22 10:47:11 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Sun, 22 Apr 2018 10:47:11 +0200 Subject: [Agda] ASN.1 and type theory In-Reply-To: References: Message-ID: <95ddd524-9c0b-a757-61f1-97c14036308f@cse.gu.se> On 2018-04-20 17:06, David Wahlstedt wrote: > Or maybe some type theorist have written about ASN.1 anywhere? A quick search led to https://github.com/bendy/fiat-asn.1, which is described as "A formally verified ASN.1 compiler using Fiat". -- /NAD From carlos.camarao at gmail.com Sun Apr 22 14:38:30 2018 From: carlos.camarao at gmail.com (Carlos Camarao) Date: Sun, 22 Apr 2018 09:38:30 -0300 Subject: [Agda] SBLP 2018 deadline extension Message-ID: SBLP 2018 deadline extension ________________________________________________________________________________ Universidade de S?o Paulo - ICMC/USP S?o Carlos, Brazil, September 20-21, 2018 Conference website http://www.sbc.org.br/cbsoft2018 Submission link https://easychair.org/conferences/?conf=sblp2018 SBLp 2018 is the 22nd edition of the Brazilian Symposium on Programming Languages. The symposium is promoted by the Brazilian Computer Society (SBC) and provides a forum for researchers, students and professionals to present and discuss ideas and innovations in the design, definition, analysis, implementation and practical use of programming languages. SBLP 2018 updated deadlines are: ________________________________________________________________________________ Abstract submission: May 6th 2018 Paper submission: May 21st 2018 Author notification: June 29th 2018 Camera ready deadline: July 15th 2018 Submission Guidelines ________________________________________________________________________________ Papers can be written in Portuguese or English. Submission in English is strongly encouraged since the symposium proceedings are indexed in the ACM Digital Library. The acceptance of a paper implies that at least one of its authors will register for the symposium to present it. Papers must be original and not simultaneously submitted to another journal or conference. Papers must be submitted electronically (in PDF format) via the Easychair System: http://www.easychair.org/conferences/?conf=sblp2018 The following paper categories are welcome (page limits include figures, references and appendices): Full papers: up to 8 pages long in ACM 2-column conference format, available at http://www.acm.org/publications/proceedings-template Short papers: up to 3 pages in the same format, can discuss new ideas which are at an early stage of development or can report partial results of on-going dissertations or theses. List of Topics (related but not limited to the following) ________________________________________________________________________________ ? Programming paradigms and styles, scripting and domain-specific languages and support for real-time, service-oriented, multi-threaded, parallel, and distributed programming ? Program generation and transformation ? Formal semantics and theoretical foundations: denotational, operational, algebraic and categorical ? Program analysis and verification, type systems, static analysis and abstract interpretation ? Programming language design and implementation, programming language environments, compilation and interpretation techniques Publication ________________________________________________________________________________ SBLP proceedings will be published in ACM's digital library. As in previous editions, after the conference authors of selected regular papers will be invited to submit an extended version of their work to be considered for publication in a journal's special issue. Since 2009, selected papers of each SBLP edition are being published in a special issue of Science of Computer Programming, by Elsevier. Program Committee ________________________________________________________________________________ Mariza Bigonha Universidade Federal de Minas Gerais Roberto Bigonha Universidade Federal de Minas Gerais Andre R. Du Bois Universidade Federal de Pelotas Christiano Braga Universidade Federal Fluminense Carlos Camar?o Universidade Federal de Minas Gerais (chair) Fernando Castor Universidade Federal de Pernambuco Renato Cerqueira IBM Research, Brazil Jo?o Fernandes Universidade de Coimbra Jo?o Ferreira Teesside University Luc?lia Figueiredo Universidade Federal de Ouro Preto Ismael Figueroa Pontif?cia Universidad Cat?lica de Valparaiso Alex Garcia Instituto Militar de Engenharia Francisco Heron Universidade Federal do Cear? Roberto Ierusalimschy Pontif?cia Universidade Cat?lica do Rio de Janeiro Yu David Liu State University of New York at Binghamton Hans-Wolfgang Loidl Heriot-Watt University Marcelo Maia Universidade Federal de Uberl?ndia Andr? M. Maidl Pontif?cia Universidade Cat?lica do Paran? Manuel A. Martins Universidade de Aveiro F?bio Mascarenhas Universidade Federal do Rio de Janeiro S?rgio Medeiros Universidade Federal do Rio Grande do Norte Victor Miraldo University of Utrecht ?lvaro Moreira Universidade Federal do Rio Grande do Sul Anamaria M. Moreira Universidade Federal do Rio de Janeiro Peter Mosses Swansea University Martin Musicante Universidade Federal do Rio Grande do Norte Alberto Pardo Universidad de la Rep?blica Fernando Pereira Universidade Federal de Minas Gerais Gustavo Pinto Universidade Federal do Par? Louis-Noel Pouchet Ohio State University Zongyan Qiu Peking University Henrique R?belo Universidade Federal de Pernambuco Leonardo Reis Universidade Federal de Ouro Preto Rodrigo Ribeiro Universidade Federal de Ouro Preto Noemi Rodriguez Pontif?cia Universidade Cat?lica do Rio de Janeiro Francisco Sant'Anna Universidade Estadual do Rio de Janeiro Jo?o Saraiva Universidade do Minho Martin Sulzmann Hochschule Karlsruhe - Technik und Wirtschaft (chair) Leopoldo Teixeira Universidade Federal de Pernambuco Simon Thompson University of Kent Cristiano Vasconcellos Universidade do Estado de Santa Catarina Varmo Vene University of Tartu Invited Speaker ________________________________________________________________________________ Martin Sulzmann, Hochschule Karlsruhe - Technik und Wirtschaft, Germany Contact ________________________________________________________________________________ All questions about submissions should be emailed to Carlos Camar?o (camarao at dcc.ufmg.br) -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.wahlstedt at gmail.com Sun Apr 22 21:00:31 2018 From: david.wahlstedt at gmail.com (David Wahlstedt) Date: Sun, 22 Apr 2018 19:00:31 +0000 Subject: [Agda] ASN.1 and type theory In-Reply-To: <95ddd524-9c0b-a757-61f1-97c14036308f@cse.gu.se> References: <95ddd524-9c0b-a757-61f1-97c14036308f@cse.gu.se> Message-ID: Thanks! Den s?n 22 apr. 2018 10:47Nils Anders Danielsson skrev: > On 2018-04-20 17:06, David Wahlstedt wrote: > > Or maybe some type theorist have written about ASN.1 anywhere? > > A quick search led to > > https://github.com/bendy/fiat-asn.1, > > which is described as "A formally verified ASN.1 compiler using Fiat". > > -- > /NAD > -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.escardo at cs.bham.ac.uk Mon Apr 23 21:55:03 2018 From: m.escardo at cs.bham.ac.uk (=?UTF-8?B?TWFydMOtbiBIw7Z0emVsIEVzY2FyZMOz?=) Date: Mon, 23 Apr 2018 20:55:03 +0100 Subject: [Agda] Redundant imports Message-ID: I have reorganized a large code base by splitting and merging modules, and moving things from one module to another, and I fear I am left with very many redundant imports. Is there any way to detect them automatically? This is important to try speed up "reloading" in interactive mode. (Although already this refactoring has improved this bit.) Thanks, Martin From nad at cse.gu.se Tue Apr 24 10:54:06 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Tue, 24 Apr 2018 10:54:06 +0200 Subject: [Agda] Redundant imports In-Reply-To: References: Message-ID: On 2018-04-23 21:55, Mart?n H?tzel Escard? wrote: > I have reorganized a large code base by splitting and merging modules, > and moving things from one module to another, and I fear I am left > with very many redundant imports. Is there any way to detect them > automatically? Guillame Allais has been working on something like this on a separate branch: https://github.com/agda/agda/issues/2503 -- /NAD From mechvel at botik.ru Tue Apr 24 11:59:50 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Tue, 24 Apr 2018 12:59:50 +0300 Subject: [Agda] Redundant imports In-Reply-To: References: Message-ID: <1524563990.2682.6.camel@one.mechvel.pereslavl.ru> I also suffer of redundant import. Even a slight code change often leads to redundant import. ------ Sergei On Mon, 2018-04-23 at 20:55 +0100, Mart?n H?tzel Escard? wrote: > I have reorganized a large code base by splitting and merging modules, > and moving things from one module to another, and I fear I am left with > very many redundant imports. Is there any way to detect them > automatically? This is important to try speed up "reloading" in > interactive mode. (Although already this refactoring has improved this bit.) > > Thanks, > Martin > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > From guillaume.allais at ens-lyon.org Wed Apr 25 13:40:04 2018 From: guillaume.allais at ens-lyon.org (Guillaume Allais) Date: Wed, 25 Apr 2018 13:40:04 +0200 Subject: [Agda] Redundant imports In-Reply-To: <2964237b-91e6-6494-7a0c-d1311424ff0c@cs.bham.ac.uk> References: <2964237b-91e6-6494-7a0c-d1311424ff0c@cs.bham.ac.uk> Message-ID: <6e1f8612-080c-c278-85f2-663512c48180@ens-lyon.org> Hi Martin, I don't really remember how it works but looking at the code, there seems to be a warning level for useless imports (the analysis was extremely slow so it seems I disabled it by default and that's probably one of the reasons why I did not try to merge it in Agda stable). https://github.com/agda/agda/commit/f45e8e0850e8e5d5a42f65c46275beeb112df4d8#diff-71ae678c257eb560c9d6e9fb881133c4R108 I think that if you were to put `{-# OPTIONS -Wuseless-imports #-}` at the top of your file, it should work. Hope it helps! Cheers, -- gallais On 25/04/18 10:04, Martin Escardo wrote: > Thanks. I compiled this branch. But how do I use this feature? I just > tried to load a module in emacs, with deliberately unneeded imports, > and nothing is reported. Or do I need to invoke a command for this > check? M. > > On 24/04/18 09:54, nad at cse.gu.se wrote: >> On 2018-04-23 21:55, Mart?n H?tzel Escard? wrote: >>> I have reorganized a large code base by splitting and merging modules, >>> and moving things from one module to another, and I fear I am left >>> with very many redundant imports. Is there any way to detect them >>> automatically? >> >> Guillame Allais has been working on something like this on a separate >> branch: >> >> ?? https://github.com/agda/agda/issues/2503 >> > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From m.escardo at cs.bham.ac.uk Wed Apr 25 13:53:07 2018 From: m.escardo at cs.bham.ac.uk (Martin Escardo) Date: Wed, 25 Apr 2018 12:53:07 +0100 Subject: [Agda] Redundant imports In-Reply-To: <6e1f8612-080c-c278-85f2-663512c48180@ens-lyon.org> References: <2964237b-91e6-6494-7a0c-d1311424ff0c@cs.bham.ac.uk> <6e1f8612-080c-c278-85f2-663512c48180@ens-lyon.org> Message-ID: <9504a1e0-88b0-6423-23c5-70d78996505a@cs.bham.ac.uk> On 25/04/18 12:40, guillaume.allais at ens-lyon.org wrote: > Hi Martin, > > I don't really remember how it works but looking at the code, > there seems to be a warning level for useless imports (the > analysis was extremely slow so it seems I disabled it by > default and that's probably one of the reasons why I did not > try to merge it in Agda stable). > > https://github.com/agda/agda/commit/f45e8e0850e8e5d5a42f65c46275beeb112df4d8#diff-71ae678c257eb560c9d6e9fb881133c4R108 > > I think that if you were to put `{-# OPTIONS -Wuseless-imports #-}` > at the top of your file, it should work. Ah, thanks. The problem is that I have 70 files, and I don't want to add this non-standard option in all of them. I tried "agda --W useless-imports everything.lagda" but this is not recognized from the command line. (I am trying to clean a number of files that I am going to use for teaching in May, and one nice thing to do would be to get rid of the useless imports.) Martin > > Hope it helps! > > Cheers, > -- > gallais > > On 25/04/18 10:04, Martin Escardo wrote: >> Thanks. I compiled this branch. But how do I use this feature? I just >> tried to load a module in emacs, with deliberately unneeded imports, >> and nothing is reported. Or do I need to invoke a command for this >> check? M. >> >> On 24/04/18 09:54, nad at cse.gu.se wrote: >>> On 2018-04-23 21:55, Mart?n H?tzel Escard? wrote: >>>> I have reorganized a large code base by splitting and merging modules, >>>> and moving things from one module to another, and I fear I am left >>>> with very many redundant imports. Is there any way to detect them >>>> automatically? >>> >>> Guillame Allais has been working on something like this on a separate >>> branch: >>> >>> ?? https://github.com/agda/agda/issues/2503 >>> >> > > -- Martin Escardo http://www.cs.bham.ac.uk/~mhe From guillaume.allais at ens-lyon.org Wed Apr 25 14:03:12 2018 From: guillaume.allais at ens-lyon.org (Guillaume Allais) Date: Wed, 25 Apr 2018 14:03:12 +0200 Subject: [Agda] Redundant imports In-Reply-To: <9504a1e0-88b0-6423-23c5-70d78996505a@cs.bham.ac.uk> References: <2964237b-91e6-6494-7a0c-d1311424ff0c@cs.bham.ac.uk> <6e1f8612-080c-c278-85f2-663512c48180@ens-lyon.org> <9504a1e0-88b0-6423-23c5-70d78996505a@cs.bham.ac.uk> Message-ID: I think you have to either use `--warning` or `-W` but `--W` won't work. On 25/04/18 13:53, Martin Escardo wrote: > > > On 25/04/18 12:40, guillaume.allais at ens-lyon.org wrote: >> Hi Martin, >> >> I don't really remember how it works but looking at the code, >> there seems to be a warning level for useless imports (the >> analysis was extremely slow so it seems I disabled it by >> default and that's probably one of the reasons why I did not >> try to merge it in Agda stable). >> >> https://github.com/agda/agda/commit/f45e8e0850e8e5d5a42f65c46275beeb112df4d8#diff-71ae678c257eb560c9d6e9fb881133c4R108 >> >> >> I think that if you were to put `{-# OPTIONS -Wuseless-imports #-}` >> at the top of your file, it should work. > > Ah, thanks. The problem is that I have 70 files, and I don't want to > add this non-standard option in all of them. I tried "agda --W > useless-imports everything.lagda" but this is not recognized from the > command line. > > (I am trying to clean a number of files that I am going to use for > teaching in May, and one nice thing to do would be to get rid of the > useless imports.) > > Martin > > >> >> Hope it helps! >> >> Cheers, >> -- >> gallais >> >> On 25/04/18 10:04, Martin Escardo wrote: >>> Thanks. I compiled this branch. But how do I use this feature? I just >>> tried to load a module in emacs, with deliberately unneeded imports, >>> and nothing is reported. Or do I need to invoke a command for this >>> check? M. >>> >>> On 24/04/18 09:54, nad at cse.gu.se wrote: >>>> On 2018-04-23 21:55, Mart?n H?tzel Escard? wrote: >>>>> I have reorganized a large code base by splitting and merging >>>>> modules, >>>>> and moving things from one module to another, and I fear I am left >>>>> with very many redundant imports. Is there any way to detect them >>>>> automatically? >>>> >>>> Guillame Allais has been working on something like this on a separate >>>> branch: >>>> >>>> ??? https://github.com/agda/agda/issues/2503 >>>> >>> >> >> > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From m.escardo at cs.bham.ac.uk Wed Apr 25 14:23:14 2018 From: m.escardo at cs.bham.ac.uk (Martin Escardo) Date: Wed, 25 Apr 2018 13:23:14 +0100 Subject: [Agda] Redundant imports In-Reply-To: References: <2964237b-91e6-6494-7a0c-d1311424ff0c@cs.bham.ac.uk> <6e1f8612-080c-c278-85f2-663512c48180@ens-lyon.org> <9504a1e0-88b0-6423-23c5-70d78996505a@cs.bham.ac.uk> Message-ID: <194312da-33cd-82a3-89b0-d8bb9b73d87f@cs.bham.ac.uk> On 25/04/18 13:03, guillaume.allais at ens-lyon.org wrote: > I think you have to either use `--warning` or `-W` but `--W` won't work. Ah, sorry. :-) That does the trick. It is very slow, as you say, but it is very useful. Thank you very much. Martin > > On 25/04/18 13:53, Martin Escardo wrote: >> >> >> On 25/04/18 12:40, guillaume.allais at ens-lyon.org wrote: >>> Hi Martin, >>> >>> I don't really remember how it works but looking at the code, >>> there seems to be a warning level for useless imports (the >>> analysis was extremely slow so it seems I disabled it by >>> default and that's probably one of the reasons why I did not >>> try to merge it in Agda stable). >>> >>> https://github.com/agda/agda/commit/f45e8e0850e8e5d5a42f65c46275beeb112df4d8#diff-71ae678c257eb560c9d6e9fb881133c4R108 >>> >>> >>> I think that if you were to put `{-# OPTIONS -Wuseless-imports #-}` >>> at the top of your file, it should work. >> >> Ah, thanks. The problem is that I have 70 files, and I don't want to >> add this non-standard option in all of them. I tried "agda --W >> useless-imports everything.lagda" but this is not recognized from the >> command line. >> >> (I am trying to clean a number of files that I am going to use for >> teaching in May, and one nice thing to do would be to get rid of the >> useless imports.) >> >> Martin >> >> >>> >>> Hope it helps! >>> >>> Cheers, >>> -- >>> gallais >>> >>> On 25/04/18 10:04, Martin Escardo wrote: >>>> Thanks. I compiled this branch. But how do I use this feature? I just >>>> tried to load a module in emacs, with deliberately unneeded imports, >>>> and nothing is reported. Or do I need to invoke a command for this >>>> check? M. >>>> >>>> On 24/04/18 09:54, nad at cse.gu.se wrote: >>>>> On 2018-04-23 21:55, Mart?n H?tzel Escard? wrote: >>>>>> I have reorganized a large code base by splitting and merging >>>>>> modules, >>>>>> and moving things from one module to another, and I fear I am left >>>>>> with very many redundant imports. Is there any way to detect them >>>>>> automatically? >>>>> >>>>> Guillame Allais has been working on something like this on a separate >>>>> branch: >>>>> >>>>> ??? https://github.com/agda/agda/issues/2503 >>>>> >>>> >>> >>> >> > > -- Martin Escardo http://www.cs.bham.ac.uk/~mhe From m.escardo at cs.bham.ac.uk Wed Apr 25 22:01:25 2018 From: m.escardo at cs.bham.ac.uk (=?UTF-8?B?TWFydMOtbiBIw7Z0emVsIEVzY2FyZMOz?=) Date: Wed, 25 Apr 2018 21:01:25 +0100 Subject: [Agda] Allow cyclic module imports Message-ID: <97093606-2764-0b92-dfc6-dc60d9e524cc@cs.bham.ac.uk> But of course still check that any cyclic definitions within the cyclic modules are well founded. I don't want to put this as a feature request before we discuss this and see the (un)desirable consequences that I haven't seen on my own. To some extent, breaking anything into modules is arbitrary and depends on taste. But, nevertheless, modules are useful to aid understanding (and compilation efficiency too). However, I often find myself creating artificial modules to break module import cycles. And I am sure you do to. Here is a concrete example. I have four modules UF-Subsingletons*, two modules UF-Equiv*, two modules UF-Retracts* because (1) in order to define equivalence, we need to know what subsingleton types are and some properties of them. (2) in order to prove some properties about subsingletons, we need to use some properties of equivalences. (3) in order to prove some more properties of equivalences, we need to prove some more properties of subsingletons. (4) and then add retracts to the picture, and something analogous to (1)-(3) takes place. My original development was monolitic because of that. In one (big) file, you develop things in the mathematical order they are needed. Then I refactored it into "topics" (as above). But then the same topic needed several modules, as explained. Couldn't we just allow cyclic module imports, provided the total set of definitions in all modules are well founded? There are a number of things to consider: (1) Is this easy to implement? (2) Does it have conceptual / software engineering disadvantages? Looking mathematically at the problem, I see things like this: we have a directed acyclic graph of definitions (or replace acyclic by well founded). Assigning them to modules amounts to quotienting this graph. Such quotients are seldom nice - they hardly ever reflect the structured of the unquotiented graph. In particular, in the development I am discussing, the module-picture of the development ( http://www.cs.bham.ac.uk/~mhe/agda-new/module-graph.pdf) clearly shows (to me) that most of the dependencies are artificial when particular definitions in particular modules are considered. Martin From fhi.1990 at gmail.com Thu Apr 26 10:28:26 2018 From: fhi.1990 at gmail.com (=?UTF-8?Q?Frederik_Hangh=C3=B8j_Iversen?=) Date: Thu, 26 Apr 2018 10:28:26 +0200 Subject: [Agda] agda-mode input method Message-ID: I'd like to use the input method that agda-mode ships with in other major-modes. If I do `M-x set-input-method` Agda does not appear anywhere on the list. Only after I engage `M-x agda2-mode` (and then change back again) does it appear on the list. Can anyone more emacs-savvy than me explain why this is the case? I can think of at least two useful places to have agda's input method: Haskell with UnicodeSyntax and latex with \usepackage{unicode-math}. -- Regards *Frederik Hangh?j Iversen* -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at cse.gu.se Thu Apr 26 10:29:53 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Thu, 26 Apr 2018 10:29:53 +0200 Subject: [Agda] Allow cyclic module imports In-Reply-To: <97093606-2764-0b92-dfc6-dc60d9e524cc@cs.bham.ac.uk> References: <97093606-2764-0b92-dfc6-dc60d9e524cc@cs.bham.ac.uk> Message-ID: <917e3ba8-62a4-b86e-74ad-07ab0ac258e5@cse.gu.se> On 2018-04-25 22:01, Mart?n H?tzel Escard? wrote: > There are a number of things to consider: > > (1) Is this easy to implement? > > (2) Does it have conceptual / software engineering disadvantages? I'm not quite sure what you are proposing. Is the idea to treat everything in a module cycle as one big mutual block? Or is the idea to still require mutual blocks for things that are mutually recursive, but sort the mutual blocks topologically? In the latter case, should this sorting be done after meta-variables have been resolved (in which case I wonder how they are resolved), or based only on what the user has written in the code? And how should independent definitions be ordered? Or should the signature be modified so that it is no longer a list (of mutual blocks), but some kind of DAG? -- /NAD From nad at cse.gu.se Thu Apr 26 10:32:36 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Thu, 26 Apr 2018 10:32:36 +0200 Subject: [Agda] agda-mode input method In-Reply-To: References: Message-ID: <6f68c5dc-7712-77c7-9c1c-141f5fc7ded9@cse.gu.se> On 2018-04-26 10:28, Frederik Hangh?j Iversen wrote: > I'd like to use the input method that agda-mode ships with in other > major-modes. If I do `M-x set-input-method` Agda does not appear > anywhere on the list. Only after I engage `M-x agda2-mode` (and then > change back again) does it appear on the list. > > Can anyone more emacs-savvy than me explain why this is the case? The Agda mode is typically not loaded when Emacs is started, but when an Agda file is opened, see agda2.el for implementation details. -- /NAD From m.escardo at cs.bham.ac.uk Thu Apr 26 10:36:46 2018 From: m.escardo at cs.bham.ac.uk (Martin Escardo) Date: Thu, 26 Apr 2018 09:36:46 +0100 Subject: [Agda] Allow cyclic module imports In-Reply-To: <917e3ba8-62a4-b86e-74ad-07ab0ac258e5@cse.gu.se> References: <97093606-2764-0b92-dfc6-dc60d9e524cc@cs.bham.ac.uk> <917e3ba8-62a4-b86e-74ad-07ab0ac258e5@cse.gu.se> Message-ID: <24a2c3c0-2c93-b528-9bfb-5c35b35a36bc@cs.bham.ac.uk> On 26/04/18 09:29, nad at cse.gu.se wrote: > On 2018-04-25 22:01, Mart?n H?tzel Escard? wrote: >> There are a number of things to consider: >> >> (1) Is this easy to implement? >> >> (2) Does it have conceptual / software engineering disadvantages? > > I'm not quite sure what you are proposing. Is the idea to treat > everything in a module cycle as one big mutual block? No. > Or is the idea to > still require mutual blocks for things that are mutually recursive, but > sort the mutual blocks topologically? Yes. > In the latter case, should this > sorting be done after meta-variables have been resolved (in which case I > wonder how they are resolved), or based only on what the user has > written in the code? And how should independent definitions be ordered? > Or should the signature be modified so that it is no longer a list (of > mutual blocks), but some kind of DAG? In my example, I have a sets A, B, C of code for certain mathematical concepts a,b,c. At the moment, I have to break things e,g. in modules A1-A3, B1-B3, C1-C2 A1 B1 C1 B2 A2 C2 A3 B3 where the modules in each line depend on the modules in the previous lines. I would rather have only three modules A=A1+A2+A3, B=B1+B2+B3, and C=C1+C2, each of them cyclically importing each other, but Agda figuring out that there is no real cyclic dependency. Martin From fhi.1990 at gmail.com Thu Apr 26 10:39:38 2018 From: fhi.1990 at gmail.com (=?UTF-8?Q?Frederik_Hangh=C3=B8j_Iversen?=) Date: Thu, 26 Apr 2018 10:39:38 +0200 Subject: [Agda] agda-mode input method In-Reply-To: <6f68c5dc-7712-77c7-9c1c-141f5fc7ded9@cse.gu.se> References: <6f68c5dc-7712-77c7-9c1c-141f5fc7ded9@cse.gu.se> Message-ID: Is there a way to make agda-input available without loading the Agda itself. I feel that the input mode is so generally useful that it ought to be stand-alone. On Thu, Apr 26, 2018 at 10:32 AM, Nils Anders Danielsson wrote: > On 2018-04-26 10:28, Frederik Hangh?j Iversen wrote: > >> I'd like to use the input method that agda-mode ships with in other >> major-modes. If I do `M-x set-input-method` Agda does not appear >> anywhere on the list. Only after I engage `M-x agda2-mode` (and then >> change back again) does it appear on the list. >> >> Can anyone more emacs-savvy than me explain why this is the case? >> > > The Agda mode is typically not loaded when Emacs is started, but when an > Agda file is opened, see agda2.el for implementation details. > > -- > /NAD > -- Regards *Frederik Hangh?j Iversen* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mechvel at botik.ru Thu Apr 26 11:35:24 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Thu, 26 Apr 2018 12:35:24 +0300 Subject: [Agda] Allow cyclic module imports In-Reply-To: <97093606-2764-0b92-dfc6-dc60d9e524cc@cs.bham.ac.uk> References: <97093606-2764-0b92-dfc6-dc60d9e524cc@cs.bham.ac.uk> Message-ID: <1524735324.2531.7.camel@one.mechvel.pereslavl.ru> For example, Haskell allows cyclic module import, and I used such. A real-world library for mathematics is likely to use cyclic module import. But Agda is somewhat more complex, I do not know where this may lead to. ------ Sergei On Wed, 2018-04-25 at 21:01 +0100, Mart?n H?tzel Escard? wrote: > But of course still check that any cyclic definitions within the cyclic > modules are well founded. > > I don't want to put this as a feature request before we discuss this and > see the (un)desirable consequences that I haven't seen on my own. > > To some extent, breaking anything into modules is arbitrary and depends > on taste. But, nevertheless, modules are useful to aid understanding > (and compilation efficiency too). > > However, I often find myself creating artificial modules to break module > import cycles. And I am sure you do to. > > Here is a concrete example. > > I have four modules UF-Subsingletons*, two modules UF-Equiv*, two > modules UF-Retracts* because > > (1) in order to define equivalence, we need to know what subsingleton > types are and some properties of them. > > (2) in order to prove some properties about subsingletons, we need to > use some properties of equivalences. > > (3) in order to prove some more properties of equivalences, we need to > prove some more properties of subsingletons. > > (4) and then add retracts to the picture, and something analogous to > (1)-(3) takes place. > > My original development was monolitic because of that. In one (big) > file, you develop things in the mathematical order they are needed. > > Then I refactored it into "topics" (as above). But then the same topic > needed several modules, as explained. > > Couldn't we just allow cyclic module imports, provided the total set of > definitions in all modules are well founded? > > There are a number of things to consider: > > (1) Is this easy to implement? > > (2) Does it have conceptual / software engineering disadvantages? > > Looking mathematically at the problem, I see things like this: we have a > directed acyclic graph of definitions (or replace acyclic by well > founded). Assigning them to modules amounts to quotienting this graph. > Such quotients are seldom nice - they hardly ever reflect the structured > of the unquotiented graph. In particular, in the development I am > discussing, the module-picture of the development ( > http://www.cs.bham.ac.uk/~mhe/agda-new/module-graph.pdf) clearly shows > (to me) that most of the dependencies are artificial when particular > definitions in particular modules are considered. > > Martin > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > From sandro.stucki at gmail.com Thu Apr 26 11:43:36 2018 From: sandro.stucki at gmail.com (Sandro Stucki) Date: Thu, 26 Apr 2018 11:43:36 +0200 Subject: [Agda] agda-mode input method In-Reply-To: References: <6f68c5dc-7712-77c7-9c1c-141f5fc7ded9@cse.gu.se> Message-ID: > Is there a way to make agda-input available without loading the Agda itself. The input method is in a separate file "agda-input", so I guess it can be used standalone in principle. Of course, you still need to tell emacs how to find the file. So you could include something like this in your .emacs file: (add-to-list 'load-path "/emacs-mode/") (require 'agda-input nil t) But that's a bit brittle, so it's probably better to just load agda-mode the usual way: (load-file (let ((coding-system-for-read 'utf-8)) (shell-command-to-string "agda-mode locate"))) (require 'agda-input nil t) If you just want unicode support you could also use the "TeX" input method (though personally, I prefer the Agda input method). Cheers /Sandro On Thu, Apr 26, 2018 at 10:39 AM, Frederik Hangh?j Iversen wrote: > Is there a way to make agda-input available without loading the Agda itself. > > I feel that the input mode is so generally useful that it ought to be > stand-alone. > > On Thu, Apr 26, 2018 at 10:32 AM, Nils Anders Danielsson > wrote: >> >> On 2018-04-26 10:28, Frederik Hangh?j Iversen wrote: >>> >>> I'd like to use the input method that agda-mode ships with in other >>> major-modes. If I do `M-x set-input-method` Agda does not appear >>> anywhere on the list. Only after I engage `M-x agda2-mode` (and then >>> change back again) does it appear on the list. >>> >>> Can anyone more emacs-savvy than me explain why this is the case? >> >> >> The Agda mode is typically not loaded when Emacs is started, but when an >> Agda file is opened, see agda2.el for implementation details. >> >> -- >> /NAD > > > > > -- > Regards > Frederik Hangh?j Iversen > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > From leo at halfaya.org Thu Apr 26 14:36:16 2018 From: leo at halfaya.org (John Leo) Date: Thu, 26 Apr 2018 05:36:16 -0700 Subject: [Agda] agda-mode input method In-Reply-To: References: <6f68c5dc-7712-77c7-9c1c-141f5fc7ded9@cse.gu.se> Message-ID: Here's some code I got from Jennifer Paykin at UPenn to use Agda mode standalone (via control-\) which is similar: (condition-case nil (progn (load-file (let ((coding-system-for-read 'utf-8)) (expand-file-name "agda-input.el" (file-name-directory (shell-command-to-string "agda-mode locate"))))) (setq agda-input-user-translations '(("N" . ("?")))) (agda-input-setup) (set-input-method "Agda")) (error (message "Could not load the Agda input method."))) On Thu, Apr 26, 2018 at 2:43 AM, Sandro Stucki wrote: > > Is there a way to make agda-input available without loading the Agda > itself. > > The input method is in a separate file "agda-input", so I guess it can > be used standalone in principle. Of course, you still need to tell > emacs how to find the file. So you could include something like this > in your .emacs file: > > (add-to-list 'load-path "/emacs-mode/") > (require 'agda-input nil t) > > But that's a bit brittle, so it's probably better to just load > agda-mode the usual way: > > (load-file (let ((coding-system-for-read 'utf-8)) > (shell-command-to-string "agda-mode locate"))) > (require 'agda-input nil t) > > If you just want unicode support you could also use the "TeX" input > method (though personally, I prefer the Agda input method). > > Cheers > /Sandro > > > On Thu, Apr 26, 2018 at 10:39 AM, Frederik Hangh?j Iversen > wrote: > > Is there a way to make agda-input available without loading the Agda > itself. > > > > I feel that the input mode is so generally useful that it ought to be > > stand-alone. > > > > On Thu, Apr 26, 2018 at 10:32 AM, Nils Anders Danielsson > > wrote: > >> > >> On 2018-04-26 10:28, Frederik Hangh?j Iversen wrote: > >>> > >>> I'd like to use the input method that agda-mode ships with in other > >>> major-modes. If I do `M-x set-input-method` Agda does not appear > >>> anywhere on the list. Only after I engage `M-x agda2-mode` (and then > >>> change back again) does it appear on the list. > >>> > >>> Can anyone more emacs-savvy than me explain why this is the case? > >> > >> > >> The Agda mode is typically not loaded when Emacs is started, but when an > >> Agda file is opened, see agda2.el for implementation details. > >> > >> -- > >> /NAD > > > > > > > > > > -- > > Regards > > Frederik Hangh?j Iversen > > > > _______________________________________________ > > Agda mailing list > > Agda at lists.chalmers.se > > https://lists.chalmers.se/mailman/listinfo/agda > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at cse.gu.se Thu Apr 26 15:02:09 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Thu, 26 Apr 2018 15:02:09 +0200 Subject: [Agda] agda-mode input method In-Reply-To: References: <6f68c5dc-7712-77c7-9c1c-141f5fc7ded9@cse.gu.se> Message-ID: On 2018-04-26 10:39, Frederik Hangh?j Iversen wrote: > Is there a way to make agda-input available without loading the Agda > itself. The Agda input method is in a separate file, agda-input.el, which can be loaded independently. For instance, if you want to use the Agda input method in text mode, then you can include the following commands in your .emacs: ;; Puts the directory with the Agda input method on the load path, ;; among other things. (load-file (let ((coding-system-for-read 'utf-8)) (shell-command-to-string "agda-mode locate"))) ;; Loads the Agda input method. (require 'agda-input) ;; Enables the Agda input method when text mode is activated. (add-hook 'text-mode-hook (lambda nil (set-input-method "Agda"))) -- /NAD From fhi.1990 at gmail.com Thu Apr 26 15:31:17 2018 From: fhi.1990 at gmail.com (=?UTF-8?Q?Frederik_Hangh=C3=B8j_Iversen?=) Date: Thu, 26 Apr 2018 15:31:17 +0200 Subject: [Agda] agda-mode input method In-Reply-To: References: <6f68c5dc-7712-77c7-9c1c-141f5fc7ded9@cse.gu.se> Message-ID: On Thu, Apr 26, 2018 at 3:02 PM, Nils Anders Danielsson wrote: > On 2018-04-26 10:39, Frederik Hangh?j Iversen wrote: > >> Is there a way to make agda-input available without loading the Agda >> itself. >> > > The Agda input method is in a separate file, agda-input.el, which can be > loaded independently. For instance, if you want to use the Agda input > method in text mode, then you can include the following commands in your > .emacs: > > ;; Puts the directory with the Agda input method on the load path, > ;; among other things. > (load-file (let ((coding-system-for-read 'utf-8)) > (shell-command-to-string "agda-mode locate"))) > > ;; Loads the Agda input method. > (require 'agda-input) > > ;; Enables the Agda input method when text mode is activated. > (add-hook 'text-mode-hook > (lambda nil (set-input-method "Agda"))) > > -- > /NAD > This looks like the sort of thing I was going for. I'll give it a try. Thank you! I'll also give the TeX-input method a try. -- Regards *Frederik Hangh?j Iversen* -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at cse.gu.se Thu Apr 26 15:36:58 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Thu, 26 Apr 2018 15:36:58 +0200 Subject: [Agda] Allow cyclic module imports In-Reply-To: <24a2c3c0-2c93-b528-9bfb-5c35b35a36bc@cs.bham.ac.uk> References: <97093606-2764-0b92-dfc6-dc60d9e524cc@cs.bham.ac.uk> <917e3ba8-62a4-b86e-74ad-07ab0ac258e5@cse.gu.se> <24a2c3c0-2c93-b528-9bfb-5c35b35a36bc@cs.bham.ac.uk> Message-ID: On 2018-04-26 10:36, Martin Escardo wrote: > In my example, I have a sets A, B, C of code for certain mathematical > concepts a,b,c. At the moment, I have to break things e,g. in modules > A1-A3, B1-B3, C1-C2 > > A1 > B1 > C1 > B2 > A2 > C2 > A3 > B3 > > where the modules in each line depend on the modules in the previous > lines. I would rather have only three modules A=A1+A2+A3, B=B1+B2+B3, > and C=C1+C2, each of them cyclically importing each other, but Agda > figuring out that there is no real cyclic dependency. What about instances? Consider the following code: data D : Set where d? d? : D abstract instance x : D x = d? f : ? _ : D ? ? D f ? y ? = y z : D z = f Here we have a dependency from z to x. However, one cannot see this simply by analysing the symbols occurring in the source code. Should the following code be accepted? data D : Set where d? d? : D f : ? _ : D ? ? D f ? y ? = y z : D z = f abstract instance x : D x = d? -- /NAD From nad at cse.gu.se Thu Apr 26 15:48:01 2018 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Thu, 26 Apr 2018 15:48:01 +0200 Subject: [Agda] agda-mode input method In-Reply-To: References: <6f68c5dc-7712-77c7-9c1c-141f5fc7ded9@cse.gu.se> Message-ID: On 2018-04-26 15:31, Frederik Hangh?j Iversen wrote: > This looks like the sort of thing I was going for. I'll give it a try. > Thank you! I'll also give the TeX-input method a try. I based the Agda input method on the TeX input method. The following (customisable) part of the code specifies exactly how: (defcustom agda-input-inherit `(("TeX" . (agda-input-compose (agda-input-drop '("geq" "leq" "bullet" "qed" "par")) (agda-input-or (agda-input-drop-prefix "\\") (agda-input-or (agda-input-compose (agda-input-drop '("^l" "^o" "^r" "^v")) (agda-input-prefix "^")) (agda-input-prefix "_"))))) ) [...]) In words: * Keep bindings that start with _. * Keep bindings that start with ^, except for ^l, ^o, ^r and ^v. * Keep bindings that start with \, and drop this prefix. * Remove geq, leq, bullet, qed and par from the bindings above. These bindings are combined with bindings specific to the Agda input method (these are customisable). Finally another part of the code (also customisable) removes empty bindings and prepends \ to all bindings. -- /NAD From amindfv at gmail.com Sat Apr 28 22:22:49 2018 From: amindfv at gmail.com (Tom Murphy) Date: Sat, 28 Apr 2018 16:22:49 -0400 Subject: [Agda] Allow cyclic module imports In-Reply-To: <1524735324.2531.7.camel@one.mechvel.pereslavl.ru> References: <97093606-2764-0b92-dfc6-dc60d9e524cc@cs.bham.ac.uk> <1524735324.2531.7.camel@one.mechvel.pereslavl.ru> Message-ID: Fwiw Haskell's cyclic module imports can be a real pain and most projects don't use them. Not to discourage this line of inquiry, but as a data point! Tom On Thu, Apr 26, 2018 at 5:35 AM, Sergei Meshveliani wrote: > For example, Haskell allows cyclic module import, and I used such. > A real-world library for mathematics is likely to use cyclic module > import. > But Agda is somewhat more complex, I do not know where this may lead > to. > > ------ > Sergei > > > > On Wed, 2018-04-25 at 21:01 +0100, Mart?n H?tzel Escard? wrote: > > But of course still check that any cyclic definitions within the cyclic > > modules are well founded. > > > > I don't want to put this as a feature request before we discuss this and > > see the (un)desirable consequences that I haven't seen on my own. > > > > To some extent, breaking anything into modules is arbitrary and depends > > on taste. But, nevertheless, modules are useful to aid understanding > > (and compilation efficiency too). > > > > However, I often find myself creating artificial modules to break module > > import cycles. And I am sure you do to. > > > > Here is a concrete example. > > > > I have four modules UF-Subsingletons*, two modules UF-Equiv*, two > > modules UF-Retracts* because > > > > (1) in order to define equivalence, we need to know what subsingleton > > types are and some properties of them. > > > > (2) in order to prove some properties about subsingletons, we need to > > use some properties of equivalences. > > > > (3) in order to prove some more properties of equivalences, we need to > > prove some more properties of subsingletons. > > > > (4) and then add retracts to the picture, and something analogous to > > (1)-(3) takes place. > > > > My original development was monolitic because of that. In one (big) > > file, you develop things in the mathematical order they are needed. > > > > Then I refactored it into "topics" (as above). But then the same topic > > needed several modules, as explained. > > > > Couldn't we just allow cyclic module imports, provided the total set of > > definitions in all modules are well founded? > > > > There are a number of things to consider: > > > > (1) Is this easy to implement? > > > > (2) Does it have conceptual / software engineering disadvantages? > > > > Looking mathematically at the problem, I see things like this: we have a > > directed acyclic graph of definitions (or replace acyclic by well > > founded). Assigning them to modules amounts to quotienting this graph. > > Such quotients are seldom nice - they hardly ever reflect the structured > > of the unquotiented graph. In particular, in the development I am > > discussing, the module-picture of the development ( > > http://www.cs.bham.ac.uk/~mhe/agda-new/module-graph.pdf) clearly shows > > (to me) that most of the dependencies are artificial when particular > > definitions in particular modules are considered. > > > > Martin > > > > > > _______________________________________________ > > Agda mailing list > > Agda at lists.chalmers.se > > https://lists.chalmers.se/mailman/listinfo/agda > > > > > _______________________________________________ > Agda mailing list > Agda at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Graham.Hutton at nottingham.ac.uk Mon Apr 30 10:50:08 2018 From: Graham.Hutton at nottingham.ac.uk (Graham Hutton) Date: Mon, 30 Apr 2018 08:50:08 +0000 Subject: [Agda] Journal of Functional Programming - Call for PhD Abstracts Message-ID: Dear all, If you or one of your students recently completed a PhD in the area of functional programming, please submit the dissertation abstract for publication in JFP: simple process, no refereeing, open access, deadline 25th May 2018. Please share! Best wishes, Graham Hutton ============================================================ CALL FOR PHD ABSTRACTS Journal of Functional Programming Deadline: 25th May 2018 http://tinyurl.com/jfp-phd-abstracts ============================================================ PREAMBLE: Many students complete PhDs in functional programming each year. As a service to the community, the Journal of Functional Programming publishes the abstracts from PhD dissertations completed during the previous year. The abstracts are made freely available on the JFP website, i.e. not behind any paywall. They do not require any transfer of copyright, merely a license from the author. A dissertation is eligible for inclusion if parts of it have or could have appeared in JFP, that is, if it is in the general area of functional programming. The abstracts are not reviewed. Please submit dissertation abstracts according to the instructions below. We welcome submissions from both the PhD student and PhD advisor/supervisor although we encourage them to coordinate. ============================================================ SUBMISSION: Please submit the following information to Graham Hutton by 25th May 2018. o Dissertation title: (including any subtitle) o Student: (full name) o Awarding institution: (full name and country) o Date of PhD award: (month and year; depending on the institution, this may be the date of the viva, corrections being approved, graduation ceremony, or otherwise) o Advisor/supervisor: (full names) o Dissertation URL: (please provide a permanently accessible link to the dissertation if you have one, such as to an institutional repository or other public archive; links to personal web pages should be considered a last resort) o Dissertation abstract: (plain text, maximum 1000 words; you may use \emph{...} for emphasis, but we prefer no other markup or formatting in the abstract, but do get in touch if this causes significant problems) Please do not submit a copy of the dissertation itself, as this is not required. JFP reserves the right to decline to publish abstracts that are not deemed appropriate. ============================================================ PHD ABSTRACT EDITOR: Graham Hutton School of Computer Science University of Nottingham Nottingham NG8 1BB United Kingdom ============================================================ This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please contact the sender and delete the email and attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. Email communications with the University of Nottingham may be monitored where permitted by law. From P.Achten at cs.ru.nl Mon Apr 30 11:29:59 2018 From: P.Achten at cs.ru.nl (Peter Achten) Date: Mon, 30 Apr 2018 11:29:59 +0200 Subject: [Agda] final call for papers: Trends in Functional Programming, 11-13 june 2018, Chalmers Campus Johanneberg, Gothenburg - deadline extended - Message-ID: <46da8ebe-cabd-6fcd-a627-552dbb97f5d3@cs.ru.nl> ?????????????? ------------------------------------- ???????????? F I N A L?? C A L L?? F O R?? P A P E R S ?????????????? ------------------------------------- ??????????????????? ----- deadline extended ----- ??????????????????? ======== TFP 2018 =========== ????????? 19th Symposium on Trends in Functional Programming ?????????????????????????? 11-13 June, 2018 ???????????????????? Chalmers Campus Johanneberg, Gothenburg ?????????? http://www.cse.chalmers.se/~myreen/tfp2018/index.html The symposium on Trends in Functional Programming (TFP) is an international forum for researchers with interests in all aspects of functional programming, taking a broad view of current and future trends in the area. It aspires to be a lively environment for presenting the latest research results, and other contributions (see below at scope). Please be aware that TFP uses two distinct rounds of submissions (see below at submission details). TFP 2018 will be the main event of a pair of functional programming events. TFP 2018 will be accompanied by the International Workshop on Trends in Functional Programming in Education (TFPIE), which will take place on June 14. == SCOPE == The symposium recognizes that new trends may arise through various routes. As part of the Symposium's focus on trends we therefore identify the following five article categories. High-quality articles are solicited in any of these categories: Research Articles: ??? Leading-edge, previously unpublished research work Position Articles: ??? On what new trends should or should not be Project Articles: ??? Descriptions of recently started new projects Evaluation Articles: ??? What lessons can be drawn from a finished project Overview Articles: ??? Summarizing work with respect to a trendy subject. Articles must be original and not simultaneously submitted for publication to any other forum. They may consider any aspect of functional programming: theoretical, implementation-oriented, or experience-oriented. Applications of functional programming techniques to other languages are also within the scope of the symposium. Topics suitable for the symposium include, but are not limited to: ??? Functional programming and multicore/manycore computing ??? Functional programming in the cloud ??? High performance functional computing ??? Extra-functional (behavioural) properties of functional programs ??? Dependently typed functional programming ??? Validation and verification of functional programs ??? Debugging and profiling for functional languages ??? Functional programming in different application areas: ??? security, mobility, telecommunications applications, embedded ??? systems, global computing, grids, etc. ??? Interoperability with imperative programming languages ??? Novel memory management techniques ??? Program analysis and transformation techniques ??? Empirical performance studies ??? Abstract/virtual machines and compilers for functional languages ??? (Embedded) domain specific languages ??? New implementation strategies ??? Any new emerging trend in the functional programming area If you are in doubt on whether your article is within the scope of TFP, please contact the TFP 2018 program chairs, Micha? Pa?ka and Magnus Myreen. == Best Paper Awards == To reward excellent contributions, TFP awards a prize for the best paper accepted for the formal proceedings. TFP traditionally pays special attention to research students, acknowledging that students are almost by definition part of new subject trends. A student paper is one for which the authors state that the paper is mainly the work of students, the students are listed as first authors, and a student would present the paper. A prize for the best student paper is awarded each year. In both cases, it is the PC of TFP that awards the prize. In case the best paper happens to be a student paper, that paper will then receive both prizes. == Paper Submissions == We use EasyChair for the refereeing process. The link to the submission page is: https://easychair.org/conferences/?conf=tfp2018 Authors of papers have the choice of having their contributions formally reviewed either before or after the Symposium. == Pre-symposium formal review == Papers to be formally reviewed before the symposium should be submitted before an early deadline and receive their reviews and notification of acceptance for both presentation and publication before the symposium. A paper that has been rejected in this process may still be accepted for presentation at the symposium, but will not be considered for the post-symposium formal review. == Post-symposium formal review == Draft papers will receive minimal reviews and notification of acceptance for presentation at the symposium. Authors of draft papers will be invited to submit revised papers based on the feedback receive at the symposium. A post-symposium refereeing process will then select a subset of these articles for formal publication. == Paper categories == Draft papers and papers submitted for formal review are submitted as extended abstracts (4 to 10 pages in length) or full papers (20 pages). The submission must clearly indicate which category it belongs to: research, position, project, evaluation, or overview paper. It should also indicate which authors are research students, and whether the main author(s) are students. A draft paper for which all authors are students will receive additional feedback by one of the PC members shortly after the symposium has taken place. == Format == Papers must be written in English, and written using the LNCS style. For more information about formatting please consult the Springer LNCS web site. == Important Dates == Submission (pre-symposium review):?????????????????? March 26, 2018? --? passed? -- Submission (draft, post-symposium review):?????????? May?? 11, 2018? -- extended -- Notification (pre- and post-symposium review):?????? May?? 13, 2018? -- extended -- Registration:??????????????????????????????????????? June?? 3, 2018 TFP Symposium:?????????????????????????????????????? June 11-13, 2018 TFPIE Workshop:????????????????????????????????????? June?? 14, 2018 Student papers feedback:???????????????????????????? June?? 21, 2018 Submission (post-symposium review):????????????????? August 14, 2018 Notification (post-symposium review):??????????????? September 20, 2018 Camera-ready paper (pre- and post-symposium review): November 30, 2018 == Program Committee == Program Co-chairs Micha? Pa?ka,??? Chalmers University of Technology (SE) Magnus Myreen,??? Chalmers University of Technology (SE) Program Committee Soichiro Hidaka,??????? Hosei University (JP) Meng Wang,????????????? University of Bristol (UK) Sam Tobin-Hochstadt,??? Indiana University Bloomington (US) Tiark Rompf,??????????? Purdue University (US) Patricia Johann,??????? Appalachian State University (US) Neil Sculthorpe,??????? Nottingham Trent University (UK) Andres L?h,???????????? Well-Typed LLP (UK) Tarmo Uustalu,????????? Tallinn University of Technology (EE) Cosmin E. Oancea,?????? University of Copenhagen (DK) Mauro Jaskelioff,?????? Universidad Nacional de Rosario (AR) Peter Achten,?????????? Radboud University (NL) Dimitrios Vytiniotis,?? Microsoft Research (UK) Alberto Pardo,????????? Universidad de la Rep?blica (UY) Natalia Chechina,?????? University of Glasgow (UK) Peter Sestoft,????????? IT University of Copenhagen (DK) Scott Owens,??????????? University of Kent (UK) From mechvel at botik.ru Mon Apr 30 15:42:38 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Mon, 30 Apr 2018 16:42:38 +0300 Subject: [Agda] how to set level Message-ID: <1525095758.2770.17.camel@one.mechvel.pereslavl.ru> Please, what is wrong in the below program? I define Expression over a Semiring, and the relations _=e_ and _ Hello, Please, find below the third call for papers for IFL 2018. Please forward these to anyone you think may be interested. Apologies for any duplicates you may receive. best regards, Jurriaan Hage Publicity Chair of IFL --- ============================================================ ==================== IFL 2018 30th Symposium on Implementation and Application of Functional Languages University of Massachusetts Lowell, MA, USA September 5th-7th, 2018 http://iflconference.org ============================================================ ==================== ### Scope The goal of the IFL symposia is to bring together researchers actively engaged in the implementation and application of functional and function-based programming languages. IFL 2018 will be a venue for researchers to present and discuss new ideas and concepts, work in progress, and publication-ripe results related to the implementation and application of functional languages and function-based programming. Topics of interest to IFL include, but are not limited to: - language concepts - type systems, type checking, type inferencing - compilation techniques - staged compilation - run-time function specialization - run-time code generation - partial evaluation - (abstract) interpretation - metaprogramming - generic programming - automatic program generation - array processing - concurrent/parallel programming - concurrent/parallel program execution - embedded systems - web applications - (embedded) domain specific languages - security - novel memory management techniques - run-time profiling performance measurements - debugging and tracing - virtual/abstract machine architectures - validation, verification of functional programs - tools and programming techniques - (industrial) applications ### Keynote Speakers * Adam Chlipala, Massachusetts Institute of Technology CSAIL * Arjun Guha, University of Massachusetts Amherst ### Submissions and peer-review Differently from previous editions of IFL, IFL 2018 solicits two kinds of submissions: * Regular papers (12 pages including references) * Draft papers for presentations ('weak' limit between 8 and 15 pages) Regular papers will undergo a rigorous review by the program committee, and will be evaluated according to their correctness, novelty, originality, relevance, significance, and clarity. A set of regular papers will be conditionally accepted for publication. Authors of conditionally accepted papers will be provided with committee reviews along with a set of mandatory revisions. Regular papers not accepted for publication will be considered as draft papers, at the request of the author. Draft papers will be screened to make sure that they are within the scope of IFL, and will be accepted for presentation or rejected accordingly. Prior to the symposium: Authors of conditionally accepted papers and accepted presentations will submit a pre-proceedings version of their work that will appear in the draft proceedings distributed at the symposium. The draft proceedings does not constitute a formal publication. We require that at least one of the authors present the work at IFL 2018. After the symposium: Authors of conditionally accepted papers will submit a revised versions of their paper for the formal post-proceedings. The program committee will assess whether the mandatory revisions have been adequately addressed by the authors and thereby determines the final accept/reject status of the paper. Our interest is to ultimately accept all conditionally accepted papers. If you are an author of a conditionally accepted paper, please make sure that you address all the concerns of the reviewers. Authors of accepted presentations will be given the opportunity to incorporate the feedback from discussions at the symposium and will be invited to submit a revised full article for the formal post-proceedings. The program committee will evaluate these submissions according to their correctness, novelty, originality, relevance, significance, and clarity, and will thereby determine whether the paper is accepted or rejected. ### Publication The formal proceedings will appear in the International Conference Proceedings Series of the ACM Digital Library. At no time may work submitted to IFL be simultaneously submitted to other venues; submissions must adhere to ACM SIGPLAN's republication policy: http://www.sigplan.org/Resources/Policies/Republication ### Important dates Submission of regular papers: May 25, 2018 Submission of draft papers: July 17, 2018 Regular and draft papers notification: July 20, 2018 Deadline for early registration: August 8, 2018 Submission of pre-proceedings version: August 29, 2018 IFL Symposium: September 5-7, 2018 Submission of papers for post-proceedings: November 7, 2018 Notification of acceptance: December 22, 2018 Camera-ready version: February 10, 2019 ### Submission details All contributions must be written in English. Papers must use the ACM two columns conference format, which can be found at: http://www.acm.org/publications/proceedings-template Authors submit through EasyChair: https://easychair.org/conferences/?conf=ifl2018 ### Peter Landin Prize The Peter Landin Prize is awarded to the best paper presented at the symposium every year. The honored article is selected by the program committee based on the submissions received for the formal review process. The prize carries a cash award equivalent to 150 Euros. ### Organization and Program committee Chairs: Jay McCarthy & Matteo Cimini, University of Massachusetts Lowell, USA Program Committee: * Arthur Chargueraud, Inria, FR * Ben Delaware, Purdue University, USA * Christos Dimoulas, Northwestern University, USA * David Darais, University of Vermont, USA * Dominic Orchard, University of Kent, UK * Ekaterina Komendantskaya, Heriot-Watt University, UK * Garrett Morris, University of Kansas, USA * Heather Miller, EPFL & Northeastern University, CH & USA * Jeremy Yallop, University of Cambridge, UK * Keiko Nakata, SAP Innovation Center Potsdam, DE * Laura Castro, University of A Coruna, ESP * Magnus Myreen, Chalmers University of Technology, SWE * Natalia Chechina, Bournemouth University, UK * Peter Achten, Radboud Universiteit Nijmegen, NL * Peter-Michael Osera, Grinnell College, USA * Richard Eisenberg, Bryn Mawr College, USA * Trevor McDonell, University of New South Wales, AUS * Yukiyoshi Kameyama, University of Tsukuba, JAP ### Venue The 30th IFL is organized by the University of Massachusetts Lowell. The City of Lowell is located at the heart of the Merrimack Valley just 30 miles northwest of Boston. Lowell can be easily reached by train or taxi. See the website for more information on the venue. ### Acknowledgments This call-for-papers is an adaptation and evolution of content from previous instances of IFL. We are grateful to prior organizers for their work, which is reused here. A part of IFL 2018 format and CFP language that describes conditionally accepted papers has been adapted from call-for-papers of OOPSLA conferences. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mechvel at botik.ru Tue May 1 13:18:23 2018 From: mechvel at botik.ru (Sergei Meshveliani) Date: Tue, 01 May 2018 14:18:23 +0300 Subject: [Agda] how to set level In-Reply-To: <1525095758.2770.17.camel@one.mechvel.pereslavl.ru> References: <1525095758.2770.17.camel@one.mechvel.pereslavl.ru> Message-ID: <1525173503.2599.14.camel@one.mechvel.pereslavl.ru> On Mon, 2018-04-30 at 16:42 +0300, Sergei Meshveliani wrote: > Please, what is wrong in the below program? > > I define Expression over a Semiring, and the relations _=e_ and _ Expression. > But Agda 2.5.3 does not solve the level values. > First it forces the level ?= for Expression. > And then, I cannot satisfy it with the level values for _ Lift calls. > [..] > --********************************************************************** > open import Level using (_?_; Lift) > open import Algebra using (Semiring) > open import Algebra.FunctionProperties as FuncProp using (Op?) > open import Relation.Binary using (Rel; IsStrictTotalOrder) > renaming (Decidable to Decidable?) > open import Relation.Binary.PropositionalEquality using (_?_) > open import Data.Empty using (?) > open import Data.Unit using (?) > open import Data.Sum using (_?_) > open import Data.Product using (_?_; _,_) > open import Data.Nat using (?) renaming (_?_ to _?n_; _<_ to _ > ------------------------------------------------------------------------- > postulate anything : ? {a} {A : Set a} ? A -- for debug > module Foo {? ?= ?} (R : Semiring ? ?=) > (open Semiring R using (_?_) renaming (Carrier to C)) > (_?_ : Decidable? _?_) > (_<_ : Rel C ?) > (isDTO : IsStrictTotalOrder _?_ _<_) > where > open Semiring R using (_+_) > > data Expression : Set ? where cf : C ? Expression > var : ? ? Expression > _:+_ : Op? Expression > infixl 6 _:+_ > > data _=e_ : Expression ? Expression ? Set ?= > where > cfEq : ? {a b} ? a ? b ? cf a =e cf b > varEq : ? {i j} ? i ? j ? var i =e var j > +eq : ? {x x' y y'} ? x =e x' ? y =e y' ? (x :+ y) =e (x' :+ y') > > > _ -- (?= ? ?) ? > > (cf a) (cf _) (cf _) > (var i) (var _) (var _) > (_ :+ _) (_ :+ _) (x :+ y) -- anything > --************************************************************************** I find now the needed code: _