Environment for running behavioral programs written in Javascript.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
src
.gitignore
.travis.yml
LICENSE.md
README.md
changelog-2016.md
changelog-2017.md
dependency-reduced-pom.xml
nbactions-release-profile.xml
nbactions.xml
pom.xml

README.md

BPjs: A Javascript-based Behavioral Programming Runtime.

This repository contains a javascript-based BP library.

Build Status Coverage Status Maven Central Documentation Status JavaDocs

License

  • BPjs is open sourced under the MIT license. If you use it in a system, please provide a link to this page somewhere in the documentation/system about section.
  • BPjs uses the Mozilla Rhino Javascript engine. Project page and source code can be found here.

Getting BPjs

  • For Maven projects: Add BPjs as dependency. Note that the version number changes.
<dependencies>
    ...
    <dependency>
        <groupId>com.github.bthink-bgu</groupId>
        <artifactId>BPjs</artifactId>
        <version>0.9.3</version>
    </dependency>
    ...
</dependencies>

Documentation

Change log for the BPjs library.

2018-10-17

  • BProgramRunner now has a halt() method #53.
  • Documentation now covering verification (well, the basics).
  • A b-progrm's logging level can be set from Java (#50)
  • 🚮 Removed old exception code. More tests.
  • 🚮 bsync, deprecated long ago, was removed.

2018-10-16

  • 🔄 ambiguous term daemonMode changed to waitForExternalEvents (#54).
  • 🐛 PrioritizedBSyncEventSelectionStrategy selected wrong event.

2018-10-20

  • BPJsCliRunner can now directly executed from Maven, using mvn exec:java. Pass arguments using -Dexec.args="args go here".
  • BPJsCliRunner can verify a program. Pass --verify as a commandline argument. Use --full-state-storage to force the verification to use the full state data when determining whether a state was visited (requires more memory).

2018-10-13

  • 🐛 B-Program setup sequence is consistent for all b-threads, including those in appended code.

2018-08-08

  • Decorating event selection strategies just go easier with the introduction of AbstractEventSelectionStrategyDecorator.
  • Added a pausing event selection strategy, to allow pausing and rate-limiting the execution of a BProgram.
  • 🐛 PrioritizedBSyncEventSelectionStrategy deals with its own JavaScript Context properly (fixes #34).
  • Added a "what do you want to do" section to the docs, to help newcomers.

2108-06-*

  • Many more tests and benchmarks.

2018-04-26

  • 🐛 Verifiers can be re-used.
  • Support for modern JS features, such as let expressions and generators.
  • bp.sync prints a warning when a b-thread blocks an event it requests #10.
  • 🚮 Removed extra logging.
  • ⬆️ More tests.
  • ⬆️ Fixed TicTacToe example: now split into two executing classes (interactive GUI and verification). Same core TTT code is used in both, which proves the point that BPjs can be used for smooth transition from verified model to a full application. 🎉
  • Added a file with useful tips.
  • MOAR UNIT TESTSTSSSTTTSTSS!!!!!!!

2018-03-21

  • bsync is deprecated, in favor of bp.sync. The latter can be called from any function, not just the immediate b-thread function.
  • BProgramRunner now implements Java's Runnable.
  • ⬆️ Simplified b-thread scope processing. This means scopes behave closer to what a JavaScript programmer would expect.
  • ⬆️ Javadoc references use latest version (rather than a fixed one).
  • 🔄 Code cleanup.
  • 🔄 Documentation cleanup.
  • 🔄 Old updates from this file moved to "changelog" files.

2018-02-25

  • ⬆️ VisitedStateStore Adds a clear() method.
  • 🐛 DfsBProgramVerifier instances can now be re-used.

2018-01-24

  • ⬆️ Improved hashing algorithm on BThreadStateVisitedNodeStore.
  • Transient caching of thread state in BThreadSyncSnapshots. This improves verification performance, with low memory cost.
  • 🐛 Removed visited state stores that took incoming state into consideration.
  • 🔄 More mazes in the Mazes example.

2018-01-18

  • 🐛 Fixed a crash where program with failed assertions were intermittently crashing.

2018-01-17

  • 🐛 Verifier now correctly identifies deadlock as a state where there are requested events, but they are all blocked (formerly it just looked for the existence of b-threads).

2018-01-12

  • 🐛 Refactored analysis code, removing the invalid (easy to understand, but invalid) PathRequirement based analysis, and using only b-thread now. This design is much cleaner, as it uses less concepts. Also moves us towards "everything is a b-thread" world.
  • Added tests to demonstrate the various states a verification can end in.
  • 🐛 Verifiers and runners terminate their threadpools when they are done using them.

2018-01-11

  • During forward execution, b-threads can halt execution using bp.ASSERT(boolean, text).
  • ⬆️ Refactored the engine tasks to support raising assertions. Reduced some code duplication in the way.
  • ⬆️ Thread pools executing b-threads are now allocated per-executor/verifier (as opposed to using a single static pool).

Earlier Changes

Legend:

  • 🔄 Change
  • New feature
  • 🚮 Deprecation
  • ⬆️ Upgrade
  • 🐛 Bug fix