Git Product home page Git Product logo

digitallogicsonsage's Introduction

Hi there ๐Ÿ‘‹

digitallogicsonsage's People

Contributors

amaanigoose avatar hrithik254 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

amaanigoose

digitallogicsonsage's Issues

Make changes in function sage_boolexp

`def sage_boolexp(string):

""this function converts boolean expresssion written 
    using *, +, ' representing AND, OR, NOT 
    operations to sage interpretable expression""


literal_list0 = ["&" if i == "*" else i for i in string]
literal_list1 = ["|" if i == "+" else i for i in literal_list0]
for i in range(len(literal_list1)):
    if literal_list1[i] == "'":
        del literal_list1[i]
        if literal_list1[i-1] == ")":
            j = i-1
            while literal_list1[j] != "(":
                j += -1
            literal_list1.insert(j,'~')
            i += 1
        else:
            literal_list1.insert(i-1,"~")
return_string = ''
for literal in literal_list1:
    return_string += literal
return return_string`

This is the current code which converts a boolean expression entered by the user using * for AND, + for OR and ' for NOT.
currently it requires the user to enter * to indicate AND, what I want is that the user enters ab' + bc instead of a*b' + b*c
The main purpose of this function is to save time. note: the * and + expressions can contain spaces but y' cannot be written as y '. a + b *d'is acceptable but a + b *d ' would give error. This is alo a potential issue, but it can be fixed later

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.