Giter Site home page Giter Site logo

harvardpl / abcdatalog Goto Github PK

View Code? Open in Web Editor NEW
42.0 3.0 8.0 882 KB

Datalog that's as easy as ABC.

Home Page: https://harvardpl.github.io/AbcDatalog/

License: Other

Java 83.99% HTML 15.89% Shell 0.11%
datalog logic-programming declarative-programming knowledge-base rule-engine

abcdatalog's People

Contributors

aaronbembenek avatar mariofares avatar tmoux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

abcdatalog's Issues

Run tests in CI

We should add a GitHub Action that packages the project and runs tests when PRs are made.

UI/UX Improvement

First, thank you to the authors for this wonderful tool.

I think there are a lot of improvements that can be made in terms of the interface and user experience. Some little additions can bring this program a long way and make it much more convenient for students to use.

Some suggestions

  • Changing the Look and Feel to FlatLaF. This would bring about the most difference with about 4 lines of code given the dependencies are met upon compilation. In short, this is the look and feel of JetBrains IDEs.
  • Changing the font to something more readable like JetBrains Mono
  • Adding an edit menu with standard editing controls (Undo, Redo, Cut, Copy, Paste, Select All, Clear All, etc.). Some of these could be implemented cleanly by extending JTextArea.
  • Adding a view menu with at least the following (Zoom in, Zoom out, Restore default zoom). In addition, having the option to switch to a vertical view (editors are side by side rather than on top of each other)
  • Parentheses completion
  • Adding accelerators and mnemonics to the menus and menu items

Beyond these additions, there are a couple of line operations that could be very convenient (ones that I wish I had when completing assignments with the tool)

  • Delete current line
  • Duplicate current line
  • Move lines up/down

I have experience with Swing and desktop development, and I am more than willing to spearhead these changes. No changes are needed to anything but the gui directory.

Maven does not run JUnit tests

Currently, tests are not run when the project is packaged because Maven does not know where to find them. The project should be restructured so that tests are in the src/test/java directory (following Maven conventions).

Bug with extensible predicates and parallel executor

I tried running the "ExecutorExample" program and encountered this exception:

Exception in thread "main" java.lang.IllegalArgumentException: Predicate true is not marked as extensible.
	at edu.harvard.seas.pl.abcdatalog.engine.bottomup.concurrent.ExtensibleBottomUpEvalManager.addFact(ExtensibleBottomUpEvalManager.java:182)
	at edu.harvard.seas.pl.abcdatalog.engine.bottomup.concurrent.ExtensibleBottomUpEvalManager.eval(ExtensibleBottomUpEvalManager.java:123)
	at edu.harvard.seas.pl.abcdatalog.executor.DatalogParallelExecutor.start(DatalogParallelExecutor.java:90)
	at edu.harvard.seas.pl.abcdatalog.executor.ExecutorExample.main(ExecutorExample.java:122)

After some poking around I found there is a fact "true" that always gets added to the list of initial facts:

rewrittenClauses.add(new ValidClause(True.getTrueAtom(), Collections.emptyList()));

The example uses the DatalogParallelExecutor, which uses the ExtensibleBottomUpEvalManager.
The exception is thrown here when trying to add the "true" fact:

public void addFact(PositiveAtom fact) {
if (!this.extensiblePreds.contains(fact.getPred())) {
throw new IllegalArgumentException(
"Predicate " + fact.getPred().getSym() + " is not marked as extensible.");
}

In the example file, the executor is initialized here:

DatalogParallelExecutor ex = new DatalogParallelExecutor();
ex.initialize(ast, Collections.singleton(edge));

However, there doesn't seem to be a way to add the "true" predicate here as it is private.
Thus, it seems this exception will occur whenever the DatalogParallelExecutor is used.

UI suggestion: overtype closing parenthesis

I have a small UI suggestion that should complement the autocompleting parentheses feature: "overtyping" closing brackets. This would allow users to type over an existing closing bracket without adding an extra bracket.
For example, when typing edge(a, b)., one first types edge(, which automatically creates the closing bracket, resulting in the text edge(). Without this feature, users would have to manually move their cursor around the existing closing bracket.

This is the standard behavior in text editors such as VSCode and Sublime Text (https://stackoverflow.com/questions/75002527/how-editor-autoclosingovertype-works-in-vscode-settings).

I have a patch to implement this, and I'm happy to submit a PR. I just wanted to check whether you would welcome this change to the UI.

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.