Git Product home page Git Product logo

math-logic's Introduction

math-logic

Repository contains homework tasks from math logic course. Link to the course.

Requirement: alex, happy

Parses proposition with the following grammar:

Expr ::= Disj | Disj '->' Expr
Disj ::= Conj | Disj '|' Conj
Conj ::= Term | Conj '&' Term
Term ::= '!' Term | '(' Expr ')' | Name
Name = [A-Z] [A-Z 0-9]*

Lexer is generated by alex and Parser is generated by happy

Example

input:

P->!QQ->!R10&S|!T&U&V

output:

(->,P,(->,(!QQ),(|,(&,(!R10),S),(&,(&,(!T),U),V))))

Checks given proof of a proposition and annotates each line deducing necessary rules. Complexity: O(N)

Example

input:

A,B|-A&B
A
B
A->B->A&B
B->A&B
A&B

output:

(1) A (Prop. 1)
(2) B (Prop. 2)
(3) (A)->((B)->((A)&(B))) (Ax. 3)
(4) (B)->((A)&(B)) (M.P. 3, 1)
(5) ((A)&(B)) (M.P. 4, 2)

Implementation of proof deduction theorem: transform given proof of Γ,A⊢B to Γ⊢A->B

input:

A|-B->A
A->B->A
A
B->A

output:

|-(A)->(A)
(A)->((A)->(A))
((A)->((A)->(A)))->(((A)->(((A)->(A))->(A)))->((A)->(A)))
((A)->(((A)->(A))->(A)))->((A)->(A))
(A)->(((A)->(A))->(A))
(A)->(A)

Implementation of completeness theorem for zeroth-order logic: checks a1,a2,..,an ⊨ phi and builds the proof of a1,..,an ⊢ phi.

input:

B,W|=A->B

output:

B,W|-A->B
B->A->B
B
A->B

input:

|=!A&!B

output:

Proposition is false for A=T,B=F

Checks that reflexive transitive closure of given graph is lattice with necessary properties.

Checked lattice's properties:

  • join-semilattice: each two elements has a least upper bound (i.e. +/v is completely defined)
  • meet-semilattice: each two elements has a least lower bound (i.e. -/ is completely defined)
  • distributivity
  • implicativity
  • Boolean algebra: forall A . A+!A=1

input:

5
2 3 4
5
5
5
5

output:

refutation of destributivity: 2*(3+4)

Gets intuitionistic proposition and Kripke model which refutes that. Returns Heyting model that refutes the proposition.

math-logic's People

Contributors

gopavel avatar

Watchers

 avatar

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.