Skip to content

Commit e95cc62

Browse files
Merge branch 'develop-remove-pragmas-theorem'. Close #613.
**Description** The code of `copilot-theorem` contains unused language pragmas. To comply with our coding style, which required unused code not to be included in the codebase, those pragmas should be removed. **Type** - Management: comply with styling requirement. **Additional context** None. **Requester** - Ivan Perez. **Method to check presence of bug** Not applicable (not a bug). **Expected result** The code contains no unused pragmas. Running `hlint` with the following auxiliary file indicates that there are no unused PRAGMAS. ```yaml - ignore: {name: "Redundant bracket"} - ignore: {name: "Use infix"} - ignore: {name: "Redundant as"} - ignore: {name: "Redundant <$>"} - ignore: {name: "Use camelCase"} - ignore: {name: "Avoid lambda"} - ignore: {name: "Use gets"} - ignore: {name: "Redundant $"} - ignore: {name: "Use <&>"} - ignore: {name: "Use concatMap"} - ignore: {name: "Move brackets to avoid $"} - ignore: {name: "Use /="} - ignore: {name: "Use newtype instead of data"} - ignore: {name: "Use :"} - ignore: {name: "Replace case with fromMaybe"} - ignore: {name: "Use >=>"} - ignore: {name: "Use curry"} - ignore: {name: "Use first"} - ignore: {name: "Use hPrint"} - ignore: {name: "Use or"} - ignore: {name: "Use fmap"} - ignore: {name: "Use if"} - ignore: {name: "Use <$>"} - ignore: {name: "Reduce duplication"} - ignore: {name: "Eta reduce"} ``` The following dockerfile runs hlint on copilot-theorem with the provided list of ignored warnings, which does not include unnecessary language pragmas, and checks that there are no warnings reported, after which it prints the message success: ``` --- Dockerfile-verify-613 FROM ubuntu:jammy ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update RUN apt-get install --yes git RUN apt-get install --yes hlint ADD ignore.yaml /tmp/ignore.yaml RUN hlint --version SHELL ["/bin/bash", "-c"] CMD git clone $REPO \ && cd $NAME \ && git checkout $COMMIT \ && hlint -h /tmp/ignore.yaml copilot-theorem/src \ && echo "Success" --- ignore.yaml - ignore: {name: "Redundant bracket"} - ignore: {name: "Use infix"} - ignore: {name: "Redundant as"} - ignore: {name: "Redundant <$>"} - ignore: {name: "Use camelCase"} - ignore: {name: "Avoid lambda"} - ignore: {name: "Use gets"} - ignore: {name: "Redundant $"} - ignore: {name: "Use <&>"} - ignore: {name: "Use concatMap"} - ignore: {name: "Move brackets to avoid $"} - ignore: {name: "Use /="} - ignore: {name: "Use newtype instead of data"} - ignore: {name: "Use :"} - ignore: {name: "Replace case with fromMaybe"} - ignore: {name: "Use >=>"} - ignore: {name: "Use curry"} - ignore: {name: "Use first"} - ignore: {name: "Use hPrint"} - ignore: {name: "Use or"} - ignore: {name: "Use fmap"} - ignore: {name: "Use if"} - ignore: {name: "Use <$>"} - ignore: {name: "Reduce duplication"} - ignore: {name: "Eta reduce"} ``` Command (substitute variables based on new path after merge): ``` $ docker run -e "REPO=https://github.com/Copilot-Language/copilot" -e "NAME=copilot" -e "COMMIT=<HASH>" -it copilot-verify-613 ``` **Solution implemented** Remove all unused PRAGMAS from the code in `copilot-theorem`. **Further notes** None.
2 parents 59fec12 + c9954d6 commit e95cc62

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

copilot-theorem/CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2025-05-29
2+
* Removed unused pragmas. (#613)
3+
14
2025-05-07
25
* Version bump (4.4). (#618)
36
* Translate quantifiers correctly in Kind2 backend. (#594)

copilot-theorem/src/Copilot/Theorem/Kind2/Prover.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE LambdaCase #-}
21
{-# LANGUAGE Trustworthy #-}
32

43
-- | A prover backend based on Kind2.

copilot-theorem/src/Copilot/Theorem/Prover/SMTIO.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE LambdaCase #-}
21
{-# LANGUAGE NamedFieldPuns #-}
32
{-# LANGUAGE RankNTypes #-}
43
{-# LANGUAGE Safe #-}

copilot-theorem/src/Copilot/Theorem/What4.hs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
{-# LANGUAGE DataKinds #-}
2-
{-# LANGUAGE FlexibleContexts #-}
3-
{-# LANGUAGE GADTs #-}
4-
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
5-
{-# LANGUAGE KindSignatures #-}
6-
{-# LANGUAGE LambdaCase #-}
7-
{-# LANGUAGE MultiWayIf #-}
8-
{-# LANGUAGE PatternSynonyms #-}
9-
{-# LANGUAGE RankNTypes #-}
10-
{-# LANGUAGE ScopedTypeVariables #-}
11-
{-# LANGUAGE StandaloneDeriving #-}
12-
{-# LANGUAGE TemplateHaskell #-}
13-
{-# LANGUAGE TupleSections #-}
14-
{-# LANGUAGE TypeApplications #-}
15-
{-# LANGUAGE TypeOperators #-}
1+
{-# LANGUAGE DataKinds #-}
2+
{-# LANGUAGE FlexibleContexts #-}
3+
{-# LANGUAGE GADTs #-}
4+
{-# LANGUAGE KindSignatures #-}
5+
{-# LANGUAGE LambdaCase #-}
6+
{-# LANGUAGE PatternSynonyms #-}
7+
{-# LANGUAGE RankNTypes #-}
8+
{-# LANGUAGE ScopedTypeVariables #-}
9+
{-# LANGUAGE TypeApplications #-}
10+
{-# LANGUAGE TypeOperators #-}
1611

1712
-- |
1813
-- Module : Copilot.Theorem.What4

0 commit comments

Comments
 (0)