GithubHelp home page GithubHelp logo

junkil-park / apt-winter-2023 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aalok-thakkar/apt-winter-2023

0.0 0.0 0.0 22 KB

Tutorial for Move Prover for Aptos India Winter School 2023

Boogie 96.58% Move 3.42%

apt-winter-2023's Introduction

Puzzle description

Find a,b,...,h such that:

1 <= a,b,...,h <= 9

    a b c
  +   d e
  -------
    f g h

a is the double of c
b is less than h
c is equal to e
d is equal to f
e is less than or equal to 3
f is odd
g is even
h is greater than or equal to 5

Solving the puzzle using Move Prover

In sources/puzzlie.move, the function Puzzle::puzzle is constructed to take 8 numbers (i.e., a, b, ..., h) and abort if the input does not satisfy any rule of the puzzle. In addition, the spec block for the function is added to assert that the function always aborts, in other words, there is no input that satisfies all the rule. The Move Prover will disprove the function specification giving a counter-example which satisfies all of the puzzle rules. It will become the solution of the puzzle.

Use the following command to run Move Prover:

move prove

The following is the expected output of Move Prover:

    error: function does not abort under this condition
    |
 36 |         aborts_if true;
    |         ^^^^^^^^^^^^^^^
    |
    =     at /puzzle.move:28: puzzle
    =         a = 6
    =         b = 5
    =         c = 3
    =         d = 7
    =         e = 3
    =         f = 7
    =         g = 2
    =         h = 6
    ...

Solution

    a b c        6 5 3
  +   d e      +   7 3
  -------      -------
    f g h        7 2 6

apt-winter-2023's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.