Giter Club home page Giter Club logo

logic-life-search's Introduction

This version is deprecated. LLS is now hosted on GitLab.

logic-life-search's People

Contributors

oscarcunningham 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

Watchers

 avatar

logic-life-search's Issues

Rule dictionary parsing fails if dictionary contains literal "0" or "1"

I think I found (and fixed) a bug in the way rule dictionaries are parsed. Since I'm lazy, I'll just post a patch here instead of forking the repo and making a proper pull request:

diff --git a/lls b/lls
index 95c8414..16342eb 100755
--- a/lls
+++ b/lls
@@ -222,9 +222,10 @@ rule = src.LLS_rules.rule_from_rulestring(args.rule, indent = indent + 1, verbos
 # Add "user_input_" to user's variable names, to prevent collisions"
 if args.rule != None and args.rule.strip()[0] == "{":
     for transition, literal in rule.items():
-        variable, negated = variable_from_literal(literal)
-        literal = negate("user_input_" + variable, negated)
-        rule[transition] = literal
+        if literal not in ["0","1"]:
+            variable, negated = variable_from_literal(literal)
+            literal = negate("user_input_" + variable, negated)
+            rule[transition] = literal

 if args.input_file_name:
     #Check current directory and then search_pattern/

Questions about background and transition encoding errors.

For both "--bg" and "--bgos" the help just says "Specify a background", and I can't find any description or comment in source code. What does it mean? I'm interested.

Also, doing -M0 (Knuth CNF formatting, I saw in the forums) vs -M1 (Life CNF formatting) gives different results (was fooling around):

dandan@Lenovo-H3060:~/Documents/logic-life-search$ ./lls --bg backgrounds/zebra -s p3 -a p1 -b 10 -M1

Getting search pattern...
Done

Preprocessing...
Done

Number of undetermined cells: 300
Number of variables: 902
Number of clauses: 41573

Active width: 10
Active height: 10
Active duration: 4

Solving...
Done

Time taken: 0.664324045181 seconds

x = 12, y = 12, rule = B3/S23
bbbbbbbbbbbb$
oooobboooooo$
bbboooobobbb$
obbbbbbboooo$
bobbboobobob$
obbbbbobobbo$
bbbbbbobooob$
obbbboobobbo$
bobbbobbooob$
obbbbboobbbo$
bbbobbbbbobb$
oooooooooooo!


dandan@Lenovo-H3060:~/Documents/logic-life-search$ ./lls --bg backgrounds/zebra -s p3 -a p1 -b 10 -M0

Getting search pattern...
Done

Preprocessing...
Done

Number of undetermined cells: 300
Number of variables: 6626
Number of clauses: 26577

Active width: 10
Active height: 10
Active duration: 4

Solving...
Done

Time taken: 0.010046005249 seconds

Unsatisfiable

dandan@Lenovo-H3060:~/Documents/logic-life-search$ 

(By the way I'm testitemqlstudop on conwaylife forums)

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.