Skip to content

Ema#7

Merged
Yaboku19 merged 12 commits intomainfrom
ema
Apr 24, 2025
Merged

Ema#7
Yaboku19 merged 12 commits intomainfrom
ema

Conversation

@Yaboku19
Copy link
Collaborator

pull request for true false nand zero and add

Copy link
Owner

@shilangyu shilangyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is "ema" in the PR title?

Comment on lines 96 to 115
| nand_true :
Reduce (.nand .btrue .btrue) (.bfalse)
| nand_false1 :
Reduce (.nand .bfalse _) (.btrue)
| nand_false2 :
Reduce (.nand _ .bfalse) (.btrue)
| successor :
Reduce t t' ->
Reduce (.succ t) (.succ t')
| ctx_add1 :
Reduce t t' ->
Reduce (.add t t2) (.add t' t2)
| ctx_add2 :
Reduce t t' ->
IsValue v ->
Reduce (.add v t) (.add v t')
| add_zero :
Reduce (.add .zero t) (t)
| add_succ :
Reduce (.add (Term.succ t) (t2)) (Term.succ (.add t t2))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's be consistent with the other rules

Suggested change
| nand_true :
Reduce (.nand .btrue .btrue) (.bfalse)
| nand_false1 :
Reduce (.nand .bfalse _) (.btrue)
| nand_false2 :
Reduce (.nand _ .bfalse) (.btrue)
| successor :
Reduce t t' ->
Reduce (.succ t) (.succ t')
| ctx_add1 :
Reduce t t' ->
Reduce (.add t t2) (.add t' t2)
| ctx_add2 :
Reduce t t' ->
IsValue v ->
Reduce (.add v t) (.add v t')
| add_zero :
Reduce (.add .zero t) (t)
| add_succ :
Reduce (.add (Term.succ t) (t2)) (Term.succ (.add t t2))
| nand_true :
Reduce (.nand .btrue .btrue) .bfalse
| nand_false1 :
Reduce (.nand .bfalse _) .btrue
| nand_false2 :
Reduce (.nand _ .bfalse) .btrue
| ctx_succ :
Reduce t t' ->
Reduce (.succ t) (.succ t')
| ctx_add1 :
Reduce t1 t1' ->
Reduce (.add t1 t2) (.add t1' t2)
| ctx_add2 :
IsValue v1 ->
Reduce t2 t2' ->
Reduce (.add v1 t2) (.add v1 t2')
| add_zero :
Reduce (.add .zero t2) t2
| add_succ :
Reduce (.add (Term.succ t1) t2) (Term.succ (.add t1 t2))

Copy link
Owner

@shilangyu shilangyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@Yaboku19 Yaboku19 merged commit f2e93dc into main Apr 24, 2025
1 check passed
@Yaboku19 Yaboku19 deleted the ema branch April 24, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants