All Projects → levjj → Esverify

levjj / Esverify

Licence: mit
ECMAScript verification with SMT solvers

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Esverify

Gesture recognition
a gesture recognition verification lock
Stars: ✭ 37 (-66.06%)
Mutual labels:  verification
Tulip Control
Temporal Logic Planning toolbox
Stars: ✭ 81 (-25.69%)
Mutual labels:  verification
Awesome Open Hardware Verification
A List of Free and Open Source Hardware Verification Tools and Frameworks
Stars: ✭ 103 (-5.5%)
Mutual labels:  verification
Scrypt Interactive
[DEPRECATED] Truebit Verification for Scrypt
Stars: ✭ 47 (-56.88%)
Mutual labels:  verification
Ssri
Standard Subresource Integrity library for Node.js
Stars: ✭ 69 (-36.7%)
Mutual labels:  verification
Minasmsverification
短信验证:基于阿里云的 微信小程序 功能模块: 直接用 / mini-program + Node.js + Alibaba Cloud / Front & Back End
Stars: ✭ 94 (-13.76%)
Mutual labels:  verification
Liquidhaskell
Liquid Types For Haskell
Stars: ✭ 863 (+691.74%)
Mutual labels:  verification
Tlaplus
TLC is an explicit state model checker for specifications written in TLA+. The TLA+Toolbox is an IDE for TLA+.
Stars: ✭ 1,618 (+1384.4%)
Mutual labels:  verification
Vonage Java Sdk
Vonage Server SDK for Java. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.
Stars: ✭ 75 (-31.19%)
Mutual labels:  verification
Brightid
Reference mobile app for BrightID
Stars: ✭ 101 (-7.34%)
Mutual labels:  verification
Smsretrieverapimaster
Automatic SMS Verification with the SMS Retriever API
Stars: ✭ 48 (-55.96%)
Mutual labels:  verification
Reachabilityanalysis.jl
Methods to compute sets of states reachable by dynamical systems
Stars: ✭ 59 (-45.87%)
Mutual labels:  verification
Jhverificationcodeview
验证码输入框,验证码,code view,iOS验证码输入
Stars: ✭ 96 (-11.93%)
Mutual labels:  verification
Owasp Masvs
The Mobile Application Security Verification Standard (MASVS) is a standard for mobile app security.
Stars: ✭ 1,030 (+844.95%)
Mutual labels:  verification
Verifyedittext
带下划线的验证码输入框
Stars: ✭ 103 (-5.5%)
Mutual labels:  verification
Rverify.js
✅❎ A lightweight image rotation verification plugin.
Stars: ✭ 33 (-69.72%)
Mutual labels:  verification
Sea Dsa
A new context, field, and array-sensitive heap analysis for LLVM bitcode based on DSA.
Stars: ✭ 90 (-17.43%)
Mutual labels:  verification
React Native Code Verification
❤️ Simple UI for pincode verification
Stars: ✭ 109 (+0%)
Mutual labels:  verification
Ergo
The Language for Smart Legal Contracts
Stars: ✭ 108 (-0.92%)
Mutual labels:  verification
Hacl Star
HACL*, a formally verified cryptographic library written in F*
Stars: ✭ 1,360 (+1147.71%)
Mutual labels:  verification

esverify

Build Status NPM Version Greenkeeper badge

Program Verification for ECMAScript/JavaScript (esverify.org).

Alpha: This is still a research prototype and not yet ready for production use.

Documentation

A detailed documentation of esverify and its theoretical foundations is currently work-in-progress and will be published soon.

Example

Given a simple JavaScript max function, we can add pre- and post-conditions using special pseudo-calls to requires and ensures with boolean expressions.

function max(a, b) {
  requires(typeof a === "number");
  requires(typeof b === "number");
  ensures(res => res >= a);

  if (a >= b) {
    return a;
  } else {
    return b;
  }
}

These expressions will then be statically verified with respect to the function body with an SMT solver.

More examples can be found in the tests directory.

Supported Features

  • Expressions with boolean values, strings, integer and real number arithmetic
  • Function pre- and post conditions as well as inline assertions and invariants
  • Automatically generates counter-examples for failed assertions
  • Runs counter-example as JavaScript code to reproduce errors in dynamic context and differentiate incorrect programs from false negatives
  • Mutable variables and limited temporal reasoning, e.g. old(x) > x
  • Control flow including branching, returns and while loops with manually specified invariants
  • Inductive reasoning with loop invariants and recursive functions
  • Automatic inlining of function body for external proofs of function properties (restricted to one level of inlining)
  • Closures
  • Checking of function purity
  • Higher-order functions
  • Simple proof checking using Curry-Howard correspondence
  • Simple immutable classes with fields, methods and class invariant (no inheritance)
  • Immutable JavaScript objects using string keys
  • Immutable arrays (no sparse arrays)
  • Restricted verifier preamble for global objects such as console and Math

It is based on the z3 SMT solver but avoids trigger heuristics and thereby (most) timeouts and other unpredictable results by requiring manual instantiation. Function definitions and class invariants correspond to universal quantifiers and function calls and field access act as triggers that instantiate these quantifiers in a deterministic way.

To Do (see GitHub issues)

  • Termination checking
  • Mutable objects, arrays and classes
  • Modules with imports and exports
  • Prototype and subclass inheritance
  • Verifier-only "ghost" variables, arguments and functions/predicates
  • TypeScript as input language

Usage as Command Line Tool

Simple usage without installation:

$ npx esverify file.js

Installation:

$ npm install -g esverify

Command Line Options:

$ esverify --help
Usage: esverify [OPTIONS] FILE

Options:
  --z3path PATH           Path to local z3 executable
                          (default path is "z3")
  -r, --remote            Invokes z3 remotely via HTTP request
  --z3url URL             URL to remote z3 web server
  --noqi                  Disables quantifier instantiations
  -t, --timeout SECS      Sets timeout in seconds for z3
                          (default timeout is 10s, 0 disables timeout)
  -f, --logformat FORMAT  Format can be either "simple" or "colored"
                          (default format is "colored")
  -q, --quiet             Suppresses output
  -v, --verbose           Prints SMT input, output and test code
  --logsmt PATH           Path for logging SMT input in verbose mode
                          (default path is "/tmp/vc.smt")
  -h, --help              Prints this help text and exit
  --version               Prints version information

Usage as Library

Installation via npm:

$ npm install esverify --save

Import verify and invoke on source code to receive a promise of messages.

import { verify } from "esverify";

const opts = { };
const messages = await verify("assert(1 > 2);", opts);
messages.forEach(msg => console.log(msg.status));

The options and returned messages have the following structure:

type opts = {
  filename: string,
  logformat: "simple" | "colored" = "colored",
  z3path: string = "z3",
  z3url: string,
  remote: boolean = false,
  quiet: true,
  verbose: false,
  logsmt: '/tmp/vc.smt'
  timeout: 5,
  qi: true
}

type msg = {
  status: "verified" | "unverified" | "timeout" | "error",
  loc: { file: string, start: { line: number, column: number },
                       end:   { line: number, column: number }},
  description: string
}

Interactive Tools

A simple web-based editor is available online at esverify.org/try.

Additionally, there is a Vim Plugin and an Emacs Plugin which display verification results inline.

More tool support will be coming soon.

License

MIT License

Issues

Please report bugs to the GitHub Issue Tracker. esverify is currently developed and maintained by Christopher Schuster.

Acknowledgements

Inspired by Dafny and LiquidHaskell.

This project is developed by the Software and Languages Research Group at University of California, Santa Cruz. Thanks also to Tommy, Sohum and Cormac for support and advice.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].