Skip to content

copilot-theorem: Extend range of versions of kind2 #734

Closed

Description

@ivanperez-keera

Description

In order to keep Copilot effectively working in the current software ecosystem, we need to extend the versions of dependencies that Copilot can be installed with. kind2 has seen release 2.3.0, but copilot-theorem requires kind2 0.7.2.

Type

  • Management: update versions of dependencies.

Additional context

None.

Requester

  • Ivan Perez.

Method to check presence of bug

Not applicable (not a bug).

Expected result

Copilot can be installed with a modern version of kind2.

Desired result

Copilot can be installed with a modern version of kind2.

Proposed solution

Modify translation of Copilot to kind2's syntax in copilot-theorem to comply with the requirements of a modern version of kind2, and, if applicable, parsing of the results produced by kind2.

Further notes

None.

Activity

  1. added
    CR:Type:ManagementAdmin only: Change request for conformance with policies or procedures
    CR:Status:InitiatedAdmin only: Change request that has been initiated
    on May 25, 2026
  2. ivanperez-keera commented on May 25, 2026

    @ivanperez-keera
    MemberAuthor

    Change Manager: Confirmed that the issue exists.

  3. added
    CR:Status:ConfirmedAdmin only: Change request that has been acknowledged by the change manager
    and removed
    CR:Status:InitiatedAdmin only: Change request that has been initiated
    on May 25, 2026
  4. ivanperez-keera commented on May 25, 2026

    @ivanperez-keera
    MemberAuthor

    Technical Lead: Confirmed that the issue should be addressed.

  5. added
    CR:Status:AcceptedAdmin only: Change request accepted by technical lead
    and removed
    CR:Status:ConfirmedAdmin only: Change request that has been acknowledged by the change manager
    on May 25, 2026
  6. ivanperez-keera commented on May 25, 2026

    @ivanperez-keera
    MemberAuthor

    Technical Lead: Issue scheduled for fixing in Copilot 4.7.2.

    Fix assigned to: @chathhorn-galois .

  7. added
    CR:Status:ScheduledAdmin only: Change requested scheduled
    and removed
    CR:Status:AcceptedAdmin only: Change request accepted by technical lead
    on May 25, 2026
  8. added this to the 4.7.2 milestone on May 25, 2026
  9. 24 remaining items

  10. ivanperez-keera commented on Jul 8, 2026

    @ivanperez-keera
    MemberAuthor

    Change Manager: The issue is being re-assigned due to the original author being unavailable and changes being needed.

    Issue assigned to: @ivanperez-keera in addition to the original author.

  11. ivanperez-keera commented on Jul 8, 2026

    @ivanperez-keera
    MemberAuthor

    Change Manager: Verified that:

    • Solution is implemented:
      • The code proposed compiles and passes all tests. Details:
        Build log: https://app.travis-ci.com/github/Copilot-Language/copilot/builds/278451863
      • The solution proposed produces the expected result. Details:
        The following Dockerfile checks that copilot-theorem works with kind2 version 2.3.0 by using both to evaluate a specification and comparing the results from Kind2 to the expectation for the specific spec, after which it prints the message "Success":
        --- Dockerfile-verify-734
        FROM ubuntu:focal
        
        # Avoid interactive prompts during package installation
        ENV DEBIAN_FRONTEND=noninteractive
        
        # Install system dependencies and build tools
        RUN apt-get update && apt-get install -y --no-install-recommends \
            alex \
            build-essential \
            ca-certificates \
            curl \
            git \
            git \
            happy \
            libgmp-dev \
            libz-dev \
            m4 \
            pkg-config \
            software-properties-common \
            unzip \
            wget \
            z3 \
            && rm -rf /var/lib/apt/lists/*
        
        WORKDIR /root
        
        # Install kind2
        RUN wget -L https://github.com/kind2-mc/kind2/releases/download/v2.3.0/kind2-v2.3.0-linux-x86_64.tar.gz -O kind2-v2.3.0-linux-x86_64.tar.gz
        RUN tar -zxvpf kind2-v2.3.0-linux-x86_64.tar.gz && rm kind2-v2.3.0-linux-x86_64.tar.gz
        RUN mv kind2 /usr/local/bin
        RUN chmod a+x /usr/local/bin/kind2
        
        # Install GHC
        RUN add-apt-repository ppa:hvr/ghc
        RUN apt-get update
        RUN apt-get install --yes ghc-8.6.5 cabal-install-2.4
        
        ENV PATH=/opt/ghc/8.6.5/bin:/opt/cabal/2.4/bin:$PWD/.cabal-sandbox/bin:$PATH
        
        # Install Copilot
        RUN cabal update
        RUN cabal v1-sandbox init
        
        ARG REPO=https://github.com/copilot-language/copilot
        ARG GIT_COMMIT=master
        
        RUN git clone ${REPO} copilot
        RUN cd copilot && git checkout ${GIT_COMMIT}
        
        RUN cabal v1-install \
               copilot/copilot \
               copilot/copilot-c99 \
               copilot/copilot-core \
               copilot/copilot-interpreter \
               copilot/copilot-language \
               copilot/copilot-libraries \
               copilot/copilot-prettyprinter \
               copilot/copilot-theorem
        
        ADD Spec.hs /tmp
        RUN cabal v1-exec -- runhaskell /tmp/Spec.hs | grep -e "t1: proof failed" -e "t2: proof checked successfully"
        RUN echo "Success"
        
        --- Spec.hs
        import Data.Functor
        import Prelude hiding ((++))
        
        import Copilot.Theorem.Kind2
        import Copilot.Theorem.Prove
        import Language.Copilot
        
        trueThenFalses :: Stream Bool
        trueThenFalses = [True] ++ constant False
        
        spec :: Spec
        spec = do
          void $ theorem "t1" (forAll trueThenFalses) (check (kind2Prover def))
          void $ theorem "t2" (exists trueThenFalses) (check (kind2Prover def))
        
        main :: IO ()
        main = void $ reify spec
        
        Command (substitute variables based on new path after merge):
        $ docker build --build-arg REPO=https://github.com/ivanperez-keera/copilot --build-arg GIT_COMMIT=b8ff2fbaa16abac1441d172fa557e727d4380e66  -t kind2 -f Dockerfile-verify-734 .
        
    • Implementation is documented. Details:
      The code includes comments and the README is updated.
    • Change history is clear.
    • Commit messages are clear.
    • Changelogs are updated.
    • Examples are updated. Details:
      No updates needed; the change does not affect the existing API.
    • Required version bumps are evaluated. Details:
      Bump required; the code alter the existing API and removes public elements.
  12. ivanperez-keera commented on Jul 8, 2026

    @ivanperez-keera
    MemberAuthor

    Change Manager: Implementation ready to be merged.

  13. added
    CR:Status:ClosedAdmin only: Change request that has been completed
    and removed
    CR:Status:VerificationAdmin only: Change request that is currently being verified
    on Jul 8, 2026
  14. added a commit that references this issue on Oct 27, 2026
    86c9a1a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

CR:Status:ClosedAdmin only: Change request that has been completedCR:Type:ManagementAdmin only: Change request for conformance with policies or procedures

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions