Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Variable Wire Printing for Compiled VampIR Function #170

Merged
merged 2 commits into from
Nov 22, 2023

Conversation

agureev
Copy link
Collaborator

@agureev agureev commented Nov 3, 2023

Previously a Lambda function taking natural number arguments A1 to
An would be compiled to a circuit with arguments x1 to x(n+1)
where argument xi in the circuit for i<(n+1) stands for argument
A(n-i) and x(n+1) stands as an unused variable.

Current change omits the final variable and reverses the rest, so
that the compiled circuit will have arguments xn to x1 in that
order.

Hence one gets results such as:

TRANS> (to-circuit (lamb (list int) (lamb (list int) (plus (index 0) (index 1)))) :name)
(def name x2 x1 = {
   (x1 + x2)
 };)
TRANS> (to-circuit (unit) :name)
(def name = {
   ()
 };)

Note that this changes how to input coproduct type circuit variables.

Fixes errors on system loading relating to symbols
`method`, `generic-function`, `class`, `variable`, 'type', and 'function' not being external to
the mgl-pax package by removing the `pax:` prefix.

The prefix was removed only when necessary, only done after SBCL would
complain about the symbol not being external.
Previously a Lambda function taking natural number arguments `A1` to
`An` would be compiled to a circuit with arguments `x1` to `x(n+1)`
where argument `xi` in the circuit for i<(n+1) stands for argument
`A(n-i)` and `x(n+1)` stands as an unused variable.

Current channge omits the final variable and renames the rest, so
that the compiled circuit will have appropriate argument order and
type corresponding to the relevant STLC term.

Note that this changes how to input coproduct type circuit variables.

A
@agureev agureev force-pushed the artem/circuit-arg-print branch from d3372ee to f057960 Compare November 3, 2023 13:01
@mariari mariari merged commit ea3a3f0 into main Nov 22, 2023
2 checks passed
@mariari mariari deleted the artem/circuit-arg-print branch November 22, 2023 11:09
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